Observation

class Data_Reduction.Observation(parent=None, name=None, dss=None, date=None, project=None)

Bases: object

superclass for a data structure and methods

aliases - (dict) data keys to replace those in original data
channel - (dict) signal paths, e.g., different freqs and pols
data - (dict) original data, e.g., read from file or database
DOY - (int) day of year of observation
end - (float) UNIX time at the end
latitude - (float) from obs
logger - (logging.Logger)
longitude - (float) from obs
name - (str) user assigned, defaults to YEAR/DOY
numdata - (int) number of data samples
obs - (AE.DSS) observatory
session - (Session) set of observations, parent to Observation
session_path - (str) directory for session files
start - (float) UNIX time at the beginning
year - (int) year of observation

Reserved Column Names

These column names are recognized. They are also the keys for attribute data.

These quantities must be present in some form:

unixtime   (float) UNIX time in sec
chan_name  (str)   channel name
integr     (float) integration (exposure) in sec
azel       (float,float) azimuth and elevation in decimal deg
power      (float) power level if only a single channel

Optional:

diode      (float) 0 or power in K (integers OK)
level      (float) (unidentified -- in ``tlog`` table)
cryotemp   (float) cryostat temp in K
windspeed  (float) km/hr
winddir    (float) deg
ambtemp    (float) deg C
pressure   (float) mbar

Columns to be computed:

mpldatenum (float) matplotlib ``datenum``

Alternative for power:

tsys       (float) system temperature (calibrated power)
top        (float) alternative for ``tsys`` (used in DSN)
vfc_counts (int)   VFC counts (rate times ``integr``)

Any column with a name which is not a reserved name is assumed to be power-like data from the channel with that name, unless that name is in a list provided to the argument ignore in the method get_data_channels of the class DataGetterMixin.

Alternative for unixtime:

year       (int) year of observation
doy        (int) day of year
utc        (str) HH:MM:SS
timestr    (str) something like 2020/06/14/14:22:21.00

Alternative for chan_name:

chan       (int) index in receiver channel names

Alternative for azel:

radec      (float,float) precessed right ascension in decimal hours and
           precessed declination in decimal deg
radec1950  (float,float) mean right ascension in decimal hours and
           mean declination in decimal deg at epoch
radec2000  (float,float) mean right ascension in decimal hours and
           mean declination at epoch in decimal deg
az         (float) azimuth in decimal deg
el         (float) elevation in decimal deg
ra         (float) precessed right ascension in decimal hours
dec        (float) precessed declination in decimal deg
ra1950     (float) mean right ascension in decimal hours at epoch
dec1950    (float) mean declination in decimal deg at epoch
ra2000     (float) mean right ascension in decimal hours at epoch
dec2000    (float) mean declination in decimal deg at epoch

Notes

  • The data structure is a dict.

  • The value of a data item is either a numpy array or a object like float, int, or str.

  • The keys have reserved words defined above and will be lowercase.

  • Items with other keys may be added, typically by a child class.

  • Coordinates shall be in pairs, e.g. ``azel`, radec. (This way you never get one without the other.)

Attributes Summary

power_keys

reserved

Methods Summary

check_for(data, longlat)

Checks for separate coordinates and splits if coord pairs

sideband_separate(data)

Converts a complex spectrum array and returns two reals with USB and LSB

splitkey(longlat)

Checks for presence of coordinates in pairs or singles

unpack_to_complex(rawdata)

Converts a sequence of alternating real/imag samples to complex

Attributes Documentation

power_keys = ['tsys', 'top', 'vfc_counts', 'power']
reserved = ['unixtime', 'chan_name', 'integr', 'az', 'el', 'year', 'doy', 'utc', 'timestr', 'chan', 'tsys', 'top', 'diode', 'level', 'cryotemp', 'windspeed', 'winddir', 'ambtemp', 'pressure', 'ra', 'dec', 'ra1950', 'dec1950', 'ra2000', 'dec2000']

Methods Documentation

check_for(data, longlat)

Checks for separate coordinates and splits if coord pairs

Parameters
  • data (dict) – attribute data

  • longlat (str) – “azel”, or “radec”, or “radecEPOC”

sideband_separate(data)

Converts a complex spectrum array and returns two reals with USB and LSB

This applies a Hilbert transform to the complex data.

splitkey(longlat)

Checks for presence of coordinates in pairs or singles

:param longlat : “azel”, or “radec”, or “radecEPOC” :type longlat : str

unpack_to_complex(rawdata)

Converts a sequence of alternating real/imag samples to complex

:param rawdata : alternating real and imaginary bytes :type rawdata : numpy array of signed int8

Returns

numpy array of complex