Coverage for /wheeldirectory/casa-6.7.2-31-py3.12.el8/lib/py/lib/python3.12/site-packages/casatools/msmetadata.py: 54%
219 statements
« prev ^ index » next coverage.py v7.10.1, created at 2025-07-31 10:44 +0000
« prev ^ index » next coverage.py v7.10.1, created at 2025-07-31 10:44 +0000
1##################### generated by xml-casa (v2) from msmetadata.xml ################
2##################### 6a1320e2e64866ba74ad9fdeebc2d13e ##############################
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, or
51 3. the product of the number of polarizations and the number of
52 channels it contains exceeds 256.
54 The window is classified as a *TDM spectral window* if it is neither a WVR window,
55 a channel average window, nor an FDM window.
58 """
59 return self._swigobj.almaspws(chavg, fdm, sqld, tdm, wvr, complement)
61 def antennadiameter(self, antenna=int(-1)):
62 """Get the diameter for the specified antenna. The antenna can be specified either by
63 its zero-based ID from the ANTENNA table or by its name in that table. The returned
64 dictionary is a valid quantity. If a negative integer is provided for the antenna, then
65 all atenna diameters will be returned in a dictionary that has keys that are the antenna IDs
66 and values that are dictionaries, each being a valid quantity representing the diameter for
67 that antenna ID.
69 """
70 return self._swigobj.antennadiameter(antenna)
72 def antennaids(self, name='', mindiameter='0m', maxdiameter='1pc', obsid=int(-1)):
73 """Get the zero-based antenna IDs for the specfied antenna names and the specified diameter
74 range for the specified observation ID. An array of unique IDs in order of the specified names is returned.
75 Note that if a specified name is listed mulitple times in the ANTENNA table, the largest
76 ID is returned, unless the observation ID is specified to be non-negative, in which case, the
77 returned IDs are filtered based on the specified observation ID.
78 If no names and no diameter range is specified, all IDs are returned.
80 """
81 return self._swigobj.antennaids(name, mindiameter, maxdiameter, obsid)
83 def antennanames(self, antennaids=int(-1)):
84 """Get the name of the antenna for the specfied zero-based antenna ID. If antennaids is not specified,
85 all antenna names are returned.
87 """
88 return self._swigobj.antennanames(antennaids)
90 def antennaoffset(self, which=int(0)):
91 """Get the offset position of the specified antenna relative to the array reference position. Antenna may
92 be specified as a zero-based integer (row number in the ANTENNA table) or a string representing a valid
93 antenna name. The returned
94 record contains the longitude, latitude, and elevation offsets as quantity records. The reported longitude and
95 latitude offsets are measured along the surface of a sphere whose center is coincident with the center of
96 the earth and whose surface contains the observatory reference position.
98 """
99 return self._swigobj.antennaoffset(which)
101 def antennaposition(self, which=int(0)):
102 """Get the position of the specified antenna. The returned record represents a position measure,
103 and can be used as such by the measures (me) tool.
105 """
106 return self._swigobj.antennaposition(which)
108 def antennastations(self, which=int(-1), obsid=int(-1)):
109 """Get the station names of the specified antennas. If a specified antenna name is listed multiple
110 times in the ANTENNA table, obsid is negative, and which is specified as an array of names, then
111 the station associated with the largest ID for that antenna is returned. If obsid is nonnegative,
112 returned stations are filtered based on that. If which is specified as a string (antenna name),
113 then all the stations associated with that antenna are returned.
115 """
116 return self._swigobj.antennastations(which, obsid)
118 def antennasforscan(self, scan=int(-1), obsid=int(-1), arrayid=int(-1)):
119 """Get an array of the unique antennaIDs for the specified scan, observation ID, and array ID.
121 """
122 return self._swigobj.antennasforscan(scan, obsid, arrayid)
124 def bandwidths(self, spw=int(-1)):
125 """Get the bandwidths in Hz for the specified spectral windows. If spw less than zero, return bandwidths for all spectral windows.
127 """
128 return self._swigobj.bandwidths(spw)
130 def baseband(self, spw):
131 """Get the baseband for the specified spectral window.
133 """
134 return self._swigobj.baseband(spw)
136 def baselines(self):
137 """Get a two dimensional boolean array representing baselines for data recorded in the MS. A value of True means
138 there is at least one row in the MS main table for that baseline, False means no rows for that baseline. Autocorrelation
139 "baseline" information is also present via the values along the diagonal.
141 """
142 return self._swigobj.baselines()
144 def chanavgspws(self):
145 """Get an array of spectral window IDs used for channel averages. These are windows that do have 1 channel.
147 """
148 return self._swigobj.chanavgspws()
150 def chaneffbws(self, spw, unit='', asvel=False):
151 """Get an array of channel effective bandwidths for the specified spectral window. The parameter
152 asvel indicates if velocity widths (True) or frequency widths (False) should be returned.
153 The unit parameter specifies the units that the returned values should have. If empty (default),
154 "Hz" will be used if asvel=False, or "km/s" will be used if asvel=True.
156 """
157 return self._swigobj.chaneffbws(spw, unit, asvel)
159 def chanfreqs(self, spw, unit='Hz'):
160 """Get an array of channel frequencies for the specified spectral window.
162 """
163 return self._swigobj.chanfreqs(spw, unit)
165 def chanres(self, spw, unit='', asvel=False):
166 """Get an array of channel resolutions for the specified spectral window. The parameter
167 asvel indicates if velocity widths (True) or frequency widths (False) should be returned.
168 The unit parameter specifies the units that the returned values should have. If empty (default),
169 "Hz" will be used if asvel=False, or "km/s" will be used if asvel=True.
171 """
172 return self._swigobj.chanres(spw, unit, asvel)
174 def chanwidths(self, spw, unit='Hz'):
175 """Get an array of channel widths for the specified spectral window.
177 """
178 return self._swigobj.chanwidths(spw, unit)
180 def close(self):
181 """This method will close the tool and reclaim system resources it has been using. Returns true if successful.
183 """
184 return self._swigobj.close()
186 def corrbit(self, spw=int(-1)):
187 """Get the value of SPECTRAL_WINDOW::SDM_CORR_BIT column for the specified spw.
188 If spw >= 0 is specified, a string value is returned. If spw <0, a list
189 of string values with length equal to the number of spectral windows is returned.
190 If the SPECTRAL_WINDOW::SDM_CORR_BIT column does not exist, either
191 "UNKNOWN" is returned if spw>=0, or a list with nspw entries of
192 "UNKNOWN" is returned if spw<0. A list of integers may also be
193 supplied for the spw parameter. In this case, all integers should be in the
194 range [0, spw-1] or an exception will be thrown. The return value will
195 be a list containing the corresponding CORR_BIT values in the order
196 of the spws specified.
198 """
199 return self._swigobj.corrbit(spw)
201 def corrprodsforpol(self, pol=int(-1)):
202 """Get the correlation products associated with the specified polarization ID.
204 """
205 return self._swigobj.corrprodsforpol(pol)
207 def corrtypesforpol(self, pol=int(-1)):
208 """Get the correlation types associated with the specified polarization ID.
210 """
211 return self._swigobj.corrtypesforpol(pol)
213 def datadescids(self, spw=int(-1), pol=int(-1)):
214 """Get a list of data description IDs associated with the specified spectral window ID
215 and/or polarization ID. Values of less than zero for either means all IDs should be used
216 in the selection.
218 """
219 return self._swigobj.datadescids(spw, pol)
221 def done(self):
222 """This method will close the tool and reclaim system resources it has been using. Returns true if successful.
224 """
225 return self._swigobj.done()
227 def effexposuretime(self):
228 """Get the effective exposure time (equivalent to what might be more commonly known as total integration
229 time or total sample time) is calculated by summing over all rows in the main MS table, excluding
230 autocorrelations or rows where FLAG_ROW is false, thusly:
232 sum[over i] (exposure[i]*sum[over j](UFBW[i, j])/ncorrelations[i] )/ nmaxbaselines
234 where exposure[i] is the value of EXPOSURE for the ith row, the inner sum is performed over each correlation
235 for that row, UFBW is the unflagged fractional bandwidth is determined by summing all the widths of the
236 unflagged channels for that correlation and dividing by the total bandwidth of all spectral windows observed
237 at the timestamp of row i, ncorrelations is the number of correlations determined by the number of rows in
238 the FLAG matrix for MS row i, and nmaxbaselines is the maximum number of antenna pairs,
239 nantennas*(nantennas-1)/2, where nantennas is the number of antennas in the ANTENNA table. This method returns
240 a quantity (a dictionary having a numerical value and a string unit).
242 """
243 return self._swigobj.effexposuretime()
245 def exposuretime(self, scan=int(0), spwid=int(0), polid=int(-1), obsid=int(0), arrayid=int(0)):
246 """Get the exposure time for the specified scan, spwid, polarization ID, array ID, and observation ID.
247 This is the exposure time of the record with the lowest time stamp of the records associated with
248 these parameters. Returns a quantity dictionary. If polid is not specified (or specified and negative)
249 and there is only one polarization ID in for the specified combination of scan, spwid, obsID, and
250 arrayID, then that polarization ID is used. If there are multiple polarization IDs for the
251 combination of other parameters, a list of these is logged and an empty dictionary is returned.
253 """
254 return self._swigobj.exposuretime(scan, spwid, polid, obsid, arrayid)
256 def fdmspws(self):
257 """Get an array of spectral window IDs used for FDM. These windows
258 are defined by the rules in the description of the method
259 almaspws().
261 """
262 return self._swigobj.fdmspws()
264 def fieldnames(self):
265 """Get an array of field names as they appear in the FIELD table.
267 """
268 return self._swigobj.fieldnames()
270 def fieldsforintent(self, intent='', asnames=False):
271 """Get an array of the unique fields for the specified intent. Note that * matches any number of characters of all character classes.
273 """
274 return self._swigobj.fieldsforintent(intent, asnames)
276 def fieldsforname(self, name=''):
277 """Get an array of the unique, zero-based field IDs for the specified field name. If the field name is the
278 empty string (the default), a list of all unique field IDs in the main table of the MS will be returned.
280 """
281 return self._swigobj.fieldsforname(name)
283 def fieldsforscan(self, scan=int(-1), asnames=False, obsid=int(-1), arrayid=int(-1)):
284 """Get an array of the unique fields for the specified scan number, observation ID, and array ID.
286 """
287 return self._swigobj.fieldsforscan(scan, asnames, obsid, arrayid)
289 def fieldsforscans(self, scans=[ ], asnames=False, obsid=int(-1), arrayid=int(-1), asmap=False):
290 """Get an array or dictionary of the unique fields for the specified scan numbers, observation ID, and array ID.
291 If asnames=True, the values returned will be the field names, if False, they will be field IDs.
292 If asmap=True, the structure returned will be a dictionary which maps scan number (as a string) to fields.
293 In this case, both obsid and arrayid must be nonnegative. If asmap=False, a single array of fields is returned
294 that matches the query. In this case, if obsid and/or arrayid are negative, then it indicates that all
295 fields matching any obsid and/or arrayid should be returned. An empty array specified for scans means
296 that all scans for the selected obsid and arrayid should be included.
298 """
299 return self._swigobj.fieldsforscans(scans, asnames, obsid, arrayid, asmap)
301 def fieldsforsource(self, source=int(-1), asnames=False):
302 """Get an array of the unique fields for the specified source.
304 """
305 return self._swigobj.fieldsforsource(source, asnames)
307 def fieldsforsources(self, asnames=False):
308 """Get a map of source IDs to fields. The keys (source IDs) will be strings.
310 """
311 return self._swigobj.fieldsforsources(asnames)
313 def fieldsforspw(self, spw=int(-1), asnames=False):
314 """Get an array of the unique fields for the specified spectral window.
316 """
317 return self._swigobj.fieldsforspw(spw, asnames)
319 def fieldsfortimes(self, time=float(-1), tol=float(0)):
320 """Get an array of the unique, zero-based, fieldIDs for the specified time range (time-tol to time+tol).
322 """
323 return self._swigobj.fieldsfortimes(time, tol)
325 def intents(self):
326 """Get an array of the unique intents associated with the MS.
328 """
329 return self._swigobj.intents()
331 def intentsforfield(self, field=int(0)):
332 """Get an array of the unique intents for the specified field.
334 """
335 return self._swigobj.intentsforfield(field)
337 def intentsforscan(self, scan=int(-1), obsid=int(-1), arrayid=int(-1)):
338 """Get an array of the unique intents for the specified scan, observation ID, and array ID.
340 """
341 return self._swigobj.intentsforscan(scan, obsid, arrayid)
343 def intentsforspw(self, spw=int(-1)):
344 """Get an array of the unique intents for the specified spectral window ID.
346 """
347 return self._swigobj.intentsforspw(spw)
349 def meanfreq(self, spw, unit='Hz'):
350 """Get the mean frequency for the specified spectral window.
352 """
353 return self._swigobj.meanfreq(spw, unit)
355 def name(self):
356 """Get the name of the attached MS.
358 """
359 return self._swigobj.name()
361 def namesforfields(self, fieldids=''):
362 """Get the name of the specified field.
364 """
365 return self._swigobj.namesforfields(fieldids)
367 def namesforspws(self, spwids=''):
368 """Get the name of the specified spw(s).
370 """
371 return self._swigobj.namesforspws(spwids)
373 def nantennas(self):
374 """Get the number of antennas associated with the MS.
376 """
377 return self._swigobj.nantennas()
379 def narrays(self):
380 """Get the number of arrays associated with the MS from the ARRAY table.
382 """
383 return self._swigobj.narrays()
385 def nbaselines(self, ac=False):
386 """Get the number of unique baselines (antenna pairs) represented in the main MS table. This can, in theory, be less than
387 n*(n-1)/2 (n being the number of antennas in the ANTENNA table), if data for certain baselines
388 are not included in the main MS table. Autocorrelation "baselines" are included in this count if ac=True.
390 """
391 return self._swigobj.nbaselines(ac)
393 def nchan(self, spw):
394 """Get the number of channels associated with the specified spectral window.
396 """
397 return self._swigobj.nchan(spw)
399 def ncorrforpol(self, polid=int(-1)):
400 """Get the number of correlations for the specified polarization ID. If the specified polarization ID
401 is negative, an array of numbers of correlations is returned. The indices of that array represent polarization IDs.
403 """
404 return self._swigobj.ncorrforpol(polid)
406 def nfields(self):
407 """Get the number of fields associated with the MS.
409 """
410 return self._swigobj.nfields()
412 def nobservations(self):
413 """Get the number of observations associated with the MS from the OBSERVATIONS table.
415 """
416 return self._swigobj.nobservations()
418 def nspw(self, includewvr=True):
419 """This method will return the number of spectral windows in the associated MS.
421 """
422 return self._swigobj.nspw(includewvr)
424 def nstates(self):
425 """This method will return the number of states (number of rows in the STATES table) in the associated MS.
427 """
428 return self._swigobj.nstates()
430 def nscans(self):
431 """Get the number of scans associated with the MS.
433 """
434 return self._swigobj.nscans()
436 def nsources(self):
437 """Get the number of unique values from the SOURCE_ID column in the SOURCE table. The number of rows in the
438 SOURCE table may be greater than this value.
440 """
441 return self._swigobj.nsources()
443 def nrows(self, autoc=True, flagged=True):
444 """Get the number of visibilities (from the main table) associated with the MS.
446 """
447 return self._swigobj.nrows(autoc, flagged)
449 def observers(self):
450 """Get an array of observers as they are listed in the OBSERVATIONS table.
452 """
453 return self._swigobj.observers()
455 def observatorynames(self):
456 """Get an array of MS telescope (observatory) names as they are listed in the OBSERVATIONS table.
458 """
459 return self._swigobj.observatorynames()
461 def observatoryposition(self, which=int(0)):
462 """Get the position of the specified telescope.
464 """
465 return self._swigobj.observatoryposition(which)
467 def open(self, msfile='', maxcache=float(50)):
468 """Attach this tool to the specified MS. This method runs a few basic MS validation tests, and if any of these
469 fail (which indicates that the MS is invalid), an error occurs and the tool is not attached to the MS.
470 Note that it is ultimately the user's responsibility to ensure that the MS is valid. Running the methods
471 of this tool on an invalid MS may result in incorrect results or even a crash of CASA. Such invalidities
472 include any MS subtable not having appropriate information (eg, an OBSERVATION subtable not having enough rows
473 to account for all the OBSERVATION_IDs in the main table).
475 """
476 return self._swigobj.open(msfile, maxcache)
478 def phasecenter(self, fieldid=int(0), epoch={ }):
479 """Get a direction measures for the phasecenter of the field id and time specified
481 """
482 return self._swigobj.phasecenter(fieldid, epoch)
484 def pointingdirection(self, rownum=int(0), interpolate=False, initialrow=int(0)):
485 """Get the pointing direction for antennas at the specified row number in the main MS table. Returns a record
486 containing the time, antenna IDs and corresponding pointing directions.
488 """
489 return self._swigobj.pointingdirection(rownum, interpolate, initialrow)
491 def polidfordatadesc(self, ddid=int(-1)):
492 """Get the polarization ID associated with the specified data description ID. If the specified data description ID
493 is negative, an array of polarization IDs is returned. The indices of that array represent data description IDs.
495 """
496 return self._swigobj.polidfordatadesc(ddid)
498 def projects(self):
499 """Get an array of projects as they are listed in the OBSERVATIONS table.
501 """
502 return self._swigobj.projects()
504 def propermotions(self):
505 """Get the values of the DIRECTION column from the SOURCE table. Returns a dictionary in which the
506 keys are the associated zero-based row numbers, represented as strings, in the SOURCE table. The
507 associated values are two element dictionaries, with keys "longitude" and "latitude", containing
508 the longitudinal and latidinal components of the proper motion, which are valid quantity dictionaries.
510 """
511 return self._swigobj.propermotions()
513 def refdir(self, field=int(0), epoch={ }):
514 """Get a direction measure for the reference direction of the field and time specified
516 """
517 return self._swigobj.refdir(field, epoch)
519 def reffreq(self, spw=int(-1)):
520 """Get the reference frequency of the specified spectral window. The returned frequency is in
521 the form of a valid measures dictionary.
523 """
524 return self._swigobj.reffreq(spw)
526 def restfreqs(self, sourceid=int(0), spw=int(0)):
527 """Get the rest frequencies from the SOURCE table for the specified source and spectral window.
528 The return value will be a dictionary of frequency measures if the rest frequencies are
529 defined for the specified inputs, or False if they do not.
531 """
532 return self._swigobj.restfreqs(sourceid, spw)
534 def rxbands(self, spwids=''):
535 """ALMA-only. Returns an integer array containing the receiver band
536 of the specified spw(s). A return value of -1 means no receiver
537 band number could be determined. The name of the spw is first
538 checked to determine if the receiver band value is encoded
539 there. If not, the corresponding spectral window ID is sought in
540 the ASDM_RECEIVER table, if it exists, and if it has less than
541 or equal number of rows compared to the SPECTRAL_WINDOW table.
542 If the corresponding spectral window can be found in the
543 ASDM_RECEIVER table, then the corresponding frequencyBand column
544 value is checked to determine if the receiver band information
545 is encoded there. In the case where the spectral window ID is
546 present in multiple cells of the spectralWindowId column, the
547 first row in which the ID is found is used to determine the
548 receiver band. If all these tests fail, -1 is returned for the
549 specified spectral window.
551 """
552 return self._swigobj.rxbands(spwids)
554 def scannumbers(self, obsid=int(-1), arrayid=int(-1)):
555 """This method will return an array of unique scan numbers in the associated MS for the specified observation ID and array ID.
557 """
558 return self._swigobj.scannumbers(obsid, arrayid)
560 def scansforfield(self, field='', obsid=int(-1), arrayid=int(-1)):
561 """Get an array of the unique scan numbers associated with the specified field, observation ID, and array ID.
563 """
564 return self._swigobj.scansforfield(field, obsid, arrayid)
566 def scansforfields(self, obsid=int(0), arrayid=int(0)):
567 """Get a dictionary of which maps field ID to scan numbers for the specified observation ID
568 and array ID. The keys (field IDs) will be strings. obsid and arrayid must both
569 be non-negative.
571 """
572 return self._swigobj.scansforfields(obsid, arrayid)
574 def scansforintent(self, intent='', obsid=int(-1), arrayid=int(-1)):
575 """Get an array of the unique scan numbers associated with the specified intent, observation ID, and arrayID.
576 The "*" character matches any number of characters from all character classes.
578 """
579 return self._swigobj.scansforintent(intent, obsid, arrayid)
581 def scansforspw(self, spw=int(-1), obsid=int(-1), arrayid=int(-1)):
582 """Get an array of the unique scan numbers associated with the specified zero-based spectral window ID, observation ID, and array ID.
584 """
585 return self._swigobj.scansforspw(spw, obsid, arrayid)
587 def scansforspws(self, obsid=int(0), arrayid=int(0)):
588 """Get a dictionary of which maps spw ID to scan numbers for the specified observation ID
589 and array ID. The keys (spectral window IDs) will be strings. obsid and arrayid must both
590 be non-negative.
592 """
593 return self._swigobj.scansforspws(obsid, arrayid)
595 def scansforstate(self, state=int(-1), obsid=int(-1), arrayid=int(-1)):
596 """Get an array of the unique scan numbers for the specified state, observation ID, and array ID.
598 """
599 return self._swigobj.scansforstate(state, obsid, arrayid)
601 def scansfortimes(self, time=float(-1), tol=float(0), obsid=int(-1), arrayid=int(-1)):
602 """Get an array of the unique scan numbers for the specified time range (time-tol to time+tol), observation ID, and array ID.
604 """
605 return self._swigobj.scansfortimes(time, tol, obsid, arrayid)
607 def schedule(self, obsid=int(-1)):
608 """Get the schedule information for the specified observation ID.
610 """
611 return self._swigobj.schedule(obsid)
613 def sideband(self, spw):
614 """Get the sideband for the specified spectral window.
616 """
617 return self._swigobj.sideband(spw)
619 def sourcedirs(self):
620 """Get the values of the DIRECTION column from the SOURCE table. Returns a dictionary in which the
621 keys are the associated row numbers, represented as strings, in the SOURCE table. Each value
622 in the returned dictionary is a valid direction measure.
624 """
625 return self._swigobj.sourcedirs()
627 def sourcetimes(self):
628 """Get the values of the TIME column from the SOURCE table. Returns a dictionary in which the
629 keys are the associated row numbers, represented as strings, in the SOURCE table. Each value
630 in the returned dictionary is a valid time quantity.
632 """
633 return self._swigobj.sourcetimes()
635 def sourceidforfield(self, field=int(-1)):
636 """Get the source ID from the field table for the specified field ID.
638 """
639 return self._swigobj.sourceidforfield(field)
641 def sourceidsfromsourcetable(self):
642 """Get the values of the SOURCE_ID column from the SOURCE table. It is unfortunate that the SOURCE
643 table has a column named SOURCE_ID, because implicitly the "ID" of a row in an MS subtable is
644 generally meant to reflect a row number in that table, but that is not the case for the SOURCE table.
646 """
647 return self._swigobj.sourceidsfromsourcetable()
649 def sourcenames(self):
650 """Get the values of the SOURCE_NAME column from the SOURCE table.
652 """
653 return self._swigobj.sourcenames()
655 def spwsforbaseband(self, baseband=int(-1), sqldmode='include'):
656 """Get the spectral windows associated with the specified baseband or dictionary that maps baseband to spectral windows.
658 """
659 return self._swigobj.spwsforbaseband(baseband, sqldmode)
661 def spwfordatadesc(self, ddid=int(-1)):
662 """Get the spectral window ID associated with the specified data description ID. If the specified data description ID
663 is negative, an array of spectral window IDs is returned. The indices of that array represent data description IDs.
665 """
666 return self._swigobj.spwfordatadesc(ddid)
668 def spwsforfield(self, field=''):
669 """Get an array of the unique spectral window IDs for the specified field.
671 """
672 return self._swigobj.spwsforfield(field)
674 def spwsforfields(self):
675 """Get a dictionary which maps field IDs to spectral window IDs. The field IDs are keys in the
676 returned dictionary. To access a particular element, one must ensure the key is a string.
678 """
679 return self._swigobj.spwsforfields()
681 def spwsforintent(self, intent=''):
682 """Get an array of the unique spectral window IDs for the specified intent. The "*" character matches any number of characters from all character classes.
684 """
685 return self._swigobj.spwsforintent(intent)
687 def spwsfornames(self, spwids=''):
688 """Get the IDs of the specified spw(s). Returns a dictionary where the keys
689 are the requested spectral window names that are present in the data set
690 and the values are arrays of the spectral window IDs corresponding to the
691 name. If a specified name is not present, a warning message is logged and
692 that name is not included in the returned dictionary. Specifying no names
693 results in a dictionary containing the name to spw ID mapping for the
694 entire data set.
696 """
697 return self._swigobj.spwsfornames(spwids)
699 def spwsforscan(self, scan=int(-1), obsid=int(-1), arrayid=int(-1)):
700 """Get an array of the unique spectral window IDs for the specified scan number, observation ID, and array ID.
702 """
703 return self._swigobj.spwsforscan(scan, obsid, arrayid)
705 def spwsforscans(self, obsid=int(0), arrayid=int(0)):
706 """Get a dictionary of which maps scan number to spectral windows for the specified observation ID and array ID. The keys (scan
707 numbers) will be strings. obsid and arrayid must both be non-negative.
709 """
710 return self._swigobj.spwsforscans(obsid, arrayid)
712 def subwindows(self, spwids=''):
713 """ALMA-only. Returns an integer array containing the subwindow of
714 the specified spw(s). The spw name is checked to determine if
715 the subwindow value is encoded within it. A return value of -1
716 indicates that a subwindow number could be determined.
718 """
719 return self._swigobj.subwindows(spwids)
721 def statesforscan(self, scan=int(-1), obsid=int(-1), arrayid=int(-1)):
722 """Get an array of the unique state IDs for the specified scan number, observation ID, and array ID.
724 """
725 return self._swigobj.statesforscan(scan, obsid, arrayid)
727 def statesforscans(self, obsid=int(0), arrayid=int(0)):
728 """Get a dictionary which maps scan numbers to state IDs for the specified array and observation IDs. The returned dictionary
729 will have scan numbers, as strings, as keys.
731 """
732 return self._swigobj.statesforscans(obsid, arrayid)
734 def summary(self):
735 """Get dictionary summarizing the MS.
737 """
738 return self._swigobj.summary()
740 def tdmspws(self):
741 """Get an array of spectral window IDs used for TDM. These windows
742 are defined by the rules in the description of the method
743 almaspws().
745 """
746 return self._swigobj.tdmspws()
748 def timerangeforobs(self, obsid=int(-1)):
749 """Get the time range for the specified observation ID. The return value is a dictionary containing
750 keys "begin" and "end". Each of the associated value are dictionaries representing epochs which
751 are valid measure records. The values are taken directly from the OBSERVATION subtable; no
752 half-intervals are added or subtracted.
754 """
755 return self._swigobj.timerangeforobs(obsid)
757 def timesforfield(self, field=int(-1)):
758 """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.
760 """
761 return self._swigobj.timesforfield(field)
763 def timesforintent(self, intent=''):
764 """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.
766 """
767 return self._swigobj.timesforintent(intent)
769 def timesforscan(self, scan=int(-1), obsid=int(-1), arrayid=int(-1), perspw=False):
770 """Get the unique times for the specified scan number, observation ID, and array ID. If perspw=True, the returned data structure is
771 a dictionary that has keys representing zero-based spectral window IDs and values representing the unique values of the TIME column
772 corrsponding to the specified scan and that corresponding spectral window ID. If False, an array of unique values from the TIME
773 column for the specified scan is returned; there is no separation into spectral window IDs.
775 """
776 return self._swigobj.timesforscan(scan, obsid, arrayid, perspw)
778 def timesforscans(self, scans=int(0), obsid=int(-1), arrayid=int(-1)):
779 """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.
781 """
782 return self._swigobj.timesforscans(scans, obsid, arrayid)
784 def timesforspws(self, spw=int(-1)):
785 """Get the unique times corresponding to the specified spectral window(s). The input indicates the
786 spws for which times are to be retrieved, and can be a single integer or an array of
787 integers. If a single, non-negative integer, an array of unique times associated with
788 that spectral window are returned. Otherwise, a dictionary of times associated with the
789 specified spectral windows are returned, with the spws (as strings) as the keys and the
790 times as the values. A negative integer will cause a dictionary of all spws and their
791 associated times to be returned.
793 """
794 return self._swigobj.timesforspws(spw)
796 def transitions(self, sourceid=int(0), spw=int(0)):
797 """Get the spectral transitions from the SOURCE table for the specified source and spectral window.
798 The return value will be an array of transitions if the transitions are
799 defined for the specified inputs, or False if they do not.
801 """
802 return self._swigobj.transitions(sourceid, spw)
804 def wvrspws(self, complement=False):
805 """Get an array of spectral window IDs used for WVR. These are windows that have 4 channels.
806 If complement is True, return the complement set instead (all non-wvr spw IDs). WVR windows
807 are identified using the algorithm
808 1. check for water vapor radiometer (WVR) spectral windows using the spectral window
809 name "WVR#NOMINAL" and report these.
810 2. If no SPWs match that string, then the names are checked for "WVR" and are reported instead.
812 """
813 return self._swigobj.wvrspws(complement)