DSS28db

class Data_Reduction.GAVRT.DSS28db(host='kraken.gavrt.org', user='ops', pw='v3H!cle', name='dss28_eac', port=3306)

Bases: Data_Reduction.GAVRT.mysql.BaseDB

subclass for the DSS-28 EAC database

provides methods for handling tables

Attributes::

logger - logging.Logger object receiver - receivers which provide data sessions - dict of sessions obtained with ‘get_session’

Methods Summary

extract_boresight_data(year, doy)

Get the metadata for the boresights on the designated day.

get_Tsys(chan, start, stop)

Get system temperatures from tlog

get_receiver_data(year, doy, time, columns)

Get the receiver state at a given time

get_session(year, doy)

get IDs for an observing session

get_source_names(source_IDs)

Get the source information from gavrt_sources.source

insertRecord(table, rec)

not allowed for subclass

updateValues(vald, table)

not allowed for subclass

Methods Documentation

extract_boresight_data(year, doy)

Get the metadata for the boresights on the designated day.

The boresights are extracted from table ‘xscan’. Missing ‘el’ data are obtained from table ‘xpwr’. The source, scan axis and channel are obtained from table ‘xpwr_cfg’. The receiver data are obtained from table ‘rss_cfg’.

Returns a dictionary like this:

{'utc':        list of datetime.timedelta,
 'epoch':      list of float,
 'az':         list of float,
 'el':         list of value,
 'chan':       list of int,
 'tsrc':       list of float,
 'axis':       list of str,
 'source':     list of str,
 'xpwr_cfg_id: list of int',
 'xscan_id':   list of int,
 'source_id':  list of int,
 'rx':         list of dict}

An ‘rx’ dict looks like this:

{ 2: {'if_bw':    float,
      'if_mode':  str,
      'pol':      str,
      'sky_freq': float,
      'utc':      datetime.timedelta},
  4: { ... },
 ....
 16: { ... }}

:param year : year of observation :type year : int

:param doy : day of year :type doy : int

Returns

dict

get_Tsys(chan, start, stop)

Get system temperatures from tlog

:param start : UNIXtime at start of selection :type start : float

:param stop : UNIXtime at end of selection :type stop :float

get_receiver_data(year, doy, time, columns)

Get the receiver state at a given time

This creates a dictionary keyed with channel number and returns a dictionary of the receiver configuration, keyed with specified in the columns, that was in effect at the given time.

Notes

The challenge here is to get the latest configuration data for each channel at or prior to the specified time. That channel may have been configured on the same day or a prior day. The method we’ll use is to find the ID of last configuration change and assume that the IDs are sequential in date/time.

:param db : database :type db : Mysql.BaseDB instance

:param year : year of observation :type year : int

:param doy : day of year :type doy : int

:param time : UTC for the requested receiver state :type time : datetime.timedelta

:param columns : data items to be returned :type columns : list of str

Returns

dict

get_session(year, doy)

get IDs for an observing session

get_source_names(source_IDs)

Get the source information from gavrt_sources.source

Returns a dict with source names for the source IDs provided

insertRecord(table, rec)

not allowed for subclass

updateValues(vald, table)

not allowed for subclass