The first example
illustrates the most basic observing script.
Here, a passband source is observed at the start of the project.
After that, a calibrator and a
source are alternately observed until the end of the project.
Note that long lines have been broken up by putting a slash (\)
at the end of a line (make sure there are no spaces after the slash!)
and the remainder of the command is continued on the next line(s).
Also, it is assumed that the catalog called j2000.cat exists and
contains the proper information for the sources observed.
Since, in this example,
the information about the correlator and
receiver tuning is identical for all observed sources, it is easier to
define a generic setup (called tuning) that is called at the very
beginning of the script.
This insures that the correlator is set properly and the receivers are
tuned prior to any observations.
Also, in this example, there are characteristics that are common to all
of the source setups.
These common features are grouped together in a setup (called all)
and it is included by each source in its definition.
The setup for the source 3C454.3 has included the maxobs
keyword to insure that, if the script is stopped before the end of the
project and then restarted, the passband would not be observed more than once.
If, in this example, the passband was to be observed at the end rather
than at the beginning of the program, the user would only need to
switch the order of the scan and loop commands;
add the stop keyword to the loop command to insure that it
finishes with enough time to observe the passband
(changing loop to loop stop=stop-30 should suffice);
and remove the stop keyword from the passband scan command.
It is worth noting that this example consists of only 8 command lines!
The rest of the example is made up of comments describing the
observations and messages designed to help the scheduler.
Writing this identical observation as a shell script would take
well over 80 lines of C-shell programming!
However, to make this
a more interesting example,
assume that the first calibrator (0541-056)
will be used at the start of the loop command and will continue to
be used until ninety minutes after the second calibrator (0739+016)
has begun to be used.
This use of calibrator overlap might be more helpful in
the calibration step of the data reduction process than if one
source took over only after the first one finished.
Note that the calsetup logic was defined as an AND between
the setups calib1 and calib2.
The overlap is handled completely by the
lstrange keyword in the setups.
When the LST is between 1 and 7 hours, the setup calib2 is not
considered valid and is skipped.
Likewise,
when the LST is beyond 7 hours, the setup calib1 will no longer be
considered valid and will be skipped.
However, between 5:30 and 7 hours LST, both sources are valid and
are both observed.
If the logic had been defined as an OR instead of an AND,
then only the calib1 setup would be observed while it is valid
(between 01:00 and 07:00 LST) and calib2 would only be observed
after calib1 is no longer valid (LST beyond 07:00).
Also, there would be no calibrator observations made that would overlap.
The next example illustrates
a more realistic (and more complex) observation script.
In this example,
the passband observation is only attempted if the
script begins at the best starting times (i.e. it does not begin in the
middle of the requested LST time range).
When observed, the passband consists of a wide, narrow, and wide
band observation on the calibrator source.
If the first passband source is not visible, then the second group of
wide, narrow, wide observations is attempted.
Some C-shell programming has been done to
determine how long the loop command should run.
Remember that the svalue command returns the number of times a setup
has been observed (when the maxobs keyword is set in a setup).
Because the setups listed are separated by commas, the return value will
be the sum of the number of observations for each of the four setups.
Since observations of 3c454.3 will only be attempted if 3c273 is not visible,
the return value of svalue will be 0 if neither source was
visible or it will be 3 (one for each of the wide, narrow, wide observations)
if one of the passband sources was able to be observed.
Hence, if the passband combination has not been observed already,
then the loop command should terminate early enough
(before the project stop time)
so that enough time will remain to observe the passband at the end of
the project.
Notice also that the passband sources have been restricted to an LST range
of (by using the setup keyword) lstrange=0730,1730 and
lstrange=1700,0200.
Incidentally, this last one could have been equivalently specified as
lstrange=0,0200,1700,2400.
A Basic Example
Multiple Calibrators
The next example illustrates how to do the same observation as shown in
the first example but using two calibrators.
If only one of the two calibrators is desired to be observed at a time,
then the previous example
only needs to be modified to include the setup command for the
additional calibrator and the calsetup keyword in the loop
would just list both calibrators with the OR operator between them.
Multiple Passband Observations
A Template Observing Script
Finally, we include here a template script created by Rick Forster
for use by students at the Hat Creek Summer School.