Run and Scan Specification for the LWA Swarm¶
Module that contains all of the relevant class to build up a representation of a interferometer definition file. The hierarchy of classes is:
- Project - class that holds all of the information about the project (including
the observer) and one or more runs. Technically, a ID file has only one run but this approach allows for the generation of multiple SD files from a single Project object.
Observer - class that hold the observer’s name and numeric ID
- Run - class that holds all of the scans associated and the associated
correlator setup for a with a particular interferometer run
- Scan - class that hold information about a particular scan. It
includes a variety of attributes that are used to convert human- readable inputs to SDF data values. The scan class is further subclasses into:
DRX - class for general DRX scan, with sub-classes: * Solar - class for solar tracking * Jovian - class for Jovian tracking
Most class contain ‘validate’ attribute functions that can be used to determine if the project/run/scan are valid or not given the constraints of the ADP system.
In addition to providing the means for creating interferometer definition files from scratch, this module also includes a simple parser for ID files.
Changed in version 2.0.0: Added support for astropy.time.Time and astropy.coordinates.Angle instances
New in version 1.2.4.
- class lsl.common.idf.DRX(target, intent, start, duration, ra, dec, frequency1, frequency2, filter, gain=-1, pm=[0.0, 0.0], comments=None)¶
- Required Arguments:
scan target
scan intent
scan start date/time (UTC YYYY/MM/DD HH:MM:SS.SSS string or timezone- aware datetime instance)
scan duration (HH:MM:SS.SSS string or timedelta instance)
scan RA in hours, J2000.0 or ephem.hours instance
scan Dec in degrees, J2000.0 or ephem.hours instance
scan tuning frequency 1 (Hz)
scan tuning frequency 1 (Hz)
integer filter code
- Optional Keywords:
comments - comments about the scan
- class lsl.common.idf.Jovian(target, intent, start, duration, frequency1, frequency2, filter, gain=-1, comments=None)¶
Sub-class of DRX specifically for Jovian DRX scans. It features a reduced number of parameters needed to setup the scan.
- Required Arguments:
scan target
scan intent
scan start date/time (UTC YYYY/MM/DD HH:MM:SS.SSS string or timezone- aware datetime instance)
scan duration (HH:MM:SS.SSS string or timedelta instance)
scan tuning frequency 1 (Hz)
scan tuning frequency 1 (Hz)
integer filter code
- Optional Keywords:
comments - comments about the scan
- property fixed_body¶
Return an ephem.Body object corresponding to where the scan is pointed. None if the scan mode is TBN.
- class lsl.common.idf.Observer(name, id, first=None, last=None)¶
Class to hold information about an observer.
- class lsl.common.idf.Project(observer, name, id, runs=None, comments=None, project_office=None)¶
Class to hold all the information about a specific interferometer run for a project/proposal.
- append(newRun)¶
Add a new run to the list of runs.
- generate_sdfs(starting_session_id=1, run=0, verbose=False)¶
Convert the ID file into a collection of lsl.common.sdfADP.Project instances that can be used to write SD files.
- render(run=0, verbose=False)¶
Create a run definition file that corresponds to the specified run. Returns the ID file’s contents as a string.
- update()¶
Update the various runs that are part of this project.
- validate(verbose=False)¶
Examine all of the runs and all of their scans to check for validity. If everything is valid, return True. Otherwise, return False.
- writeto(filename, run=0, verbose=False, overwrite=False)¶
Create a run definition file that corresponds to the specified run and write it to the provided filename.
- class lsl.common.idf.ProjectOffice(project=None, runs=None, scans=None)¶
Class to hold comments from the LWA object office. This class isn’t really needed to create ID files, but it is helpful for parsing ID files.
- class lsl.common.idf.Run(name, id, scans=None, data_return_method='DRSU', comments=None, correlator_channels=512, correlator_inttime=1.0, correlator_basis='linear', stations=[<LWAStation id='VL', name='LWA1', lat=34:04:08.0, long=-107:37:42.1, elev=2133.6, pressure=0.0, horizon=0:00:00.0, antennas=[...], interface=<LSLInterface backend='lsl.common.dp', mcs='lsl.common.mcs', sdf='lsl.common.sdf', metabundle='lsl.common.metabundle', sdm='lsl.common.sdm'>>, <LWAStation id='SV', name='LWASV', lat=34:20:54.1, long=-106:53:08.8, elev=1477.8, pressure=0.0, horizon=0:00:00.0, antennas=[...], interface=<LSLInterface backend='lsl.common.adp', mcs='lsl.common.mcsADP', sdf='lsl.common.sdfADP', metabundle='lsl.common.metabundleADP', sdm='lsl.common.sdmADP'>>])¶
Class to hold all of the scans in an interferometer run.
- append(newScan)¶
Add a new Scan to the list of scans.
- property correlator_basis¶
Correlator output polarization basis.
- property correlator_channels¶
Number of correlator channels to use.
- property correlator_inttime¶
Correlator integration time in seconds.
- property stations¶
List of LWA stations to use in the interferometer.
- update()¶
Update the various scans in the run.
- validate(verbose=False)¶
Examine all of the scans associated with the run to check for validity. If everything is valid, return True. Otherwise, return False.
- class lsl.common.idf.Scan(target, intent, start, duration, mode, ra, dec, frequency1, frequency2, filter, gain=-1, pm=[0.0, 0.0], comments=None)¶
Class to hold the specifics of a scans. It currently handles TRK_RADEC, TRK_SOL, and TRK_JOV.
- add_alt_phase_center(target_or_apc, intent=None, ra=None, dec=None, pm=None)¶
Add an alternate phase center to the scan.
- property dec¶
Target dec. (J2000).
- property duration¶
Duration in seconds.
- estimate_bytes()¶
Estimate the data volume for the specified type and duration of scans. For DRX:
bytes = duration * sample_rate / 4096 * 4128 bytes * 2 tunings * 2 pols.
- property fixed_body¶
Return an ephem.Body object corresponding to where the scan is pointed. None if the scan mode is TBN.
- property frequency1¶
Tuning 1 frequency in Hz.
- property frequency2¶
Tuning 2 frequency in Hz.
- property intent¶
Obsevational intent.
- property pm¶
Target proper motion in mas/yr.
- property ra¶
Target RA (J2000).
- property start¶
Start time.
- property target_visibility¶
Return the fractional visibility of the target during the scan period.
- update()¶
Update the computed parameters from the string values.
- validate(verbose=False)¶
Evaluate the scan and return True if it is valid, False otherwise.
- class lsl.common.idf.Solar(target, intent, start, duration, frequency1, frequency2, filter, gain=-1, comments=None)¶
Sub-class of DRX specifically for Solar DRX scans. It features a reduced number of parameters needed to setup the scan.
- Required Arguments:
scan target
scan intent
scan start date/time (UTC YYYY/MM/DD HH:MM:SS.SSS string or timezone- aware datetime instance)
scan duration (HH:MM:SS.SSS string or timedelta instance)
scan tuning frequency 1 (Hz)
scan tuning frequency 1 (Hz)
integer filter code
- Optional Keywords:
comments - comments about the scan
- property fixed_body¶
Return an ephem.Body object corresponding to where the scan is pointed. None if the scan mode is TBN.
- lsl.common.idf.get_scan_start_stop(obs)¶
Given a scan, get the start and stop times (returned as a two- element tuple of UTC datetime instances).
- lsl.common.idf.is_valid(filename, verbose=False)¶
Given a filename, see if it is valid IDF file or not.
- lsl.common.idf.parse_idf(filename, verbose=False)¶
Given a filename, read the file’s contents into the IDF instance and return that instance.