Interferometry in manual mode with software version 5.0.3
Author: Complete rewrite. 2008 April 4. RAL.
- added DTX clock incantation 20080408 RI
- added note to kill log 20080411 RI
- removed DTX clock incantation (no longer needed), and updated the hot load and Walsh switching sections. 20080430 RR
- Twiki tweak AH
Changes for version 5.0.3:
- Recommended method is to use execfile to run a complete CCL script, modified from template example files.
- CorrGUI run on oper01 (if you run it at all)
- Pointing model run automatically
- Frequency for refraction correction set in scripts.
In what follows:
- > denotes the unix shell prompt,
- >>> the python prompt,
- CCL>>> the CCL prompt and
- psi> the prompt for psi scripts.
To get the PSI prompt type:
>cd /groups/psi/Public_PSI
>./psi
All sessions should be run on oper01.
0.Prerequisites
The following assumes that the system has been set up according to:
- Antenna Startup and Shutdown Procedures
- System Software Setup
- Radiometer Software Setup
This will ensure that the antennas are movable and in focus, with pointing
models loaded, the receivers are set up, the line-length correction is turned on
and being logged.
1.Run the logpower script
This utility will log total power data, az,el position and the hotload status
and temperature from the specified antenna into an ASCII file in
/groups/sci/interferometry/YYYYMMDD. Needed if you are planning to use the hot
load for calibration.
>/groups/sci/scripts/5.0.2/logpower.py -a both -s 4
will log data from both antennas, creating the YYYYMMDD directory if it does not already exist.
2. Set up a data directory
IF you have
NOT run the logpower script and the data directory does not yet
exist, create it:
>mkdir /groups/sci/interferometry/YYYYMMDD
where YYYYMMDD is the current UT date.
3. Create an array
On the
OMC
View -> create array
This brings up a panel showing all potential antennas
Click Manual -> indicators for antennas 1 and 2 turn green
Left click on 1
Shift left click on 2
Both indicators should turn blue
Click on Create
Wait until the antennas are assigned to the array (
click on Alma -> antennas;
both antennas should be assigned to the new array CONTROL/Arraynnn).
4. Create an observing script
Load /groups/sci/scripts/5.0.3/irc10216_SO2.py as a template into an editor.
It uses the high resolution FDM correlator mode. If you want the standard low-resolution TDM mode, (useful for nearly live looks at the phase) see one of:
/groups/sci/scripts/5.0.3/3C273_long.py 1 scan, 30 subscans each of 2 minutes on 3C273
/groups/sci/scripts/5.0.3/3C84_0359.py 20 scans, each on 1 2min subscan, alternating between 3C273 and 3C279
Keep in mind that they are older and probably need updating.
Rename your file to avoid inadvertantly saving over the template.
Things you might want to edit in the file:
a) Number of cycles
cycles=n
n is the number of cycles of the main repeat loop
b) Integration time
corrConf.integrationDuration.setValue(n)
n is the number of 48ms correlator dumps in an integration. Standard value is
210 (10.08s). Values between 21 and 210 are typical.
c) subscan duration
corrConf.subScanDuration.setValue(n)
n is the number of integrations per subscan. These should correspond to 2 minutes or
less (a subscan is the amount of data transferred from correlator to
archive). Standard values 12 integrations of 10.08s. At the ATF each subscan has some overhead (~10s?) during which no data is taken.
d) Observing frequency
sfi_obs_mode.setFrequency(freq)
freq is the observing frequency, in Hz. Standard value is 103.83375e9; for CS
observations, use 98E9.
e) Walsh switching
Once the observing frequency has been set, turn on Walsh switching:
PSI>rs walsh 3,4
Tells Vx to use Walsh function 3, and AEC to use 4. 0 and 1 should also work. The order does not matter as long as each antenna is using a different function.
To actually turn on (enable) Walsh switching:
PSI>rs walsh ef
NOTE! The performance will be degraded if you retune the receiver frequency while Walsh switching is on. Disable it
with
PSI>rs walsh d
before changing frequencies (and then enable it again). This is a problem for nearly all of the scripts, since they run setFrequency().
f) Sources (including calibrators) to be observed
execfile('/groups/sci/scripts/sources.py')
name_src = 'OMC-1'
ra_src, dec_ = sources.radec_from_name(name1)
src1 = create_source_RADec(ra1, dec1)
Here, sourcename1 must be one of the sources in the catalog
/groups/sci/scripts/sources.text. If you want to observe something else, add it to the catalog for future use. Make as many blocks as you need for the sources you want to observe, e.g.
name_cal='0530+135'
ra_cal, dec_cal = sources.radec_from_name(name_cal)
src_cal = create_source_RADec(ra_cal, dec_cal)
f) Optimizing signal levels
You should first go to the target position in order to optimize on the right airmass:
sfi_obs_mode.setDirection(ra_src, dec_src, fieldName=name_src)
The command used for 5.0.3 is
sfi_obs_mode.optimizeSignalLevels(2.0)
Unlike in 5.0.2, you should use a value of 2.0 to get voltages around 1V.
g) Using the hot load
Insert this block immediately before observing the sources.
import CCL.FEB
name_hl = 'hotload'
src_hl = create_source_RADec(ra_src, dec_src) # use source 1 position
sfi_obs_mode.setDirection(ra_src, dec_src, fieldName=name_hl)
# Put in the hot loads.
febs ={}
for ant in array.antennas():
febs[ant] = CCL.FEB.FEB(ant)
febs[ant].SET_CHOPPER_TO_LOAD()
# 30s should be plenty of time for a hot load obs.
nints_per_subscan = int(30.0 / (0.048 * n48ms_per_intdur))
if nints_per_subscan < 1:
nints_per_subscan = 1
corrConf.subScanDuration.setValue(nints_per_subscan)
nints_per_subscan = corrConf.subScanDuration.getValue()
print "Starting the hot load observation."
sfi_obs_mode.beginScan([ScanIntentMod.TARGET], src_hl)
sfi_obs_mode.beginSubscan(spectSpec,corrConf,[SubscanIntentMod.ON_SOURCE])
sfi_obs_mode.endSubscan()
sfi_obs_mode.endScan()
# Take out the hot loads.
for ant in febs:
febs[ant].SET_CHOPPER_TO_SKY()
h) Cable delay
# Specify the cable_delay in seconds.
cable_delay = 119.275e-9 # Empirical 2008 Apr 27
sds.setAntennaCableDelay('DA41',cable_delay)
Be prepared for this number to change if electronics modules are replaced. See
Appendix B, below for details of how to change it.
i) Order of observations
Best explained by some examples.
A simple block with one source, scan and subscan
sfi_obs_mode.setDirection(ra1, dec1, fieldName=name1)
sfi_obs_mode.beginScan([ScanIntentMod.TARGET], src1)
sfi_obs_mode.beginSubscan(spectSpec,corrConf,[SubscanIntentMod.ON_SOURCE])
sfi_obs_mode.endSubscan()
The same, but repeated cycles times:
sfi_obs_mode.setDirection(ra1, dec1, fieldName=name1)
sfi_obs_mode.beginScan([ScanIntentMod.TARGET], src1)
for i in range(cycles):
sfi_obs_mode.beginSubscan(spectSpec,corrConf,[SubscanIntentMod.ON_SOURCE])
sfi_obs_mode.endSubscan()
sfi_obs_mode.endScan()
Note: indentation is important, and very tricky (don't even try!) on the CCL command line. Use an editor and execfile for even short snippets requiring indentation.
Alternating between two sources:
for i in range(cycles):
sfi_obs_mode.setDirection(ra1, dec1, fieldName=name1)
sfi_obs_mode.beginScan([ScanIntentMod.TARGET], src1)
sfi_obs_mode.beginSubscan(spectSpec,corrConf,[SubscanIntentMod.ON_SOURCE])
sfi_obs_mode.endSubscan()
sfi_obs_mode.endScan()
sfi_obs_mode.setDirection(ra2, dec2, fieldName=name2)
sfi_obs_mode.beginScan([ScanIntentMod.TARGET], src2)
sfi_obs_mode.beginSubscan(spectSpec,corrConf,[SubscanIntentMod.ON_SOURCE])
sfi_obs_mode.endSubscan()
sfi_obs_mode.endScan()
5. Check that the correlator is synchronised with the rest of the system
>ssh ccc
>arrayTimeCompare CORR/ARRAY_TIME/CDP_NODE/N01
>exit
You should see a line:
delta = remote-local: 0[acs]
If the number is NOT 0, then the correlator subsystem will have to be restarted
and the correlator computers power cycled (see Appendix C).
6. Start a CCL session and execute the observing script
* It is recommended that you have your observing script available in
*
* an emacs window so that you can follow execution and cut/paste
*
* non-CCL commands from it. But beware of indentation when doing so.
*
* If you want to enable Walsh functions (phase switching) see
*
* Appendix A
*
>mmc --arrayname=CONTROL/Arraynnn
where nnn is the number of the array you created in (3) - 001, 002, etc.
This brings up the CCL prompt CCL>>>
CCL>>>execfile('/groups/sci/scripts/observations.py')
Keep an eye on the Labview IF total power displays and the mount panels. You
should see glitches in the total power, followed by a steady trace around 1V as
the setFrequency and optimizeSignalLevels commands are executed. At this point,
it is safe to turn on the
CorrGUI [see (6), below]. You will be able to see the
setDirection command execute by watching the mount panel (or antennas) unless
you are already on source.
Also look at the
OMC dataflow window. Note the exec block id (which will be
something like uid://X1eb/X2482/X1), as this is needed for data reduction. You
will need to resize the field to see this. You will be able to see the progress
of the observation in the scan and subscan fields. These read n - m, where n is
the number of (sub)scans initiated and m the number completed. After the end of
execution, the indicator on the left of the dataflow entry will be green, the
numbers of completed scans and subscans should be as you set them in the script
and control will be returned to the CCL prompt.
7. Executing CCL commands by hand
For debugging purposes, you may want to execute commands from the script by
cutting and pasting from an emacs window. Be careful to preserve the
indentation:
- Avoid extra spaces at the beginnings of lines
- Preserve indentation in for loops
- Paste lines inside for loops one at a time
- Terminate a for loop with a blank line
When executing a subscan in this way, paste in the sfi_obs_mode.endSubscan()
command as soon as the
sfi_obs_mode.beginSubscan(spectSpec,corrConf,[SubscanIntentMod.ON_SOURCE]
command returns control - otherwise the subscan will not finish. Also take care
to make sure that there are no unmatched begin/end execution. scan or subscan
commands.
This method is prone to finger trouble.
Don't do it! Seriously. The main problem is that it should not be running before the array = getArray() command in the observing script. Even if you wait until after getArray() the first time, you'll probably forget to kill
CorrGUI before starting your next Execution Block (i.e. array). The secondary problem is that it isn't very useful unless the correlator is in a low resolution mode.
You were warned:
CorrGUI can be used to monitor the autocorrelations, cross-correlation phase and
amplitude. To start it type:
>CorrGUI&
at a shell prompt. In this mode, subscan data will be displayed automatically.
* Do not use any of the
CorrGUI buttons in this mode.
*
You will see displays of:
Vertex antenna autocorrelation amplitude (top L)
Alcatel antenna autocorrelation amplitude (top R)
Cross-correlation amplitude (bottom L)
Cross-correlation phase (bottom R)
all plotted against channel number. If things are working well, the phase should
be fairly flat across the band and you should be able to see the target clearly
in the cross-correlation amplitude (need to link and example here).
9. Tidying up after an observation
- Close down the CorrGUI if you had it running (press the Quit button)
- Exit from CCL by typing CTRL D on the CCL>> shell
- Destroy the array: On OMC Scheduler -> Destroy array
wait until the antennas panel shows both DV01 and DA41 unassigned to be sure
that the array has actually been destroyed.
In
OMC, you can get rid of the defunct array's tab by going to View->Manage Display.
You can now start another observation.
10. Exporting the data and making a measurement set
'>
cd /groups/sci/interferometry/YYYYMMDD
'>
asdmExport -b uid://X1eb/Xnnnn/X1
where nnnn is the number of the exec block noted earlier. This creates a
directory uid___X1eb_Xnnnn_X1
'>
asdm2MS --ocm ca uid___X1eb_Xnnnn_X1
creates a measurement set called uid___X1eb_Xnnnn_X1.ms.
Now change permissions so that everyone can read/write it:
'>
chmod -R ugo+wrx uid___X1eb_Xnnnn_X1.ms
11. Plotting the data using CASA
Appendix A: Additional information
###########################
A1. Correcting a delay error
###########################
After a change of electronics modules (e.g. digitizer clock), fibre length etc.,
the cable delay may change. The symptom is a linear phase change across the
band. For a variation with a positive slope and about 2 wraps across the
bandwidth, the delay should be increased by about 1 ns. To correct:
CCL>>>sds.getAntennaCableDelay('DA41')
reports the current cable delay (which should be as set by the observing
script). To set a new value:
CCL>>>sds.setAntennaCableDelay('DA41',delay)
where delay is in s (e.g. 511.8375e-9).
Make sure that the delay server is set up and that the antennas are tracking by
executing the standard observing script commands as far as
CCL>>>sfi_obs_mode.setDirection(ra1, dec1, fieldName=name1)
Do not start a scan from CCL. Then start
CorrGUI and initiate continuous
subscans:
- Select TDM mode
- Integration set to a multiple of 1.008s
-
###################
A2. Walsh functions
###################
Walsh Funtions only after tunning ! (after set_frequency(xxe9) function call)
In order to remove spurious signals such as DC offsets, ALMA will use 180 phase
modulation at the rirst LO, decoded after the digitizer. In order to test this,
without desynchronization problems, we can apply Walsh functions 0 (constant)
and 1 (Emerson, ALMA Memo 565), essentially as in traditional phase switching.
To do this:
Set up the receivers as usual
# Install Walsh functions 0 and 1 in Vertex and Alcatel respectively. 0 and 1 can also be replaced with 3 and 4.
PSI>rs walsh 0,1
# Enable Walsh function switching
PSI>rs walsh ef
If you are watching in
CorrGUI, and in TDM mode, you should still see the internal beacon signal in channel 180, but the spurious 250MHz harmonics should vanish.
# Disable Walsh switching
PSI>rs walsh d
Walsh switching works wonders
if you do not tune to another frequency while it is on. If you do, performance will be degraded.
Appendix B: Trouble-shooting
#######################
B1. Correlator problems
#######################
If you get a timeout error when trying to start
CorrGUI, the times are probably
not synchronised between the correlator and the rest of the world.
exit
CorrGUI
Check whether the correlator containers are up (green) on
OMC. If they are all OK:
correlator subsystem -> shutdown -> operational
If any of the containers are down:
correlator subsystem -> shutdown
You need to power-cycle ccc (if CCC containers are down) and/or cdp00 (for CDP
containers).
'>
pstrip -u almaproc cob-pdu list
which gives a listing
1 - cdp ON
2 - ccc ON
..........
so to power-cycle ccc and cdp00:
'>
pstrip -u almaproc cob-pdu cycle 1
'>
pstrip -u almaproc cob-pdu cycle 2
To check:
'>
ssh ccc
'>
ssh cdp00
You should be able to log in to both machines once they are up. Then exit.
Then restart the containers and bring the correlator subsystem to operational.
#################################################
B2.On-line monitoring of the LLC for phase jumps
#################################################
To monitor LLC phase jumps visually, look at the LLC Labview displays on
snickers. To get these, click on LLC1 -> details on the central lo rack
display; similarly for LLC2. The frequency of phase jumps depends on the rate of
ambient temperature change, and are more often on AEC due to the extra fibre
length. These data will be stored in:
/groups/psi/Public_PSI/Data/Daily/2007/yyyy-mm-dd-LLC_02/ provided that the psi
monitor script has been started (see system software startup checklist). A new
file is created at UT midnight automatically.