get_scans

Data_Reduction.DSN.database.get_scans(db, dss, scan_times_dict)

Processes a scan times dictionary and returns data about each scan.

By following foreign keys, this expands on the minimal data returned by get_scan-times() and creates a dictionary with lists for each key.

Notes

We begin in a state ‘onpoint’ == False and scan the table ‘pointing_status until status = ‘on point’ is detected. This is the start of a scan. We use ‘pointing_id’ from that row to go to the table ‘pointing’, where we get the aximuth, elevation and pointing_cmd_id. If pointing_cmd_id has a valid value then we get all the data for that row, which includes source and offsets. We then set ‘onpoint’ to True

If state ‘onpoint’ == True and status = ‘moving’ is encountered we compute the scan duration, average azimuth and elevation, and system temperature, and put it all in ‘scan_data’. We the set ‘onpoint’ to False.

:param db : Obtained from Mysql.open_db() :type db : database connection object

:param dss : Station ID :type dss : int

:param scan_times_dict : Result from get_scan-times() :type scan_times_dict : dict

Returns

(dict) Keys of the dictionary are:: - source: the source observed, - scan_time: the scan start time, - exposure: the scan length, - beamaoff: the beam offset in azimuth, - beamxoff: the beam offset in cross-elevation, - beameoff: the beam offset in elevation, - beamhoff: the beam offset in hour angle, - beamcoff: the beam offset in cross-declination, - beamdoff: the beam offset in declination, - azimuth: the antenna azimuth, and - elevation: the antenna elevation