Station Meta-Data

Station-Level Data

Module for creating object oriented representations of the LWA stations.

class lsl.common.stations.ARX(id, channel=0, asp_channel=0, input='', output='')
Object to store information about a ARX board/channel combination. Stores ARX:
  • ID name (id)

  • Channel number (channel; 1-16)

  • ASP channel number (asp_channel; 1-520)

  • ASP rack input connector label (input)

  • ASP rack output connector label (output)

The object also as a functional attribute named ‘delay’ that computes the cable delay for a particular frequency or collection of frequencies in Hz.

Changed in version 1.0.0: Added attributes to hold the ASP rack input and output connector labels.

response(filter='split', dB=True)

Return a two-element tuple (freq in Hz, S21 magnitude in dB) for the ARX response for the current board/channel from the “ARX0026” memo on the “LWA Engineering Documents” wiki. For ARX boards at LWA-SV, data from the production tests are used.

Filter options are:

Note

If ‘split@3MHz’ or ‘full@3MHz’ are requested for LWA1, the values for ‘split’ and ‘full’ are returned instead.

Changed in version 1.2.1: Switched the filter numbers over to match what ASP uses at LWA1 and LWA-SV. Also, changed the default filter to ‘split’ to match the default value for observations.

Changed in version 1.0.0: Add an option to specify whether the magnitude should be returned in dB or not.

class lsl.common.stations.Antenna(id, arx=None, board=0, digitizer=0, input='', stand=None, pol=0, theta=0.0, phi=0.0, fee=None, fee_port=1, cable=None, status=0)
Object to store the information about an antenna. Stores antenna:
  • ID number (id)

  • ARX instance the antenna is attached to (arx)

  • DP1/ROACH board number (board)

  • DP1/ROACH digitizer number (digitizer)

  • DP/ADP rack input connector (input)

  • Stand instance the antenna is part of (stand)

  • Polarization (0 == N-S; pol)

  • Antenna vertical mis-alignment in degrees (theta)

  • Antenna rotation mis-alignment in degrees (phi)

  • Fee instance the antenna is attached to (fee)

  • Port of the FEE used for the antenna (fee_port)

  • Cable instance used to connect the antenna (cable)

  • Status of the antenna (status)

Status codes are:
  • 0 == Not installed

  • 1 == Bad

  • 2 == Suspect, possibly bad

  • 3 == OK

Changed in version 1.0.0: Added an attribute to hold the DP rack input connector label.

property combined_status

Return the combined antenna + FEE status as a two digit number with the first digit representing the antenna status and the second the FEE status.

response(dB=False)

Return a two-element tuple (freq in Hz, mis-match efficiency) for a model LWA1 antenna from Hicks et al. (2012, PASP, 124, 1090).

New in version 1.0.0.

class lsl.common.stations.Cable(id, length, vf=0, dd=0, a0=0.00428, a1=0.0, ref_freq=10000000.0, stretch=1.0)
Object to store information about a cable. Stores cable:
  • ID name (id)

  • Length in meters (length)

  • Velocity factor (fractional, vf)

  • Dispersive delay (seconds, dd)

  • Gain term that goes as the square root of frequency (a0)

  • Gain term that goes as frequency (a1)

  • Gain term reference frequency (Hz, ref_freq)

  • Cable length stretch factor (stretch)

  • Clock offset (seconds, clock_offset)

The object also as a functional attribute named ‘delay’ that computes the cable delay for a particular frequency or collection of frequencies in Hz.

attenuation(frequency=49000000.0, dB=False)

Get the multiplicative cable loss for a specific frequency (in Hz). Cable loss (attenuation) affects the measured power as follows: P_out = P_in / att. If attenuations for more than one frequency are needed, the frequencies can be passed in as a numpy array.

Changed in version 1.0.0: Added the `dB’ keyword to allow dB to be returned.

delay(frequency=49000000.0, ns=False)

Get the delay associated with the cable in second (or nanoseconds if the ‘ns’ keyword is set to True) for a particular frequency or collection of frequencies in Hz.

gain(frequency=49000000.0, dB=False)

Get the cable gain (“inverse loss”) for a specific frequency (in Hz). Cable gain affects the measured power as follows: P_out = P_in * g. If gains for more than one frequency are needed, the frequencies can be passed in as a numpy array.

Changed in version 1.0.0: Added the `dB’ keyword to allow dB to be returned.

response(dB=False)

Return a two-element tuple (freq in Hz, attenuation) for the cable using the model from LWA Memo #170.

New in version 1.0.1.

class lsl.common.stations.FEE(id, id_number, gain1=0, gain2=0, status=0)
Object to store the information about a FEE. Stores FEE:
  • ID name (id)

  • ID number (id_number)

  • Gain of port 1 (gain1)

  • Gain of part 2 (gain2)

  • Status (status)

Status codes are:
  • 0 == Not installed

  • 1 == Bad

  • 2 == Suspect, possibly bad

  • 3 == OK

response(dB=False)

Return a two-element tuple (freq in Hz, gain) for the frequency- dependent gain for a v1.7 FEE from LWA Memo #190, FEE0010, Figure 3.

New in version 1.0.1.

class lsl.common.stations.LSLInterface(backend=None, mcs=None, sdf=None, metabundle=None, sdm=None)

Object to store information about how to work with the station in LSL. This includes names for the:

  • Backend module to use (backend)

  • MCS module to use (mcs)

  • SDF module to use (sdf)

  • Metadata module to use (metabundle)

  • SDM module to use (sdm)

New in version 1.2.0.

class lsl.common.stations.LWAStation(name, lat, long, elev, id='', antennas=None, interface=None)

Object to hold information about the a LWA station. This object can create a ephem.Observer representation of itself and identify which stands were in use at a given time. Stores station:

  • Name (name)

  • ID code (id)

  • Latitiude in radians [but initialized as degrees] (N is positive, lat)

  • Longitude in radians [but initialized as degrees] (W is negative, long)

  • Elevation in meters (elev)

  • List of Antenna instances (antennas)

LWAStation provides several method and properties for dealing with the station’s location on Earth. These include:

  • get_observer: Return an ephem.Observer instance representing the station

  • aipy_location: A tuple for setting the location of an AIPY AntennaArray

    instance

  • geocentric_location: A tuple of the EC-EF coordinates of the station

  • eci_transform_matrix: Return a 3x3 transformation matrix to convert

    antenna positions to ECI coordinates

  • eci_inverse_transform_matrix: Return a 3x3 transformation matrix to convert

    antenna positions from ECI coordinates

  • get_enz_offset: Return the east, north, and vertical offsets to a point on

    the surface of the Earth

  • get_pointing_and_distance: Return the pointing direction and distance to

    another location on the surface of the Earth

LWAStation also provides several properties for dealing with the station’s antennas. These include:

  • antennas: A list of antennas

  • stands: A list of stands

  • pols: A list of polarizations

  • cables: A list of cables

Changed in version 1.2.0: Added a new ‘interface’ attribute which provides referenves to various modules to help interface with the station.

Changed in version 1.0.0: Converted LWAStation to be an instance of LWAStationBase and ephem.Observer to make it easier to work with ephem.Body objects.

Added additional functions for dealing with other locations.

Changed getECEFTransform() to get_eci_transform() to make the function name consistent with its purpose.

property aipy_location

Return a tuple that can be used by AIPY for specifying a array location.

property cables

Return a list of Cable instances for each antenna, sorted by digitizer number.

compute(body)

Update the provided ephem.Body instance with the current location as viewed from the site.

New in version 1.0.0.

property eci_inverse_transform_matrix

Return a 3x3 transformation matrix that converts a baseline in earth-centered inertial coordinates [x, y, z] to [east, north, elevation] for that baseline.

property eci_transform_matrix

Return a 3x3 transformation matrix that converts a baseline in [east, north, elevation] to earth-centered inertial coordinates for that baseline [x, y, z]. Based off the ‘local_to_eci’ function in the lwda_fits-dev library.

property geocentric_location

Return a tuple with earth-centered, earth-fixed coordinates for the station.

get_enz_offset(locTo)

Given another location on the surface of the Earth, either as a LWAStation instance or a three-element tuple of latitude (deg.), longitude (deg.), and elevation (m), return the topocentric offset in meter along the east, north, and vertical directions.

get_observer(date=None, JD=False)

Return a ephem.Observer object for this site.

get_pointing_and_distance(locTo)

Given another location on the surface of the Earth, either as a LWAStation instance or a three-element tuple of latitude (deg.), longitude (deg.), and elevation (m), return the bearing azimuth/ elevation in radians and distance in meters to the location.

Changed in version 1.0.1: Renamed from getPointingAndDirection to get_pointing_and_distance

property pols

Return a list of polarization (0 == N-S; 1 == E-W) for each antenna, sorted by digitizer number.

property stands

Return a list of Stand instances for each antenna, sorted by digitizer number.

class lsl.common.stations.Stand(id, x, y, z)

Object to store the information (location and ID) about a stand. Stores stand:

  • ID number (id)

  • Position relative to the center stake in meters (x,y,z)

The x, y, and z positions can also be accessed through subscripts:

Stand[0] = x Stand[1] = y Stand[2] = z

Changed in version 1.0.0: Added the option to get the positions via subscripts.

lsl.common.stations.ecef_to_geo(x, y, z)

Convert earth-centered, earth-fixed coordinates to (rad), longitude (rad), elevation (m) using Bowring’s method.

lsl.common.stations.geo_to_ecef(lat, lon, elev)

Convert latitude (rad), longitude (rad), elevation (m) to earth- centered, earth-fixed coordinates.

lsl.common.stations.get_full_stations()

Function to return a list of full stations.

New in version 1.2.0.

lsl.common.stations.parse_ssmif(filename)

Given a SSMIF file, return a fully-filled LWAStation instance. This function supports both human-readable files (filenames with ‘.txt’ extensions) or binary packed files (filenames with ‘.dat’ extensions).

Station Dynamic MIB Data

Module for reading in an interpreting binary-packed Station Dynamic MIB (SDM) files (as defined in MCS0031, v5).

class lsl.common.sdm.SDM(station=None, shl=None, asp=None, dp=None, dr=None, status=None, ant_status=None, dpo_status=None, settings=None)

Python object that holds the various bits of information in a binary-packed Station Dynamic MIB file (SDM file).

update_antennas(antennas)

Given a list of lsl.common.stations.Antenna instances, return a new list of Antenna instances with updated antenna status codes.

class lsl.common.sdm.SubSubSystemStatus(fee=None, rpd=None, sep=None, arb=None, dp1=None, dp2=None, dr=None)

Python object that holds the status for the sub-subsystems in a SDM file.

binary_read(fh)

Given an open file handle, interpret it in the context of a subsubsystem_status_struct C structure and update the Python instance accordingly.

class lsl.common.sdm.SubSystemStatus(name, summary=6, info='UNK', time=0)

Python object that holds the status for a particular subsystem in a SDM file.

binary_read(fh)

Given an open file handle, interpret it in the context of a subsystem_status_struct C structure and update the Python instance accordingly.

lsl.common.sdm.parse_sdm(filename)

Given a filename, read the file’s contents into the SDM instance and return that instance.

Stand-Level Data

This module stores various functions that are needed for computing UV coverage and time delays. The functions in the module:

  • compute the u, v, and w coordinates of all baselines defined by an array of stands

  • compute the track through the uv-plane of a collection of baselines as the Earth rotates.

Changed in version 0.4.0: Removed function for dealing with meta-data (position, cable length, etc.) for individual stands since these are wrapped in the new lsl.common.stations module.

Changed in version 1.0.0: Generalized the compute_uvw() and compute_uv_track() functions.

Changed in version 2.0.1: Added support for ephem.Angle, astropy.coordinates.Angle, and astropy.coordinates.EarthLocation instances in the compute_uvw() and compute_uv_track() functions.