Source code for casatools.msmetadata

#
# stub class definition file for docstring parsing
#

[docs]class msmetadata: r""" Operations to retrieve metadata from a measurment set The msmd tool provides methods to retrieve metadata from measurement sets. **Attaching to a Measurement Set** The simplest and most common way to attach an msmd tool to a measurement set is to use the msmd.open method which requires that you specify the name of the measurement set table. NOTE: Any modifications to an MS while an associated msmd tool is open will not be reflected in the msmd tool. You must close and reopen the tool if you want to capture changes made to metadata of an MS if such a change occurs. """
[docs] def msmetadata(self): r""" msmetadata method """ pass
[docs] def almaspws(self, chavg=False, fdm=False, sqld=False, tdm=False, wvr=False, complement=False): r""" Get spectral window IDs based on ALMA-specific criteria. The inputs are or'ed together to form the returned list. If complement=True, then the complement of the selection is returned. If the SPECTRAL_WINDOW table has the optional BBC_NO column and if the name of the spectral window matches the regular expression "BB_[0-9]#SQLD", where [0-9] indicates that a single integer matches, the window is classified as a *square law detector spectral window*. The following algorithm is used to identify WVR spwectral windows: 1. check for water vapor radiometer (WVR) spectral windows using the spectral window name "WVR#NOMINAL" and report these. 2. If no SPWs match that string, then the names are checked for "WVR" and are reported instead. If the window is not found to be a WVR window, it is then checked if The window is classified as a *channel average spectral window* if it is not a WVR window, if the number of channels is one, and the spectral window name does not contain the string "FULL_RES" The window is classified as an *FDM window* if it is neither a WVR window nor a channel average window and if either 1. its bandwidth is less than 2 GHz, or 2. the number of channels it contains is greater than or equal to 15 but not equal to 256, 128, 64, 32, 16, 248, 124, 62, or 31. The window is classified as a *TDM spectral window* if it is neither a WVR window, a channel average window, nor an FDM window. .. rubric:: Parameters - ``chavg (bool=False)`` - Get channel average spectral windows? - ``fdm (bool=False)`` - Get FDM spectral windows? - ``sqld (bool=False)`` - Get square law (i.e. total power) detector spectral windows? - ``tdm (bool=False)`` - Get TDM spectral windows? - ``wvr (bool=False)`` - Get WVR spectral windows? - ``complement (bool=False)`` - Return the complement of the selected set? .. rubric:: Returns ``intVec`` .. rubric:: Examples :: msmd.open("my.ms") # get all square law detector spectral window IDs msmd.almaspws(sqld=True) # get all spectral window IDs other than those associated with square law detectors msmd.almaspws(sqld=True, complement=True) """ pass
[docs] def antennadiameter(self, antenna='-1'): r""" Get the diameter for the specified antenna. The antenna can be specified either by its zero-based ID from the ANTENNA table or by its name in that table. The returned dictionary is a valid quantity. If a negative integer is provided for the antenna, then all atenna diameters will be returned in a dictionary that has keys that are the antenna IDs and values that are dictionaries, each being a valid quantity representing the diameter for that antenna ID. .. rubric:: Parameters - ``antenna ({string, int}='-1')`` - Zero-based antenna in the ANTENNA table, or antenna name. A negative integer will cause all antenna diameters to be returned. .. rubric:: Returns ``record`` .. rubric:: Examples :: msmd.open("my.ms") # Get the diameter of the antenna named "VB2" diameter = msmd.antennadiameter("VB2") msmd.done() """ pass
[docs] def antennaids(self, name='', mindiameter='0m', maxdiameter='1pc', obsid=-1): r""" Get the zero-based antenna IDs for the specfied antenna names and the specified diameter range for the specified observation ID. An array of unique IDs in order of the specified names is returned. Note that if a specified name is listed mulitple times in the ANTENNA table, the largest ID is returned, unless the observation ID is specified to be non-negative, in which case, the returned IDs are filtered based on the specified observation ID. If no names and no diameter range is specified, all IDs are returned. .. rubric:: Parameters - ``name ({string, stringVec}='')`` - Antenna names (string or string array) for which to get the corresponding IDs. Note that * matches any number of characters of all character classes. - ``mindiameter (variant='0m')`` - Minimum antenna diameter, expressed as a quantity. - ``maxdiameter (variant='1pc')`` - Maximum antenna diameter, expressed as a quantity. - ``obsid (int=-1)`` - Observation ID. If negative, all observation IDs are considered. .. rubric:: Returns ``intVec`` .. rubric:: Examples :: msmd.open("my.ms") # get the zero-based antenna IDs for the antenna named "VB2" antenna_id = msmd.antennaids("VB2")[0] # get the zero-based antenna IDs for all antennas with diameters between 9m and 11m antenna_ids = msmd.antennaids(mindiameter="9m", maxdiameter=qa.quantity("11m")) msmd.done() """ pass
[docs] def antennanames(self, antennaids=-1): r""" Get the name of the antenna for the specfied zero-based antenna ID. If antennaids is not specified, all antenna names are returned. .. rubric:: Parameters - ``antennaids ({int, intVec}=-1)`` - Zero-based antenna IDs (int or int array) for which to get the antenna names. .. rubric:: Returns ``stringVec`` .. rubric:: Examples :: msmd.open("my.ms") # get the name associated with antenna ID 31 antenna_name = msmd.antennanames(31)[0] msmd.done() """ pass
[docs] def antennaoffset(self, which='0'): r""" Get the offset position of the specified antenna relative to the array reference position. Antenna may be specified as a zero-based integer (row number in the ANTENNA table) or a string representing a valid antenna name. The returned record contains the longitude, latitude, and elevation offsets as quantity records. The reported longitude and latitude offsets are measured along the surface of a sphere whose center is coincident with the center of the earth and whose surface contains the observatory reference position. .. rubric:: Parameters - ``which ({string, int}='0')`` - Zero-based antenna in the ANTENNA table, or antenna name. .. rubric:: Returns ``record`` .. rubric:: Examples :: msmd.open("my.ms") # get the offset of the (zero-based) 3rd antenna in the ANTENNA table antennna_offset = msmd.antennaoffset(3) # get the offset of antenna DV02 antennna_offset = msmd.antennaoffset('DV02') msmd.done() """ pass
[docs] def antennaposition(self, which='0'): r""" Get the position of the specified antenna. The returned record represents a position measure, and can be used as such by the measures (me) tool. .. rubric:: Parameters - ``which ({int, string}='0')`` - Zero-based antenna ID in the ANTENNA table or antenna name. .. rubric:: Returns ``record`` .. rubric:: Examples :: msmd.open("my.ms") # get the position of the (zero-based) 3rd antenna in the ANTENNA table antennna_position = msmd.antennaposition(3) # get the position of the antenna named DV07 antennna_position = msmd.antennaposition("DV07") msmd.done() """ pass
[docs] def antennastations(self, which='-1', obsid=-1): r""" Get the station names of the specified antennas. If a specified antenna name is listed multiple times in the ANTENNA table, obsid is negative, and which is specified as an array of names, then the station associated with the largest ID for that antenna is returned. If obsid is nonnegative, returned stations are filtered based on that. If which is specified as a string (antenna name), then all the stations associated with that antenna are returned. .. rubric:: Parameters - ``which ({int, string, intVec, stringVec}='-1')`` - Zero-based antenna ID(s) in the ANTENNA table or antenna name(s). Single numeric id less than zero retrieves all station names. - ``obsid (int=-1)`` - Observation ID. If negative, all observation IDs are considered. .. rubric:: Returns ``stringVec`` .. rubric:: Examples :: msmd.open("my.ms") # get all station names stations = msmd.antennastations(-1) # get the stations of the antennas named DV07 and DV01 stations = msmd.antennaposition(["DV07", "DV01"]) msmd.done() """ pass
[docs] def antennasforscan(self, scan=-1, obsid=-1, arrayid=-1): r""" Get an array of the unique antennaIDs for the specified scan, observation ID, and array ID. .. rubric:: Parameters - ``scan (int=-1)`` - Scan number for which to return the intents. - ``obsid (int=-1)`` - Observation ID. If less than 0, all observation IDs are used. - ``arrayid (int=-1)`` - Array ID. If less than 0, all array IDs are used. .. rubric:: Returns ``intVec`` .. rubric:: Examples :: msmd.open("my.ms") # get the antennas associated with scan 4 (all observation IDs, all array IDs) antennas = msmd.antennasforscan(4) msmd.done() """ pass
[docs] def bandwidths(self, spw=-1): r""" Get the bandwidths in Hz for the specified spectral windows. If spw less than zero, return bandwidths for all spectral windows. .. rubric:: Parameters - ``spw ({int, intVec}=-1)`` - Spectral window IDs, if integer less than zero, return bandwidths for all spectral windows. .. rubric:: Returns ``any`` .. rubric:: Examples :: msmd.open("my.ms") # get bandwdith for spectral window 2. baseband = msmd.bandwidth(2) msmd.done() """ pass
[docs] def baseband(self, spw=''): r""" Get the baseband for the specified spectral window. .. rubric:: Parameters - ``spw (int='')`` - Spectral window ID. .. rubric:: Returns ``int`` .. rubric:: Examples :: msmd.open("my.ms") # get baseband for spectral window 2. baseband = msmd.baseband(2) msmd.done() """ pass
[docs] def baselines(self): r""" Get a two dimensional boolean array representing baselines for data recorded in the MS. A value of True means there is at least one row in the MS main table for that baseline, False means no rows for that baseline. Autocorrelation "baseline" information is also present via the values along the diagonal. """ pass
[docs] def chanavgspws(self): r""" Get an array of spectral window IDs used for channel averages. These are windows that do have 1 channel. """ pass
[docs] def chaneffbws(self, spw='', unit='', asvel=False): r""" Get an array of channel effective bandwidths for the specified spectral window. The parameter asvel indicates if velocity widths (True) or frequency widths (False) should be returned. The unit parameter specifies the units that the returned values should have. If empty (default), "Hz" will be used if asvel=False, or "km/s" will be used if asvel=True. .. rubric:: Parameters - ``spw (int='')`` - Spectral window ID. - ``unit (string='')`` - Desired unit of returned quantities. Empty means "Hz" if asvel=False, "km/s" if asvel=True. - ``asvel (bool=False)`` - Should return values be equivalent velocity widths? .. rubric:: Returns ``doubleVec`` .. rubric:: Examples :: msmd.open("my.ms") # get the channel effective bandwidths for spectral window 2, in m/s chan_ebw = msmd.chaneffbws(2, "m/s", True) msmd.done() """ pass
[docs] def chanfreqs(self, spw='', unit='Hz'): r""" Get an array of channel frequencies for the specified spectral window. .. rubric:: Parameters - ``spw (int='')`` - Spectral window ID. - ``unit (string='Hz')`` - Convert frequencies to this unit. .. rubric:: Returns ``doubleVec`` .. rubric:: Examples :: msmd.open("my.ms") # get the channel frequencies for spectral window 2. chan_freqs = msmd.chanfreqs(2) msmd.done() """ pass
[docs] def chanres(self, spw='', unit='', asvel=False): r""" Get an array of channel resolutions for the specified spectral window. The parameter asvel indicates if velocity widths (True) or frequency widths (False) should be returned. The unit parameter specifies the units that the returned values should have. If empty (default), "Hz" will be used if asvel=False, or "km/s" will be used if asvel=True. .. rubric:: Parameters - ``spw (int='')`` - Spectral window ID. - ``unit (string='')`` - Desired unit of returned quantities. Empty means "Hz" if asvel=False, "km/s" if asvel=True. - ``asvel (bool=False)`` - Should return values be equivalent velocity resolutions? .. rubric:: Returns ``doubleVec`` .. rubric:: Examples :: msmd.open("my.ms") # get the channel resolutions for spectral window 2, in m/s chan_res = msmd.chanres(2, "m/s", True) msmd.done() """ pass
[docs] def chanwidths(self, spw='', unit='Hz'): r""" Get an array of channel widths for the specified spectral window. .. rubric:: Parameters - ``spw (int='')`` - Spectral window ID. - ``unit (string='Hz')`` - Convert frequencies to this unit. .. rubric:: Returns ``doubleVec`` .. rubric:: Examples :: msmd.open("my.ms") # get the channel widths for spectral window 2. chan_freqs = msmd.chanwidths(2) msmd.done() """ pass
[docs] def close(self): r""" This method will close the tool and reclaim system resources it has been using. Returns True if successful. """ pass
[docs] def corrbit(self, spw='-1'): r""" Get the value of SPECTRAL_WINDOW::SDM_CORR_BIT column for the specified spw. If spw >= 0 is specified, a string value is returned. If spw <0, a list of string values with length equal to the number of spectral windows is returned. If the SPECTRAL_WINDOW::SDM_CORR_BIT column does not exist, either "UNKNOWN" is returned if spw>=0, or a list with nspw entries of "UNKNOWN" is returned if spw<0. A list of integers may also be supplied for the spw parameter. In this case, all integers should be in the range [0, spw-1] or an exception will be thrown. The return value will be a list containing the corresponding CORR_BIT values in the order of the spws specified. .. rubric:: Parameters - ``spw (variant='-1')`` - Spectral window ID(s). May be an integer or list of integers. If integer, <0 implies all. .. rubric:: Returns ``any`` .. rubric:: Examples :: msmd.open("my.ms") # get value of SPECTRAL_WINDOW::SDM_CORR_BIT column for spw=2. cb = msmd.corrbit(spw=2) msmd.done() """ pass
[docs] def corrprodsforpol(self, pol=-1): r""" Get the correlation products associated with the specified polarization ID. .. rubric:: Parameters - ``pol (int=-1)`` - Polarization ID. Must be nonnegative. .. rubric:: Returns ``any`` .. rubric:: Examples :: msmd.open("my.ms") # get correlation products for polarization ID 3 corrprods = msmd.corrprodsforpol(3) msmd.done() """ pass
[docs] def corrtypesforpol(self, pol=-1): r""" Get the correlation types associated with the specified polarization ID. .. rubric:: Parameters - ``pol (int=-1)`` - Polarization ID. Must be nonnegative. .. rubric:: Returns ``intVec`` .. rubric:: Examples :: msmd.open("my.ms") # get correlation types for polarization ID 3 corrtypes = msmd.corrtypesforpol(3) msmd.done() """ pass
[docs] def datadescids(self, spw=-1, pol=-1): r""" Get a list of data description IDs associated with the specified spectral window ID and/or polarization ID. Values of less than zero for either means all IDs should be used in the selection. .. rubric:: Parameters - ``spw (int=-1)`` - Spectral window ID. Less than zero implies any, - ``pol (int=-1)`` - Polarization ID. Less than zero implies any. .. rubric:: Returns ``intVec`` .. rubric:: Examples :: msmd.open("my.ms") # get all data description IDs associated with spw 2. msmd.datadescids(spw=2) # same as before but limit the IDs returned to those associated with # polarization ID 3 msmd.datadescids(spw=2, pol=3) msmd.done() """ pass
[docs] def done(self): r""" This method will close the tool and reclaim system resources it has been using. Returns True if successful. """ pass
[docs] def effexposuretime(self): r""" Get the effective exposure time (equivalent to what might be more commonly known as total integration time or total sample time) is calculated by summing over all rows in the main MS table, excluding autocorrelations or rows where FLAG_ROW is False, thusly: sum[over i] (exposure[i]*sum[over j](UFBW[i, j])/ncorrelations[i] )/ nmaxbaselines where exposure[i] is the value of EXPOSURE for the ith row, the inner sum is performed over each correlation for that row, UFBW is the unflagged fractional bandwidth is determined by summing all the widths of the unflagged channels for that correlation and dividing by the total bandwidth of all spectral windows observed at the timestamp of row i, ncorrelations is the number of correlations determined by the number of rows in the FLAG matrix for MS row i, and nmaxbaselines is the maximum number of antenna pairs, nantennas*(nantennas-1)/2, where nantennas is the number of antennas in the ANTENNA table. This method returns a quantity (a dictionary having a numerical value and a string unit). """ pass
[docs] def exposuretime(self, scan=0, spwid=0, polid=-1, obsid=0, arrayid=0): r""" Get the exposure time for the specified scan, spwid, polarization ID, array ID, and observation ID. This is the exposure time of the record with the lowest time stamp of the records associated with these parameters. Returns a quantity dictionary. If polid is not specified (or specified and negative) and there is only one polarization ID in for the specified combination of scan, spwid, obsID, and arrayID, then that polarization ID is used. If there are multiple polarization IDs for the combination of other parameters, a list of these is logged and an empty dictionary is returned. .. rubric:: Parameters - ``scan (int=0)`` - Scan number. - ``spwid (int=0)`` - Spectral window ID. - ``polid (int=-1)`` - Polarization ID. - ``obsid (int=0)`` - Observation ID. - ``arrayid (int=0)`` - Array ID. .. rubric:: Returns ``record`` .. rubric:: Examples :: msmd.open("my.ms") # get the exposure time for scan 1, spwid 2, and polid 3 # for obsid=0 and arrayid=0 integration_time = msmd.exposuretime(scan=1, spwid=2, polid=3) msmd.done() """ pass
[docs] def fdmspws(self): r""" Get an array of spectral window IDs used for FDM. These are windows that do not have 64, 128, or 256 channels. """ pass
[docs] def fieldnames(self): r""" Get an array of field names as they appear in the FIELD table. """ pass
[docs] def fieldsforintent(self, intent='', asnames=False): r""" Get an array of the unique fields for the specified intent. Note that \* matches any number of characters of all character classes. .. rubric:: Parameters - ``intent (string='')`` - Intent (case sensitive) for which to return the fields. - ``asnames (bool=False)`` - If True, return the field names. If False, return the zero-based field IDs. .. rubric:: Returns ``any`` .. rubric:: Examples :: msmd.open("my.ms") # get the field names for intent "observe target" field_names = msmd.fieldsforintent("observe target", True, regex=False) # get the field IDs for intent "observe target" field_IDs = msmd.fieldsforintent("observe target", False, regex=False) # get all field IDs for all intents which contain 'WVR' field_IDs = msmd.fieldsforIntent("*WVR*") msmd.done() """ pass
[docs] def fieldsforname(self, name=''): r""" Get an array of the unique, zero-based field IDs for the specified field name. If the field name is the empty string (the default), a list of all unique field IDs in the main table of the MS will be returned. .. rubric:: Parameters - ``name (string='')`` - Field name (case sensitive) for which to return the fields. .. rubric:: Returns ``intVec`` .. rubric:: Examples :: msmd.open("my.ms") # get the field IDs for field name "Enceladus" fields = msmd.fieldsforname("Enceladus") msmd.done() """ pass
[docs] def fieldsforscan(self, scan=-1, asnames=False, obsid=-1, arrayid=-1): r""" Get an array of the unique fields for the specified scan number, observation ID, and array ID. .. rubric:: Parameters - ``scan (int=-1)`` - Scan number for which to return the fields. - ``asnames (bool=False)`` - If True, return the field names. If False, return the zero-based field IDs. - ``obsid (int=-1)`` - Observation ID. A negative value means use all observation IDs. - ``arrayid (int=-1)`` - Array ID. A negative value means use all array IDs. .. rubric:: Returns ``any`` .. rubric:: Examples :: msmd.open("my.ms") # get the field names for scan number 5 (for all array IDs and all observation IDs). field_names = msmd.fieldsforscan(5, True) # get the field IDs for scan number 5 (for all array IDs and all observation IDs) field_IDs = msmd.fieldsforscan(5, False) msmd.done() """ pass
[docs] def fieldsforscans(self, scans='', asnames=False, obsid=-1, arrayid=-1, asmap=False): r""" Get an array or dictionary of the unique fields for the specified scan numbers, observation ID, and array ID. If asnames=True, the values returned will be the field names, if False, they will be field IDs. If asmap=True, the structure returned will be a dictionary which maps scan number (as a string) to fields. In this case, both obsid and arrayid must be nonnegative. If asmap=False, a single array of fields is returned that matches the query. In this case, if obsid and/or arrayid are negative, then it indicates that all fields matching any obsid and/or arrayid should be returned. An empty array specified for scans means that all scans for the selected obsid and arrayid should be included. .. rubric:: Parameters - ``scans (intVec='')`` - Scan numbers for which to return the fields. - ``asnames (bool=False)`` - If True, return the field names. If False, return the zero-based field IDs. - ``obsid (int=-1)`` - Observation ID. A negative value means use all observation IDs. - ``arrayid (int=-1)`` - Array ID. A negative value means use all array IDs. - ``asmap (bool=False)`` - Return a dictionary mapping scan numbers to fields? .. rubric:: Returns ``any`` .. rubric:: Examples :: msmd.open("my.ms") # get the field names for scan numbers 5 and 10 (all obsids, all arrayids) field_names = msmd.fieldsforscan([5, 10], True) # get the field IDs for scan numbers 5 and 10 (all obsids, all arrayids) field_IDs = msmd.fieldsforscan([5, 10], False) # get mapping of scans to fields for arrayid=2 and obsid=4 scans_to_fields = msmd.fieldsforscan(obsid=4, arrayid=2, asmap=True) msmd.done() """ pass
[docs] def fieldsforsource(self, source=-1, asnames=False): r""" Get an array of the unique fields for the specified source. .. rubric:: Parameters - ``source (int=-1)`` - Zero-based source ID for which to return the fields. - ``asnames (bool=False)`` - If True, return the field names. If False, return the zero-based field IDs. .. rubric:: Returns ``any`` .. rubric:: Examples :: msmd.open("my.ms") # get the field names for source ID 1 field_names = msmd.fieldsforsource(1, True) # get the field IDs for source ID 1 field_IDs = msmd.fieldsforsource(1, False) msmd.done() """ pass
[docs] def fieldsforsources(self, asnames=False): r""" Get a map of source IDs to fields. The keys (source IDs) will be strings. .. rubric:: Parameters - ``asnames (bool=False)`` - If True, return the field names. If False, return the zero-based field IDs. .. rubric:: Returns ``record`` .. rubric:: Examples :: msmd.open("my.ms") # get the source to field name map sources_to_fields = msmd.fieldsforsources(True) # access the field names for source 1 field = sources_to_fields["1"] msmd.done() """ pass
[docs] def fieldsforspw(self, spw=-1, asnames=False): r""" Get an array of the unique fields for the specified spectral window. .. rubric:: Parameters - ``spw (int=-1)`` - Zero-based spectral window ID for which to return the fields. - ``asnames (bool=False)`` - If True, return the field names. If False, return the zero-based field IDs. .. rubric:: Returns ``any`` .. rubric:: Examples :: msmd.open("my.ms") # get the field names for spectral window 1 field_names = msmd.fieldsforspw(1, True) # get the field IDs for spectral window 1 field_IDs = msmd.fieldsforspw(1, False) msmd.done() """ pass
[docs] def fieldsfortimes(self, time=-1, tol=0): r""" Get an array of the unique, zero-based, fieldIDs for the specified time range (time-tol to time+tol). .. rubric:: Parameters - ``time (double=-1)`` - Time at center of time range. - ``tol (double=0)`` - Time on either side of center for specifying range. .. rubric:: Returns ``intVec`` .. rubric:: Examples :: msmd.open("my.ms") # get the field IDs associated with the specified time range fields = msmd.fieldsfortimes(4.8428293714e+09, 20) msmd.done() """ pass
[docs] def intents(self): r""" Get an array of the unique intents associated with the MS. """ pass
[docs] def intentsforfield(self, field='-1'): r""" Get an array of the unique intents for the specified field. .. rubric:: Parameters - ``field ({int, string}='-1')`` - Field ID or name for which to return the intents. .. rubric:: Returns ``stringVec`` .. rubric:: Examples :: msmd.open("my.ms") # get the intents associated with field 4 intents = msmd.intentsforfield(4) # get intents for field "MOS" intents2 = msmd.intentsforfield("MOS") msmd.done() """ pass
[docs] def intentsforscan(self, scan=-1, obsid=-1, arrayid=-1): r""" Get an array of the unique intents for the specified scan, observation ID, and array ID. .. rubric:: Parameters - ``scan (int=-1)`` - Scan number for which to return the intents. - ``obsid (int=-1)`` - Observation ID. A negative value means use all observation IDs. - ``arrayid (int=-1)`` - Array ID. A negative value means use all array IDs. .. rubric:: Returns ``stringVec`` .. rubric:: Examples :: msmd.open("my.ms") # get the intents associated with scan 4 (all obsids, all arrayids) intents = msmd.intentsforscan(4) msmd.done() """ pass
[docs] def intentsforspw(self, spw=-1): r""" Get an array of the unique intents for the specified spectral window ID. .. rubric:: Parameters - ``spw (int=-1)`` - Spectral window ID (\>=0) for which to return the intents. .. rubric:: Returns ``stringVec`` .. rubric:: Examples :: msmd.open("my.ms") # get the intents associated with spectral window ID 3 intents = msmd.intentsforspw(3) msmd.done() """ pass
[docs] def meanfreq(self, spw='', unit='Hz'): r""" Get the mean frequency for the specified spectral window. .. rubric:: Parameters - ``spw (int='')`` - Spectral window ID. - ``unit (string='Hz')`` - Convert frequencies to this unit. .. rubric:: Returns ``double`` .. rubric:: Examples :: msmd.open("my.ms") # get the mean frequency for spectral window 2. mean_freq = msmd.meanfreq(2) msmd.done() """ pass
[docs] def name(self): r""" Get the name of the attached MS. """ pass
[docs] def namesforfields(self, fieldids=''): r""" Get the name of the specified field. .. rubric:: Parameters - ``fieldids ({string, int, intVec}='')`` - Zero-based field IDs for which to get the names (integer or interger array). Unspecified will return all field names. .. rubric:: Returns ``stringVec`` .. rubric:: Examples :: msmd.open("my.ms") # get the name for field 8 and 2. field_names = msmd.namesforfields([8, 2]) # get all field names all_field_nams = namesforfields() msmd.done() """ pass
[docs] def namesforspws(self, spwids=''): r""" Get the name of the specified spw(s). .. rubric:: Parameters - ``spwids ({string, int, intVec}='')`` - Zero-based spw ID(s) for which to get the names (integer or interger array). Unspecified will return all spw names. .. rubric:: Returns ``stringVec`` .. rubric:: Examples :: msmd.open("my.ms") # get the name for spws 8 and 2. spw_names = msmd.namesforspws([8, 2]) # get all spw names all_spw_names = msmd.namesforspws() msmd.done() """ pass
[docs] def nantennas(self): r""" Get the number of antennas associated with the MS. """ pass
[docs] def narrays(self): r""" Get the number of arrays associated with the MS from the ARRAY table. """ pass
[docs] def nbaselines(self, ac=False): r""" Get the number of unique baselines (antenna pairs) represented in the main MS table. This can, in theory, be less than n*(n-1)/2 (n being the number of antennas in the ANTENNA table), if data for certain baselines are not included in the main MS table. Autocorrelation "baselines" are included in this count if ac=True. .. rubric:: Parameters - ``ac (bool=False)`` - Include auto-correlation "baselines"? .. rubric:: Returns ``int`` .. rubric:: Examples :: msmd.open("my.ms") number_of_baselines = msmd.nbaselines() number_of_baselines_including_ac = msmd.nbaselines(True) msmd.done() """ pass
[docs] def nchan(self, spw=''): r""" Get the number of channels associated with the specified spectral window. .. rubric:: Parameters - ``spw (int='')`` - Zero-based spw ID for which to get the number of channels. .. rubric:: Returns ``int`` .. rubric:: Examples :: msmd.open("my.ms") nchan = msmd.nchan(3) msmd.done() """ pass
[docs] def ncorrforpol(self, polid=-1): r""" Get the number of correlations for the specified polarization ID. If the specified polarization ID is negative, an array of numbers of correlations is returned. The indices of that array represent polarization IDs. .. rubric:: Parameters - ``polid (int=-1)`` - Zero-based polarization ID. A negative number will cause all the numbers of correlations to be returned. .. rubric:: Returns ``variant`` .. rubric:: Examples :: msmd.open("my.ms") # get the number of correlations associated with polarization ID 4 polid = msmd.ncorrforpol(4) # get the array of numbers of correlations from the POLARIZATION table polids = msmd.ncorrforpol(-1) msmd.done() """ pass
[docs] def nfields(self): r""" Get the number of fields associated with the MS. """ pass
[docs] def nobservations(self): r""" Get the number of observations associated with the MS from the OBSERVATIONS table. """ pass
[docs] def nspw(self, includewvr=True): r""" This method will return the number of spectral windows in the associated MS. .. rubric:: Parameters - ``includewvr (bool=True)`` - Include wvr spectral windows? If False, exclude wvr windows from count. .. rubric:: Returns ``int`` .. rubric:: Examples :: msmd.open("my.ms") number_of_spectral_windows = msmd.nspw() msmd.done() """ pass
[docs] def nstates(self): r""" This method will return the number of states (number of rows in the STATES table) in the associated MS. """ pass
[docs] def nscans(self): r""" Get the number of scans associated with the MS. """ pass
[docs] def nsources(self): r""" Get the number of unique values from the SOURCE_ID column in the SOURCE table. The number of rows in the SOURCE table may be greater than this value. """ pass
[docs] def nrows(self, autoc=True, flagged=True): r""" Get the number of visibilities (from the main table) associated with the MS. .. rubric:: Parameters - ``autoc (bool=True)`` - Include autocorrelation data? If False, only cross correlation rows will be summed. - ``flagged (bool=True)`` - Include flagged data? If False, only unflagged or patially flagged rows will be summed. .. rubric:: Returns ``double`` .. rubric:: Examples :: msmd.open("my.ms") # get the total number of rows nrows = msmd.nrows() # got the number of cross correlation rows ncross = msmd.nrows(auto=False) # get the number of unflagged rows ngood = msmd.nrows(flagged=False) # get the number of unflagged cross correlation rows ncrossunflagged = msmd.nrows(auto=False, flagged=False) msmd.done() """ pass
[docs] def observers(self): r""" Get an array of observers as they are listed in the OBSERVATIONS table. """ pass
[docs] def observatorynames(self): r""" Get an array of MS telescope (observatory) names as they are listed in the OBSERVATIONS table. """ pass
[docs] def observatoryposition(self, which=0): r""" Get the position of the specified telescope. .. rubric:: Parameters - ``which (int=0)`` - Zero-based telescope position in the OBSERVATIONS table (see msmd.telescopenames()). .. rubric:: Returns ``record`` .. rubric:: Examples :: msmd.open("my.ms") # get the position of the 0th telescope telescope_position = msmd.telescopeposition(0) msmd.done() """ pass
[docs] def open(self, msfile='', maxcache=50): r""" Attach this tool to the specified MS. This method runs a few basic MS validation tests, and if any of these fail (which indicates that the MS is invalid), an error occurs and the tool is not attached to the MS. Note that it is ultimately the user’s responsibility to ensure that the MS is valid. Running the methods of this tool on an invalid MS may result in incorrect results or even a crash of CASA. Such invalidities include any MS subtable not having appropriate information (eg, an OBSERVATION subtable not having enough rows to account for all the OBSERVATION_IDs in the main table). .. rubric:: Parameters - ``msfile (string='')`` - Name of the existing measurement set - ``maxcache (float=50)`` - Maximum cache size, in megabytes, to use. .. rubric:: Returns ``bool`` .. rubric:: Examples :: msmd.open("my.ms") # do stuff and close it msmd.done() """ pass
[docs] def phasecenter(self, fieldid=0, epoch=''): r""" Get a direction measures for the phasecenter of the field id and time specified .. rubric:: Parameters - ``fieldid (int=0)`` - Zero-based field ID for which to get the phasecenter; default fieldid=0 - ``epoch (record='')`` - Optional time, expressed as a measures epoch dictionary, if field id has a polynomial in time phasecenter or an ephemerides table attached to the ID. Default value means evaluate at the origin TIME in the FIELD table .. rubric:: Returns ``record`` .. rubric:: Examples :: msmd.open("my.ms") # get phasecenter for field ID 1 mydir = msmd.phasecenter(1); # if the phasecenter is a polynomial or has an ephemerides attached to # it a time is needed to get the phase direction ep=me.epoch('utc', '2015/03/15/15:30:55') mydir2=msmd.phasecenter(2, ep) msmd.done() """ pass
[docs] def pointingdirection(self, rownum=0, interpolate=False, initialrow=0): r""" Get the pointing direction for antennas at the specified row number in the main MS table. Returns a record containing the time, antenna IDs and corresponding pointing directions. .. rubric:: Parameters - ``rownum (int=0)`` - Row number in the main MS table. - ``interpolate (bool=False)`` - Interpolate pointings in case the interval in the main table is shorter than that in the pointing table (often the case in fast-scanning in single dish observaitions) - ``initialrow (int=0)`` - Initial guess of row index in pointing table to start search. .. rubric:: Returns ``record`` .. rubric:: Examples :: msmd.open("my.ms") # get the pointing directions for row ID 500 dirs = msmd.pointingdirection(500) msmd.done() """ pass
[docs] def polidfordatadesc(self, ddid=-1): r""" Get the polarization ID associated with the specified data description ID. If the specified data description ID is negative, an array of polarization IDs is returned. The indices of that array represent data description IDs. .. rubric:: Parameters - ``ddid (int=-1)`` - Zero-based data description ID. A negative number will cause all the polarization IDs to be returned. .. rubric:: Returns ``variant`` .. rubric:: Examples :: msmd.open("my.ms") # get the polarization ID associated with data description ID 3 polid = msmd.polidfordatadesc(3) # get the array of polarization IDs in the order they appear in the DATA_DESCRIPTION table polids = msmd.polidfordatadesc(-1) msmd.done() """ pass
[docs] def projects(self): r""" Get an array of projects as they are listed in the OBSERVATIONS table. """ pass
[docs] def propermotions(self): r""" Get the values of the DIRECTION column from the SOURCE table. Returns a dictionary in which the keys are the associated zero-based row numbers, represented as strings, in the SOURCE table. The associated values are two element dictionaries, with keys "longitude" and "latitude", containing the longitudinal and latidinal components of the proper motion, which are valid quantity dictionaries. """ pass
[docs] def refdir(self, field='0', epoch=''): r""" Get a direction measure for the reference direction of the field and time specified .. rubric:: Parameters - ``field ({string, int}='0')`` - Zero-based field ID or field name for which to get the reference direction; default field=0 - ``epoch (record='')`` - Optional time, expressed as a measures epoch dictionary, if associated field has a polynomial in time reference direction or an ephemerides table attached it. Default value means evaluate at the origin TIME in the FIELD table .. rubric:: Returns ``record`` .. rubric:: Examples :: msmd.open("my.ms") # get reference direction for field ID 1 mydir = msmd.refdir(1); # if the reference direction is a polynomial or has an ephemerides attached to # it a time is needed to get the reference direction ep=me.epoch('utc', '2015/03/15/15:30:55') mydir2=msmd.phasecenter(2, ep) msmd.done() """ pass
[docs] def reffreq(self, spw=-1): r""" Get the reference frequency of the specified spectral window. The returned frequency is in the form of a valid measures dictionary. .. rubric:: Parameters - ``spw (int=-1)`` - Zero-based spectral window ID. .. rubric:: Returns ``record`` .. rubric:: Examples :: msmd.open("my.ms") # get the reference frequency for spw ID 20 reffreq = msmd.reffreq(20) msmd.done() """ pass
[docs] def restfreqs(self, sourceid=0, spw=0): r""" Get the rest frequencies from the SOURCE table for the specified source and spectral window. The return value will be a dictionary of frequency measures if the rest frequencies are defined for the specified inputs, or False if they do not. .. rubric:: Parameters - ``sourceid (int=0)`` - Zero-based source ID (from the SOURCE::SOURCE_ID column). - ``spw (int=0)`` - Zero-based spectral window ID. .. rubric:: Returns ``any`` .. rubric:: Examples :: msmd.open("my.ms") # get the rest frequencies for source ID 2 and spw ID 20 reffreq = msmd.restfreqs(2, 20) msmd.done() """ pass
[docs] def rxbands(self, spwids=''): r""" ALMA-only. Returns an integer array containing the receiver band of the specified spw(s). A return value of -1 means no receiver band number could be determined. The name of the spw is first checked to determine if the receiver band value is encoded there. If not, the corresponding spectral window ID is sought in the ASDM_RECEIVER table, if it exists, and if it has less than or equal number of rows compared to the SPECTRAL_WINDOW table. If the corresponding spectral window can be found in the ASDM_RECEIVER table, then the corresponding frequencyBand column value is checked to determine if the receiver band information is encoded there. In the case where the spectral window ID is present in multiple cells of the spectralWindowId column, the first row in which the ID is found is used to determine the receiver band. If all these tests fail, -1 is returned for the specified spectral window. .. rubric:: Parameters - ``spwids ({string, int, intVec}='')`` - Zero-based spw ID(s) for which to get the values (integer or interger array). Unspecified will return all receiver band values. .. rubric:: Returns ``intVec`` .. rubric:: Examples :: msmd.open("my.ms") # get the receiver bands for spws 8 and 2. rx_bands = msmd.rxbands([8, 2]) # get all receiver bands all_rx_bands = msmd.rxbands() msmd.done() """ pass
[docs] def scannumbers(self, obsid=-1, arrayid=-1): r""" This method will return an array of unique scan numbers in the associated MS for the specified observation ID and array ID. .. rubric:: Parameters - ``obsid (int=-1)`` - Observation ID. A negative value indicates all observation IDs should be used. - ``arrayid (int=-1)`` - Array ID. A negative value indicates all array IDs should be used. .. rubric:: Returns ``intVec`` .. rubric:: Examples :: msmd.open("my.ms") # scan numbers for all obsids and all arrayids scan_numbers = msmd.scannumbers() msmd.done() """ pass
[docs] def scansforfield(self, field='', obsid=-1, arrayid=-1): r""" Get an array of the unique scan numbers associated with the specified field, observation ID, and array ID. .. rubric:: Parameters - ``field ({string, int}='')`` - Field ID or field name (case sensitive) for which to return the scan numbers. - ``obsid (int=-1)`` - Observation ID. A negative value indicates all observation IDs should be used. - ``arrayid (int=-1)`` - Array ID. A negative value indicates all array IDs should be used. .. rubric:: Returns ``intVec`` .. rubric:: Examples :: msmd.open("my.ms") # get the scan numbers associated with field "planet Z" (all obsids, all arrayids) scan_numbers = msmd.scansforfield("planet Z") # get the scan numbers associated with field ID 5 (all obsids, all arrayids) scan_numbers = msmd.scansforfield(5) msmd.done() """ pass
[docs] def scansforfields(self, obsid=0, arrayid=0): r""" Get a dictionary of which maps field ID to scan numbers for the specified observation ID and array ID. The keys (field IDs) will be strings. obsid and arrayid must both be non-negative. .. rubric:: Parameters - ``obsid (int=0)`` - Observation ID. Must be non-negative. - ``arrayid (int=0)`` - Array ID. Must be non-negative. .. rubric:: Returns ``record`` .. rubric:: Examples :: msmd.open("my.ms") # get the field - scan map for arrayID 1 and obsID 2 field_to_scans = msmd.scansforfields(arrayid=1, obsid=2) # access the scans associated with field ID 2 field_to_scans2 = field_to_scans["2"] msmd.done() """ pass
[docs] def scansforintent(self, intent='', obsid=-1, arrayid=-1): r""" Get an array of the unique scan numbers associated with the specified intent, observation ID, and arrayID. The "*" character matches any number of characters from all character classes. .. rubric:: Parameters - ``intent (string='')`` - Intent (case-sensitive) for which to return the scan numbers. - ``obsid (int=-1)`` - Observation ID. A negative value indicates all observation IDs should be used. - ``arrayid (int=-1)`` - Array ID. A negative value indicates all array IDs should be used. .. rubric:: Returns ``intVec`` .. rubric:: Examples :: msmd.open("my.ms") # get the scan numbers associated with intent "detect planet X" (all obsids, all arrayids) scan_numbers = msmd.scansforintent("detect planet X", regex=False) # got all the scan numbers associated with all intents which contain 'WVR' (all obsids, all arrayids) scan_numbers = msmd.scansforintent("*WVR*") msmd.done() """ pass
[docs] def scansforspw(self, spw=-1, obsid=-1, arrayid=-1): r""" Get an array of the unique scan numbers associated with the specified zero-based spectral window ID, observation ID, and array ID. .. rubric:: Parameters - ``spw (int=-1)`` - Zero-based spectral window ID for which to return the scan numbers. - ``obsid (int=-1)`` - Observation ID. A negative value indicates all observation IDs should be used. - ``arrayid (int=-1)`` - Array ID. A negative value indicates all array IDs should be used. .. rubric:: Returns ``intVec`` .. rubric:: Examples :: msmd.open("my.ms") # get the scan numbers associated with spectral window ID 14, all obsids, all arrayids scan_numbers = msmd.scansforspw(14) msmd.done() """ pass
[docs] def scansforspws(self, obsid=0, arrayid=0): r""" Get a dictionary of which maps spw ID to scan numbers for the specified observation ID and array ID. The keys (spectral window IDs) will be strings. obsid and arrayid must both be non-negative. .. rubric:: Parameters - ``obsid (int=0)`` - Observation ID. Must be non-negative. - ``arrayid (int=0)`` - Array ID. Must be non-negative. .. rubric:: Returns ``record`` .. rubric:: Examples :: msmd.open("my.ms") # get the spw - scan map for arrayID 1 and obsID 2 spw_to_scans = msmd.scansforspws(arrayid=1, obsid=2) # access the scans associated with spw ID 2 spw_to_scans2 = spw_to_scans["2"] msmd.done() """ pass
[docs] def scansforstate(self, state=-1, obsid=-1, arrayid=-1): r""" Get an array of the unique scan numbers for the specified state, observation ID, and array ID. .. rubric:: Parameters - ``state (int=-1)`` - ID of state for which to return the scan numbers. - ``obsid (int=-1)`` - Observation ID. A negative value indicates all observation IDs should be used. - ``arrayid (int=-1)`` - Array ID. A negative value indicates all array IDs should be used. .. rubric:: Returns ``intVec`` .. rubric:: Examples :: msmd.open("my.ms") # get the scan numbers associated with state 2, all obsids, all arrayids scans = msmd.scansforstate(2) msmd.done() """ pass
[docs] def scansfortimes(self, time=-1, tol=0, obsid=-1, arrayid=-1): r""" Get an array of the unique scan numbers for the specified time range (time-tol to time+tol), observation ID, and array ID. .. rubric:: Parameters - ``time (double=-1)`` - Time at center of time range. - ``tol (double=0)`` - Time difference on either side of center for specifying range. - ``obsid (int=-1)`` - Observation ID. A negative value indicates all observation IDs should be used. - ``arrayid (int=-1)`` - Array ID. A negative value indicates all array IDs should be used. .. rubric:: Returns ``intVec`` .. rubric:: Examples :: msmd.open("my.ms") # get the scan numbers associated with the specified time range (all obsids, all array ids) scans = msmd.scansfortimes(4.84282937e+09, 20) msmd.done() """ pass
[docs] def schedule(self, obsid=-1): r""" Get the schedule information for the specified observation ID. .. rubric:: Parameters - ``obsid (int=-1)`` - Observation ID. .. rubric:: Returns ``stringVec`` .. rubric:: Examples :: msmd.open("my.ms") # get the schdule information for observation ID = 2 schedule = msmd.schedule()[2] msmd.done() """ pass
[docs] def sideband(self, spw=''): r""" Get the sideband for the specified spectral window. .. rubric:: Parameters - ``spw (int='')`` - Spectral window ID. .. rubric:: Returns ``int`` .. rubric:: Examples :: msmd.open("my.ms") # get sideband for spectral window 2. sideband = msmd.sideband(2) msmd.done() """ pass
[docs] def sourcedirs(self): r""" Get the values of the DIRECTION column from the SOURCE table. Returns a dictionary in which the keys are the associated row numbers, represented as strings, in the SOURCE table. Each value in the returned dictionary is a valid direction measure. """ pass
[docs] def sourcetimes(self): r""" Get the values of the TIME column from the SOURCE table. Returns a dictionary in which the keys are the associated row numbers, represented as strings, in the SOURCE table. Each value in the returned dictionary is a valid time quantity. """ pass
[docs] def sourceidforfield(self, field=-1): r""" Get the source ID from the field table for the specified field ID. .. rubric:: Parameters - ``field (int=-1)`` - Zero-based field ID for which to return the source ID from the field table. .. rubric:: Returns ``int`` .. rubric:: Examples :: msmd.open("my.ms") # get source ID associated with field ID 2 sourceid = msmd.sourceidforfield(2) msmd.done() """ pass
[docs] def sourceidsfromsourcetable(self): r""" Get the values of the SOURCE_ID column from the SOURCE table. It is unfortunate that the SOURCE table has a column named SOURCE_ID, because implicitly the "ID" of a row in an MS subtable is generally meant to reflect a row number in that table, but that is not the case for the SOURCE table. """ pass
[docs] def sourcenames(self): r""" Get the values of the SOURCE_NAME column from the SOURCE table. """ pass
[docs] def spwsforbaseband(self, baseband=-1, sqldmode='include'): r""" Get the spectral windows associated with the specified baseband or dictionary that maps baseband to spectral windows. .. rubric:: Parameters - ``baseband (int=-1)`` - Baseband number. If \<0, return a dictionary mapping basebands to spws. - ``sqldmode (string='include')`` - If "include", include SQLD windows, if "exclude", exclude SQLD windows, if "only", include only SQLD windows. Case insenstive, inimum match honored. .. rubric:: Returns ``variant`` .. rubric:: Examples :: msmd.open("my.ms") # get the spectral window IDs associated with all the basebands in this dataset basebandtospwdict = msmd.spwsforbasebands() # get an array of spws associated with baseband 2. spwsforbb2 = msmd.spwsforbasebands(2) msmd.done() """ pass
[docs] def spwfordatadesc(self, ddid=-1): r""" Get the spectral window ID associated with the specified data description ID. If the specified data description ID is negative, an array of spectral window IDs is returned. The indices of that array represent data description IDs. .. rubric:: Parameters - ``ddid (int=-1)`` - Zero-based data description ID. A negative number will cause all the spectral window IDs to be returned. .. rubric:: Returns ``variant`` .. rubric:: Examples :: msmd.open("my.ms") # get the spectral window ID associated with data description ID 3 spw = msmd.spwfordatadesc(3) # get the array of spectral window IDs in the order they appear in the DATA_DESCRIPTION table spws = msmd.spwfordatadesc(-1) msmd.done() """ pass
[docs] def spwsforfield(self, field=''): r""" Get an array of the unique spectral window IDs for the specified field. .. rubric:: Parameters - ``field ({string, int}='')`` - Field (case sensitive string or zero-based integer ID) for which to return the spectral window IDs. .. rubric:: Returns ``intVec`` .. rubric:: Examples :: msmd.open("my.ms") # get the spectral window IDs associated with field "Fomalhaut" spws = msmd.spwsforfield("Fomalhaut") # get spectral window IDs associated with field ID 2 spws = msmd.spwsforfield(2) msmd.done() """ pass
[docs] def spwsforfields(self): r""" Get a dictionary which maps field IDs to spectral window IDs. The field IDs are keys in the returned dictionary. To access a particular element, one must ensure the key is a string. """ pass
[docs] def spwsforintent(self, intent=''): r""" Get an array of the unique spectral window IDs for the specified intent. The "*" character matches any number of characters from all character classes. .. rubric:: Parameters - ``intent (string='')`` - Intent (case sensitive) for which to return the spectral window IDs. .. rubric:: Returns ``intVec`` .. rubric:: Examples :: msmd.open("my.ms") # get the spectral window IDs associated with "MY COOL INTENT" spws = msmd.spwsforintent("MY COOL INTENT") # got all the spw IDs associated with all intents which contain 'WVR' scan_numbers = msmd.spwsforintent("*WVR*") msmd.done() msmd.done() """ pass
[docs] def spwsfornames(self, spwids=''): r""" Get the IDs of the specified spw(s). Returns a dictionary where the keys are the requested spectral window names that are present in the data set and the values are arrays of the spectral window IDs corresponding to the name. If a specified name is not present, a warning message is logged and that name is not included in the returned dictionary. Specifying no names results in a dictionary containing the name to spw ID mapping for the entire data set. .. rubric:: Parameters - ``spwids ({string, stringVec}='')`` - Names of the spws for which IDs are needed (string or string array). Unspecified will return all spw names. .. rubric:: Returns ``record`` .. rubric:: Examples :: msmd.open("my.ms") # get the IDs for spws named "CO" and "HCN" spw_ids = msmd.spwsfornames(["CO", "HCN"]) # get the complete spw name to ID map spw_names_to_ids = msmd.spwsfornames() msmd.done() """ pass
[docs] def spwsforscan(self, scan=-1, obsid=-1, arrayid=-1): r""" Get an array of the unique spectral window IDs for the specified scan number, observation ID, and array ID. .. rubric:: Parameters - ``scan (int=-1)`` - Scan number for which to return the spectral window IDs. - ``obsid (int=-1)`` - Observation ID. A negative value means that all observation IDs should be used. - ``arrayid (int=-1)`` - Array ID. A negative value means that all array IDs should be used. .. rubric:: Returns ``intVec`` .. rubric:: Examples :: msmd.open("my.ms") # get the spectral window IDs associated with scan number 20, all obsids, all arrayids. spws = msmd.spwsforscan(20) msmd.done() """ pass
[docs] def spwsforscans(self, obsid=0, arrayid=0): r""" Get a dictionary of which maps scan number to spectral windows for the specified observation ID and array ID. The keys (scan numbers) will be strings. obsid and arrayid must both be non-negative. .. rubric:: Parameters - ``obsid (int=0)`` - Observation ID. Must be non-negative. - ``arrayid (int=0)`` - Array ID. Must be non-negative. .. rubric:: Returns ``record`` .. rubric:: Examples :: msmd.open("my.ms") # get the scan - spw map for arrayID 1 and obsID 2 scan_to_spws = msmd.spwsforscans(arrayid=1, obsid=2) # access the spws associated with scan 2 spws_for_scan2 = scan_to_spws["2"] msmd.done() """ pass
[docs] def subwindows(self, spwids=''): r""" ALMA-only. Returns an integer array containing the subwindow of the specified spw(s). The spw name is checked to determine if the subwindow value is encoded within it. A return value of -1 indicates that a subwindow number could be determined. .. rubric:: Parameters - ``spwids ({string, int, intVec}='')`` - Zero-based spw ID(s) for which to get the values (integer or interger array). Unspecified will return all receiver band values. .. rubric:: Returns ``intVec`` .. rubric:: Examples :: msmd.open("my.ms") # get the subwindows for spws 8 and 2. sws = msmd.subwindows([8, 2]) # get all subwindows all_sws = msmd.subwindows() msmd.done() """ pass
[docs] def statesforscan(self, scan=-1, obsid=-1, arrayid=-1): r""" Get an array of the unique state IDs for the specified scan number, observation ID, and array ID. .. rubric:: Parameters - ``scan (int=-1)`` - Scan number for which to return the state IDs. - ``obsid (int=-1)`` - Observation ID. A negative value means that all observation IDs should be used. - ``arrayid (int=-1)`` - Array ID. A negative value means that all array IDs should be used. .. rubric:: Returns ``intVec`` .. rubric:: Examples :: msmd.open("my.ms") # get the state IDs associated with scan number 251, all obsids, all arrayids states = msmd.statesforscan(251) msmd.done() """ pass
[docs] def statesforscans(self, obsid=0, arrayid=0): r""" Get a dictionary which maps scan numbers to state IDs for the specified array and observation IDs. The returned dictionary will have scan numbers, as strings, as keys. .. rubric:: Parameters - ``obsid (int=0)`` - Observation ID, must be nonnegative. - ``arrayid (int=0)`` - Array ID, must be nonnegative. .. rubric:: Returns ``record`` .. rubric:: Examples :: msmd.open("my.ms") # get the map of scan numbers to state IDs for arrayID=1, obsID=2 scans_to_states = msmd.statesforscans(obsID=2, arrayID=1) states_for_scan_5 = scans_to_states[str(5)] msmd.done() """ pass
[docs] def summary(self): r""" Get dictionary summarizing the MS. """ pass
[docs] def tdmspws(self): r""" Get an array of spectral window IDs used for TDM. These are windows that have 64, 128, or 256 channels. """ pass
[docs] def timerangeforobs(self, obsid=-1): r""" Get the time range for the specified observation ID. The return value is a dictionary containing keys "begin" and "end". Each of the associated value are dictionaries representing epochs which are valid measure records. The values are taken directly from the OBSERVATION subtable; no half-intervals are added or subtracted. .. rubric:: Parameters - ``obsid (int=-1)`` - Zero-based observation ID for which to get the time range. .. rubric:: Returns ``record`` .. rubric:: Examples :: msmd.open("my.ms") # get the time range associated with observation ID 3 timerange = msmd.timerangeforobs(3) msmd.done() """ pass
[docs] def timesforfield(self, field=-1): r""" Get an array of the unique times for the specified field. .. rubric:: Parameters - ``field (int=-1)`` - Zero-based field ID for which to return the times. .. rubric:: Returns ``doubleVec`` .. rubric:: Examples :: msmd.open("my.ms") # get the times associated with field 3 times = msmd.timesforfields(3) msmd.done() """ pass
[docs] def timesforintent(self, intent=''): r""" Get an array of the unique times for the specified intent. .. rubric:: Parameters - ``intent (string='')`` - Intent for which to return the times. .. rubric:: Returns ``doubleVec`` .. rubric:: Examples :: msmd.open("my.ms") # get the times associated with intent "myintent" times = msmd.timesforintent("myintent") msmd.done() """ pass
[docs] def timesforscan(self, scan=-1, obsid=-1, arrayid=-1, perspw=False): r""" Get the unique times for the specified scan number, observation ID, and array ID. If perspw=True, the returned data structure is a dictionary that has keys representing zero-based spectral window IDs and values representing the unique values of the TIME column corrsponding to the specified scan and that corresponding spectral window ID. If False, an array of unique values from the TIME column for the specified scan is returned; there is no separation into spectral window IDs. .. rubric:: Parameters - ``scan (int=-1)`` - Scan number for which to return the times. - ``obsid (int=-1)`` - Observation ID. A negative value indicates all observation IDs should be used. - ``arrayid (int=-1)`` - Array ID. A negative value indicates all array IDs should be used. - ``perspw (bool=False)`` - Return output dictionary with keys representing spectral window IDs (True), or an array of all times (False). .. rubric:: Returns ``any`` .. rubric:: Examples :: msmd.open("my.ms") # get the times associated with scan number 10, all obsids, all arrayids. times = msmd.timesforscan(10) msmd.done() """ pass
[docs] def timesforscans(self, scans=-1, obsid=-1, arrayid=-1): r""" Get an array of the unique times for the specified scan numbers, observation ID, and array ID. .. rubric:: Parameters - ``scans ({int, intVec}=-1)`` - Scan number(s) for which to return the times. - ``obsid (int=-1)`` - Observation ID. A negative value indicates all observation IDs should be used. - ``arrayid (int=-1)`` - Array ID. A negative value indicates all array IDs should be used. .. rubric:: Returns ``doubleVec`` .. rubric:: Examples :: msmd.open("my.ms") # get the times associated with scan numbers 10 and 20, all obsids, all arrayids times = msmd.timesforscans([10,20]) msmd.done() """ pass
[docs] def timesforspws(self, spw=-1): r""" Get the unique times corresponding to the specified spectral window(s). The input indicates the spws for which times are to be retrieved, and can be a single integer or an array of integers. If a single, non-negative integer, an array of unique times associated with that spectral window are returned. Otherwise, a dictionary of times associated with the specified spectral windows are returned, with the spws (as strings) as the keys and the times as the values. A negative integer will cause a dictionary of all spws and their associated times to be returned. .. rubric:: Parameters - ``spw ({int, intVec}=-1)`` - Zero-based spectral window ID(s). A negative integer will cause the all the times for all spws to be returned. .. rubric:: Returns ``any`` .. rubric:: Examples :: msmd.open("my.ms") # get the times associated with spws 10 and 20 times = msmd.timesforspws([10,20]) # print the times for spw 10 print times["10"] msmd.done() """ pass
[docs] def transitions(self, sourceid=0, spw=0): r""" Get the spectral transitions from the SOURCE table for the specified source and spectral window. The return value will be an array of transitions if the transitions are defined for the specified inputs, or False if they do not. .. rubric:: Parameters - ``sourceid (int=0)`` - Zero-based source ID (from the SOURCE::SOURCE_ID column). - ``spw (int=0)`` - Zero-based spectral window ID. .. rubric:: Returns ``any`` .. rubric:: Examples :: msmd.open("my.ms") # get the transitions for source ID 2 and spw ID 20 reffreq = msmd.transitions(2, 20) msmd.done() """ pass
[docs] def wvrspws(self, complement=False): r""" Get an array of spectral window IDs used for WVR. These are windows that have 4 channels. If complement is True, return the complement set instead (all non-wvr spw IDs). WVR windows are identified using the algorithm 1. check for water vapor radiometer (WVR) spectral windows using the spectral window name "WVR#NOMINAL" and report these. 2. If no SPWs match that string, then the names are checked for "WVR" and are reported instead. .. rubric:: Parameters - ``complement (bool=False)`` - If True, return all non-wvr spws. .. rubric:: Returns ``intVec`` .. rubric:: Examples :: msmd.open("my.ms") # get the spectral window IDs used for WVR. wvr_spws = msmd.wvrspws() msmd.done() """ pass