Coverage for /wheeldirectory/casa-6.7.0-12-py3.10.el8/lib/py/lib/python3.10/site-packages/casatools/__casac__/msmetadata.py: 58%
298 statements
« prev ^ index » next coverage.py v7.6.4, created at 2024-10-31 19:53 +0000
« prev ^ index » next coverage.py v7.6.4, created at 2024-10-31 19:53 +0000
1# This file was automatically generated by SWIG (http://www.swig.org).
2# Version 3.0.12
3#
4# Do not make changes to this file unless you know what you are doing--modify
5# the SWIG interface file instead.
7from sys import version_info as _swig_python_version_info
8if _swig_python_version_info >= (2, 7, 0):
9 def swig_import_helper():
10 import importlib
11 pkg = __name__.rpartition('.')[0]
12 mname = '.'.join((pkg, '_msmetadata')).lstrip('.')
13 try:
14 return importlib.import_module(mname)
15 except ImportError:
16 return importlib.import_module('_msmetadata')
17 _msmetadata = swig_import_helper()
18 del swig_import_helper
19elif _swig_python_version_info >= (2, 6, 0):
20 def swig_import_helper():
21 from os.path import dirname
22 import imp
23 fp = None
24 try:
25 fp, pathname, description = imp.find_module('_msmetadata', [dirname(__file__)])
26 except ImportError:
27 import _msmetadata
28 return _msmetadata
29 try:
30 _mod = imp.load_module('_msmetadata', fp, pathname, description)
31 finally:
32 if fp is not None:
33 fp.close()
34 return _mod
35 _msmetadata = swig_import_helper()
36 del swig_import_helper
37else:
38 import _msmetadata
39del _swig_python_version_info
41try:
42 _swig_property = property
43except NameError:
44 pass # Python < 2.2 doesn't have 'property'.
46try:
47 import builtins as __builtin__
48except ImportError:
49 import __builtin__
51def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
52 if (name == "thisown"):
53 return self.this.own(value)
54 if (name == "this"):
55 if type(value).__name__ == 'SwigPyObject':
56 self.__dict__[name] = value
57 return
58 method = class_type.__swig_setmethods__.get(name, None)
59 if method:
60 return method(self, value)
61 if (not static):
62 if _newclass:
63 object.__setattr__(self, name, value)
64 else:
65 self.__dict__[name] = value
66 else:
67 raise AttributeError("You cannot add attributes to %s" % self)
70def _swig_setattr(self, class_type, name, value):
71 return _swig_setattr_nondynamic(self, class_type, name, value, 0)
74def _swig_getattr(self, class_type, name):
75 if (name == "thisown"):
76 return self.this.own()
77 method = class_type.__swig_getmethods__.get(name, None)
78 if method:
79 return method(self)
80 raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name))
83def _swig_repr(self):
84 try:
85 strthis = "proxy of " + self.this.__repr__()
86 except __builtin__.Exception:
87 strthis = ""
88 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
90try:
91 _object = object
92 _newclass = 1
93except __builtin__.Exception:
94 class _object:
95 pass
96 _newclass = 0
98class msmetadata(_object):
99 """Proxy of C++ casac::msmetadata class."""
101 __swig_setmethods__ = {}
102 __setattr__ = lambda self, name, value: _swig_setattr(self, msmetadata, name, value)
103 __swig_getmethods__ = {}
104 __getattr__ = lambda self, name: _swig_getattr(self, msmetadata, name)
105 __repr__ = _swig_repr
107 def __init__(self):
108 """__init__(self) -> msmetadata"""
109 this = _msmetadata.new_msmetadata()
110 try:
111 self.this.append(this)
112 except __builtin__.Exception:
113 self.this = this
115 def almaspws(self, *args, **kwargs):
116 """
117 almaspws(self, _chavg, _fdm, _sqld, _tdm, _wvr, _complement) -> std::vector< long >
121 Summary:
122 Get a list of spectral window IDs with ALMA-specific attributes.
124 Description:
127 Get spectral window IDs based on ALMA-specific criteria. The inputs are or'ed together
128 to form the returned list. If complement=True, then the complement of the selection
129 is returned.
131 If the SPECTRAL_WINDOW table has the optional BBC_NO column and if the name
132 of the spectral window matches the regular expression 'BB_[0-9]#SQLD', where
133 [0-9] indicates that a single integer matches, the window is classified as
134 a *square law detector spectral window*.
136 The following algorithm is used to identify WVR spwectral windows:
138 1. check for water vapor radiometer (WVR) spectral windows using the spectral window
139 name 'WVR#NOMINAL' and report these.
140 2. If no SPWs match that string, then the names are checked for 'WVR' and are reported instead.
142 If the window is not found to be a WVR window, it is then checked if
144 The window is classified as a *channel average spectral window* if it is not
145 a WVR window, if the number of channels is one, and the spectral window name
146 does not contain the string 'FULL_RES'
148 The window is classified as an *FDM window* if it is neither a WVR window nor
149 a channel average window and if either
151 1. its bandwidth is less than 2 GHz, or
152 2. the number of channels it contains is greater than or equal to 15 but not
153 equal to 256, 128, 64, 32, 16, 248, 124, 62, or 31.
155 The window is classified as a *TDM spectral window* if it is neither a WVR window,
156 a channel average window, nor an FDM window.
160 Input Parameters:
161 chavg Get channel average spectral windows?
162 fdm Get FDM spectral windows?
163 sqld Get square law (i.e. total power) detector spectral windows?
164 tdm Get TDM spectral windows?
165 wvr Get WVR spectral windows?
166 complement Return the complement of the selected set?
168 Example:
170 msmd.open('my.ms')
171 # get all square law detector spectral window IDs
172 msmd.almaspws(sqld=True)
173 # get all spectral window IDs other than those associated with square law detectors
174 msmd.almaspws(sqld=True, complement=True)
176 --------------------------------------------------------------------------------
178 """
179 return _msmetadata.msmetadata_almaspws(self, *args, **kwargs)
182 def antennadiameter(self, *args, **kwargs):
183 """
184 antennadiameter(self, _antenna) -> record *
188 Summary:
189 Get the diameter for the specified antenna.
191 Description:
194 Get the diameter for the specified antenna. The antenna can be specified either by
195 its zero-based ID from the ANTENNA table or by its name in that table. The returned
196 dictionary is a valid quantity. If a negative integer is provided for the antenna, then
197 all atenna diameters will be returned in a dictionary that has keys that are the antenna IDs
198 and values that are dictionaries, each being a valid quantity representing the diameter for
199 that antenna ID.
202 Input Parameters:
203 antenna Zero-based antenna in the ANTENNA table, or antenna name. A negative integer will cause all antenna diameters to be returned.
205 Example:
207 msmd.open('my.ms')
208 # Get the diameter of the antenna named 'VB2'
209 diameter = msmd.antennadiameter('VB2')
210 msmd.done()
212 --------------------------------------------------------------------------------
214 """
215 return _msmetadata.msmetadata_antennadiameter(self, *args, **kwargs)
218 def antennaids(self, *args, **kwargs):
219 """
220 antennaids(self, _name, _mindiameter, _maxdiameter, _obsid) -> std::vector< long >
224 Summary:
225 Get the zero-based antenna ID for the specfied antenna name.
227 Description:
230 Get the zero-based antenna IDs for the specfied antenna names and the specified diameter
231 range for the specified observation ID. An array of unique IDs in order of the specified names is returned.
232 Note that if a specified name is listed mulitple times in the ANTENNA table, the largest
233 ID is returned, unless the observation ID is specified to be non-negative, in which case, the
234 returned IDs are filtered based on the specified observation ID.
235 If no names and no diameter range is specified, all IDs are returned.
238 Input Parameters:
239 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.
240 mindiameter Minimum antenna diameter, expressed as a quantity.
241 maxdiameter Maximum antenna diameter, expressed as a quantity.
242 obsid Observation ID. If negative, all observation IDs are considered.
244 Example:
246 msmd.open('my.ms')
247 # get the zero-based antenna IDs for the antenna named 'VB2'
248 antenna_id = msmd.antennaids('VB2')[0]
249 # get the zero-based antenna IDs for all antennas with diameters between 9m and 11m
250 antenna_ids = msmd.antennaids(mindiameter='9m', maxdiameter=qa.quantity('11m'))
251 msmd.done()
253 --------------------------------------------------------------------------------
255 """
256 return _msmetadata.msmetadata_antennaids(self, *args, **kwargs)
259 def antennanames(self, *args, **kwargs):
260 """
261 antennanames(self, _antennaids) -> std::vector< std::string >
265 Summary:
266 Get the names of the antennas for the specfied zero-based antenna IDs.
268 Description:
271 Get the name of the antenna for the specfied zero-based antenna ID. If antennaids is not specified,
272 all antenna names are returned.
275 Input Parameters:
276 antennaids Zero-based antenna IDs (int or int array) for which to get the antenna names.
278 Example:
280 msmd.open('my.ms')
281 # get the name associated with antenna ID 31
282 antenna_name = msmd.antennanames(31)[0]
283 msmd.done()
285 --------------------------------------------------------------------------------
287 """
288 return _msmetadata.msmetadata_antennanames(self, *args, **kwargs)
291 def antennaoffset(self, *args, **kwargs):
292 """
293 antennaoffset(self, _which) -> record *
297 Summary:
298 Get the offset position of the specified antenna relative to the array reference position.
300 Description:
303 Get the offset position of the specified antenna relative to the array reference position. Antenna may
304 be specified as a zero-based integer (row number in the ANTENNA table) or a string representing a valid
305 antenna name. The returned
306 record contains the longitude, latitude, and elevation offsets as quantity records. The reported longitude and
307 latitude offsets are measured along the surface of a sphere whose center is coincident with the center of
308 the earth and whose surface contains the observatory reference position.
311 Input Parameters:
312 which Zero-based antenna in the ANTENNA table, or antenna name.
314 Example:
316 msmd.open('my.ms')
317 # get the offset of the (zero-based) 3rd antenna in the ANTENNA table
318 antennna_offset = msmd.antennaoffset(3)
319 # get the offset of antenna DV02
320 antennna_offset = msmd.antennaoffset('DV02')
321 msmd.done()
323 --------------------------------------------------------------------------------
325 """
326 return _msmetadata.msmetadata_antennaoffset(self, *args, **kwargs)
329 def antennaposition(self, *args, **kwargs):
330 """
331 antennaposition(self, _which) -> record *
335 Summary:
336 Get the position of the specified antenna.
338 Description:
341 Get the position of the specified antenna. The returned record represents a position measure,
342 and can be used as such by the measures (me) tool.
345 Input Parameters:
346 which Zero-based antenna ID in the ANTENNA table or antenna name.
348 Example:
350 msmd.open('my.ms')
351 # get the position of the (zero-based) 3rd antenna in the ANTENNA table
352 antennna_position = msmd.antennaposition(3)
353 # get the position of the antenna named DV07
354 antennna_position = msmd.antennaposition('DV07')
355 msmd.done()
357 --------------------------------------------------------------------------------
359 """
360 return _msmetadata.msmetadata_antennaposition(self, *args, **kwargs)
363 def antennastations(self, *args, **kwargs):
364 """
365 antennastations(self, _which, _obsid) -> std::vector< std::string >
369 Summary:
370 Get the station names of the specified antennas.
372 Description:
375 Get the station names of the specified antennas. If a specified antenna name is listed multiple
376 times in the ANTENNA table, obsid is negative, and which is specified as an array of names, then
377 the station associated with the largest ID for that antenna is returned. If obsid is nonnegative,
378 returned stations are filtered based on that. If which is specified as a string (antenna name),
379 then all the stations associated with that antenna are returned.
382 Input Parameters:
383 which Zero-based antenna ID(s) in the ANTENNA table or antenna name(s). Single numeric id less than zero retrieves all station names.
384 obsid Observation ID. If negative, all observation IDs are considered.
386 Example:
388 msmd.open('my.ms')
389 # get all station names
390 stations = msmd.antennastations(-1)
391 # get the stations of the antennas named DV07 and DV01
392 stations = msmd.antennaposition(['DV07', 'DV01'])
393 msmd.done()
395 --------------------------------------------------------------------------------
397 """
398 return _msmetadata.msmetadata_antennastations(self, *args, **kwargs)
401 def antennasforscan(self, *args, **kwargs):
402 """
403 antennasforscan(self, _scan, _obsid, _arrayid) -> std::vector< long >
407 Summary:
408 Get an array of the unique antenna IDs for the specified scan, obsservation ID, and array ID.
410 Description:
413 Get an array of the unique antennaIDs for the specified scan, observation ID, and array ID.
416 Input Parameters:
417 scan Scan number for which to return the intents.
418 obsid Observation ID. If less than 0, all observation IDs are used.
419 arrayid Array ID. If less than 0, all array IDs are used.
421 Example:
423 msmd.open('my.ms')
424 # get the antennas associated with scan 4 (all observation IDs, all array IDs)
425 antennas = msmd.antennasforscan(4)
426 msmd.done()
428 --------------------------------------------------------------------------------
430 """
431 return _msmetadata.msmetadata_antennasforscan(self, *args, **kwargs)
434 def bandwidths(self, *args, **kwargs):
435 """
436 bandwidths(self, _spw) -> variant *
440 Summary:
441 Get the bandwidths in Hz for the specified spectral windows. If spw less than zero, return bandwidths for all spectral windows.
443 Description:
446 Get the bandwidths in Hz for the specified spectral windows. If spw less than zero, return bandwidths for all spectral windows.
449 Input Parameters:
450 spw Spectral window IDs, if integer less than zero, return bandwidths for all spectral windows.
452 Example:
454 msmd.open('my.ms')
455 # get bandwdith for spectral window 2.
456 baseband = msmd.bandwidth(2)
457 msmd.done()
459 --------------------------------------------------------------------------------
461 """
462 return _msmetadata.msmetadata_bandwidths(self, *args, **kwargs)
465 def baseband(self, *args, **kwargs):
466 """
467 baseband(self, _spw) -> long
471 Summary:
472 Get the baseband for the specified spectral window.
474 Description:
477 Get the baseband for the specified spectral window.
480 Input Parameters:
481 spw Spectral window ID.
483 Example:
485 msmd.open('my.ms')
486 # get baseband for spectral window 2.
487 baseband = msmd.baseband(2)
488 msmd.done()
490 --------------------------------------------------------------------------------
492 """
493 return _msmetadata.msmetadata_baseband(self, *args, **kwargs)
496 def baselines(self):
497 """
498 baselines(self) -> variant *
502 Summary:
503 Get a two dimensional boolean array representing baselines for data recorded in the MS.
505 Description:
508 Get a two dimensional boolean array representing baselines for data recorded in the MS. A value of True means
509 there is at least one row in the MS main table for that baseline, False means no rows for that baseline. Autocorrelation
510 'baseline' information is also present via the values along the diagonal.
513 Example:
515 msmd.open('my.ms')
516 # get the baseline matrix for this data set
517 baselines = msmd.baselines()
518 msmd.done()
520 --------------------------------------------------------------------------------
522 """
523 return _msmetadata.msmetadata_baselines(self)
526 def chanavgspws(self):
527 """
528 chanavgspws(self) -> std::vector< long >
532 Summary:
533 Get an array of spectral window IDs used for channel averages. These are windows that do have 1 channel.
535 Description:
539 Get an array of spectral window IDs used for channel averages. These are windows that do have 1 channel.
542 Example:
544 msmd.open('my.ms')
545 # get the spectral window IDs used for channel averages.
546 chan_avg_spws = msmd.chanavgspws()
547 msmd.done()
549 --------------------------------------------------------------------------------
551 """
552 return _msmetadata.msmetadata_chanavgspws(self)
555 def chaneffbws(self, *args, **kwargs):
556 """
557 chaneffbws(self, _spw, _unit, _asvel) -> std::vector< double >
561 Summary:
562 Get an array of channel effective bandwidths for the specified spectral window.
564 Description:
567 Get an array of channel effective bandwidths for the specified spectral window. The parameter
568 asvel indicates if velocity widths (True) or frequency widths (False) should be returned.
569 The unit parameter specifies the units that the returned values should have. If empty (default),
570 'Hz' will be used if asvel=False, or 'km/s' will be used if asvel=True.
573 Input Parameters:
574 spw Spectral window ID.
575 unit Desired unit of returned quantities. Empty means 'Hz' if asvel=False, 'km/s' if asvel=True.
576 asvel Should return values be equivalent velocity widths?
578 Example:
580 msmd.open('my.ms')
581 # get the channel effective bandwidths for spectral window 2, in m/s
582 chan_ebw = msmd.chaneffbws(2, 'm/s', True)
583 msmd.done()
585 --------------------------------------------------------------------------------
587 """
588 return _msmetadata.msmetadata_chaneffbws(self, *args, **kwargs)
591 def chanfreqs(self, *args, **kwargs):
592 """
593 chanfreqs(self, _spw, _unit) -> std::vector< double >
597 Summary:
598 Get an array of channel frequencies for the specified spectral window.
600 Description:
603 Get an array of channel frequencies for the specified spectral window.
606 Input Parameters:
607 spw Spectral window ID.
608 unit Convert frequencies to this unit.
610 Example:
612 msmd.open('my.ms')
613 # get the channel frequencies for spectral window 2.
614 chan_freqs = msmd.chanfreqs(2)
615 msmd.done()
617 --------------------------------------------------------------------------------
619 """
620 return _msmetadata.msmetadata_chanfreqs(self, *args, **kwargs)
623 def chanres(self, *args, **kwargs):
624 """
625 chanres(self, _spw, _unit, _asvel) -> std::vector< double >
629 Summary:
630 Get an array of channel resolutions for the specified spectral window.
632 Description:
635 Get an array of channel resolutions for the specified spectral window. The parameter
636 asvel indicates if velocity widths (True) or frequency widths (False) should be returned.
637 The unit parameter specifies the units that the returned values should have. If empty (default),
638 'Hz' will be used if asvel=False, or 'km/s' will be used if asvel=True.
641 Input Parameters:
642 spw Spectral window ID.
643 unit Desired unit of returned quantities. Empty means 'Hz' if asvel=False, 'km/s' if asvel=True.
644 asvel Should return values be equivalent velocity resolutions?
646 Example:
648 msmd.open('my.ms')
649 # get the channel resolutions for spectral window 2, in m/s
650 chan_res = msmd.chanres(2, 'm/s', True)
651 msmd.done()
653 --------------------------------------------------------------------------------
655 """
656 return _msmetadata.msmetadata_chanres(self, *args, **kwargs)
659 def chanwidths(self, *args, **kwargs):
660 """
661 chanwidths(self, _spw, _unit) -> std::vector< double >
665 Summary:
666 Get an array of channel widths for the specified spectral window.
668 Description:
671 Get an array of channel widths for the specified spectral window.
674 Input Parameters:
675 spw Spectral window ID.
676 unit Convert frequencies to this unit.
678 Example:
680 msmd.open('my.ms')
681 # get the channel widths for spectral window 2.
682 chan_freqs = msmd.chanwidths(2)
683 msmd.done()
685 --------------------------------------------------------------------------------
687 """
688 return _msmetadata.msmetadata_chanwidths(self, *args, **kwargs)
691 def close(self):
692 """
693 close(self) -> bool
697 Summary:
698 Close this tool and reclaim system resources associated with it.
700 Description:
703 This method will close the tool and reclaim system resources it has been using. Returns true if successful.
706 Example:
708 msmd.open('my.ms')
709 # do things with tool
710 # finish, close tool and free up resources.
711 msmd.close()
713 --------------------------------------------------------------------------------
715 """
716 return _msmetadata.msmetadata_close(self)
719 def corrbit(self, *args, **kwargs):
720 """
721 corrbit(self, _spw) -> variant *
725 Summary:
726 Get the value of the SPECTRAL_WINDOW::SDM_CORR_BIT column for the specified spw.
728 Description:
731 Get the value of SPECTRAL_WINDOW::SDM_CORR_BIT column for the specified spw.
732 If spw >= 0 is specified, a string value is returned. If spw <0, a list
733 of string values with length equal to the number of spectral windows is returned.
734 If the SPECTRAL_WINDOW::SDM_CORR_BIT column does not exist, either
735 'UNKNOWN' is returned if spw>=0, or a list with nspw entries of
736 'UNKNOWN' is returned if spw<0. A list of integers may also be
737 supplied for the spw parameter. In this case, all integers should be in the
738 range [0, spw-1] or an exception will be thrown. The return value will
739 be a list containing the corresponding CORR_BIT values in the order
740 of the spws specified.
743 Input Parameters:
744 spw Spectral window ID(s). May be an integer or list of integers. If integer, <0 implies all.
746 Example:
748 msmd.open('my.ms')
749 # get value of SPECTRAL_WINDOW::SDM_CORR_BIT column for spw=2.
750 cb = msmd.corrbit(spw=2)
751 msmd.done()
753 --------------------------------------------------------------------------------
755 """
756 return _msmetadata.msmetadata_corrbit(self, *args, **kwargs)
759 def corrprodsforpol(self, *args, **kwargs):
760 """
761 corrprodsforpol(self, _pol) -> variant *
765 Summary:
766 Get the correlation products associated with the specified polarization ID
768 Description:
771 Get the correlation products associated with the specified polarization ID.
774 Input Parameters:
775 pol Polarization ID. Must be nonnegative.
777 Example:
779 msmd.open('my.ms')
780 # get correlation products for polarization ID 3
781 corrprods = msmd.corrprodsforpol(3)
782 msmd.done()
784 --------------------------------------------------------------------------------
786 """
787 return _msmetadata.msmetadata_corrprodsforpol(self, *args, **kwargs)
790 def corrtypesforpol(self, *args, **kwargs):
791 """
792 corrtypesforpol(self, _pol) -> std::vector< long >
796 Summary:
797 Get the correlation types associated with the specified polarization ID
799 Description:
802 Get the correlation types associated with the specified polarization ID.
805 Input Parameters:
806 pol Polarization ID. Must be nonnegative.
808 Example:
810 msmd.open('my.ms')
811 # get correlation types for polarization ID 3
812 corrtypes = msmd.corrtypesforpol(3)
813 msmd.done()
815 --------------------------------------------------------------------------------
817 """
818 return _msmetadata.msmetadata_corrtypesforpol(self, *args, **kwargs)
821 def datadescids(self, *args, **kwargs):
822 """
823 datadescids(self, _spw, _pol) -> std::vector< long >
827 Summary:
828 Get the data description IDs associated with the specified spectral window and/or polarization ID
830 Description:
833 Get a list of data description IDs associated with the specified spectral window ID
834 and/or polarization ID. Values of less than zero for either means all IDs should be used
835 in the selection.
838 Input Parameters:
839 spw Spectral window ID. Less than zero implies any,
840 pol Polarization ID. Less than zero implies any.
842 Example:
844 msmd.open('my.ms')
845 # get all data description IDs associated with spw 2.
846 msmd.datadescids(spw=2)
847 # same as before but limit the IDs returned to those associated with
848 # polarization ID 3
849 msmd.datadescids(spw=2, pol=3)
850 msmd.done()
852 --------------------------------------------------------------------------------
854 """
855 return _msmetadata.msmetadata_datadescids(self, *args, **kwargs)
858 def done(self):
859 """
860 done(self) -> bool
864 Summary:
865 Close this tool and reclaim system resources associated with it.
867 Description:
870 This method will close the tool and reclaim system resources it has been using. Returns true if successful.
873 Example:
875 msmd.open('my.ms')
876 # do things with tool
877 # finish, close tool and free up resources.
878 msmd.done()
880 --------------------------------------------------------------------------------
882 """
883 return _msmetadata.msmetadata_done(self)
886 def effexposuretime(self):
887 """
888 effexposuretime(self) -> record *
892 Summary:
893 Get the effective exposure (on-source integration time)
895 Description:
898 Get the effective exposure time (equivalent to what might be more commonly known as total integration
899 time or total sample time) is calculated by summing over all rows in the main MS table, excluding
900 autocorrelations or rows where FLAG_ROW is false, thusly:
902 sum[over i] (exposure[i]*sum[over j](UFBW[i, j])/ncorrelations[i] )/ nmaxbaselines
904 where exposure[i] is the value of EXPOSURE for the ith row, the inner sum is performed over each correlation
905 for that row, UFBW is the unflagged fractional bandwidth is determined by summing all the widths of the
906 unflagged channels for that correlation and dividing by the total bandwidth of all spectral windows observed
907 at the timestamp of row i, ncorrelations is the number of correlations determined by the number of rows in
908 the FLAG matrix for MS row i, and nmaxbaselines is the maximum number of antenna pairs,
909 nantennas*(nantennas-1)/2, where nantennas is the number of antennas in the ANTENNA table. This method returns
910 a quantity (a dictionary having a numerical value and a string unit).
913 Example:
915 msmd.open('my.ms')
916 # get the effective exposure time.
917 exposure_time = msmd.effexposuretime()
918 msmd.done()
920 --------------------------------------------------------------------------------
922 """
923 return _msmetadata.msmetadata_effexposuretime(self)
926 def exposuretime(self, *args, **kwargs):
927 """
928 exposuretime(self, _scan, _spwid, _polid, _obsid, _arrayid) -> record *
932 Summary:
933 Get the exposure time for the specified scan, spwid, polarization ID, array ID, and observation ID.
935 Description:
938 Get the exposure time for the specified scan, spwid, polarization ID, array ID, and observation ID.
939 This is the exposure time of the record with the lowest time stamp of the records associated with
940 these parameters. Returns a quantity dictionary. If polid is not specified (or specified and negative)
941 and there is only one polarization ID in for the specified combination of scan, spwid, obsID, and
942 arrayID, then that polarization ID is used. If there are multiple polarization IDs for the
943 combination of other parameters, a list of these is logged and an empty dictionary is returned.
946 Input Parameters:
947 scan Scan number.
948 spwid Spectral window ID.
949 polid Polarization ID.
950 obsid Observation ID.
951 arrayid Array ID.
953 Example:
955 msmd.open('my.ms')
956 # get the exposure time for scan 1, spwid 2, and polid 3
957 # for obsid=0 and arrayid=0
958 integration_time = msmd.exposuretime(scan=1, spwid=2, polid=3)
959 msmd.done()
961 --------------------------------------------------------------------------------
963 """
964 return _msmetadata.msmetadata_exposuretime(self, *args, **kwargs)
967 def fdmspws(self):
968 """
969 fdmspws(self) -> std::vector< long >
973 Summary:
974 Get an array of spectral window IDs used for FDM. These are windows that do not have 64, 128, or 256 channels.
976 Description:
980 Get an array of spectral window IDs used for FDM. These are windows that do not have 64, 128, or 256 channels.
983 Example:
985 msmd.open('my.ms')
986 # get the spectral window IDs used for FDM.
987 fdm_spws = msmd.fdmspws()
988 msmd.done()
990 --------------------------------------------------------------------------------
992 """
993 return _msmetadata.msmetadata_fdmspws(self)
996 def fieldnames(self):
997 """
998 fieldnames(self) -> std::vector< std::string >
1002 Summary:
1003 Get an array of field names as they appear in the FIELD table.
1005 Description:
1008 Get an array of field names as they appear in the FIELD table.
1011 Example:
1013 msmd.open('my.ms')
1014 # get list of field names in the ms
1015 fieldnames = msmd.fieldnames()
1016 msmd.done()
1018 --------------------------------------------------------------------------------
1020 """
1021 return _msmetadata.msmetadata_fieldnames(self)
1024 def fieldsforintent(self, *args, **kwargs):
1025 """
1026 fieldsforintent(self, _intent, _asnames) -> variant *
1030 Summary:
1031 Get an array of the unique fields for the specified intent.
1033 Description:
1036 Get an array of the unique fields for the specified intent. Note that * matches any number of characters of all character classes.
1039 Input Parameters:
1040 intent Intent (case sensitive) for which to return the fields.
1041 asnames If true, return the field names. If false, return the zero-based field IDs.
1043 Example:
1045 msmd.open('my.ms')
1046 # get the field names for intent 'observe target'
1047 field_names = msmd.fieldsforintent('observe target', True, regex=False)
1048 # get the field IDs for intent 'observe target'
1049 field_IDs = msmd.fieldsforintent('observe target', False, regex=False)
1050 # get all field IDs for all intents which contain 'WVR'
1051 field_IDs = msmd.fieldsforIntent('*WVR*')
1052 msmd.done()
1054 --------------------------------------------------------------------------------
1056 """
1057 return _msmetadata.msmetadata_fieldsforintent(self, *args, **kwargs)
1060 def fieldsforname(self, *args, **kwargs):
1061 """
1062 fieldsforname(self, _name) -> std::vector< long >
1066 Summary:
1067 Get an array of the unique, zero-based field IDs for the specified field name.
1069 Description:
1072 Get an array of the unique, zero-based field IDs for the specified field name. If the field name is the
1073 empty string (the default), a list of all unique field IDs in the main table of the MS will be returned.
1076 Input Parameters:
1077 name Field name (case sensitive) for which to return the fields.
1079 Example:
1081 msmd.open('my.ms')
1082 # get the field IDs for field name 'Enceladus'
1083 fields = msmd.fieldsforname('Enceladus')
1084 msmd.done()
1086 --------------------------------------------------------------------------------
1088 """
1089 return _msmetadata.msmetadata_fieldsforname(self, *args, **kwargs)
1092 def fieldsforscan(self, *args, **kwargs):
1093 """
1094 fieldsforscan(self, _scan, _asnames, _obsid, _arrayid) -> variant *
1098 Summary:
1099 Get an array of the unique fields for the specified scan number, observation ID, and array ID.
1101 Description:
1104 Get an array of the unique fields for the specified scan number, observation ID, and array ID.
1107 Input Parameters:
1108 scan Scan number for which to return the fields.
1109 asnames If true, return the field names. If false, return the zero-based field IDs.
1110 obsid Observation ID. A negative value means use all observation IDs.
1111 arrayid Array ID. A negative value means use all array IDs.
1113 Example:
1115 msmd.open('my.ms')
1116 # get the field names for scan number 5 (for all array IDs and all observation IDs).
1117 field_names = msmd.fieldsforscan(5, True)
1118 # get the field IDs for scan number 5 (for all array IDs and all observation IDs)
1119 field_IDs = msmd.fieldsforscan(5, False)
1120 msmd.done()
1122 --------------------------------------------------------------------------------
1124 """
1125 return _msmetadata.msmetadata_fieldsforscan(self, *args, **kwargs)
1128 def fieldsforscans(self, *args, **kwargs):
1129 """
1130 fieldsforscans(self, _scans, _asnames, _obsid, _arrayid, _asmap) -> variant *
1134 Summary:
1135 Get an array or dictionary of the unique fields for the specified scan numbers, observationID, and array ID.
1137 Description:
1140 Get an array or dictionary of the unique fields for the specified scan numbers, observation ID, and array ID.
1141 If asnames=True, the values returned will be the field names, if False, they will be field IDs.
1142 If asmap=True, the structure returned will be a dictionary which maps scan number (as a string) to fields.
1143 In this case, both obsid and arrayid must be nonnegative. If asmap=False, a single array of fields is returned
1144 that matches the query. In this case, if obsid and/or arrayid are negative, then it indicates that all
1145 fields matching any obsid and/or arrayid should be returned. An empty array specified for scans means
1146 that all scans for the selected obsid and arrayid should be included.
1149 Input Parameters:
1150 scans Scan numbers for which to return the fields.
1151 asnames If true, return the field names. If false, return the zero-based field IDs.
1152 obsid Observation ID. A negative value means use all observation IDs.
1153 arrayid Array ID. A negative value means use all array IDs.
1154 asmap Return a dictionary mapping scan numbers to fields?
1156 Example:
1158 msmd.open('my.ms')
1159 # get the field names for scan numbers 5 and 10 (all obsids, all arrayids)
1160 field_names = msmd.fieldsforscan([5, 10], True)
1161 # get the field IDs for scan numbers 5 and 10 (all obsids, all arrayids)
1162 field_IDs = msmd.fieldsforscan([5, 10], False)
1163 # get mapping of scans to fields for arrayid=2 and obsid=4
1164 scans_to_fields = msmd.fieldsforscan(obsid=4, arrayid=2, asmap=True)
1165 msmd.done()
1167 --------------------------------------------------------------------------------
1169 """
1170 return _msmetadata.msmetadata_fieldsforscans(self, *args, **kwargs)
1173 def fieldsforsource(self, *args, **kwargs):
1174 """
1175 fieldsforsource(self, _source, _asnames) -> variant *
1179 Summary:
1180 Get an array of the unique fields for the specified source ID.
1182 Description:
1185 Get an array of the unique fields for the specified source.
1188 Input Parameters:
1189 source Zero-based source ID for which to return the fields.
1190 asnames If true, return the field names. If false, return the zero-based field IDs.
1192 Example:
1194 msmd.open('my.ms')
1195 # get the field names for source ID 1
1196 field_names = msmd.fieldsforsource(1, True)
1197 # get the field IDs for source ID 1
1198 field_IDs = msmd.fieldsforsource(1, False)
1199 msmd.done()
1201 --------------------------------------------------------------------------------
1203 """
1204 return _msmetadata.msmetadata_fieldsforsource(self, *args, **kwargs)
1207 def fieldsforsources(self, *args, **kwargs):
1208 """
1209 fieldsforsources(self, _asnames) -> record *
1213 Summary:
1214 Get a map of source IDs to fields.
1216 Description:
1219 Get a map of source IDs to fields. The keys (source IDs) will be strings.
1222 Input Parameters:
1223 asnames If true, return the field names. If false, return the zero-based field IDs.
1225 Example:
1227 msmd.open('my.ms')
1228 # get the source to field name map
1229 sources_to_fields = msmd.fieldsforsources(True)
1230 # access the field names for source 1
1231 field = sources_to_fields['1']
1232 msmd.done()
1234 --------------------------------------------------------------------------------
1236 """
1237 return _msmetadata.msmetadata_fieldsforsources(self, *args, **kwargs)
1240 def fieldsforspw(self, *args, **kwargs):
1241 """
1242 fieldsforspw(self, _spw, _asnames) -> variant *
1246 Summary:
1247 Get an array of the unique fields for the specified spectral window.
1249 Description:
1252 Get an array of the unique fields for the specified spectral window.
1255 Input Parameters:
1256 spw Zero-based spectral window ID for which to return the fields.
1257 asnames If true, return the field names. If false, return the zero-based field IDs.
1259 Example:
1261 msmd.open('my.ms')
1262 # get the field names for spectral window 1
1263 field_names = msmd.fieldsforspw(1, True)
1264 # get the field IDs for spectral window 1
1265 field_IDs = msmd.fieldsforspw(1, False)
1266 msmd.done()
1268 --------------------------------------------------------------------------------
1270 """
1271 return _msmetadata.msmetadata_fieldsforspw(self, *args, **kwargs)
1274 def fieldsfortimes(self, *args, **kwargs):
1275 """
1276 fieldsfortimes(self, _time, _tol) -> std::vector< long >
1280 Summary:
1281 Get an array of the unique, zero-based, field IDs for the specified time range (time-tol to time+tol).
1283 Description:
1286 Get an array of the unique, zero-based, fieldIDs for the specified time range (time-tol to time+tol).
1289 Input Parameters:
1290 time Time at center of time range.
1291 tol Time on either side of center for specifying range.
1293 Example:
1295 msmd.open('my.ms')
1296 # get the field IDs associated with the specified time range
1297 fields = msmd.fieldsfortimes(4.8428293714e+09, 20)
1298 msmd.done()
1300 --------------------------------------------------------------------------------
1302 """
1303 return _msmetadata.msmetadata_fieldsfortimes(self, *args, **kwargs)
1306 def intents(self):
1307 """
1308 intents(self) -> std::vector< std::string >
1312 Summary:
1313 Get an array of the unique intents associated with the MS.
1315 Description:
1318 Get an array of the unique intents associated with the MS.
1321 Example:
1323 msmd.open('my.ms')
1324 # get the intents associated with the MS
1325 intents = msmd.intents()
1326 msmd.done()
1328 --------------------------------------------------------------------------------
1330 """
1331 return _msmetadata.msmetadata_intents(self)
1334 def intentsforfield(self, *args, **kwargs):
1335 """
1336 intentsforfield(self, _field) -> std::vector< std::string >
1340 Summary:
1341 Get an array of the unique intents for the specified field.
1343 Description:
1346 Get an array of the unique intents for the specified field.
1349 Input Parameters:
1350 field Field ID or name for which to return the intents.
1352 Example:
1354 msmd.open('my.ms')
1355 # get the intents associated with field 4
1356 intents = msmd.intentsforfield(4)
1357 # get intents for field 'MOS'
1358 intents2 = msmd.intentsforfield('MOS')
1359 msmd.done()
1361 --------------------------------------------------------------------------------
1363 """
1364 return _msmetadata.msmetadata_intentsforfield(self, *args, **kwargs)
1367 def intentsforscan(self, *args, **kwargs):
1368 """
1369 intentsforscan(self, _scan, _obsid, _arrayid) -> std::vector< std::string >
1373 Summary:
1374 Get an array of the unique intents for the specified scan, obsservation ID, and array ID.
1376 Description:
1379 Get an array of the unique intents for the specified scan, observation ID, and array ID.
1382 Input Parameters:
1383 scan Scan number for which to return the intents.
1384 obsid Observation ID. A negative value means use all observation IDs.
1385 arrayid Array ID. A negative value means use all array IDs.
1387 Example:
1389 msmd.open('my.ms')
1390 # get the intents associated with scan 4 (all obsids, all arrayids)
1391 intents = msmd.intentsforscan(4)
1392 msmd.done()
1394 --------------------------------------------------------------------------------
1396 """
1397 return _msmetadata.msmetadata_intentsforscan(self, *args, **kwargs)
1400 def intentsforspw(self, *args, **kwargs):
1401 """
1402 intentsforspw(self, _spw) -> std::vector< std::string >
1406 Summary:
1407 Get an array of the unique intents for the specified spectral window ID.
1409 Description:
1412 Get an array of the unique intents for the specified spectral window ID.
1415 Input Parameters:
1416 spw Spectral window ID (>=0) for which to return the intents.
1418 Example:
1420 msmd.open('my.ms')
1421 # get the intents associated with spectral window ID 3
1422 intents = msmd.intentsforspw(3)
1423 msmd.done()
1425 --------------------------------------------------------------------------------
1427 """
1428 return _msmetadata.msmetadata_intentsforspw(self, *args, **kwargs)
1431 def meanfreq(self, *args, **kwargs):
1432 """
1433 meanfreq(self, _spw, _unit) -> double
1437 Summary:
1438 Get the mean frequency for the specified spectral window.
1440 Description:
1443 Get the mean frequency for the specified spectral window.
1446 Input Parameters:
1447 spw Spectral window ID.
1448 unit Convert frequencies to this unit.
1450 Example:
1452 msmd.open('my.ms')
1453 # get the mean frequency for spectral window 2.
1454 mean_freq = msmd.meanfreq(2)
1455 msmd.done()
1457 --------------------------------------------------------------------------------
1459 """
1460 return _msmetadata.msmetadata_meanfreq(self, *args, **kwargs)
1463 def name(self):
1464 """
1465 name(self) -> string
1469 Summary:
1470 Get the name of the attached MS.
1472 Description:
1475 Get the name of the attached MS.
1478 Example:
1480 msmd.open('my.ms')
1481 # get its name
1482 myname = msmd.name()
1483 msmd.done()
1485 --------------------------------------------------------------------------------
1487 """
1488 return _msmetadata.msmetadata_name(self)
1491 def namesforfields(self, *args, **kwargs):
1492 """
1493 namesforfields(self, _fieldids) -> std::vector< std::string >
1497 Summary:
1498 Get the name of the specified field.
1500 Description:
1503 Get the name of the specified field.
1506 Input Parameters:
1507 fieldids Zero-based field IDs for which to get the names (integer or interger array). Unspecified will return all field names.
1509 Example:
1511 msmd.open('my.ms')
1512 # get the name for field 8 and 2.
1513 field_names = msmd.namesforfields([8, 2])
1514 # get all field names
1515 all_field_nams = namesforfields()
1516 msmd.done()
1518 --------------------------------------------------------------------------------
1520 """
1521 return _msmetadata.msmetadata_namesforfields(self, *args, **kwargs)
1524 def namesforspws(self, *args, **kwargs):
1525 """
1526 namesforspws(self, _spwids) -> std::vector< std::string >
1530 Summary:
1531 Get the name of the specified spws.
1533 Description:
1536 Get the name of the specified spw(s).
1539 Input Parameters:
1540 spwids Zero-based spw ID(s) for which to get the names (integer or interger array). Unspecified will return all spw names.
1542 Example:
1544 msmd.open('my.ms')
1545 # get the name for spws 8 and 2.
1546 spw_names = msmd.namesforspws([8, 2])
1547 # get all spw names
1548 all_spw_names = msmd.namesforspws()
1549 msmd.done()
1551 --------------------------------------------------------------------------------
1553 """
1554 return _msmetadata.msmetadata_namesforspws(self, *args, **kwargs)
1557 def nantennas(self):
1558 """
1559 nantennas(self) -> long
1563 Summary:
1564 Get the number of antennas associated with the MS.
1566 Description:
1569 Get the number of antennas associated with the MS.
1572 Example:
1574 msmd.open('my.ms')
1575 number_of_antennas = msmd.nantennas()
1576 msmd.done()
1578 --------------------------------------------------------------------------------
1580 """
1581 return _msmetadata.msmetadata_nantennas(self)
1584 def narrays(self):
1585 """
1586 narrays(self) -> long
1590 Summary:
1591 Get the number of arrays associated with the MS from the ARRAY table.
1593 Description:
1596 Get the number of arrays associated with the MS from the ARRAY table.
1599 Example:
1601 msmd.open('my.ms')
1602 number_of_array_ids = msmd.narrays()
1603 msmd.done()
1605 --------------------------------------------------------------------------------
1607 """
1608 return _msmetadata.msmetadata_narrays(self)
1611 def nbaselines(self, *args, **kwargs):
1612 """
1613 nbaselines(self, _ac) -> long
1617 Summary:
1618 Get the number of baselines represented in the main MS table.
1620 Description:
1623 Get the number of unique baselines (antenna pairs) represented in the main MS table. This can, in theory, be less than
1624 n*(n-1)/2 (n being the number of antennas in the ANTENNA table), if data for certain baselines
1625 are not included in the main MS table. Autocorrelation 'baselines' are included in this count if ac=True.
1628 Input Parameters:
1629 ac Include auto-correlation 'baselines'?
1631 Example:
1633 msmd.open('my.ms')
1634 number_of_baselines = msmd.nbaselines()
1635 number_of_baselines_including_ac = msmd.nbaselines(True)
1636 msmd.done()
1638 --------------------------------------------------------------------------------
1640 """
1641 return _msmetadata.msmetadata_nbaselines(self, *args, **kwargs)
1644 def nchan(self, *args, **kwargs):
1645 """
1646 nchan(self, _spw) -> long
1650 Summary:
1651 Get the number of channels associated with the specified spectral window.
1653 Description:
1656 Get the number of channels associated with the specified spectral window.
1659 Input Parameters:
1660 spw Zero-based spw ID for which to get the number of channels.
1662 Example:
1664 msmd.open('my.ms')
1665 nchan = msmd.nchan(3)
1666 msmd.done()
1668 --------------------------------------------------------------------------------
1670 """
1671 return _msmetadata.msmetadata_nchan(self, *args, **kwargs)
1674 def ncorrforpol(self, *args, **kwargs):
1675 """
1676 ncorrforpol(self, _polid) -> variant *
1680 Summary:
1681 Get the number of correlations for the specified polarization ID.
1683 Description:
1686 Get the number of correlations for the specified polarization ID. If the specified polarization ID
1687 is negative, an array of numbers of correlations is returned. The indices of that array represent polarization IDs.
1690 Input Parameters:
1691 polid Zero-based polarization ID. A negative number will cause all the numbers of correlations to be returned.
1693 Example:
1695 msmd.open('my.ms')
1696 # get the number of correlations associated with polarization ID 4
1697 polid = msmd.ncorrforpol(4)
1698 # get the array of numbers of correlations from the POLARIZATION table
1699 polids = msmd.ncorrforpol(-1)
1700 msmd.done()
1702 --------------------------------------------------------------------------------
1704 """
1705 return _msmetadata.msmetadata_ncorrforpol(self, *args, **kwargs)
1708 def nfields(self):
1709 """
1710 nfields(self) -> long
1714 Summary:
1715 Get the number of fields associated with the MS.
1717 Description:
1720 Get the number of fields associated with the MS.
1723 Example:
1725 msmd.open('my.ms')
1726 number_of_fields = msmd.nfields()
1727 msmd.done()
1729 --------------------------------------------------------------------------------
1731 """
1732 return _msmetadata.msmetadata_nfields(self)
1735 def nobservations(self):
1736 """
1737 nobservations(self) -> long
1741 Summary:
1742 Get the number of observations associated with the MS from the OBSERVATIONS table.
1744 Description:
1747 Get the number of observations associated with the MS from the OBSERVATIONS table.
1750 Example:
1752 msmd.open('my.ms')
1753 number_of_obs_ids = msmd.nobservations()
1754 msmd.done()
1756 --------------------------------------------------------------------------------
1758 """
1759 return _msmetadata.msmetadata_nobservations(self)
1762 def nspw(self, *args, **kwargs):
1763 """
1764 nspw(self, _includewvr) -> long
1768 Summary:
1769 Get the number of spectral windows associated with the MS.
1771 Description:
1774 This method will return the number of spectral windows in the associated MS.
1777 Input Parameters:
1778 includewvr Include wvr spectral windows? If false, exclude wvr windows from count.
1780 Example:
1782 msmd.open('my.ms')
1783 number_of_spectral_windows = msmd.nspw()
1784 msmd.done()
1786 --------------------------------------------------------------------------------
1788 """
1789 return _msmetadata.msmetadata_nspw(self, *args, **kwargs)
1792 def nstates(self):
1793 """
1794 nstates(self) -> long
1798 Summary:
1799 Get the number of states (from the STATE table) associated with the MS.
1801 Description:
1804 This method will return the number of states (number of rows in the STATES table) in the associated MS.
1807 Example:
1809 msmd.open('my.ms')
1810 number_of_states = msmd.nstates()
1811 msmd.done()
1813 --------------------------------------------------------------------------------
1815 """
1816 return _msmetadata.msmetadata_nstates(self)
1819 def nscans(self):
1820 """
1821 nscans(self) -> long
1825 Summary:
1826 Get the number of scans associated with the MS.
1828 Description:
1831 Get the number of scans associated with the MS.
1834 Example:
1836 msmd.open('my.ms')
1837 number_of_scans = msmd.nscans()
1838 msmd.done()
1840 --------------------------------------------------------------------------------
1842 """
1843 return _msmetadata.msmetadata_nscans(self)
1846 def nsources(self):
1847 """
1848 nsources(self) -> long
1852 Summary:
1853 Get the number of unique values from the SOURCE_ID column in the SOURCE table.
1855 Description:
1858 Get the number of unique values from the SOURCE_ID column in the SOURCE table. The number of rows in the
1859 SOURCE table may be greater than this value.
1862 Example:
1864 msmd.open('my.ms')
1865 number_of_unique_source_ids = msmd.nsources()
1866 msmd.done()
1868 --------------------------------------------------------------------------------
1870 """
1871 return _msmetadata.msmetadata_nsources(self)
1874 def nrows(self, *args, **kwargs):
1875 """
1876 nrows(self, _autoc, _flagged) -> double
1880 Summary:
1881 Get the number of visibilities (from the main table) associated with the MS.
1883 Description:
1886 Get the number of visibilities (from the main table) associated with the MS.
1889 Input Parameters:
1890 autoc Include autocorrelation data? If False, only cross correlation rows will be summed.
1891 flagged Include flagged data? If False, only unflagged or patially flagged rows will be summed.
1893 Example:
1895 msmd.open('my.ms')
1896 # get the total number of rows
1897 nrows = msmd.nrows()
1898 # got the number of cross correlation rows
1899 ncross = msmd.nrows(auto=False)
1900 # get the number of unflagged rows
1901 ngood = msmd.nrows(flagged=False)
1902 # get the number of unflagged cross correlation rows
1903 ncrossunflagged = msmd.nrows(auto=False, flagged=False)
1904 msmd.done()
1906 --------------------------------------------------------------------------------
1908 """
1909 return _msmetadata.msmetadata_nrows(self, *args, **kwargs)
1912 def observers(self):
1913 """
1914 observers(self) -> std::vector< std::string >
1918 Summary:
1919 Get an array observers as they are listed in the OBSERVATIONS table.
1921 Description:
1924 Get an array of observers as they are listed in the OBSERVATIONS table.
1927 Example:
1929 msmd.open('my.ms')
1930 # get the observers
1931 observers = msmd.observers()
1932 msmd.done()
1934 --------------------------------------------------------------------------------
1936 """
1937 return _msmetadata.msmetadata_observers(self)
1940 def observatorynames(self):
1941 """
1942 observatorynames(self) -> std::vector< std::string >
1946 Summary:
1947 Get an array of MS telescope (observatory) names as they are listed in the OBSERVATIONS table.
1949 Description:
1952 Get an array of MS telescope (observatory) names as they are listed in the OBSERVATIONS table.
1955 Example:
1957 msmd.open('my.ms')
1958 # get the telescope names
1959 telescope_names = msmd.telescopenames()
1960 msmd.done()
1962 --------------------------------------------------------------------------------
1964 """
1965 return _msmetadata.msmetadata_observatorynames(self)
1968 def observatoryposition(self, *args, **kwargs):
1969 """
1970 observatoryposition(self, _which) -> record *
1974 Summary:
1975 Get the position of the specified telescope.
1977 Description:
1980 Get the position of the specified telescope.
1983 Input Parameters:
1984 which Zero-based telescope position in the OBSERVATIONS table (see msmd.telescopenames()).
1986 Example:
1988 msmd.open('my.ms')
1989 # get the position of the 0th telescope
1990 telescope_position = msmd.telescopeposition(0)
1991 msmd.done()
1993 --------------------------------------------------------------------------------
1995 """
1996 return _msmetadata.msmetadata_observatoryposition(self, *args, **kwargs)
1999 def open(self, *args, **kwargs):
2000 """
2001 open(self, _msfile, _maxcache) -> bool
2005 Summary:
2006 Attach the MS metadata tool to the specified MS
2008 Description:
2011 Attach this tool to the specified MS. This method runs a few basic MS validation tests, and if any of these
2012 fail (which indicates that the MS is invalid), an error occurs and the tool is not attached to the MS.
2013 Note that it is ultimately the user's responsibility to ensure that the MS is valid. Running the methods
2014 of this tool on an invalid MS may result in incorrect results or even a crash of CASA. Such invalidities
2015 include any MS subtable not having appropriate information (eg, an OBSERVATION subtable not having enough rows
2016 to account for all the OBSERVATION_IDs in the main table).
2019 Input Parameters:
2020 msfile Name of the existing measurement set
2021 maxcache Maximum cache size, in megabytes, to use.
2023 Example:
2025 msmd.open('my.ms')
2026 # do stuff and close it
2027 msmd.done()
2029 --------------------------------------------------------------------------------
2031 """
2032 return _msmetadata.msmetadata_open(self, *args, **kwargs)
2035 def phasecenter(self, *args, **kwargs):
2036 """
2037 phasecenter(self, _fieldid, _epoch) -> record *
2041 Summary:
2042 Get the phasecenter direction from a field ID and time if necessary
2044 Description:
2047 Get a direction measures for the phasecenter of the field id and time specified
2050 Input Parameters:
2051 fieldid Zero-based field ID for which to get the phasecenter; default fieldid=0
2052 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. Default value means evaluate at the origin TIME in the FIELD table
2054 Example:
2056 msmd.open('my.ms')
2057 # get phasecenter for field ID 1
2058 mydir = msmd.phasecenter(1);
2059 # if the phasecenter is a polynomial or has an ephemerides attached to
2060 # it a time is needed to get the phase direction
2061 ep=me.epoch('utc', '2015/03/15/15:30:55')
2062 mydir2=msmd.phasecenter(2, ep)
2063 msmd.done()
2065 --------------------------------------------------------------------------------
2067 """
2068 return _msmetadata.msmetadata_phasecenter(self, *args, **kwargs)
2071 def pointingdirection(self, *args, **kwargs):
2072 """
2073 pointingdirection(self, _rownum, _interpolate, _initialrow) -> record *
2077 Summary:
2078 Get the pointing direction for antennas at the specified row number in the main MS table.
2080 Description:
2083 Get the pointing direction for antennas at the specified row number in the main MS table. Returns a record
2084 containing the time, antenna IDs and corresponding pointing directions.
2087 Input Parameters:
2088 rownum Row number in the main MS table.
2089 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)
2090 initialrow Initial guess of row index in pointing table to start search.
2092 Example:
2094 msmd.open('my.ms')
2095 # get the pointing directions for row ID 500
2096 dirs = msmd.pointingdirection(500)
2097 msmd.done()
2099 --------------------------------------------------------------------------------
2101 """
2102 return _msmetadata.msmetadata_pointingdirection(self, *args, **kwargs)
2105 def polidfordatadesc(self, *args, **kwargs):
2106 """
2107 polidfordatadesc(self, _ddid) -> variant *
2111 Summary:
2112 Get the polarization ID associated with the specified data description ID.
2114 Description:
2117 Get the polarization ID associated with the specified data description ID. If the specified data description ID
2118 is negative, an array of polarization IDs is returned. The indices of that array represent data description IDs.
2121 Input Parameters:
2122 ddid Zero-based data description ID. A negative number will cause all the polarization IDs to be returned.
2124 Example:
2126 msmd.open('my.ms')
2127 # get the polarization ID associated with data description ID 3
2128 polid = msmd.polidfordatadesc(3)
2129 # get the array of polarization IDs in the order they appear in the DATA_DESCRIPTION table
2130 polids = msmd.polidfordatadesc(-1)
2131 msmd.done()
2133 --------------------------------------------------------------------------------
2135 """
2136 return _msmetadata.msmetadata_polidfordatadesc(self, *args, **kwargs)
2139 def projects(self):
2140 """
2141 projects(self) -> std::vector< std::string >
2145 Summary:
2146 Get an array projects as they are listed in the OBSERVATIONS table.
2148 Description:
2151 Get an array of projects as they are listed in the OBSERVATIONS table.
2154 Example:
2156 msmd.open('my.ms')
2157 # get the projects
2158 projects = msmd.projects()
2159 msmd.done()
2161 --------------------------------------------------------------------------------
2163 """
2164 return _msmetadata.msmetadata_projects(self)
2167 def propermotions(self):
2168 """
2169 propermotions(self) -> record *
2173 Summary:
2174 Get the values of the PROPER_MOTION column from the SOURCE table.
2176 Description:
2179 Get the values of the DIRECTION column from the SOURCE table. Returns a dictionary in which the
2180 keys are the associated zero-based row numbers, represented as strings, in the SOURCE table. The
2181 associated values are two element dictionaries, with keys 'longitude' and 'latitude', containing
2182 the longitudinal and latidinal components of the proper motion, which are valid quantity dictionaries.
2185 Example:
2187 msmd.open('my.ms')
2188 # get PROPER_MOTION column values from the SOURCE table
2189 mu = msmd.propermotions()
2190 msmd.done()
2191 # the direction associated with zero-based row number 10
2192 mu10 = mu['10']
2194 --------------------------------------------------------------------------------
2196 """
2197 return _msmetadata.msmetadata_propermotions(self)
2200 def refdir(self, *args, **kwargs):
2201 """
2202 refdir(self, _field, _epoch) -> record *
2206 Summary:
2207 Get the reference direction from a field ID and time if necessary
2209 Description:
2212 Get a direction measure for the reference direction of the field and time specified
2215 Input Parameters:
2216 field Zero-based field ID or field name for which to get the reference direction; default field=0
2217 epoch Optional time, expressed as a measures epoch dictionary, if associated field has a polynomial in time reference direction or an ephemerides table attached it. Default value means evaluate at the origin TIME in the FIELD table
2219 Example:
2221 msmd.open('my.ms')
2222 # get reference direction for field ID 1
2223 mydir = msmd.refdir(1);
2224 # if the reference direction is a polynomial or has an ephemerides attached to
2225 # it a time is needed to get the reference direction
2226 ep=me.epoch('utc', '2015/03/15/15:30:55')
2227 mydir2=msmd.phasecenter(2, ep)
2228 msmd.done()
2230 --------------------------------------------------------------------------------
2232 """
2233 return _msmetadata.msmetadata_refdir(self, *args, **kwargs)
2236 def reffreq(self, *args, **kwargs):
2237 """
2238 reffreq(self, _spw) -> record *
2242 Summary:
2243 Get the reference frequency of the specified spectral window.
2245 Description:
2248 Get the reference frequency of the specified spectral window. The returned frequency is in
2249 the form of a valid measures dictionary.
2252 Input Parameters:
2253 spw Zero-based spectral window ID.
2255 Example:
2257 msmd.open('my.ms')
2258 # get the reference frequency for spw ID 20
2259 reffreq = msmd.reffreq(20)
2260 msmd.done()
2262 --------------------------------------------------------------------------------
2264 """
2265 return _msmetadata.msmetadata_reffreq(self, *args, **kwargs)
2268 def restfreqs(self, *args, **kwargs):
2269 """
2270 restfreqs(self, _sourceid, _spw) -> variant *
2274 Summary:
2275 Get the rest frequencies from the SOURCE table for the specified source and spectral window.
2277 Description:
2280 Get the rest frequencies from the SOURCE table for the specified source and spectral window.
2281 The return value will be a dictionary of frequency measures if the rest frequencies are
2282 defined for the specified inputs, or False if they do not.
2285 Input Parameters:
2286 sourceid Zero-based source ID (from the SOURCE::SOURCE_ID column).
2287 spw Zero-based spectral window ID.
2289 Example:
2291 msmd.open('my.ms')
2292 # get the rest frequencies for source ID 2 and spw ID 20
2293 reffreq = msmd.restfreqs(2, 20)
2294 msmd.done()
2296 --------------------------------------------------------------------------------
2298 """
2299 return _msmetadata.msmetadata_restfreqs(self, *args, **kwargs)
2302 def rxbands(self, *args, **kwargs):
2303 """
2304 rxbands(self, _spwids) -> std::vector< long >
2308 Summary:
2309 ALMA-specific. Get the values of the receiver bands for the specified spws.
2311 Description:
2314 ALMA-only. Returns an integer array containing the receiver band
2315 of the specified spw(s). A return value of -1 means no receiver
2316 band number could be determined. The name of the spw is first
2317 checked to determine if the receiver band value is encoded
2318 there. If not, the corresponding spectral window ID is sought in
2319 the ASDM_RECEIVER table, if it exists, and if it has less than
2320 or equal number of rows compared to the SPECTRAL_WINDOW table.
2321 If the corresponding spectral window can be found in the
2322 ASDM_RECEIVER table, then the corresponding frequencyBand column
2323 value is checked to determine if the receiver band information
2324 is encoded there. In the case where the spectral window ID is
2325 present in multiple cells of the spectralWindowId column, the
2326 first row in which the ID is found is used to determine the
2327 receiver band. If all these tests fail, -1 is returned for the
2328 specified spectral window.
2331 Input Parameters:
2332 spwids Zero-based spw ID(s) for which to get the values (integer or interger array). Unspecified will return all receiver band values.
2334 Example:
2336 msmd.open('my.ms')
2337 # get the receiver bands for spws 8 and 2.
2338 rx_bands = msmd.rxbands([8, 2])
2339 # get all receiver bands
2340 all_rx_bands = msmd.rxbands()
2341 msmd.done()
2343 --------------------------------------------------------------------------------
2345 """
2346 return _msmetadata.msmetadata_rxbands(self, *args, **kwargs)
2349 def scannumbers(self, *args, **kwargs):
2350 """
2351 scannumbers(self, _obsid, _arrayid) -> std::vector< long >
2355 Summary:
2356 Get an array of the unique scan numbers associated with the MS for the specified observation ID and array ID.
2358 Description:
2361 This method will return an array of unique scan numbers in the associated MS for the specified observation ID and array ID.
2364 Input Parameters:
2365 obsid Observation ID. A negative value indicates all observation IDs should be used.
2366 arrayid Array ID. A negative value indicates all array IDs should be used.
2368 Example:
2370 msmd.open('my.ms')
2371 # scan numbers for all obsids and all arrayids
2372 scan_numbers = msmd.scannumbers()
2373 msmd.done()
2375 --------------------------------------------------------------------------------
2377 """
2378 return _msmetadata.msmetadata_scannumbers(self, *args, **kwargs)
2381 def scansforfield(self, *args, **kwargs):
2382 """
2383 scansforfield(self, _field, _obsid, _arrayid) -> std::vector< long >
2387 Summary:
2388 Get an array of the unique scan numbers associated with the specified field, observation ID, and array ID.
2390 Description:
2393 Get an array of the unique scan numbers associated with the specified field, observation ID, and array ID.
2396 Input Parameters:
2397 field Field ID or field name (case sensitive) for which to return the scan numbers.
2398 obsid Observation ID. A negative value indicates all observation IDs should be used.
2399 arrayid Array ID. A negative value indicates all array IDs should be used.
2401 Example:
2403 msmd.open('my.ms')
2404 # get the scan numbers associated with field 'planet Z' (all obsids, all arrayids)
2405 scan_numbers = msmd.scansforfield('planet Z')
2406 # get the scan numbers associated with field ID 5 (all obsids, all arrayids)
2407 scan_numbers = msmd.scansforfield(5)
2408 msmd.done()
2410 --------------------------------------------------------------------------------
2412 """
2413 return _msmetadata.msmetadata_scansforfield(self, *args, **kwargs)
2416 def scansforfields(self, *args, **kwargs):
2417 """
2418 scansforfields(self, _obsid, _arrayid) -> record *
2422 Summary:
2423 Get a dictionary of which maps field ID to scan numbers for the specified observation ID and array ID.
2425 Description:
2428 Get a dictionary of which maps field ID to scan numbers for the specified observation ID
2429 and array ID. The keys (field IDs) will be strings. obsid and arrayid must both
2430 be non-negative.
2433 Input Parameters:
2434 obsid Observation ID. Must be non-negative.
2435 arrayid Array ID. Must be non-negative.
2437 Example:
2439 msmd.open('my.ms')
2440 # get the field - scan map for arrayID 1 and obsID 2
2441 field_to_scans = msmd.scansforfields(arrayid=1, obsid=2)
2442 # access the scans associated with field ID 2
2443 field_to_scans2 = field_to_scans['2']
2444 msmd.done()
2446 --------------------------------------------------------------------------------
2448 """
2449 return _msmetadata.msmetadata_scansforfields(self, *args, **kwargs)
2452 def scansforintent(self, *args, **kwargs):
2453 """
2454 scansforintent(self, _intent, _obsid, _arrayid) -> std::vector< long >
2458 Summary:
2459 Get an array of the unique scan numbers associated with the specified intent, observation ID, and arrayID.
2461 Description:
2464 Get an array of the unique scan numbers associated with the specified intent, observation ID, and arrayID.
2465 The '*' character matches any number of characters from all character classes.
2468 Input Parameters:
2469 intent Intent (case-sensitive) for which to return the scan numbers.
2470 obsid Observation ID. A negative value indicates all observation IDs should be used.
2471 arrayid Array ID. A negative value indicates all array IDs should be used.
2473 Example:
2475 msmd.open('my.ms')
2476 # get the scan numbers associated with intent 'detect planet X' (all obsids, all arrayids)
2477 scan_numbers = msmd.scansforintent('detect planet X', regex=False)
2478 # got all the scan numbers associated with all intents which contain 'WVR' (all obsids, all arrayids)
2479 scan_numbers = msmd.scansforintent('*WVR*')
2480 msmd.done()
2482 --------------------------------------------------------------------------------
2484 """
2485 return _msmetadata.msmetadata_scansforintent(self, *args, **kwargs)
2488 def scansforspw(self, *args, **kwargs):
2489 """
2490 scansforspw(self, _spw, _obsid, _arrayid) -> std::vector< long >
2494 Summary:
2495 Get an array of the unique scan numbers associated with the specified zero-based spectral window ID, observation ID, and array ID.
2497 Description:
2500 Get an array of the unique scan numbers associated with the specified zero-based spectral window ID, observation ID, and array ID.
2503 Input Parameters:
2504 spw Zero-based spectral window ID for which to return the scan numbers.
2505 obsid Observation ID. A negative value indicates all observation IDs should be used.
2506 arrayid Array ID. A negative value indicates all array IDs should be used.
2508 Example:
2510 msmd.open('my.ms')
2511 # get the scan numbers associated with spectral window ID 14, all obsids, all arrayids
2512 scan_numbers = msmd.scansforspw(14)
2513 msmd.done()
2515 --------------------------------------------------------------------------------
2517 """
2518 return _msmetadata.msmetadata_scansforspw(self, *args, **kwargs)
2521 def scansforspws(self, *args, **kwargs):
2522 """
2523 scansforspws(self, _obsid, _arrayid) -> record *
2527 Summary:
2528 Get a dictionary of which maps spw ID to scan numbers for the specified observation ID and array ID.
2530 Description:
2533 Get a dictionary of which maps spw ID to scan numbers for the specified observation ID
2534 and array ID. The keys (spectral window IDs) will be strings. obsid and arrayid must both
2535 be non-negative.
2538 Input Parameters:
2539 obsid Observation ID. Must be non-negative.
2540 arrayid Array ID. Must be non-negative.
2542 Example:
2544 msmd.open('my.ms')
2545 # get the spw - scan map for arrayID 1 and obsID 2
2546 spw_to_scans = msmd.scansforspws(arrayid=1, obsid=2)
2547 # access the scans associated with spw ID 2
2548 spw_to_scans2 = spw_to_scans['2']
2549 msmd.done()
2551 --------------------------------------------------------------------------------
2553 """
2554 return _msmetadata.msmetadata_scansforspws(self, *args, **kwargs)
2557 def scansforstate(self, *args, **kwargs):
2558 """
2559 scansforstate(self, _state, _obsid, _arrayid) -> std::vector< long >
2563 Summary:
2564 Get an array of the unique scan numbers for the specified state, observation ID, and array ID.
2566 Description:
2569 Get an array of the unique scan numbers for the specified state, observation ID, and array ID.
2572 Input Parameters:
2573 state ID of state for which to return the scan numbers.
2574 obsid Observation ID. A negative value indicates all observation IDs should be used.
2575 arrayid Array ID. A negative value indicates all array IDs should be used.
2577 Example:
2579 msmd.open('my.ms')
2580 # get the scan numbers associated with state 2, all obsids, all arrayids
2581 scans = msmd.scansforstate(2)
2582 msmd.done()
2584 --------------------------------------------------------------------------------
2586 """
2587 return _msmetadata.msmetadata_scansforstate(self, *args, **kwargs)
2590 def scansfortimes(self, *args, **kwargs):
2591 """
2592 scansfortimes(self, _time, _tol, _obsid, _arrayid) -> std::vector< long >
2596 Summary:
2597 Get an array of the unique scan numbers for the specified time range (time-tol to time+tol), observation ID, and array ID.
2599 Description:
2602 Get an array of the unique scan numbers for the specified time range (time-tol to time+tol), observation ID, and array ID.
2605 Input Parameters:
2606 time Time at center of time range.
2607 tol Time difference on either side of center for specifying range.
2608 obsid Observation ID. A negative value indicates all observation IDs should be used.
2609 arrayid Array ID. A negative value indicates all array IDs should be used.
2611 Example:
2613 msmd.open('my.ms')
2614 # get the scan numbers associated with the specified time range (all obsids, all array ids)
2615 scans = msmd.scansfortimes(4.84282937e+09, 20)
2616 msmd.done()
2618 --------------------------------------------------------------------------------
2620 """
2621 return _msmetadata.msmetadata_scansfortimes(self, *args, **kwargs)
2624 def schedule(self, *args, **kwargs):
2625 """
2626 schedule(self, _obsid) -> std::vector< std::string >
2630 Summary:
2631 Get the schedule information for the specified observation ID.
2633 Description:
2636 Get the schedule information for the specified observation ID.
2639 Input Parameters:
2640 obsid Observation ID.
2642 Example:
2644 msmd.open('my.ms')
2645 # get the schdule information for observation ID = 2
2646 schedule = msmd.schedule()[2]
2647 msmd.done()
2649 --------------------------------------------------------------------------------
2651 """
2652 return _msmetadata.msmetadata_schedule(self, *args, **kwargs)
2655 def sideband(self, *args, **kwargs):
2656 """
2657 sideband(self, _spw) -> long
2661 Summary:
2662 Get the sideband for the specified spectral window.
2664 Description:
2667 Get the sideband for the specified spectral window.
2670 Input Parameters:
2671 spw Spectral window ID.
2673 Example:
2675 msmd.open('my.ms')
2676 # get sideband for spectral window 2.
2677 sideband = msmd.sideband(2)
2678 msmd.done()
2680 --------------------------------------------------------------------------------
2682 """
2683 return _msmetadata.msmetadata_sideband(self, *args, **kwargs)
2686 def sourcedirs(self):
2687 """
2688 sourcedirs(self) -> record *
2692 Summary:
2693 Get the values of the DIRECTION column from the SOURCE table.
2695 Description:
2698 Get the values of the DIRECTION column from the SOURCE table. Returns a dictionary in which the
2699 keys are the associated row numbers, represented as strings, in the SOURCE table. Each value
2700 in the returned dictionary is a valid direction measure.
2703 Example:
2705 msmd.open('my.ms')
2706 # get DIRECTION column values from the SOURCE table
2707 sourcedirs = msmd.sourcedirs()
2708 msmd.done()
2709 # the direction associated with zero-based row number 10
2710 dir10 = sourcedirs['10']
2711 # convert it to B1950, using the measure interface
2712 dir10_B1950 = me.convert(dir10, 'B1950')
2714 --------------------------------------------------------------------------------
2716 """
2717 return _msmetadata.msmetadata_sourcedirs(self)
2720 def sourcetimes(self):
2721 """
2722 sourcetimes(self) -> record *
2726 Summary:
2727 Get the values of the TIME column from the SOURCE table.
2729 Description:
2732 Get the values of the TIME column from the SOURCE table. Returns a dictionary in which the
2733 keys are the associated row numbers, represented as strings, in the SOURCE table. Each value
2734 in the returned dictionary is a valid time quantity.
2737 Example:
2739 msmd.open('my.ms')
2740 # get TIME column values from the SOURCE table
2741 sourcetimes = msmd.sourcetimes()
2742 msmd.done()
2743 # the time associated with zero-based row number 10
2744 time10 = sourcetimes['10']
2746 --------------------------------------------------------------------------------
2748 """
2749 return _msmetadata.msmetadata_sourcetimes(self)
2752 def sourceidforfield(self, *args, **kwargs):
2753 """
2754 sourceidforfield(self, _field) -> long
2758 Summary:
2759 Get the source ID from the field table for the specified field ID.
2761 Description:
2764 Get the source ID from the field table for the specified field ID.
2767 Input Parameters:
2768 field Zero-based field ID for which to return the source ID from the field table.
2770 Example:
2772 msmd.open('my.ms')
2773 # get source ID associated with field ID 2
2774 sourceid = msmd.sourceidforfield(2)
2775 msmd.done()
2777 --------------------------------------------------------------------------------
2779 """
2780 return _msmetadata.msmetadata_sourceidforfield(self, *args, **kwargs)
2783 def sourceidsfromsourcetable(self):
2784 """
2785 sourceidsfromsourcetable(self) -> std::vector< long >
2789 Summary:
2790 Get the values of the SOURCE_ID column from the SOURCE table.
2792 Description:
2795 Get the values of the SOURCE_ID column from the SOURCE table. It is unfortunate that the SOURCE
2796 table has a column named SOURCE_ID, because implicitly the 'ID' of a row in an MS subtable is
2797 generally meant to reflect a row number in that table, but that is not the case for the SOURCE table.
2800 Example:
2802 msmd.open('my.ms')
2803 # get SOURCE_ID column values from the SOURCE table
2804 sourceids = msmd.sourceidsfromsourcetable()
2805 msmd.done()
2807 --------------------------------------------------------------------------------
2809 """
2810 return _msmetadata.msmetadata_sourceidsfromsourcetable(self)
2813 def sourcenames(self):
2814 """
2815 sourcenames(self) -> std::vector< std::string >
2819 Summary:
2820 Get the values of the SOURCE_NAME column from the SOURCE table.
2822 Description:
2825 Get the values of the SOURCE_NAME column from the SOURCE table.
2828 Example:
2830 msmd.open('my.ms')
2831 # get SOURCE_NAME column values from the SOURCE table
2832 sourcenames = msmd.sourcenames()
2833 msmd.done()
2835 --------------------------------------------------------------------------------
2837 """
2838 return _msmetadata.msmetadata_sourcenames(self)
2841 def spwsforbaseband(self, *args, **kwargs):
2842 """
2843 spwsforbaseband(self, _baseband, _sqldmode) -> variant *
2847 Summary:
2848 Get the spws associated with the specified baseband or dictionary that maps baseband to spws.
2850 Description:
2853 Get the spectral windows associated with the specified baseband or dictionary that maps baseband to spectral windows.
2856 Input Parameters:
2857 baseband Baseband number. If <0, return a dictionary mapping basebands to spws.
2858 sqldmode If 'include', include SQLD windows, if 'exclude', exclude SQLD windows, if 'only', include only SQLD windows. Case insenstive, inimum match honored.
2860 Example:
2862 msmd.open('my.ms')
2863 # get the spectral window IDs associated with all the basebands in this dataset
2864 basebandtospwdict = msmd.spwsforbasebands()
2865 # get an array of spws associated with baseband 2.
2866 spwsforbb2 = msmd.spwsforbasebands(2)
2867 msmd.done()
2869 --------------------------------------------------------------------------------
2871 """
2872 return _msmetadata.msmetadata_spwsforbaseband(self, *args, **kwargs)
2875 def spwfordatadesc(self, *args, **kwargs):
2876 """
2877 spwfordatadesc(self, _ddid) -> variant *
2881 Summary:
2882 Get the spectral window ID associated with the specified data description ID.
2884 Description:
2887 Get the spectral window ID associated with the specified data description ID. If the specified data description ID
2888 is negative, an array of spectral window IDs is returned. The indices of that array represent data description IDs.
2891 Input Parameters:
2892 ddid Zero-based data description ID. A negative number will cause all the spectral window IDs to be returned.
2894 Example:
2896 msmd.open('my.ms')
2897 # get the spectral window ID associated with data description ID 3
2898 spw = msmd.spwfordatadesc(3)
2899 # get the array of spectral window IDs in the order they appear in the DATA_DESCRIPTION table
2900 spws = msmd.spwfordatadesc(-1)
2901 msmd.done()
2903 --------------------------------------------------------------------------------
2905 """
2906 return _msmetadata.msmetadata_spwfordatadesc(self, *args, **kwargs)
2909 def spwsforfield(self, *args, **kwargs):
2910 """
2911 spwsforfield(self, _field) -> std::vector< long >
2915 Summary:
2916 Get an array of the unique spectral window IDs for the specified field.
2918 Description:
2921 Get an array of the unique spectral window IDs for the specified field.
2924 Input Parameters:
2925 field Field (case sensitive string or zero-based integer ID) for which to return the spectral window IDs.
2927 Example:
2929 msmd.open('my.ms')
2930 # get the spectral window IDs associated with field 'Fomalhaut'
2931 spws = msmd.spwsforfield('Fomalhaut')
2932 # get spectral window IDs associated with field ID 2
2933 spws = msmd.spwsforfield(2)
2934 msmd.done()
2936 --------------------------------------------------------------------------------
2938 """
2939 return _msmetadata.msmetadata_spwsforfield(self, *args, **kwargs)
2942 def spwsforfields(self):
2943 """
2944 spwsforfields(self) -> record *
2948 Summary:
2949 Get a dictionary which maps field IDs to spectral window IDs.
2951 Description:
2954 Get a dictionary which maps field IDs to spectral window IDs. The field IDs are keys in the
2955 returned dictionary. To access a particular element, one must ensure the key is a string.
2958 Example:
2960 msmd.open('my.ms')
2961 # get the map of field IDs to spw IDs
2962 field_to_spw_map = msmd.spwsforfields()
2963 spws_for_field_5 = field_to_spw_map[str(5)]
2964 msmd.done()
2966 --------------------------------------------------------------------------------
2968 """
2969 return _msmetadata.msmetadata_spwsforfields(self)
2972 def spwsforintent(self, *args, **kwargs):
2973 """
2974 spwsforintent(self, _intent) -> std::vector< long >
2978 Summary:
2979 Get an array of the unique spectral window IDs for the specified intent.
2981 Description:
2984 Get an array of the unique spectral window IDs for the specified intent. The '*' character matches any number of characters from all character classes.
2987 Input Parameters:
2988 intent Intent (case sensitive) for which to return the spectral window IDs.
2990 Example:
2992 msmd.open('my.ms')
2993 # get the spectral window IDs associated with 'MY COOL INTENT'
2994 spws = msmd.spwsforintent('MY COOL INTENT')
2995 # got all the spw IDs associated with all intents which contain 'WVR'
2996 scan_numbers = msmd.spwsforintent('*WVR*')
2997 msmd.done()
2998 msmd.done()
3000 --------------------------------------------------------------------------------
3002 """
3003 return _msmetadata.msmetadata_spwsforintent(self, *args, **kwargs)
3006 def spwsfornames(self, *args, **kwargs):
3007 """
3008 spwsfornames(self, _spwids) -> record *
3012 Summary:
3013 Get the IDs of the specified spw names.
3015 Description:
3018 Get the IDs of the specified spw(s). Returns a dictionary where the keys
3019 are the requested spectral window names that are present in the data set
3020 and the values are arrays of the spectral window IDs corresponding to the
3021 name. If a specified name is not present, a warning message is logged and
3022 that name is not included in the returned dictionary. Specifying no names
3023 results in a dictionary containing the name to spw ID mapping for the
3024 entire data set.
3027 Input Parameters:
3028 spwids Names of the spws for which IDs are needed (string or string array). Unspecified will return all spw names.
3030 Example:
3032 msmd.open('my.ms')
3033 # get the IDs for spws named 'CO' and 'HCN'
3034 spw_ids = msmd.spwsfornames(['CO', 'HCN'])
3035 # get the complete spw name to ID map
3036 spw_names_to_ids = msmd.spwsfornames()
3037 msmd.done()
3039 --------------------------------------------------------------------------------
3041 """
3042 return _msmetadata.msmetadata_spwsfornames(self, *args, **kwargs)
3045 def spwsforscan(self, *args, **kwargs):
3046 """
3047 spwsforscan(self, _scan, _obsid, _arrayid) -> std::vector< long >
3051 Summary:
3052 Get an array of the unique spectral window IDs for the specified scan number, observation ID, and array ID.
3054 Description:
3057 Get an array of the unique spectral window IDs for the specified scan number, observation ID, and array ID.
3060 Input Parameters:
3061 scan Scan number for which to return the spectral window IDs.
3062 obsid Observation ID. A negative value means that all observation IDs should be used.
3063 arrayid Array ID. A negative value means that all array IDs should be used.
3065 Example:
3067 msmd.open('my.ms')
3068 # get the spectral window IDs associated with scan number 20, all obsids, all arrayids.
3069 spws = msmd.spwsforscan(20)
3070 msmd.done()
3072 --------------------------------------------------------------------------------
3074 """
3075 return _msmetadata.msmetadata_spwsforscan(self, *args, **kwargs)
3078 def spwsforscans(self, *args, **kwargs):
3079 """
3080 spwsforscans(self, _obsid, _arrayid) -> record *
3084 Summary:
3085 Get a dictionary of which maps scan number to spectral windows for the specified observation ID and array ID.
3087 Description:
3090 Get a dictionary of which maps scan number to spectral windows for the specified observation ID and array ID. The keys (scan
3091 numbers) will be strings. obsid and arrayid must both be non-negative.
3094 Input Parameters:
3095 obsid Observation ID. Must be non-negative.
3096 arrayid Array ID. Must be non-negative.
3098 Example:
3100 msmd.open('my.ms')
3101 # get the scan - spw map for arrayID 1 and obsID 2
3102 scan_to_spws = msmd.spwsforscans(arrayid=1, obsid=2)
3103 # access the spws associated with scan 2
3104 spws_for_scan2 = scan_to_spws['2']
3105 msmd.done()
3107 --------------------------------------------------------------------------------
3109 """
3110 return _msmetadata.msmetadata_spwsforscans(self, *args, **kwargs)
3113 def subwindows(self, *args, **kwargs):
3114 """
3115 subwindows(self, _spwids) -> std::vector< long >
3119 Summary:
3120 ALMA-specific. Get the values of the subwindows for the specified spws.
3122 Description:
3125 ALMA-only. Returns an integer array containing the subwindow of
3126 the specified spw(s). The spw name is checked to determine if
3127 the subwindow value is encoded within it. A return value of -1
3128 indicates that a subwindow number could be determined.
3131 Input Parameters:
3132 spwids Zero-based spw ID(s) for which to get the values (integer or interger array). Unspecified will return all receiver band values.
3134 Example:
3136 msmd.open('my.ms')
3137 # get the subwindows for spws 8 and 2.
3138 sws = msmd.subwindows([8, 2])
3139 # get all subwindows
3140 all_sws = msmd.subwindows()
3141 msmd.done()
3143 --------------------------------------------------------------------------------
3145 """
3146 return _msmetadata.msmetadata_subwindows(self, *args, **kwargs)
3149 def statesforscan(self, *args, **kwargs):
3150 """
3151 statesforscan(self, _scan, _obsid, _arrayid) -> std::vector< long >
3155 Summary:
3156 Get an array of the unique state IDs for the specified scan number, observation ID, and array ID.
3158 Description:
3161 Get an array of the unique state IDs for the specified scan number, observation ID, and array ID.
3164 Input Parameters:
3165 scan Scan number for which to return the state IDs.
3166 obsid Observation ID. A negative value means that all observation IDs should be used.
3167 arrayid Array ID. A negative value means that all array IDs should be used.
3169 Example:
3171 msmd.open('my.ms')
3172 # get the state IDs associated with scan number 251, all obsids, all arrayids
3173 states = msmd.statesforscan(251)
3174 msmd.done()
3176 --------------------------------------------------------------------------------
3178 """
3179 return _msmetadata.msmetadata_statesforscan(self, *args, **kwargs)
3182 def statesforscans(self, *args, **kwargs):
3183 """
3184 statesforscans(self, _obsid, _arrayid) -> record *
3188 Summary:
3189 Get a dictionary which maps scan numbers to state IDs for the specified array and observation IDs.
3191 Description:
3194 Get a dictionary which maps scan numbers to state IDs for the specified array and observation IDs. The returned dictionary
3195 will have scan numbers, as strings, as keys.
3198 Input Parameters:
3199 obsid Observation ID, must be nonnegative.
3200 arrayid Array ID, must be nonnegative.
3202 Example:
3204 msmd.open('my.ms')
3205 # get the map of scan numbers to state IDs for arrayID=1, obsID=2
3206 scans_to_states = msmd.statesforscans(obsID=2, arrayID=1)
3207 states_for_scan_5 = scans_to_states[str(5)]
3208 msmd.done()
3210 --------------------------------------------------------------------------------
3212 """
3213 return _msmetadata.msmetadata_statesforscans(self, *args, **kwargs)
3216 def summary(self):
3217 """
3218 summary(self) -> record *
3222 Summary:
3223 Get dictionary summarizing the MS.
3225 Description:
3228 Get dictionary summarizing the MS.
3231 Example:
3233 msmd.open('my.ms')
3234 # get the summary
3235 summary = msmd.summary()
3236 msmd.done()
3238 --------------------------------------------------------------------------------
3240 """
3241 return _msmetadata.msmetadata_summary(self)
3244 def tdmspws(self):
3245 """
3246 tdmspws(self) -> std::vector< long >
3250 Summary:
3251 Get an array of spectral window IDs used for TDM. These are windows that have 64, 128, or 256 channels.
3253 Description:
3257 Get an array of spectral window IDs used for TDM. These are windows that have 64, 128, or 256 channels.
3260 Example:
3262 msmd.open('my.ms')
3263 # get the spectral window IDs used for TDM.
3264 tdm_spws = msmd.tdmspws()
3265 msmd.done()
3267 --------------------------------------------------------------------------------
3269 """
3270 return _msmetadata.msmetadata_tdmspws(self)
3273 def timerangeforobs(self, *args, **kwargs):
3274 """
3275 timerangeforobs(self, _obsid) -> record *
3279 Summary:
3280 Get the time range for the specified observation ID
3282 Description:
3285 Get the time range for the specified observation ID. The return value is a dictionary containing
3286 keys 'begin' and 'end'. Each of the associated value are dictionaries representing epochs which
3287 are valid measure records. The values are taken directly from the OBSERVATION subtable; no
3288 half-intervals are added or subtracted.
3291 Input Parameters:
3292 obsid Zero-based observation ID for which to get the time range.
3294 Example:
3296 msmd.open('my.ms')
3297 # get the time range associated with observation ID 3
3298 timerange = msmd.timerangeforobs(3)
3299 msmd.done()
3301 --------------------------------------------------------------------------------
3303 """
3304 return _msmetadata.msmetadata_timerangeforobs(self, *args, **kwargs)
3307 def timesforfield(self, *args, **kwargs):
3308 """
3309 timesforfield(self, _field) -> std::vector< double >
3313 Summary:
3314 Get an array of the unique times for the specified field.
3316 Description:
3319 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.
3322 Input Parameters:
3323 field Zero-based field ID for which to return the times.
3325 Example:
3327 msmd.open('my.ms')
3328 # get the times associated with field 3
3329 times = msmd.timesforfield(3)
3330 msmd.done()
3332 --------------------------------------------------------------------------------
3334 """
3335 return _msmetadata.msmetadata_timesforfield(self, *args, **kwargs)
3338 def timesforintent(self, *args, **kwargs):
3339 """
3340 timesforintent(self, _intent) -> std::vector< double >
3344 Summary:
3345 Get an array of the unique times for the specified intent.
3347 Description:
3350 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.
3353 Input Parameters:
3354 intent Intent for which to return the times.
3356 Example:
3358 msmd.open('my.ms')
3359 # get the times associated with intent 'myintent'
3360 times = msmd.timesforintent('myintent')
3361 msmd.done()
3363 --------------------------------------------------------------------------------
3365 """
3366 return _msmetadata.msmetadata_timesforintent(self, *args, **kwargs)
3369 def timesforscan(self, *args, **kwargs):
3370 """
3371 timesforscan(self, _scan, _obsid, _arrayid, _perspw) -> variant *
3375 Summary:
3376 Get the unique times for the specified scan number, observation ID, and array ID.
3378 Description:
3381 Get the unique times for the specified scan number, observation ID, and array ID. If perspw=True, the returned data structure is
3382 a dictionary that has keys representing zero-based spectral window IDs and values representing the unique values of the TIME column
3383 corrsponding to the specified scan and that corresponding spectral window ID. If False, an array of unique values from the TIME
3384 column for the specified scan is returned; there is no separation into spectral window IDs.
3387 Input Parameters:
3388 scan Scan number for which to return the times.
3389 obsid Observation ID. A negative value indicates all observation IDs should be used.
3390 arrayid Array ID. A negative value indicates all array IDs should be used.
3391 perspw Return output dictionary with keys representing spectral window IDs (True), or an array of all times (False).
3393 Example:
3395 msmd.open('my.ms')
3396 # get the times associated with scan number 10, all obsids, all arrayids.
3397 times = msmd.timesforscan(10)
3398 msmd.done()
3400 --------------------------------------------------------------------------------
3402 """
3403 return _msmetadata.msmetadata_timesforscan(self, *args, **kwargs)
3406 def timesforscans(self, *args, **kwargs):
3407 """
3408 timesforscans(self, _scans, _obsid, _arrayid) -> std::vector< double >
3412 Summary:
3413 Get an array of the unique times for the specified scan numbers, observation ID, and array ID.
3415 Description:
3418 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.
3421 Input Parameters:
3422 scans Scan number(s) for which to return the times.
3423 obsid Observation ID. A negative value indicates all observation IDs should be used.
3424 arrayid Array ID. A negative value indicates all array IDs should be used.
3426 Example:
3428 msmd.open('my.ms')
3429 # get the times associated with scan numbers 10 and 20, all obsids, all arrayids
3430 times = msmd.timesforscans([10,20])
3431 msmd.done()
3433 --------------------------------------------------------------------------------
3435 """
3436 return _msmetadata.msmetadata_timesforscans(self, *args, **kwargs)
3439 def timesforspws(self, *args, **kwargs):
3440 """
3441 timesforspws(self, _spw) -> variant *
3445 Summary:
3446 Get the unique times corresponding to the specified spectral window(s).
3448 Description:
3451 Get the unique times corresponding to the specified spectral window(s). The input indicates the
3452 spws for which times are to be retrieved, and can be a single integer or an array of
3453 integers. If a single, non-negative integer, an array of unique times associated with
3454 that spectral window are returned. Otherwise, a dictionary of times associated with the
3455 specified spectral windows are returned, with the spws (as strings) as the keys and the
3456 times as the values. A negative integer will cause a dictionary of all spws and their
3457 associated times to be returned.
3460 Input Parameters:
3461 spw Zero-based spectral window ID(s). A negative integer will cause the all the times for all spws to be returned.
3463 Example:
3465 msmd.open('my.ms')
3466 # get the times associated with spws 10 and 20
3467 times = msmd.timesforspws([10,20])
3468 # print the times for spw 10
3469 print times['10']
3470 msmd.done()
3472 --------------------------------------------------------------------------------
3474 """
3475 return _msmetadata.msmetadata_timesforspws(self, *args, **kwargs)
3478 def transitions(self, *args, **kwargs):
3479 """
3480 transitions(self, _sourceid, _spw) -> variant *
3484 Summary:
3485 Get the spectral transitions from the SOURCE table for the specified source and spectral window.
3487 Description:
3490 Get the spectral transitions from the SOURCE table for the specified source and spectral window.
3491 The return value will be an array of transitions if the transitions are
3492 defined for the specified inputs, or False if they do not.
3495 Input Parameters:
3496 sourceid Zero-based source ID (from the SOURCE::SOURCE_ID column).
3497 spw Zero-based spectral window ID.
3499 Example:
3501 msmd.open('my.ms')
3502 # get the transitions for source ID 2 and spw ID 20
3503 reffreq = msmd.transitions(2, 20)
3504 msmd.done()
3506 --------------------------------------------------------------------------------
3508 """
3509 return _msmetadata.msmetadata_transitions(self, *args, **kwargs)
3512 def wvrspws(self, *args, **kwargs):
3513 """
3514 wvrspws(self, _complement) -> std::vector< long >
3518 Summary:
3519 Get an array of spectral window IDs used for WVR. These are windows that have 4 channels.
3521 Description:
3525 Get an array of spectral window IDs used for WVR. These are windows that have 4 channels.
3526 If complement is True, return the complement set instead (all non-wvr spw IDs). WVR windows
3527 are identified using the algorithm
3528 1. check for water vapor radiometer (WVR) spectral windows using the spectral window
3529 name 'WVR#NOMINAL' and report these.
3530 2. If no SPWs match that string, then the names are checked for 'WVR' and are reported instead.
3533 Input Parameters:
3534 complement If True, return all non-wvr spws.
3536 Example:
3538 msmd.open('my.ms')
3539 # get the spectral window IDs used for WVR.
3540 wvr_spws = msmd.wvrspws()
3541 msmd.done()
3543 --------------------------------------------------------------------------------
3545 """
3546 return _msmetadata.msmetadata_wvrspws(self, *args, **kwargs)
3548 __swig_destroy__ = _msmetadata.delete_msmetadata
3549 __del__ = lambda self: None
3550msmetadata_swigregister = _msmetadata.msmetadata_swigregister
3551msmetadata_swigregister(msmetadata)
3553# This file is compatible with both classic and new-style classes.