Coverage for /wheeldirectory/casa-6.7.0-12-py3.10.el8/lib/py/lib/python3.10/site-packages/casatools/msmetadata.py: 53%
219 statements
« prev ^ index » next coverage.py v7.6.4, created at 2024-10-31 17:39 +0000
« prev ^ index » next coverage.py v7.6.4, created at 2024-10-31 17:39 +0000
1##################### generated by xml-casa (v2) from msmetadata.xml ################
2##################### f8044f2323cb192c8f36b31bf6064627 ##############################
3from __future__ import absolute_import
4from .__casac__.msmetadata import msmetadata as _msmetadata
6from .errors import create_error_string
7from .typecheck import CasaValidator as _validator
8_pc = _validator( )
9from .coercetype import coerce as _coerce
12class msmetadata:
13 _info_group_ = """msmd"""
14 _info_desc_ = """Operations to retrieve metadata from a measurment set"""
15 ### self
16 def __init__(self, *args, **kwargs):
17 """
18 """
19 self._swigobj = kwargs.get('swig_object',None)
20 if self._swigobj is None:
21 self._swigobj = _msmetadata()
23 def almaspws(self, chavg=False, fdm=False, sqld=False, tdm=False, wvr=False, complement=False):
24 """Get spectral window IDs based on ALMA-specific criteria. The inputs are or'ed together
25 to form the returned list. If complement=True, then the complement of the selection
26 is returned.
28 If the SPECTRAL_WINDOW table has the optional BBC_NO column and if the name
29 of the spectral window matches the regular expression "BB_[0-9]#SQLD", where
30 [0-9] indicates that a single integer matches, the window is classified as
31 a *square law detector spectral window*.
33 The following algorithm is used to identify WVR spwectral windows:
35 1. check for water vapor radiometer (WVR) spectral windows using the spectral window
36 name "WVR#NOMINAL" and report these.
37 2. If no SPWs match that string, then the names are checked for "WVR" and are reported instead.
39 If the window is not found to be a WVR window, it is then checked if
41 The window is classified as a *channel average spectral window* if it is not
42 a WVR window, if the number of channels is one, and the spectral window name
43 does not contain the string "FULL_RES"
45 The window is classified as an *FDM window* if it is neither a WVR window nor
46 a channel average window and if either
48 1. its bandwidth is less than 2 GHz, or
49 2. the number of channels it contains is greater than or equal to 15 but not
50 equal to 256, 128, 64, 32, 16, 248, 124, 62, or 31.
52 The window is classified as a *TDM spectral window* if it is neither a WVR window,
53 a channel average window, nor an FDM window.
56 """
57 return self._swigobj.almaspws(chavg, fdm, sqld, tdm, wvr, complement)
59 def antennadiameter(self, antenna=int(-1)):
60 """Get the diameter for the specified antenna. The antenna can be specified either by
61 its zero-based ID from the ANTENNA table or by its name in that table. The returned
62 dictionary is a valid quantity. If a negative integer is provided for the antenna, then
63 all atenna diameters will be returned in a dictionary that has keys that are the antenna IDs
64 and values that are dictionaries, each being a valid quantity representing the diameter for
65 that antenna ID.
67 """
68 return self._swigobj.antennadiameter(antenna)
70 def antennaids(self, name='', mindiameter='0m', maxdiameter='1pc', obsid=int(-1)):
71 """Get the zero-based antenna IDs for the specfied antenna names and the specified diameter
72 range for the specified observation ID. An array of unique IDs in order of the specified names is returned.
73 Note that if a specified name is listed mulitple times in the ANTENNA table, the largest
74 ID is returned, unless the observation ID is specified to be non-negative, in which case, the
75 returned IDs are filtered based on the specified observation ID.
76 If no names and no diameter range is specified, all IDs are returned.
78 """
79 return self._swigobj.antennaids(name, mindiameter, maxdiameter, obsid)
81 def antennanames(self, antennaids=int(-1)):
82 """Get the name of the antenna for the specfied zero-based antenna ID. If antennaids is not specified,
83 all antenna names are returned.
85 """
86 return self._swigobj.antennanames(antennaids)
88 def antennaoffset(self, which=int(0)):
89 """Get the offset position of the specified antenna relative to the array reference position. Antenna may
90 be specified as a zero-based integer (row number in the ANTENNA table) or a string representing a valid
91 antenna name. The returned
92 record contains the longitude, latitude, and elevation offsets as quantity records. The reported longitude and
93 latitude offsets are measured along the surface of a sphere whose center is coincident with the center of
94 the earth and whose surface contains the observatory reference position.
96 """
97 return self._swigobj.antennaoffset(which)
99 def antennaposition(self, which=int(0)):
100 """Get the position of the specified antenna. The returned record represents a position measure,
101 and can be used as such by the measures (me) tool.
103 """
104 return self._swigobj.antennaposition(which)
106 def antennastations(self, which=int(-1), obsid=int(-1)):
107 """Get the station names of the specified antennas. If a specified antenna name is listed multiple
108 times in the ANTENNA table, obsid is negative, and which is specified as an array of names, then
109 the station associated with the largest ID for that antenna is returned. If obsid is nonnegative,
110 returned stations are filtered based on that. If which is specified as a string (antenna name),
111 then all the stations associated with that antenna are returned.
113 """
114 return self._swigobj.antennastations(which, obsid)
116 def antennasforscan(self, scan=int(-1), obsid=int(-1), arrayid=int(-1)):
117 """Get an array of the unique antennaIDs for the specified scan, observation ID, and array ID.
119 """
120 return self._swigobj.antennasforscan(scan, obsid, arrayid)
122 def bandwidths(self, spw=int(-1)):
123 """Get the bandwidths in Hz for the specified spectral windows. If spw less than zero, return bandwidths for all spectral windows.
125 """
126 return self._swigobj.bandwidths(spw)
128 def baseband(self, spw):
129 """Get the baseband for the specified spectral window.
131 """
132 return self._swigobj.baseband(spw)
134 def baselines(self):
135 """Get a two dimensional boolean array representing baselines for data recorded in the MS. A value of True means
136 there is at least one row in the MS main table for that baseline, False means no rows for that baseline. Autocorrelation
137 "baseline" information is also present via the values along the diagonal.
139 """
140 return self._swigobj.baselines()
142 def chanavgspws(self):
143 """Get an array of spectral window IDs used for channel averages. These are windows that do have 1 channel.
145 """
146 return self._swigobj.chanavgspws()
148 def chaneffbws(self, spw, unit='', asvel=False):
149 """Get an array of channel effective bandwidths for the specified spectral window. The parameter
150 asvel indicates if velocity widths (True) or frequency widths (False) should be returned.
151 The unit parameter specifies the units that the returned values should have. If empty (default),
152 "Hz" will be used if asvel=False, or "km/s" will be used if asvel=True.
154 """
155 return self._swigobj.chaneffbws(spw, unit, asvel)
157 def chanfreqs(self, spw, unit='Hz'):
158 """Get an array of channel frequencies for the specified spectral window.
160 """
161 return self._swigobj.chanfreqs(spw, unit)
163 def chanres(self, spw, unit='', asvel=False):
164 """Get an array of channel resolutions for the specified spectral window. The parameter
165 asvel indicates if velocity widths (True) or frequency widths (False) should be returned.
166 The unit parameter specifies the units that the returned values should have. If empty (default),
167 "Hz" will be used if asvel=False, or "km/s" will be used if asvel=True.
169 """
170 return self._swigobj.chanres(spw, unit, asvel)
172 def chanwidths(self, spw, unit='Hz'):
173 """Get an array of channel widths for the specified spectral window.
175 """
176 return self._swigobj.chanwidths(spw, unit)
178 def close(self):
179 """This method will close the tool and reclaim system resources it has been using. Returns true if successful.
181 """
182 return self._swigobj.close()
184 def corrbit(self, spw=int(-1)):
185 """Get the value of SPECTRAL_WINDOW::SDM_CORR_BIT column for the specified spw.
186 If spw >= 0 is specified, a string value is returned. If spw <0, a list
187 of string values with length equal to the number of spectral windows is returned.
188 If the SPECTRAL_WINDOW::SDM_CORR_BIT column does not exist, either
189 "UNKNOWN" is returned if spw>=0, or a list with nspw entries of
190 "UNKNOWN" is returned if spw<0. A list of integers may also be
191 supplied for the spw parameter. In this case, all integers should be in the
192 range [0, spw-1] or an exception will be thrown. The return value will
193 be a list containing the corresponding CORR_BIT values in the order
194 of the spws specified.
196 """
197 return self._swigobj.corrbit(spw)
199 def corrprodsforpol(self, pol=int(-1)):
200 """Get the correlation products associated with the specified polarization ID.
202 """
203 return self._swigobj.corrprodsforpol(pol)
205 def corrtypesforpol(self, pol=int(-1)):
206 """Get the correlation types associated with the specified polarization ID.
208 """
209 return self._swigobj.corrtypesforpol(pol)
211 def datadescids(self, spw=int(-1), pol=int(-1)):
212 """Get a list of data description IDs associated with the specified spectral window ID
213 and/or polarization ID. Values of less than zero for either means all IDs should be used
214 in the selection.
216 """
217 return self._swigobj.datadescids(spw, pol)
219 def done(self):
220 """This method will close the tool and reclaim system resources it has been using. Returns true if successful.
222 """
223 return self._swigobj.done()
225 def effexposuretime(self):
226 """Get the effective exposure time (equivalent to what might be more commonly known as total integration
227 time or total sample time) is calculated by summing over all rows in the main MS table, excluding
228 autocorrelations or rows where FLAG_ROW is false, thusly:
230 sum[over i] (exposure[i]*sum[over j](UFBW[i, j])/ncorrelations[i] )/ nmaxbaselines
232 where exposure[i] is the value of EXPOSURE for the ith row, the inner sum is performed over each correlation
233 for that row, UFBW is the unflagged fractional bandwidth is determined by summing all the widths of the
234 unflagged channels for that correlation and dividing by the total bandwidth of all spectral windows observed
235 at the timestamp of row i, ncorrelations is the number of correlations determined by the number of rows in
236 the FLAG matrix for MS row i, and nmaxbaselines is the maximum number of antenna pairs,
237 nantennas*(nantennas-1)/2, where nantennas is the number of antennas in the ANTENNA table. This method returns
238 a quantity (a dictionary having a numerical value and a string unit).
240 """
241 return self._swigobj.effexposuretime()
243 def exposuretime(self, scan=int(0), spwid=int(0), polid=int(-1), obsid=int(0), arrayid=int(0)):
244 """Get the exposure time for the specified scan, spwid, polarization ID, array ID, and observation ID.
245 This is the exposure time of the record with the lowest time stamp of the records associated with
246 these parameters. Returns a quantity dictionary. If polid is not specified (or specified and negative)
247 and there is only one polarization ID in for the specified combination of scan, spwid, obsID, and
248 arrayID, then that polarization ID is used. If there are multiple polarization IDs for the
249 combination of other parameters, a list of these is logged and an empty dictionary is returned.
251 """
252 return self._swigobj.exposuretime(scan, spwid, polid, obsid, arrayid)
254 def fdmspws(self):
255 """Get an array of spectral window IDs used for FDM. These are windows that do not have 64, 128, or 256 channels.
257 """
258 return self._swigobj.fdmspws()
260 def fieldnames(self):
261 """Get an array of field names as they appear in the FIELD table.
263 """
264 return self._swigobj.fieldnames()
266 def fieldsforintent(self, intent='', asnames=False):
267 """Get an array of the unique fields for the specified intent. Note that * matches any number of characters of all character classes.
269 """
270 return self._swigobj.fieldsforintent(intent, asnames)
272 def fieldsforname(self, name=''):
273 """Get an array of the unique, zero-based field IDs for the specified field name. If the field name is the
274 empty string (the default), a list of all unique field IDs in the main table of the MS will be returned.
276 """
277 return self._swigobj.fieldsforname(name)
279 def fieldsforscan(self, scan=int(-1), asnames=False, obsid=int(-1), arrayid=int(-1)):
280 """Get an array of the unique fields for the specified scan number, observation ID, and array ID.
282 """
283 return self._swigobj.fieldsforscan(scan, asnames, obsid, arrayid)
285 def fieldsforscans(self, scans=[ ], asnames=False, obsid=int(-1), arrayid=int(-1), asmap=False):
286 """Get an array or dictionary of the unique fields for the specified scan numbers, observation ID, and array ID.
287 If asnames=True, the values returned will be the field names, if False, they will be field IDs.
288 If asmap=True, the structure returned will be a dictionary which maps scan number (as a string) to fields.
289 In this case, both obsid and arrayid must be nonnegative. If asmap=False, a single array of fields is returned
290 that matches the query. In this case, if obsid and/or arrayid are negative, then it indicates that all
291 fields matching any obsid and/or arrayid should be returned. An empty array specified for scans means
292 that all scans for the selected obsid and arrayid should be included.
294 """
295 return self._swigobj.fieldsforscans(scans, asnames, obsid, arrayid, asmap)
297 def fieldsforsource(self, source=int(-1), asnames=False):
298 """Get an array of the unique fields for the specified source.
300 """
301 return self._swigobj.fieldsforsource(source, asnames)
303 def fieldsforsources(self, asnames=False):
304 """Get a map of source IDs to fields. The keys (source IDs) will be strings.
306 """
307 return self._swigobj.fieldsforsources(asnames)
309 def fieldsforspw(self, spw=int(-1), asnames=False):
310 """Get an array of the unique fields for the specified spectral window.
312 """
313 return self._swigobj.fieldsforspw(spw, asnames)
315 def fieldsfortimes(self, time=float(-1), tol=float(0)):
316 """Get an array of the unique, zero-based, fieldIDs for the specified time range (time-tol to time+tol).
318 """
319 return self._swigobj.fieldsfortimes(time, tol)
321 def intents(self):
322 """Get an array of the unique intents associated with the MS.
324 """
325 return self._swigobj.intents()
327 def intentsforfield(self, field=int(0)):
328 """Get an array of the unique intents for the specified field.
330 """
331 return self._swigobj.intentsforfield(field)
333 def intentsforscan(self, scan=int(-1), obsid=int(-1), arrayid=int(-1)):
334 """Get an array of the unique intents for the specified scan, observation ID, and array ID.
336 """
337 return self._swigobj.intentsforscan(scan, obsid, arrayid)
339 def intentsforspw(self, spw=int(-1)):
340 """Get an array of the unique intents for the specified spectral window ID.
342 """
343 return self._swigobj.intentsforspw(spw)
345 def meanfreq(self, spw, unit='Hz'):
346 """Get the mean frequency for the specified spectral window.
348 """
349 return self._swigobj.meanfreq(spw, unit)
351 def name(self):
352 """Get the name of the attached MS.
354 """
355 return self._swigobj.name()
357 def namesforfields(self, fieldids=''):
358 """Get the name of the specified field.
360 """
361 return self._swigobj.namesforfields(fieldids)
363 def namesforspws(self, spwids=''):
364 """Get the name of the specified spw(s).
366 """
367 return self._swigobj.namesforspws(spwids)
369 def nantennas(self):
370 """Get the number of antennas associated with the MS.
372 """
373 return self._swigobj.nantennas()
375 def narrays(self):
376 """Get the number of arrays associated with the MS from the ARRAY table.
378 """
379 return self._swigobj.narrays()
381 def nbaselines(self, ac=False):
382 """Get the number of unique baselines (antenna pairs) represented in the main MS table. This can, in theory, be less than
383 n*(n-1)/2 (n being the number of antennas in the ANTENNA table), if data for certain baselines
384 are not included in the main MS table. Autocorrelation "baselines" are included in this count if ac=True.
386 """
387 return self._swigobj.nbaselines(ac)
389 def nchan(self, spw):
390 """Get the number of channels associated with the specified spectral window.
392 """
393 return self._swigobj.nchan(spw)
395 def ncorrforpol(self, polid=int(-1)):
396 """Get the number of correlations for the specified polarization ID. If the specified polarization ID
397 is negative, an array of numbers of correlations is returned. The indices of that array represent polarization IDs.
399 """
400 return self._swigobj.ncorrforpol(polid)
402 def nfields(self):
403 """Get the number of fields associated with the MS.
405 """
406 return self._swigobj.nfields()
408 def nobservations(self):
409 """Get the number of observations associated with the MS from the OBSERVATIONS table.
411 """
412 return self._swigobj.nobservations()
414 def nspw(self, includewvr=True):
415 """This method will return the number of spectral windows in the associated MS.
417 """
418 return self._swigobj.nspw(includewvr)
420 def nstates(self):
421 """This method will return the number of states (number of rows in the STATES table) in the associated MS.
423 """
424 return self._swigobj.nstates()
426 def nscans(self):
427 """Get the number of scans associated with the MS.
429 """
430 return self._swigobj.nscans()
432 def nsources(self):
433 """Get the number of unique values from the SOURCE_ID column in the SOURCE table. The number of rows in the
434 SOURCE table may be greater than this value.
436 """
437 return self._swigobj.nsources()
439 def nrows(self, autoc=True, flagged=True):
440 """Get the number of visibilities (from the main table) associated with the MS.
442 """
443 return self._swigobj.nrows(autoc, flagged)
445 def observers(self):
446 """Get an array of observers as they are listed in the OBSERVATIONS table.
448 """
449 return self._swigobj.observers()
451 def observatorynames(self):
452 """Get an array of MS telescope (observatory) names as they are listed in the OBSERVATIONS table.
454 """
455 return self._swigobj.observatorynames()
457 def observatoryposition(self, which=int(0)):
458 """Get the position of the specified telescope.
460 """
461 return self._swigobj.observatoryposition(which)
463 def open(self, msfile='', maxcache=float(50)):
464 """Attach this tool to the specified MS. This method runs a few basic MS validation tests, and if any of these
465 fail (which indicates that the MS is invalid), an error occurs and the tool is not attached to the MS.
466 Note that it is ultimately the user's responsibility to ensure that the MS is valid. Running the methods
467 of this tool on an invalid MS may result in incorrect results or even a crash of CASA. Such invalidities
468 include any MS subtable not having appropriate information (eg, an OBSERVATION subtable not having enough rows
469 to account for all the OBSERVATION_IDs in the main table).
471 """
472 return self._swigobj.open(msfile, maxcache)
474 def phasecenter(self, fieldid=int(0), epoch={ }):
475 """Get a direction measures for the phasecenter of the field id and time specified
477 """
478 return self._swigobj.phasecenter(fieldid, epoch)
480 def pointingdirection(self, rownum=int(0), interpolate=False, initialrow=int(0)):
481 """Get the pointing direction for antennas at the specified row number in the main MS table. Returns a record
482 containing the time, antenna IDs and corresponding pointing directions.
484 """
485 return self._swigobj.pointingdirection(rownum, interpolate, initialrow)
487 def polidfordatadesc(self, ddid=int(-1)):
488 """Get the polarization ID associated with the specified data description ID. If the specified data description ID
489 is negative, an array of polarization IDs is returned. The indices of that array represent data description IDs.
491 """
492 return self._swigobj.polidfordatadesc(ddid)
494 def projects(self):
495 """Get an array of projects as they are listed in the OBSERVATIONS table.
497 """
498 return self._swigobj.projects()
500 def propermotions(self):
501 """Get the values of the DIRECTION column from the SOURCE table. Returns a dictionary in which the
502 keys are the associated zero-based row numbers, represented as strings, in the SOURCE table. The
503 associated values are two element dictionaries, with keys "longitude" and "latitude", containing
504 the longitudinal and latidinal components of the proper motion, which are valid quantity dictionaries.
506 """
507 return self._swigobj.propermotions()
509 def refdir(self, field=int(0), epoch={ }):
510 """Get a direction measure for the reference direction of the field and time specified
512 """
513 return self._swigobj.refdir(field, epoch)
515 def reffreq(self, spw=int(-1)):
516 """Get the reference frequency of the specified spectral window. The returned frequency is in
517 the form of a valid measures dictionary.
519 """
520 return self._swigobj.reffreq(spw)
522 def restfreqs(self, sourceid=int(0), spw=int(0)):
523 """Get the rest frequencies from the SOURCE table for the specified source and spectral window.
524 The return value will be a dictionary of frequency measures if the rest frequencies are
525 defined for the specified inputs, or False if they do not.
527 """
528 return self._swigobj.restfreqs(sourceid, spw)
530 def rxbands(self, spwids=''):
531 """ALMA-only. Returns an integer array containing the receiver band
532 of the specified spw(s). A return value of -1 means no receiver
533 band number could be determined. The name of the spw is first
534 checked to determine if the receiver band value is encoded
535 there. If not, the corresponding spectral window ID is sought in
536 the ASDM_RECEIVER table, if it exists, and if it has less than
537 or equal number of rows compared to the SPECTRAL_WINDOW table.
538 If the corresponding spectral window can be found in the
539 ASDM_RECEIVER table, then the corresponding frequencyBand column
540 value is checked to determine if the receiver band information
541 is encoded there. In the case where the spectral window ID is
542 present in multiple cells of the spectralWindowId column, the
543 first row in which the ID is found is used to determine the
544 receiver band. If all these tests fail, -1 is returned for the
545 specified spectral window.
547 """
548 return self._swigobj.rxbands(spwids)
550 def scannumbers(self, obsid=int(-1), arrayid=int(-1)):
551 """This method will return an array of unique scan numbers in the associated MS for the specified observation ID and array ID.
553 """
554 return self._swigobj.scannumbers(obsid, arrayid)
556 def scansforfield(self, field='', obsid=int(-1), arrayid=int(-1)):
557 """Get an array of the unique scan numbers associated with the specified field, observation ID, and array ID.
559 """
560 return self._swigobj.scansforfield(field, obsid, arrayid)
562 def scansforfields(self, obsid=int(0), arrayid=int(0)):
563 """Get a dictionary of which maps field ID to scan numbers for the specified observation ID
564 and array ID. The keys (field IDs) will be strings. obsid and arrayid must both
565 be non-negative.
567 """
568 return self._swigobj.scansforfields(obsid, arrayid)
570 def scansforintent(self, intent='', obsid=int(-1), arrayid=int(-1)):
571 """Get an array of the unique scan numbers associated with the specified intent, observation ID, and arrayID.
572 The "*" character matches any number of characters from all character classes.
574 """
575 return self._swigobj.scansforintent(intent, obsid, arrayid)
577 def scansforspw(self, spw=int(-1), obsid=int(-1), arrayid=int(-1)):
578 """Get an array of the unique scan numbers associated with the specified zero-based spectral window ID, observation ID, and array ID.
580 """
581 return self._swigobj.scansforspw(spw, obsid, arrayid)
583 def scansforspws(self, obsid=int(0), arrayid=int(0)):
584 """Get a dictionary of which maps spw ID to scan numbers for the specified observation ID
585 and array ID. The keys (spectral window IDs) will be strings. obsid and arrayid must both
586 be non-negative.
588 """
589 return self._swigobj.scansforspws(obsid, arrayid)
591 def scansforstate(self, state=int(-1), obsid=int(-1), arrayid=int(-1)):
592 """Get an array of the unique scan numbers for the specified state, observation ID, and array ID.
594 """
595 return self._swigobj.scansforstate(state, obsid, arrayid)
597 def scansfortimes(self, time=float(-1), tol=float(0), obsid=int(-1), arrayid=int(-1)):
598 """Get an array of the unique scan numbers for the specified time range (time-tol to time+tol), observation ID, and array ID.
600 """
601 return self._swigobj.scansfortimes(time, tol, obsid, arrayid)
603 def schedule(self, obsid=int(-1)):
604 """Get the schedule information for the specified observation ID.
606 """
607 return self._swigobj.schedule(obsid)
609 def sideband(self, spw):
610 """Get the sideband for the specified spectral window.
612 """
613 return self._swigobj.sideband(spw)
615 def sourcedirs(self):
616 """Get the values of the DIRECTION column from the SOURCE table. Returns a dictionary in which the
617 keys are the associated row numbers, represented as strings, in the SOURCE table. Each value
618 in the returned dictionary is a valid direction measure.
620 """
621 return self._swigobj.sourcedirs()
623 def sourcetimes(self):
624 """Get the values of the TIME column from the SOURCE table. Returns a dictionary in which the
625 keys are the associated row numbers, represented as strings, in the SOURCE table. Each value
626 in the returned dictionary is a valid time quantity.
628 """
629 return self._swigobj.sourcetimes()
631 def sourceidforfield(self, field=int(-1)):
632 """Get the source ID from the field table for the specified field ID.
634 """
635 return self._swigobj.sourceidforfield(field)
637 def sourceidsfromsourcetable(self):
638 """Get the values of the SOURCE_ID column from the SOURCE table. It is unfortunate that the SOURCE
639 table has a column named SOURCE_ID, because implicitly the "ID" of a row in an MS subtable is
640 generally meant to reflect a row number in that table, but that is not the case for the SOURCE table.
642 """
643 return self._swigobj.sourceidsfromsourcetable()
645 def sourcenames(self):
646 """Get the values of the SOURCE_NAME column from the SOURCE table.
648 """
649 return self._swigobj.sourcenames()
651 def spwsforbaseband(self, baseband=int(-1), sqldmode='include'):
652 """Get the spectral windows associated with the specified baseband or dictionary that maps baseband to spectral windows.
654 """
655 return self._swigobj.spwsforbaseband(baseband, sqldmode)
657 def spwfordatadesc(self, ddid=int(-1)):
658 """Get the spectral window ID associated with the specified data description ID. If the specified data description ID
659 is negative, an array of spectral window IDs is returned. The indices of that array represent data description IDs.
661 """
662 return self._swigobj.spwfordatadesc(ddid)
664 def spwsforfield(self, field=''):
665 """Get an array of the unique spectral window IDs for the specified field.
667 """
668 return self._swigobj.spwsforfield(field)
670 def spwsforfields(self):
671 """Get a dictionary which maps field IDs to spectral window IDs. The field IDs are keys in the
672 returned dictionary. To access a particular element, one must ensure the key is a string.
674 """
675 return self._swigobj.spwsforfields()
677 def spwsforintent(self, intent=''):
678 """Get an array of the unique spectral window IDs for the specified intent. The "*" character matches any number of characters from all character classes.
680 """
681 return self._swigobj.spwsforintent(intent)
683 def spwsfornames(self, spwids=''):
684 """Get the IDs of the specified spw(s). Returns a dictionary where the keys
685 are the requested spectral window names that are present in the data set
686 and the values are arrays of the spectral window IDs corresponding to the
687 name. If a specified name is not present, a warning message is logged and
688 that name is not included in the returned dictionary. Specifying no names
689 results in a dictionary containing the name to spw ID mapping for the
690 entire data set.
692 """
693 return self._swigobj.spwsfornames(spwids)
695 def spwsforscan(self, scan=int(-1), obsid=int(-1), arrayid=int(-1)):
696 """Get an array of the unique spectral window IDs for the specified scan number, observation ID, and array ID.
698 """
699 return self._swigobj.spwsforscan(scan, obsid, arrayid)
701 def spwsforscans(self, obsid=int(0), arrayid=int(0)):
702 """Get a dictionary of which maps scan number to spectral windows for the specified observation ID and array ID. The keys (scan
703 numbers) will be strings. obsid and arrayid must both be non-negative.
705 """
706 return self._swigobj.spwsforscans(obsid, arrayid)
708 def subwindows(self, spwids=''):
709 """ALMA-only. Returns an integer array containing the subwindow of
710 the specified spw(s). The spw name is checked to determine if
711 the subwindow value is encoded within it. A return value of -1
712 indicates that a subwindow number could be determined.
714 """
715 return self._swigobj.subwindows(spwids)
717 def statesforscan(self, scan=int(-1), obsid=int(-1), arrayid=int(-1)):
718 """Get an array of the unique state IDs for the specified scan number, observation ID, and array ID.
720 """
721 return self._swigobj.statesforscan(scan, obsid, arrayid)
723 def statesforscans(self, obsid=int(0), arrayid=int(0)):
724 """Get a dictionary which maps scan numbers to state IDs for the specified array and observation IDs. The returned dictionary
725 will have scan numbers, as strings, as keys.
727 """
728 return self._swigobj.statesforscans(obsid, arrayid)
730 def summary(self):
731 """Get dictionary summarizing the MS.
733 """
734 return self._swigobj.summary()
736 def tdmspws(self):
737 """Get an array of spectral window IDs used for TDM. These are windows that have 64, 128, or 256 channels.
739 """
740 return self._swigobj.tdmspws()
742 def timerangeforobs(self, obsid=int(-1)):
743 """Get the time range for the specified observation ID. The return value is a dictionary containing
744 keys "begin" and "end". Each of the associated value are dictionaries representing epochs which
745 are valid measure records. The values are taken directly from the OBSERVATION subtable; no
746 half-intervals are added or subtracted.
748 """
749 return self._swigobj.timerangeforobs(obsid)
751 def timesforfield(self, field=int(-1)):
752 """Get an array of the unique times associated with the specified field ID. The times correspond to those in the TIME column, so are values of the time system associated with that column and have units associated with that column. Only unique times are returned; duplicates are dropped. Providing a negative field ID will result in an exception being thrown.
754 """
755 return self._swigobj.timesforfield(field)
757 def timesforintent(self, intent=''):
758 """Get an array of the unique times associated with the specified intent. The times correspond to those in the TIME column, so are values of the time system associated with that column and have units associated with that column. Only unique times are returned; duplicates are dropped.
760 """
761 return self._swigobj.timesforintent(intent)
763 def timesforscan(self, scan=int(-1), obsid=int(-1), arrayid=int(-1), perspw=False):
764 """Get the unique times for the specified scan number, observation ID, and array ID. If perspw=True, the returned data structure is
765 a dictionary that has keys representing zero-based spectral window IDs and values representing the unique values of the TIME column
766 corrsponding to the specified scan and that corresponding spectral window ID. If False, an array of unique values from the TIME
767 column for the specified scan is returned; there is no separation into spectral window IDs.
769 """
770 return self._swigobj.timesforscan(scan, obsid, arrayid, perspw)
772 def timesforscans(self, scans=int(0), obsid=int(-1), arrayid=int(-1)):
773 """Get an array of the unique times for the specified scan numbers, observation ID, and array ID. The times correspond to those in the TIME column, so are values of the time system associated with that column and have units associated with that column. Only unique times are returned; duplicates are dropped. For the scans parameter, a single non-negative integer or a list of non-negative integers, all of which are valid scan numbers in the MS, must be supplied.
775 """
776 return self._swigobj.timesforscans(scans, obsid, arrayid)
778 def timesforspws(self, spw=int(-1)):
779 """Get the unique times corresponding to the specified spectral window(s). The input indicates the
780 spws for which times are to be retrieved, and can be a single integer or an array of
781 integers. If a single, non-negative integer, an array of unique times associated with
782 that spectral window are returned. Otherwise, a dictionary of times associated with the
783 specified spectral windows are returned, with the spws (as strings) as the keys and the
784 times as the values. A negative integer will cause a dictionary of all spws and their
785 associated times to be returned.
787 """
788 return self._swigobj.timesforspws(spw)
790 def transitions(self, sourceid=int(0), spw=int(0)):
791 """Get the spectral transitions from the SOURCE table for the specified source and spectral window.
792 The return value will be an array of transitions if the transitions are
793 defined for the specified inputs, or False if they do not.
795 """
796 return self._swigobj.transitions(sourceid, spw)
798 def wvrspws(self, complement=False):
799 """Get an array of spectral window IDs used for WVR. These are windows that have 4 channels.
800 If complement is True, return the complement set instead (all non-wvr spw IDs). WVR windows
801 are identified using the algorithm
802 1. check for water vapor radiometer (WVR) spectral windows using the spectral window
803 name "WVR#NOMINAL" and report these.
804 2. If no SPWs match that string, then the names are checked for "WVR" and are reported instead.
806 """
807 return self._swigobj.wvrspws(complement)