LWA1 observation are controlled through session definition files (SDFs). Each file contains a single session that represents one of the five DP outputs: beams 1 through 4 and TBW/TBN. Although each session uses a single output, there can be multiple observations per session.
The SDF has three basic parts:
observer information,
project information,
session Information, and
Observational setup.
These four parts are implemented in LSL in the lsl.common.sdf module.
To create an object to hold information about an observer:
from lsl.common import sdf
obs = sdf.Observer("Jayce Dowell", 99)
print obs
<lsl.common.sdf.Observer object at 0x36fc690>
Once an observer is defined, you can create the objects that will hold the project information. The only required information is the Observer object, project name, and project code.
proj = sdf.Project(obs, "This is a LWA1 project", "COMJD")
print proj
<lsl.common.sdf.Project object at 0x388c490>
Next, the session needs to be created and added to the Project:
ses = sdf.Session("This is a session", 101)
proj.append(ses)
print ses
<lsl.common.sdf.Session object at 0x388c610>
The Session object has a variety of parameters that can be set on it that control the session-wide setup. This includes which beam the observation runs on and whether or not the DR spectrometer is used: To set the beam and spectrometer mode:
# Set the DRX beam to 3
ses.setDRXBeam(3)
# Set the spectrometer setup to 1,024 channels, 768 windows per integration, and the Stokes IV mode
ses.setSpectrometerChannels(1024)
ses.setSpectrometerIntegration(768)
ses.setSpectrometerMetatag('Stokes=IV')
At this point the only thing missing are the actual observations. To define a beamforming observation that tracks a point on the sky, use the DRX object:
radec = sdf.DRX("Observation1", "M87", "2013/1/1 18:00:00", "00:10:00.000",
12.5137, 12.3911, 37.9e6, 74.03e6, 7)
print radec
ses.append(radec)
TRK_RADEC Obs. of 'Observation1': Start 2013/1/1 18:00:00 Duration 00:10:00.000 Filter: 7 Frequency: 37899999.990; 74029999.992 RA: 12.514 Dec. 12.391
The session and observation information stored within a Project can also be directly accessed:
for session in proj.sessions:
print "Session ID:", session.id
for i,obs in enumerate(session.observations):
print "Observation ID:", i
print "Is Valid?", obs.validate()
print obs
Session ID: 101 Observation ID: 0 Is Valid? True TRK_RADEC Obs. of 'Observation1': Start 2013/1/1 18:00:00 Duration 00:10:00.000 Filter: 7 Frequency: 37899999.990; 74029999.992 RA: 12.514 Dec. 12.391
Now all that is left is to create the SDF:
print proj.render(verbose=True)
[13818] Validating session 1 [13818] Validating observation 1 PI_ID 1 PI_NAME Observation1 PROJECT_ID COMJD PROJECT_TITLE This is a LWA1 project PROJECT_REMPI None provided PROJECT_REMPO None SESSION_ID 101 SESSION_TITLE This is a session SESSION_REMPI None provided SESSION_REMPO Requested data return method is DRSU SESSION_DRX_BEAM 3 SESSION_SPC 1024 768{Stokes=IV} OBS_ID 1 OBS_TITLE Observation1 OBS_TARGET M87 OBS_REMPI None provided OBS_REMPO Estimated data volume for this observation is 44.15 GB OBS_START_MJD 56293 OBS_START_MPM 64800000 OBS_START 2013/1/1 18:00:00 OBS_DUR 600000 OBS_DUR+ 00:10:00.000 OBS_MODE TRK_RADEC OBS_RA 12.513700000 OBS_DEC +12.391100000 OBS_B SIMPLE OBS_FREQ1 830506431 OBS_FREQ1+ 37.899999990 MHz OBS_FREQ2 1622226678 OBS_FREQ2+ 74.029999992 MHz OBS_BW 7 OBS_BW+ 19.600 MHz