Scheduling Block Examples#

For the following SB examples we will use the configuration examples from Example Configurations. All configurations, catalogs, and scripts are available within the Green Bank computing environment at /home/astro-util/projects/GBTog.

Todo

Check the folder and ensure all scripts are there.

The following catalog (sources.cat) will be used for all examples:

 # My source list with radial velocities
 format=spherical
 coordmode = B1950
 head = name   ra        dec        velocity
 Object1  09:56:16.98  +49:16:25.5  27.23
 Object2  08:56:16.98  +48:16:25.5  28.24
 Object3  07:56:16.98  +47:16:25.5  29.25
 Object4  06:56:16.98  +45:16:25.5  30.26

Frequency-switched observations looping through a list of sources#

In this example we perform frequency-switched observations of the HI 21 cm line towards several different sources. This example is available at /home/astro-util/projects/GBTog/SBs/example1.py.

# Frequency Switched Observations where we loop through a list of sources

# first we load the configuration file
execfile('/home/astro-util/projects/GBTog/configs/fs_config.py')

# now we load the catalog file
c = Catalog('/home/astro-util/projects/GBTog/cats/sources.cat')

# now we configure the GBT IF system for frequency switch HI observations
Configure(fs_config)

# get the list of sources
sourcenames = c.keys()

# now loop the sources
for src in sourcenames:
    Slew(src)            # Slew to each source
    Balance()            # Balance power levels
    Track(src,None,600.) # Observe each source for 10 minutes

Position-switched observations repeatedly observing the same source#

In this example we perform position-switched observations of a single source. We observe the source for two minutes and the off position for two minutes. This is repeated twenty times. This example is available at /home/astro-util/projects/GBTog/SBs/example2.py.

# Position Switched Observations to repeatedly observe the same source

# load the configuration file
execfile('/home/astro-util/projects/GBTog/configs/tp_config.py')

# load the catalog file
Catalog('/home/astro-util/projects/GBTog/cats/sources.cat')

# configure the GBT IF system for position switch HI observations
Configure(tp_config)

# specify which source we wish to observe
src = 'Object1'

# specify how far away from the source the off position should be
# offset two minutes of time in Right Ascension
myoff=Offset("J2000","00:02:00",0.0)

#Slew to the source and then balance the power levels
Slew(src)
Balance()
# now we use a Break() so that we can check the IF system
Break('Check the Balance of the IF system')

# specify how many times to observe the source
numobs = 20

# observe 'on' source for 2 minutes and 'off' source for 2 minutes
# and then repeat
for i in range(numobs):
    OnOff(src,myoff,120.)

Position-switched observations of several sources and using the Horizon object#

In this example we perform position-switched observations of three sources. We observe the first source until the second source rises above 20\(^\circ\) elevation. THen we observe the second source until it goes below 20^circ elevation at which point we observe a third source. This example is available as /home/astro-util/projects/GBTog/SBs/example3.py

# Load the configuration file and the catalog file
execfile('/home/astro-util/projects/GBTog/configs/tp_config.py')
Catalog('/home/astro-util/projects/GBTog/cats/sources.cat')

# now we configure the GBT IF system for position switched observations
Configure(tp_config)

# define which sources to observe
srcA = 'Object4'
srcB = 'Object3'
srcC = 'Object1'
myoff=Offset('J2000','00:02:00',0.0) # Off position of 2min time in RA
h=Horizon(20.0) # specify a horizon of 20 degrees elevation

riseSrcB = h.GetRise(srcB) # now get rise and set times of srcB
setSrcB = h.GetSet(srcB)

#print the rise and set times of srcB
risesetstring='20 deg elev. rise = %s and set = %s'%(riseSrcB,setSrcB)
Comment(risesetstring)

# observe srcA until srcB has risen above 20 deg elevation
Slew(srcA)
Balance()
while Now() < riseSrcB and Now() != None:
    OnOff(srcA,myoff,120.)

# now observe srcB until it sets
Slew(srcB)
Balance()
while Now() < setSrcB and Now() != None:
    OnOff(srcB,myoff,120.)

# now observe srcC five times
numobs=5
Slew(srcC)
Balance()
for i in range(numobs):
    OnOff(srcC,myoff,120.)

Frequency-switched OTF mapping#

In this example we perform frequency-switched observations of the HI 21 cm line to map a \(5^\circ \times 5^\circ\) region of the sky. We use pixels that are 3’ in size and have an integration time of 2 seconds per pixel. We do not observe the while map in this example. This example is available at /home/astro-util/projects/GBTog/SBs/example4.py

# Frequency Switched Observations where we perform on-the-fly (OTF) mapping

# Load the configuration file
execfile('/home/astro-util/projects/GBTog/configs/fs_config.py')

# Load the catalog file
Catalog('/home/astro-util/projects/GBTog/cats/sources.cat')

# now we configure the GBT IF system for freq switched HI observations
Configure(fs_config)

# now we set the parameters for the map
src       = 'Object2'                   # location of the map center
majorSize = Offset('Galactic',5.0,0.0)  # 5 degrees in galactic longitude
minorSize = Offset('Galactic',0.0,5.0)  # 5 degrees in galactic latitude
rowStep   = Offset('Galactic',0.0,0.05) # 3 arcminutes between map rows

# the time to scan each row
# time = majorSize / rowStep * integration time per pixel
scanTime = 5.0/0.05*2. # 2 seconds per pixel

# Balance power levels
Slew(src)
Balance()
Break('Check power levels')

# only do part of the map here
rowStart = 10
rowStop  = 20

# now observe for the map
RALongMap(src,majorSize,minorSize,rowStep,scanTime,
          start=rowStart,stop=rowStop)

Cyclic spectroscopy pulsar observations#

Listing 28 An example cyclic spectroscopy observation.#
# Load the built-in Astrid catalogs
fluxcal = Catalog(fluxcal)
pulsars = Catalog(pulsars_bright_MSPs_GBT)

# Define some variables to be used elsewhere in the script
fluxcal_source = "3C286"
pulsar_source = "B1937+21"
cal_scan_length = 95.0
pulsar_scan_length = 3605.0

# Define the calibration configuration
config_cs_cal = """
obstype = 'Pulsar'
receiver = 'Rcvr1_2'
restfreq = 1500.0
nwin = 1
pol = 'Linear'
backend = 'VEGAS'
bandwidth = 800.0
tint = 16*512/800e6
deltafreq = 0.0
noisecal = 'lo' 
swmode = 'tp' 
swtype = 'none'
swper = 0.04
swfreq = 0
vlow = 0.0
vhigh = 0.0
vframe = 'topo'
vdef = 'Radio'
vegas.obsmode = 'coherent_cal' 
vegas.polnmode = 'full_stokes'
vegas.numchan = 512
vegas.scale = 1200
vegas.outbits = 8
vegas.fold_bins = 2048
vegas.fold_dumptime = 10.0
vegas.cycspec = 1
vegas.ncyc = 128
vegas.cycspec_num_bins = 512
vegas.cycspec_fold_dumptime = 10
"""


# Define the pulsar configuration
config_cs_pulsar = """
obstype = 'Pulsar'
receiver = 'Rcvr1_2'
restfreq = 1500.0
nwin = 1
pol = 'Linear'
backend = 'VEGAS'
bandwidth = 800.0
tint = 16*512/800e6
deltafreq = 0.0
noisecal = 'off' 
swmode = 'tp_nocal' 
swtype = 'none'
swper = 0.04
swfreq = 0
vlow = 0.0
vhigh = 0.0
vframe = 'topo'
vdef = 'Radio'
vegas.obsmode = 'coherent_fold' 
vegas.polnmode = 'full_stokes'
vegas.numchan = 512
vegas.scale = 1200
vegas.outbits = 8
vegas.fold_parfile = '/home/gpu/tzpar/B1937+21.par'
vegas.fold_bins = 2048
vegas.fold_dumptime = 10.0
vegas.cycspec = 1
vegas.ncyc = 128
vegas.cycspec_num_bins = 512
vegas.cycspec_fold_dumptime = 10
"""

# Slew to the flux calibration source
Slew(fluxcal_source)

# Measure and apply peak/focus corrections
AutoPeakFocus()

# Configure for the flux calibration scan
Configure(config_cs_cal)
# Balance the IF system
Balance()
# Take on and off source data
OnOff(fluxcal_source, Offset("AzEl",1.0,0.0,cosv=True), cal_scan_length)

# Slew to the pulsar
Slew(pulsar_source)

# Configure for the polarizatoin calibration scan.
Configure(config_cs_cal)
# Balance the IF system
Balance()

# Take a single polarization scan
Track(pulsar_source, None, cal_scan_length)

# Configure for the pulsar scan
Configure(config_cs_pulsar)

# Take the main scan.  Note that we do *not* balance again
Track(pulsar_source, None, pulsar_scan_length)

The above example illustrates all the steps necessary to obtain flux and polarization calibration data, followed by a cyclic spectroscopy (CS) pulsar observation. These are

  1. Load an Astrid catalog using the Catalog() command.

  2. Define configuration blocks for the calibration and pulsar observations.

  3. Configure the GBT using the Configure() command.

  4. Move the telescope to a source using the Slew() command.

  5. Update the pointing and focus corrections using an AutoPeakFocus(). Always remember to reconfigure after an AutoPeakFocus, otherwise you won’t be set up for pulsar observing.

  6. Balance the IF system using the Balance() command.

  7. Take data via one of several observing directives, such as Track() or OnOff().

Note

There are a couple of things to take note of in this example.

  1. We do not issue a second Balance command after the polarization calibration scan, but instead immediately reconfigure and take our main pulsar scan. If we did rebalance, the conversion factor between counts and antenna temperature/flux density could change and our calibration scan would not be valid for the pulsar scan.

  2. We add 5 seconds to the scan length in cal- and fold-mode scans to ensure that the last sub-integration is always written to disk.

  3. This example is verbose by design so as to illustrate all the important steps. Since Astrid scripts are written in Python there are numerous techniques for simplifying observing scripts. Contact your project friend if you would like help with more advanced scripting.