lsl.common.sdf (DP-based stations) and lsl.common.sdfADP (ADP-based stations) provide means to represent a set of observations as Python objects. For each lsl.common.sdf.Project, there is:
- An observer (lsl.common.sdf.Observer)
- The project office comments (lsl.common.sdf.ProjectOffice)
- A single session that defines the SDF (lsl.common.sdf.Session)
The session contains one or more observerions (lsl.common.sdf.Observation). Each observing mode supported by the LWA is sub-classed (see below).
Class to hold all the information about a specific session for a project/proposal.
Changed in version 1.2.1: Added a new writeto() method to directly write the SDF to a file.
Add a new Session to the list of sessions.
Create a session definition file that corresponds to the specified session. Returns the SD file’s contents as a string.
Update the various sessions that are part of this project.
Examine all of the sessions and all of their observations to check for validity. If everything is valid, return True. Otherwise, return False.
Create a session definition file that corresponds to the specified session and write it to the provided filename.
Class to hold information about an observer.
Class to hold comments from the LWA object office. This class isn’t really needed to create SD files, but it is helpful for parsing SD files.
Class to hold all of the observations in a session.
Add a new Observation to the list of observations.
Set the configuration request authority to a particular value in the range of 0 to 65,535. Higher values provide higher authority to set FEE and ASP parameters.
Set the beam to use in the range of 1 to 4 or -1 to let MCS decide.
Set the data return method for the session. Valid values are: UCF, DRSU, and ‘USB Harddrives’.
Set the record interval for one of the level-1 subsystems (ASP, DP_, etc.) to a particular value in minutes. A KeyError is raised if an invalid sub-system is specified.
Set the update interval for one of the level-1 subsystems (ASP, DP_, etc.) to a particular value in minutes. A KeyError is raised if an invalid sub-system is specified.
Set the number of spectrometer channels to generate, 0 to disable.
Set the number of spectrometer FFT integrations to use, 0 to disable.
Set the spectrometer metatag, ‘’ to disable.
Update the station used by the project for source computations.
New in version 1.2.0.
Set the username to use for UCF data copies.
Update the various observations in the session.
Examine all of the observations associated with the session to check for validity. If everything is valid, return True. Otherwise, return False.
Class to hold the specifics of an observations. It currently handles TBW, TBN, TRK_RADEC, TRK_SOL, TRK_JOV, and Stepped
Changed in version 1.0.0: Added support for RA/dec values as ephem.hours/ephem.degrees instances
Place holder for functions that return the fractional visibility of the target during the observation period.
Place holder for functions that return the estimate size of the data set being defined by the observation.
Return a valid value for beam type based on whether maximum S/N beam forming has been requested.
Parse the self.duration string with the format of HH:MM:SS.SSS to return the number of milliseconds in that period.
Place holder for functions that return ephem.Body objects (or None) that define the pointing center of the observation.
Return the number of “tuning words” corresponding to the first frequency.
Return the number of “tuning words” corresponding to the second frequency.
Return the modified Julian Date corresponding to the date/time of the self.start string.
Return the number of milliseconds between the date/time specified in the self.start string and the previous UT midnight.
Set the observation start time.
Update the computed parameters from the string values.
Place holder for functions that evaluate the observation and return True if it is valid, False otherwise.
Sub-class of Observation specifically for TBW observations. It features a reduced number of parameters needed to setup the observation and provides extra information about the number of data bits and the number of samples.
Note
TBW read-out times in ms are calculated using (samples/196000+1)*5000 per MCS
Estimate the data volume for the specified type and duration of observations. For TBW:
bytes = samples / samplesPerFrame * 1224 bytes * 260 stands
Update the computed parameters from the string values.
Evaluate the observation and return True if it is valid, False otherwise.
Sub-class of Observation specifically for TBN observations. It features a reduced number of parameters needed to setup the observation.
Estimate the data volume for the specified type and duration of observations. For TBN:
bytes = duration * sampleRate / 512 * 1048 bytes * 260 stands * 2 pols.
Set the observation duration.
Set the frequency in Hz corresponding to tuning 1.
Evaluate the observation and return True if it is valid, False otherwise.
(default = False)
comments - comments about the observation
Set the pointing Dec.
Set the pointing RA.
Sub-class of DRX specifically for Solar DRX observations. It features a reduced number of parameters needed to setup the observation.
(default = False)
comments - comments about the observation
Return an ephem.Body object corresponding to where the observation is pointed. None if the observation mode is either TBN or TBW.
Sub-class of DRX specifically for Jovian DRX observations. It features a reduced number of parameters needed to setup the observation.
(default = False)
comments - comments about the observation
Return an ephem.Body object corresponding to where the observation is pointed. None if the observation mode is either TBN or TBW.
Sub-class of Observation for dealing with STEPPED-mode observations. It features a reduced number of parameters needed to setup the observation and added support for the individual steps.
Add a new BeamStep step to the list of steps.
Return the fractional visibility of the target during the observation period.
Estimate the data volume for the specified type and duration of observations. For DRX:
bytes = duration * sampleRate / 4096 * 4128 bytes * 2 tunings * 2 pols.
Parse the list of BeamStep objects to get the total observation duration as the number of milliseconds in that period.
Convert the current observation to a ‘beam-dipole mode’ observation with the specified stand. Setting the stand to zero will disable the ‘beam-dipole mode’ for this observation’.
default: 0.04; range: 0.0 to 1.0
default: 1.0; range: 0.0 to 1.0
pol - Polarization to record default: “X”
default: lsl.common.stations.lwa1
Update the computed parameters from the string values.
Evaluate the observation and return True if it is valid, False otherwise.
Class for holding all of the information (pointing center, tuning frequencies, etc.)associated with a particular step.
RADec - whether the coordinates are in RA/Dec or Az/El pairs (default=RA/Dec)
(default = False)
SpecDelays - 520 list of delays to apply for each antenna
SpecGains - 260 by 2 by 2 list of gains ([[XY, XY], [YX, YY]]) to apply for each antenna
If SpecDelays is specified, SpecGains must also be specified. Specifying both SpecDelays and SpecGains overrides the MaxSNR keyword.
Changed in version 1.0.0: Added support for azimuth/altitude and RA/dec values as ephem.hours/ephem.degrees instances
Return a valid value for beam type based on whether maximum S/N beam forming has been requested.
Parse the self.duration string with the format of HH:MM:SS.SSS to return the number of milliseconds in that period.
Return an ephem.Body object corresponding to where the observation is pointed. None if the observation mode is either TBN or TBW.
Return the number of “tuning words” corresponding to the first frequency.
Return the number of “tuning words” corresponding to the second frequency.
Set the pointing c1.
Set the pointing c2
Set the observation duration.
Set the frequency in Hz corresponding to tuning 1.
Set the frequency in Hz correpsonding to tuning 2.
Update the settings.
Evaluate the step and return True if it is valid, False otherwise.
Read in a session specification file (MCS0030, Section 5) and return the data as a dictionary.
Read in a observation specification file (MCS0030, Section 6) and return the data as a dictionary.
Read in a command script file (MCS0030, currently undocumented) and return the data as a list of dictionaries.
Given an MCS meta-data tarball, extract the information stored in the dynamic/sdm.dat file and return a lsl.common.sdm.SDM instance describing the dynamic condition of the station.
If a sdm.dat file cannot be found in the tarball, None is returned.
Given an MCS meta-data tarball, extract the information stored in the ssmif.dat file and return a lsl.common.stations.LWAStation object. Optionally, update the lsl.common.stations.Antenna instances associated whith the LWAStation object using the included SDM file.
If a ssmif.dat file cannot be found in the tarball, None is returned.
Given an MCS meta-data tarball, extract the session meta-data file (MCS0030, Section 7) and return a dictionary of observations that contain dictionaries of the OP_TAG (tag), DRSU Barcode (drsu), OBS_OUTCOME (outcome), and the MSG (msg).
Changed in version 0.6.5: Update to the new _metadata.txt format
Given an MCS meta-data tarball, extract the session specification file (MCS0030, Section 5) and return a dictionary of parameters.
Given an MCS meta-data tarball, extract one or more observation specification file (MCS0030, Section 6) and return a list of dictionaries corresponding to each OBS file. If the selectObs keyword is set to a list of observation numbers, only observations matching the numbers in selectObs are returned.
Given an MCS meta-data tarball, extract the session specification file, the session meta-data file, and all observation specification files to build up a SDF-representation of the session.
Note
This function returns a full lsl.common.sdf.Project instance with the session in question stored under project.sessions[0] and the observations under project.sessions[0].observations.
Given an MCS meta-data tarball, extract the command script and parse it. The commands are returned as a list of dictionaries (one dictionary per command).
Given an MCS meta-data tarball, extract the ASP MIB contained in it and return a dictionary of values for the filter, AT1, AT2, and ATSplit. The ‘which’ keyword is used to specify whether or not the configuration returned is at the beginning (default) or end of the session.
New in version 0.6.5.
Similar to getASPConfiguration, but returns only a single value for each of the four ASP paramters: filter, AT, AT2, and ATSplit. The values are based off the mode of the parameter.
New in version 0.6.5.
Given a filename, see if it is valid metadata tarball or not.
New in version 1.2.0.
These functions convert Python datetime instances to modified Julian Data (MJD) and milliseconds past midnight (MPM) pairs.
Convert a UTC datetime instance to a MJD, MPM pair (returned as a two-element tuple).
Based off: http://paste.lisp.org/display/73536
New in version 0.5.2.
Convert a MJD, MPM pair to a UTC-aware datetime instance.
New in version 0.5.2.
These functions are intended to help define observations that are run in Stepped mode with the beamforming method set to “SPEC_DELAYS_GAINS”.
Given a delay in ns, convert it to a course and fine portion and into the form expected by MCS in a custom beamforming SDF (little endian 16.12 unsigned integer).
New in version 0.6.3.
Given delay value from an OBS_BEAM_DELAY field in a custom beamforming SDF, return the delay in ns.
New in version 0.6.3.
Given a gain (between 0 and 1), convert it to a gain in the form expected by MCS in a custom beamforming SDF (little endian 16.1 signed integer).
Given a gain value from an OBS_BEAM_GAIN field in a custom beamforming SDF, return the decimal equivalent.
New in version 0.6.3.
These functions convert various MCS numeric codes found in the metatdata into strings.
Convert a numerical MCS status code to a string.
Convert a numerical MCS overall status code to an explination.
Convert a MCS subsystem ID code into a string.
Convert a MCS command code into a string.
Convert a MCS numeric observing mode into a string.