Coverage for /home/warp/casa/atejeda/coverage/build/linux-x86_64/python/2.7/__casac__/msmetadata : 1%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# This file was automatically generated by SWIG (http://www.swig.org). # Version 2.0.4 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead.
from sys import version_info if version_info >= (2,6,0): def swig_import_helper(): from os.path import dirname import imp fp = None try: fp, pathname, description = imp.find_module('_msmetadata', [dirname(__file__)]) except ImportError: import _msmetadata return _msmetadata if fp is not None: try: _mod = imp.load_module('_msmetadata', fp, pathname, description) finally: fp.close() return _mod _msmetadata = swig_import_helper() del swig_import_helper else: import _msmetadata del version_info try: _swig_property = property except NameError: pass # Python < 2.2 doesn't have 'property'. def _swig_setattr_nondynamic(self,class_type,name,value,static=1): if (name == "thisown"): return self.this.own(value) if (name == "this"): if type(value).__name__ == 'SwigPyObject': self.__dict__[name] = value return method = class_type.__swig_setmethods__.get(name,None) if method: return method(self,value) if (not static): self.__dict__[name] = value else: raise AttributeError("You cannot add attributes to %s" % self)
def _swig_setattr(self,class_type,name,value): return _swig_setattr_nondynamic(self,class_type,name,value,0)
def _swig_getattr(self,class_type,name): if (name == "thisown"): return self.this.own() method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError(name)
def _swig_repr(self): try: strthis = "proxy of " + self.this.__repr__() except: strthis = "" return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
try: _object = object _newclass = 1 except AttributeError: class _object : pass _newclass = 0
class msmetadata(_object): """Proxy of C++ casac::msmetadata class""" __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, msmetadata, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, msmetadata, name) __repr__ = _swig_repr def __init__(self): """__init__(self) -> msmetadata""" this = _msmetadata.new_msmetadata() try: self.this.append(this) except: self.this = this __swig_destroy__ = _msmetadata.delete_msmetadata __del__ = lambda self : None; def almaspws(self, chavg = False, fdm = False, sqld = False, tdm = False, wvr = False, complement = False): """ almaspws(self, chavg = False, fdm = False, sqld = False, tdm = False, wvr = False, complement = False) -> std::vector<(int)>
Summary Get a list of spectral window IDs with ALMA-specific attributes.
Description
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.
Input Parameters: chavg Get channel average spectral windows? false fdm Get FDM spectral windows? false sqld Get square law (i.e. total power) detector spectral windows? false tdm Get TDM spectral windows? false wvr Get WVR spectral windows? false complement Return the complement of the selected set? false
Example:
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)
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_almaspws(self, chavg, fdm, sqld, tdm, wvr, complement)
def antennaids(self, *args, **kwargs): """ antennaids(self, name = initialize_variant(""), mindiameter = initialize_variant("0m"), maxdiameter = initialize_variant("1pc")) -> std::vector<(int)>
Summary Get the zero-based antenna ID for the specfied antenna name.
Description
Get the zero-based antenna IDs for the specfied antenna names and the specified diameter range. An array of unique IDs in order of the specified names is returned. If no names and no diameter range is specified, all IDs are returned.
Input Parameters: name 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 Minimum antenna diameter, expressed as a quantity. 0m maxdiameter Maximum antenna diameter, expressed as a quantity. 1pc
Example:
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()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_antennaids(self, *args, **kwargs)
def antennanames(self, *args, **kwargs): """ antennanames(self, antennaids = initialize_variant("-1 -1")) -> std::vector<(std::string)>
Summary Get the names of the antennas for the specfied zero-based antenna IDs.
Description
Get the name of the antenna for the specfied zero-based antenna ID. If antennaids is not specified, all antenna names are returned.
Input Parameters: antennaids Zero-based antenna IDs (int or int array) for which to get the antenna names. -1 -1
Example:
msmd.open('my.ms') # get the name associated with antenna ID 31 antenna_name = msmd.antennanames(31)[0] msmd.done()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_antennanames(self, *args, **kwargs)
def antennaoffset(self, *args, **kwargs): """ antennaoffset(self, which = initialize_variant("0")) -> record
Summary Get the offset position of the specified antenna relative to the array reference position.
Description
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.
Input Parameters: which Zero-based antenna in the ANTENNA table. 0
Example:
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()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_antennaoffset(self, *args, **kwargs)
def antennaposition(self, *args, **kwargs): """ antennaposition(self, which = initialize_variant("0")) -> record
Summary Get the position of the specified antenna.
Description
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.
Input Parameters: which Zero-based antenna ID in the ANTENNA table or antenna name. 0
Example:
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()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_antennaposition(self, *args, **kwargs)
def antennastations(self, *args, **kwargs): """ antennastations(self, which = initialize_variant("-1")) -> std::vector<(std::string)>
Summary Get the station names of the specified antennas.
Description
Get the station names of the specified antennas.
Input Parameters: which Zero-based antenna ID(s) in the ANTENNA table or antenna name(s). Single numeric id less than zero retrieves all station names. -1
Example:
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()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_antennastations(self, *args, **kwargs)
def bandwidths(self, *args, **kwargs): """ bandwidths(self, spw = initialize_variant("-1")) -> variant
Summary Get the bandwidths in Hz for the specified spectral windows. If spw less than zero, return bandwidths for all spectral windows.
Description
Get the bandwidths in Hz for the specified spectral windows. If spw less than zero, return bandwidths for all spectral windows.
Input Parameters: spw Spectral window IDs, if integer less than zero, return bandwidths for all spectral windows. -1
Example:
msmd.open('my.ms') # get bandwdith for spectral window 2. baseband = msmd.bandwidth(2) msmd.done()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_bandwidths(self, *args, **kwargs)
def baseband(self, *args, **kwargs): """ baseband(self, spw) -> int
Summary Get the baseband for the specified spectral window.
Description
Get the baseband for the specified spectral window.
Input Parameters: spw Spectral window ID.
Example:
msmd.open('my.ms') # get baseband for spectral window 2. baseband = msmd.baseband(2) msmd.done()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_baseband(self, *args, **kwargs)
def baselines(self): """ baselines(self) -> variant
Summary Get a two dimensional boolean array representing baselines for data recorded in the MS.
Description
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.
Example:
msmd.open('my.ms') # get the baseline matrix for this data set baselines = msmd.baselines() msmd.done()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_baselines(self)
def chanavgspws(self): """ chanavgspws(self) -> std::vector<(int)>
Summary Get an array of spectral window IDs used for channel averages. These are windows that do have 1 channel.
Description
Get an array of spectral window IDs used for channel averages. These are windows that do have 1 channel.
Example:
msmd.open('my.ms') # get the spectral window IDs used for channel averages. chan_avg_spws = msmd.chanavgspws() msmd.done()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_chanavgspws(self)
def chanfreqs(self, *args, **kwargs): """ chanfreqs(self, spw, unit = string("Hz")) -> std::vector<(double)>
Summary Get an array of channel frequencies for the specified spectral window.
Description
Get an array of channel frequencies for the specified spectral window.
Input Parameters: spw Spectral window ID. unit Convert frequencies to this unit. Hz
Example:
msmd.open('my.ms') # get the channel frequencies for spectral window 2. chan_freqs = msmd.chanfreqs(2) msmd.done()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_chanfreqs(self, *args, **kwargs)
def chanwidths(self, *args, **kwargs): """ chanwidths(self, spw, unit = string("Hz")) -> std::vector<(double)>
Summary Get an array of channel widths for the specified spectral window.
Description
Get an array of channel widths for the specified spectral window.
Input Parameters: spw Spectral window ID. unit Convert frequencies to this unit. Hz
Example:
msmd.open('my.ms') # get the channel widths for spectral window 2. chan_freqs = msmd.chanwidths(2) msmd.done()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_chanwidths(self, *args, **kwargs)
def close(self): """ close(self) -> bool
Summary Close this tool and reclaim system resources associated with it.
Description
This method will close the tool and reclaim system resources it has been using. Returns true if successful.
Example:
msmd.open('my.ms') # do things with tool # finish, close tool and free up resources. msmd.close()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_close(self)
def datadescids(self, *args, **kwargs): """ datadescids(self, spw = -1, pol = -1) -> std::vector<(int)>
Summary Get the data description IDs associated with the specified spectral window and/or polarization ID
Description
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.
Input Parameters: spw Spectral window ID. Less than zero implies any, -1 pol Polarization ID. Less than zero implies any. -1
Example:
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()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_datadescids(self, *args, **kwargs)
def done(self): """ done(self) -> bool
Summary Close this tool and reclaim system resources associated with it.
Description
This method will close the tool and reclaim system resources it has been using. Returns true if successful.
Example:
msmd.open('my.ms') # do things with tool # finish, close tool and free up resources. msmd.done()
--------------------------------------------------------------------------------
"""
def effexposuretime(self): """ effexposuretime(self) -> record
Summary Get the effective exposure (on-source integration time)
Description
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).
Example:
msmd.open('my.ms') # get the effective exposure time. exposure_time = msmd.effexposuretime() msmd.done()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_effexposuretime(self)
def exposuretime(self, *args, **kwargs): """ exposuretime(self, scan = 0, spwid = 0, polid = -1, obsid = 0, arrayid = 0) -> record
Summary Get the exposure time for the specified scan, spwid, polarizaiton ID, array ID, and observation ID.
Description
Get the exposure time for the specified scan, spwid, polarizaiton 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.
Input Parameters: scan Scan number. 0 spwid Spectral window ID. 0 polid Polarization ID. -1 obsid Observation ID. 0 arrayid Array ID. 0
Example:
msmd.open('my.ms') # get the exposure time for scan 1, spwid 2, and polid 3 # for arrayID = 0 and obsID = 0 integration_time = msmd.getexposuretime(scan=1, spwid=2, polid=3) msmd.done()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_exposuretime(self, *args, **kwargs)
def fdmspws(self): """ fdmspws(self) -> std::vector<(int)>
Summary Get an array of spectral window IDs used for FDM. These are windows that do not have 64, 128, or 256 channels.
Description
Get an array of spectral window IDs used for FDM. These are windows that do not have 64, 128, or 256 channels.
Example:
msmd.open('my.ms') # get the spectral window IDs used for FDM. fdm_spws = msmd.fdmspws() msmd.done()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_fdmspws(self)
def fieldsforintent(self, *args, **kwargs): """ fieldsforintent(self, intent = string(""), asnames = False) -> variant
Summary Get an array of the unique fields for the specified intent.
Description
Get an array of the unique fields for the specified intent. Note that * matches any number of characters of all character classes.
Input Parameters: intent Intent (case sensitive) for which to return the fields. asnames If true, return the field names. If false, return the zero-based field IDs. false
Example:
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()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_fieldsforintent(self, *args, **kwargs)
def fieldsforname(self, *args, **kwargs): """ fieldsforname(self, name = string("")) -> std::vector<(int)>
Summary Get an array of the unique, zero-based field IDs for the specified field name.
Description
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.
Input Parameters: name Field name (case sensitive) for which to return the fields.
Example:
msmd.open('my.ms') # get the field IDs for field name 'Enceladus' fields = msmd.fieldsforname('Enceladus') msmd.done()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_fieldsforname(self, *args, **kwargs)
def fieldsforscan(self, *args, **kwargs): """ fieldsforscan(self, scan = -1, asnames = False, obsid = 0, arrayid = 0) -> variant
Summary Get an array of the unique fields for the specified scan number, observation ID, and array ID.
Description
Get an array of the unique fields for the specified scan number, observation ID, and array ID.
Input Parameters: scan Scan number for which to return the fields. -1 asnames If true, return the field names. If false, return the zero-based field IDs. false obsid Observation ID. 0 arrayid Array ID. 0
Example:
msmd.open('my.ms') # get the field names for scan number 5 (arrayid = obsid = 0) field_names = msmd.fieldsforscan(5, True) # get the field IDs for scan number 5 (arrayid = obsid = 0) field_IDs = msmd.fieldsforscan(5, False) msmd.done()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_fieldsforscan(self, *args, **kwargs)
def fieldsforscans(self, *args, **kwargs): """ fieldsforscans(self, scans = std::vector< int >(), asnames = False, obsid = 0, arrayid = 0) -> variant
Summary Get an array of the unique fields for the specified scan numbers, observationID, and array ID.
Description
Get an array of the unique fields for the specified scan numbers, observation ID, and array ID.
Input Parameters: scans Scan numbers for which to return the fields. asnames If true, return the field names. If false, return the zero-based field IDs. false obsid Observation ID. 0 arrayid Array ID. 0
Example:
msmd.open('my.ms') # get the field names for scan numbers 5 and 10 (obsid = 0, arrayid = 0) field_names = msmd.fieldsforscan([5, 10], True) # get the field IDs for scan numbers 5 and 10 (obsid = 0, arrayid = 0) field_IDs = msmd.fieldsforscan([5, 10], False) msmd.done()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_fieldsforscans(self, *args, **kwargs)
def fieldsforsource(self, *args, **kwargs): """ fieldsforsource(self, source = -1, asnames = False) -> variant
Summary Get an array of the unique fields for the specified source ID.
Description
Get an array of the unique fields for the specified spectral window.
Input Parameters: source Zero-based source ID for which to return the fields. -1 asnames If true, return the field names. If false, return the zero-based field IDs. false
Example:
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()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_fieldsforsource(self, *args, **kwargs)
def fieldsforspw(self, *args, **kwargs): """ fieldsforspw(self, spw = -1, asnames = False) -> variant
Summary Get an array of the unique fields for the specified spectral window.
Description
Get an array of the unique fields for the specified spectral window.
Input Parameters: spw Zero-based spectral window ID for which to return the fields. -1 asnames If true, return the field names. If false, return the zero-based field IDs. false
Example:
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()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_fieldsforspw(self, *args, **kwargs)
def fieldsfortimes(self, *args, **kwargs): """ fieldsfortimes(self, time = -1, tol = 0) -> std::vector<(int)>
Summary Get an array of the unique, zero-based, field IDs for the specified time range (time-tol to time+tol).
Description
Get an array of the unique, zero-based, fieldIDs for the specified time range (time-tol to time+tol).
Input Parameters: time Time at center of time range. -1 tol Time on either side of center for specifying range. 0
Example:
msmd.open('my.ms') # get the field IDs associated with the specified time range fields = msmd.fieldsfortimes(4.8428293714e+09, 20) msmd.done()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_fieldsfortimes(self, *args, **kwargs)
def intents(self): """ intents(self) -> std::vector<(std::string)>
Summary Get an array of the unique intents associated with the MS.
Description
Get an array of the unique intents associated with the MS.
Example:
msmd.open('my.ms') # get the intents associated with the MS intents = msmd.intents() msmd.done()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_intents(self)
def intentsforfield(self, *args, **kwargs): """ intentsforfield(self, field = initialize_variant("-1")) -> std::vector<(std::string)>
Summary Get an array of the unique intents for the specified field.
Description
Get an array of the unique intents for the specified field.
Input Parameters: field Field ID or name for which to return the intents. -1
Example:
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()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_intentsforfield(self, *args, **kwargs)
def intentsforscan(self, *args, **kwargs): """ intentsforscan(self, scan = -1, obsid = 0, arrayid = 0) -> std::vector<(std::string)>
Summary Get an array of the unique intents for the specified scan, obsservation ID, and array ID.
Description
Get an array of the unique intents for the specified scan, observation ID, and array ID.
Input Parameters: scan Scan number for which to return the intents. -1 obsid Observation ID. 0 arrayid Array ID. 0
Example:
msmd.open('my.ms') # get the intents associated with scan 4 (obsid=0, arrayid = 0) intents = msmd.intentsforscan(4) msmd.done()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_intentsforscan(self, *args, **kwargs)
def intentsforspw(self, *args, **kwargs): """ intentsforspw(self, spw = -1) -> std::vector<(std::string)>
Summary Get an array of the unique intents for the specified spectral window ID.
Description
Get an array of the unique intents for the specified spectral window ID.
Input Parameters: spw Spectral window ID (\>=0) for which to return the intents. -1
Example:
msmd.open('my.ms') # get the intents associated with spectral window ID 3 intents = msmd.intentsforspw(3) msmd.done()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_intentsforspw(self, *args, **kwargs)
def meanfreq(self, *args, **kwargs): """ meanfreq(self, spw, unit = string("Hz")) -> double
Summary Get the mean frequency for the specified spectral window.
Description
Get the mean frequency for the specified spectral window.
Input Parameters: spw Spectral window ID. unit Convert frequencies to this unit. Hz
Example:
msmd.open('my.ms') # get the mean frequency for spectral window 2. mean_freq = msmd.meanfreq(2) msmd.done()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_meanfreq(self, *args, **kwargs)
def name(self): """ name(self) -> string
Summary Get the name of the attached MS.
Description
Get the name of the attached MS.
Example:
msmd.open('my.ms') # get its name myname = msmd.name() msmd.done()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_name(self)
def nantennas(self): """ nantennas(self) -> int
Summary Get the number of antennas associated with the MS.
Description
Get the number of antennas associated with the MS.
Example:
msmd.open('my.ms') number_of_antennas = msmd.nantennas() msmd.done()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_nantennas(self)
def namesforfields(self, *args, **kwargs): """ namesforfields(self, fieldids = initialize_variant("")) -> std::vector<(std::string)>
Summary Get the name of the specified field.
Description
Get the name of the specified field.
Input Parameters: fieldids Zero-based field IDs for which to get the names (integer or interger array). Unspecified will return all field names.
Example:
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()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_namesforfields(self, *args, **kwargs)
def namesforspws(self, *args, **kwargs): """ namesforspws(self, spwids = initialize_variant("")) -> std::vector<(std::string)>
Summary Get the name of the specified spws.
Description
Get the name of the specified spw(s).
Input Parameters: spwids Zero-based spw ID(s) for which to get the names (integer or interger array). Unspecified will return all spw names.
Example:
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 = namesforspws() msmd.done()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_namesforspws(self, *args, **kwargs)
def nbaselines(self): """ nbaselines(self) -> int
Summary Get the number of baselines represented in the main MS table.
Description
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 not included in this count.
Example:
msmd.open('my.ms') number_of_baselines = msmd.nbaselines() msmd.done()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_nbaselines(self)
def nchan(self, *args, **kwargs): """ nchan(self, spw) -> int
Summary Get the number of channels associated with the specified spectral window.
Description
Get the number of channels associated with the specified spectral window.
Input Parameters: spw Zero-based spw ID for which to get the number of channels.
Example:
msmd.open('my.ms') nchan = msmd.nchan(3) msmd.done()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_nchan(self, *args, **kwargs)
def nfields(self): """ nfields(self) -> int
Summary Get the number of fields associated with the MS.
Description
Get the number of fields associated with the MS.
Example:
msmd.open('my.ms') number_of_fields = msmd.nfields() msmd.done()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_nfields(self)
def nobservations(self): """ nobservations(self) -> int
Summary Get the number of observations associated with the MS from the OBSERVATIONS table.
Description
Get the number of observations associated with the MS from the OBSERVATIONS table.
Example:
msmd.open('my.ms') number_of_obs_ids = msmd.nobservations() msmd.done()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_nobservations(self)
def nspw(self, includewvr = True): """ nspw(self, includewvr = True) -> int
Summary Get the number of spectral windows associated with the MS.
Description
This method will return the number of spectral windows in the associated MS.
Input Parameters: includewvr Include wvr spectral windows? If false, exclude wvr windows from count. true
Example:
msmd.open('my.ms') number_of_spectral_windows = msmd.nspw() msmd.done()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_nspw(self, includewvr)
def nstates(self): """ nstates(self) -> int
Summary Get the number of states (from the STATE table) associated with the MS.
Description
This method will return the number of states (number of rows in the STATES table) in the associated MS.
Example:
msmd.open('my.ms') number_of_states = msmd.nstates() msmd.done()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_nstates(self)
def nscans(self): """ nscans(self) -> int
Summary Get the number of scans associated with the MS.
Description
Get the number of scans associated with the MS.
Example:
msmd.open('my.ms') number_of_scans = msmd.nscans() msmd.done()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_nscans(self)
def nrows(self, autoc = True, flagged = True): """ nrows(self, autoc = True, flagged = True) -> double
Summary Get the number of visibilities (from the main table) associated with the MS.
Description
Get the number of visibilities (from the main table) associated with the MS.
Input Parameters: autoc Include autocorrelation data? If False, only cross correlation rows will be summed. true flagged Include flagged data? If False, only unflagged or patially flagged rows will be summed. true
Example:
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()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_nrows(self, autoc, flagged)
def observatorynames(self): """ observatorynames(self) -> std::vector<(std::string)>
Summary Get an array of MS telescope (observatory) names as they are listed in the OBSERVATIONS table.
Description
Get an array of MS telescope (observatory) names as they are listed in the OBSERVATIONS table.
Example:
msmd.open('my.ms') # get the telescope names telescope_names = msmd.telescopenames() msmd.done()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_observatorynames(self)
def observatoryposition(self, which = 0): """ observatoryposition(self, which = 0) -> record
Summary Get the position of the specified telescope.
Description
Get the position of the specified telescope.
Input Parameters: which Zero-based telescope position in the OBSERVATIONS table (see msmd.telescopenames()). 0
Example:
msmd.open('my.ms') # get the position of the 0th telescope telescope_position = msmd.telescopeposition(0) msmd.done()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_observatoryposition(self, which)
def open(self, *args, **kwargs): """ open(self, msfile = string(""), maxcache = 50) -> bool
Summary Attach the MS metadata tool to the specified MS
Description Attach this tool to the specified MS.
Input Parameters: msfile Name of the existing measurement set maxcache Maximum cache size, in megabytes, to use. 50
Example:
msmd.open('my.ms') # do stuff and close it msmd.done()
--------------------------------------------------------------------------------
"""
def phasecenter(self, *args, **kwargs): """ phasecenter(self, fieldid = 0, epoch = initialize_record("")) -> record
Summary Get the phasecenter direction from a field ID and time if necessary
Description
Get a direction measures for the phasecenter of the field id and time specified
Input Parameters: fieldid Zero-based field ID for which to get the phasecenter 0 epoch 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
Example:
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()
--------------------------------------------------------------------------------
"""
def pointingdirection(self, rownum = 0, interpolate = False, initialrow = 0): """ pointingdirection(self, rownum = 0, interpolate = False, initialrow = 0) -> record
Summary Get the pointing direction for antennas at the specified row number in the main MS table.
Description
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.
Input Parameters: rownum Row number in the main MS table. 0 interpolate 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) false initialrow Initial guess of row index in pointing table to start search. 0
Example:
msmd.open('my.ms') # get the pointing directions for row ID 500 dirs = msmd.pointingdirection(500) msmd.done()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_pointingdirection(self, rownum, interpolate, initialrow)
def scannumbers(self, obsid = 0, arrayid = 0): """ scannumbers(self, obsid = 0, arrayid = 0) -> std::vector<(int)>
Summary Get an array of the unique scan numbers associated with the MS for the specified observation ID and array ID.
Description
This method will return an array of unique scan numbers in the associated MS for the specified observation ID and array ID.
Input Parameters: obsid Observation ID. 0 arrayid Array ID. 0
Example:
msmd.open('my.ms') # scan numbers for obsid=0 and arrayid=0 scan_numbers = msmd.scannumbers() msmd.done()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_scannumbers(self, obsid, arrayid)
def scansforfield(self, *args, **kwargs): """ scansforfield(self, intent = initialize_variant(""), obsid = 0, arrayid = 0) -> std::vector<(int)>
Summary Get an array of the unique scan numbers associated with the specified field, observation ID, and array ID.
Description
Get an array of the unique scan numbers associated with the specified field, observation ID, and array ID.
Input Parameters: intent Field ID or field name (case sensitive) for which to return the scan numbers. obsid Observation ID. 0 arrayid Array ID. 0
Example:
msmd.open('my.ms') # get the scan numbers associated with field 'planet Z' (obsid=0, arrayid=0) scan_numbers = msmd.scansforfield('planet Z') # get the scan numbers associated with field ID 5 (obsid=0, arrayid=0) scan_numbers = msmd.scansforfield(5) msmd.done()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_scansforfield(self, *args, **kwargs)
def scansforintent(self, *args, **kwargs): """ scansforintent(self, intent = string("-1"), obsid = 0, arrayid = 0) -> std::vector<(int)>
Summary Get an array of the unique scan numbers associated with the specified intent, observation ID, and arrayID.
Description
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.
Input Parameters: intent Intent (case-sensitive) for which to return the scan numbers. -1 obsid Observation ID. 0 arrayid Array ID. 0
Example:
msmd.open('my.ms') # get the scan numbers associated with intent 'detect planet X' (obsid=0, arrayid=0) scan_numbers = msmd.scansforintent('detect planet X', regex=False) # got all the scan numbers associated with all intents which contain 'WVR' (obsid=0, arrayid=0) scan_numbers = msmd.scansforintent('*WVR*') msmd.done()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_scansforintent(self, *args, **kwargs)
def scansforspw(self, *args, **kwargs): """ scansforspw(self, spw = -1, obsid = 0, arrayid = 0) -> std::vector<(int)>
Summary Get an array of the unique scan numbers associated with the specified zero-based spectral window ID, observation ID, and array ID.
Description
Get an array of the unique scan numbers associated with the specified zero-based spectral window ID, observation ID, and array ID.
Input Parameters: spw Zero-based spectral window ID for which to return the scan numbers. -1 obsid Observation ID. 0 arrayid Array ID. 0
Example:
msmd.open('my.ms') # get the scan numbers associated with spectral window ID 14, obsid=0, arrayid=0 scan_numbers = msmd.scansforspw(14) msmd.done()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_scansforspw(self, *args, **kwargs)
def scansforstate(self, *args, **kwargs): """ scansforstate(self, state = -1, obsid = 0, arrayid = 0) -> std::vector<(int)>
Summary Get an array of the unique scan numbers for the specified state, observation ID, and array ID.
Description
Get an array of the unique scan numbers for the specified state, observation ID, and array ID.
Input Parameters: state ID of state for which to return the scan numbers. -1 obsid Observation ID. 0 arrayid Array ID. 0
Example:
msmd.open('my.ms') # get the scan numbers associated with state 2, obsid=0, arrayid=0 scans = msmd.scansforstate(2) msmd.done()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_scansforstate(self, *args, **kwargs)
def scansfortimes(self, *args, **kwargs): """ scansfortimes(self, time = -1, tol = 0, obsid = 0, arrayid = 0) -> std::vector<(int)>
Summary Get an array of the unique scan numbers for the specified time range (time-tol to time+tol), observation ID, and array ID.
Description
Get an array of the unique scan numbers for the specified time range (time-tol to time+tol), observation ID, and array ID.
Input Parameters: time Time at center of time range. -1 tol Time on either side of center for specifying range. 0 obsid Observation ID. 0 arrayid Array ID. 0
Example:
msmd.open('my.ms') # get the scan numbers associated with the specified time range (obsid=0, arrayid=0) scans = msmd.scansfortimes(4.84282937e+09, 20) msmd.done()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_scansfortimes(self, *args, **kwargs)
def sideband(self, *args, **kwargs): """ sideband(self, spw) -> int
Summary Get the sideband for the specified spectral window.
Description
Get the sideband for the specified spectral window.
Input Parameters: spw Spectral window ID.
Example:
msmd.open('my.ms') # get sideband for spectral window 2. sideband = msmd.sideband(2) msmd.done()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_sideband(self, *args, **kwargs)
def spwsforbaseband(self, *args, **kwargs): """ spwsforbaseband(self, baseband = -1, sqldmode = string("include")) -> variant
Summary Get the spws associated with the specified baseband or dictionary that maps baseband to spws.
Description
Get the spectral windows associated with the specified baseband or dictionary that maps baseband to spectral windows.
Input Parameters: baseband Baseband number. If \<0, return a dictionary mapping basebands to spws. -1 sqldmode If 'include', include SQLD windows, if 'exclude', exclude SQLD windows, if 'only', include only SQLD windows. Case insenstive, inimum match honored. include
Example:
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()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_spwsforbaseband(self, *args, **kwargs)
def spwsforfield(self, *args, **kwargs): """ spwsforfield(self, field = initialize_variant("")) -> std::vector<(int)>
Summary Get an array of the unique spectral window IDs for the specified field.
Description
Get an array of the unique spectral window IDs for the specified field.
Input Parameters: field Field (case sensitive string or zero-based integer ID) for which to return the spectral window IDs.
Example:
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()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_spwsforfield(self, *args, **kwargs)
def spwsforintent(self, *args, **kwargs): """ spwsforintent(self, intent = string("")) -> std::vector<(int)>
Summary Get an array of the unique spectral window IDs for the specified intent.
Description
Get an array of the unique spectral window IDs for the specified intent. The '*' character matches any number of characters from all character classes.
Input Parameters: intent Intent (case sensitive) for which to return the spectral window IDs.
Example:
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()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_spwsforintent(self, *args, **kwargs)
def spwsforscan(self, *args, **kwargs): """ spwsforscan(self, scan = -1, obsid = 0, arrayid = 0) -> std::vector<(int)>
Summary Get an array of the unique spectral window IDs for the specified scan number, observation ID, and array ID.
Description
Get an array of the unique spectral window IDs for the specified scan number, observation ID, and array ID.
Input Parameters: scan Scan number for which to return the spectral window IDs. -1 obsid Observation ID. 0 arrayid Array ID. 0
Example:
msmd.open('my.ms') # get the spectral window IDs associated with scan number 20, obsid=0, arrayid=0. spws = msmd.spwsforscan(20) msmd.done()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_spwsforscan(self, *args, **kwargs)
def statesforscan(self, *args, **kwargs): """ statesforscan(self, scan = -1, obsid = 0, arrayid = 0) -> std::vector<(int)>
Summary Get an array of the unique state IDs for the specified scan number, observation ID, and array ID.
Description
Get an array of the unique state IDs for the specified scan number, observation ID, and array ID.
Input Parameters: scan Scan number for which to return the state IDs. -1 obsid Observation ID. 0 arrayid Array ID. 0
Example:
msmd.open('my.ms') # get the state IDs associated with scan number 251, obsid=0, arrayid=0 states = msmd.statesforscan(251) msmd.done()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_statesforscan(self, *args, **kwargs)
def summary(self): """ summary(self) -> record
Summary Get dictionary summarizing the MS.
Description
Get dictionary summarizing the MS.
Example:
msmd.open('my.ms') # get the summary summary = msmd.summary() msmd.done()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_summary(self)
def tdmspws(self): """ tdmspws(self) -> std::vector<(int)>
Summary Get an array of spectral window IDs used for TDM. These are windows that have 64, 128, or 256 channels.
Description
Get an array of spectral window IDs used for TDM. These are windows that have 64, 128, or 256 channels.
Example:
msmd.open('my.ms') # get the spectral window IDs used for TDM. tdm_spws = msmd.tdmspws() msmd.done()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_tdmspws(self)
def timesforfield(self, *args, **kwargs): """ timesforfield(self, field = -1) -> std::vector<(double)>
Summary Get an array of the unique times for the specified field.
Description
Get an array of the unique times for the specified field.
Input Parameters: field Zero-based field ID for which to return the times. -1
Example:
msmd.open('my.ms') # get the times associated with field 3 times = msmd.timesforfields(3) msmd.done()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_timesforfield(self, *args, **kwargs)
def timesforintent(self, *args, **kwargs): """ timesforintent(self, intent = string("")) -> std::vector<(double)>
Summary Get an array of the unique times for the specified intent.
Description
Get an array of the unique times for the specified intent.
Input Parameters: intent Intent for which to return the times.
Example:
msmd.open('my.ms') # get the times associated with intent 'myintent' times = msmd.timesforintent('myintent') msmd.done()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_timesforintent(self, *args, **kwargs)
def timesforscan(self, *args, **kwargs): """ timesforscan(self, scan = -1, obsid = 0, arrayid = 0) -> std::vector<(double)>
Summary Get an array of the unique times for the specified scan number, observation ID, and array ID.
Description
Get an array of the unique times for the specified scan number, observation ID, and array ID.
Input Parameters: scan Scan number for which to return the times. -1 obsid Observation ID. 0 arrayid Array ID. 0
Example:
msmd.open('my.ms') # get the times associated with scan number 10, obsid=0, arrayid=0 times = msmd.timesforscans(10) msmd.done()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_timesforscan(self, *args, **kwargs)
def timesforscans(self, *args, **kwargs): """ timesforscans(self, scans = initialize_vector(1, (int)-1), obsid = 0, arrayid = 0) -> std::vector<(double)>
Summary Get an array of the unique times for the specified scan numbers, observation ID, and array ID.
Description
Get an array of the unique times for the specified scan numbers, observation ID, and array ID.
Input Parameters: scans Scan numbers for which to return the times. -1 obsid Observation ID. 0 arrayid Array ID. 0
Example:
msmd.open('my.ms') # get the times associated with scan numbers 10 and 20, obsid=0, arrayid=0 times = msmd.timesforscans([10,20]) msmd.done()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_timesforscans(self, *args, **kwargs)
def wvrspws(self, *args, **kwargs): """ wvrspws(self, complement = -false) -> std::vector<(int)>
Summary Get an array of spectral window IDs used for WVR. These are windows that have 4 channels.
Description
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).
Input Parameters: complement If True, return all non-wvr spws. -false
Example:
msmd.open('my.ms') # get the spectral window IDs used for WVR. wvr_spws = msmd.wvrspws() msmd.done()
--------------------------------------------------------------------------------
""" return _msmetadata.msmetadata_wvrspws(self, *args, **kwargs)
msmetadata_swigregister = _msmetadata.msmetadata_swigregister msmetadata_swigregister(msmetadata)
# This file is compatible with both classic and new-style classes.
|