Coverage for /wheeldirectory/casa-6.7.2-31-py3.12.el8/lib/py/lib/python3.12/site-packages/casatools/__casac__/msmetadata.py: 52%
298 statements
« prev ^ index » next coverage.py v7.10.1, created at 2025-07-31 10:44 +0000
« prev ^ index » next coverage.py v7.10.1, created at 2025-07-31 10:44 +0000
1# 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, or
154 3. the product of the number of polarizations and the number of
155 channels it contains exceeds 256.
157 The window is classified as a *TDM spectral window* if it is neither a WVR window,
158 a channel average window, nor an FDM window.
162 Input Parameters:
163 chavg Get channel average spectral windows?
164 fdm Get FDM spectral windows?
165 sqld Get square law (i.e. total power) detector spectral windows?
166 tdm Get TDM spectral windows?
167 wvr Get WVR spectral windows?
168 complement Return the complement of the selected set?
170 Example:
172 msmd.open('my.ms')
173 # get all square law detector spectral window IDs
174 msmd.almaspws(sqld=True)
175 # get all spectral window IDs other than those associated with square law detectors
176 msmd.almaspws(sqld=True, complement=True)
178 --------------------------------------------------------------------------------
180 """
181 return _msmetadata.msmetadata_almaspws(self, *args, **kwargs)
184 def antennadiameter(self, *args, **kwargs):
185 """
186 antennadiameter(self, _antenna) -> record *
190 Summary:
191 Get the diameter for the specified antenna.
193 Description:
196 Get the diameter for the specified antenna. The antenna can be specified either by
197 its zero-based ID from the ANTENNA table or by its name in that table. The returned
198 dictionary is a valid quantity. If a negative integer is provided for the antenna, then
199 all atenna diameters will be returned in a dictionary that has keys that are the antenna IDs
200 and values that are dictionaries, each being a valid quantity representing the diameter for
201 that antenna ID.
204 Input Parameters:
205 antenna Zero-based antenna in the ANTENNA table, or antenna name. A negative integer will cause all antenna diameters to be returned.
207 Example:
209 msmd.open('my.ms')
210 # Get the diameter of the antenna named 'VB2'
211 diameter = msmd.antennadiameter('VB2')
212 msmd.done()
214 --------------------------------------------------------------------------------
216 """
217 return _msmetadata.msmetadata_antennadiameter(self, *args, **kwargs)
220 def antennaids(self, *args, **kwargs):
221 """
222 antennaids(self, _name, _mindiameter, _maxdiameter, _obsid) -> std::vector< long >
226 Summary:
227 Get the zero-based antenna ID for the specfied antenna name.
229 Description:
232 Get the zero-based antenna IDs for the specfied antenna names and the specified diameter
233 range for the specified observation ID. An array of unique IDs in order of the specified names is returned.
234 Note that if a specified name is listed mulitple times in the ANTENNA table, the largest
235 ID is returned, unless the observation ID is specified to be non-negative, in which case, the
236 returned IDs are filtered based on the specified observation ID.
237 If no names and no diameter range is specified, all IDs are returned.
240 Input Parameters:
241 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.
242 mindiameter Minimum antenna diameter, expressed as a quantity.
243 maxdiameter Maximum antenna diameter, expressed as a quantity.
244 obsid Observation ID. If negative, all observation IDs are considered.
246 Example:
248 msmd.open('my.ms')
249 # get the zero-based antenna IDs for the antenna named 'VB2'
250 antenna_id = msmd.antennaids('VB2')[0]
251 # get the zero-based antenna IDs for all antennas with diameters between 9m and 11m
252 antenna_ids = msmd.antennaids(mindiameter='9m', maxdiameter=qa.quantity('11m'))
253 msmd.done()
255 --------------------------------------------------------------------------------
257 """
258 return _msmetadata.msmetadata_antennaids(self, *args, **kwargs)
261 def antennanames(self, *args, **kwargs):
262 """
263 antennanames(self, _antennaids) -> std::vector< std::string >
267 Summary:
268 Get the names of the antennas for the specfied zero-based antenna IDs.
270 Description:
273 Get the name of the antenna for the specfied zero-based antenna ID. If antennaids is not specified,
274 all antenna names are returned.
277 Input Parameters:
278 antennaids Zero-based antenna IDs (int or int array) for which to get the antenna names.
280 Example:
282 msmd.open('my.ms')
283 # get the name associated with antenna ID 31
284 antenna_name = msmd.antennanames(31)[0]
285 msmd.done()
287 --------------------------------------------------------------------------------
289 """
290 return _msmetadata.msmetadata_antennanames(self, *args, **kwargs)
293 def antennaoffset(self, *args, **kwargs):
294 """
295 antennaoffset(self, _which) -> record *
299 Summary:
300 Get the offset position of the specified antenna relative to the array reference position.
302 Description:
305 Get the offset position of the specified antenna relative to the array reference position. Antenna may
306 be specified as a zero-based integer (row number in the ANTENNA table) or a string representing a valid
307 antenna name. The returned
308 record contains the longitude, latitude, and elevation offsets as quantity records. The reported longitude and
309 latitude offsets are measured along the surface of a sphere whose center is coincident with the center of
310 the earth and whose surface contains the observatory reference position.
313 Input Parameters:
314 which Zero-based antenna in the ANTENNA table, or antenna name.
316 Example:
318 msmd.open('my.ms')
319 # get the offset of the (zero-based) 3rd antenna in the ANTENNA table
320 antennna_offset = msmd.antennaoffset(3)
321 # get the offset of antenna DV02
322 antennna_offset = msmd.antennaoffset('DV02')
323 msmd.done()
325 --------------------------------------------------------------------------------
327 """
328 return _msmetadata.msmetadata_antennaoffset(self, *args, **kwargs)
331 def antennaposition(self, *args, **kwargs):
332 """
333 antennaposition(self, _which) -> record *
337 Summary:
338 Get the position of the specified antenna.
340 Description:
343 Get the position of the specified antenna. The returned record represents a position measure,
344 and can be used as such by the measures (me) tool.
347 Input Parameters:
348 which Zero-based antenna ID in the ANTENNA table or antenna name.
350 Example:
352 msmd.open('my.ms')
353 # get the position of the (zero-based) 3rd antenna in the ANTENNA table
354 antennna_position = msmd.antennaposition(3)
355 # get the position of the antenna named DV07
356 antennna_position = msmd.antennaposition('DV07')
357 msmd.done()
359 --------------------------------------------------------------------------------
361 """
362 return _msmetadata.msmetadata_antennaposition(self, *args, **kwargs)
365 def antennastations(self, *args, **kwargs):
366 """
367 antennastations(self, _which, _obsid) -> std::vector< std::string >
371 Summary:
372 Get the station names of the specified antennas.
374 Description:
377 Get the station names of the specified antennas. If a specified antenna name is listed multiple
378 times in the ANTENNA table, obsid is negative, and which is specified as an array of names, then
379 the station associated with the largest ID for that antenna is returned. If obsid is nonnegative,
380 returned stations are filtered based on that. If which is specified as a string (antenna name),
381 then all the stations associated with that antenna are returned.
384 Input Parameters:
385 which Zero-based antenna ID(s) in the ANTENNA table or antenna name(s). Single numeric id less than zero retrieves all station names.
386 obsid Observation ID. If negative, all observation IDs are considered.
388 Example:
390 msmd.open('my.ms')
391 # get all station names
392 stations = msmd.antennastations(-1)
393 # get the stations of the antennas named DV07 and DV01
394 stations = msmd.antennaposition(['DV07', 'DV01'])
395 msmd.done()
397 --------------------------------------------------------------------------------
399 """
400 return _msmetadata.msmetadata_antennastations(self, *args, **kwargs)
403 def antennasforscan(self, *args, **kwargs):
404 """
405 antennasforscan(self, _scan, _obsid, _arrayid) -> std::vector< long >
409 Summary:
410 Get an array of the unique antenna IDs for the specified scan, obsservation ID, and array ID.
412 Description:
415 Get an array of the unique antennaIDs for the specified scan, observation ID, and array ID.
418 Input Parameters:
419 scan Scan number for which to return the intents.
420 obsid Observation ID. If less than 0, all observation IDs are used.
421 arrayid Array ID. If less than 0, all array IDs are used.
423 Example:
425 msmd.open('my.ms')
426 # get the antennas associated with scan 4 (all observation IDs, all array IDs)
427 antennas = msmd.antennasforscan(4)
428 msmd.done()
430 --------------------------------------------------------------------------------
432 """
433 return _msmetadata.msmetadata_antennasforscan(self, *args, **kwargs)
436 def bandwidths(self, *args, **kwargs):
437 """
438 bandwidths(self, _spw) -> casac::variant *
442 Summary:
443 Get the bandwidths in Hz for the specified spectral windows. If spw less than zero, return bandwidths for all spectral windows.
445 Description:
448 Get the bandwidths in Hz for the specified spectral windows. If spw less than zero, return bandwidths for all spectral windows.
451 Input Parameters:
452 spw Spectral window IDs, if integer less than zero, return bandwidths for all spectral windows.
454 Example:
456 msmd.open('my.ms')
457 # get bandwdith for spectral window 2.
458 baseband = msmd.bandwidth(2)
459 msmd.done()
461 --------------------------------------------------------------------------------
463 """
464 return _msmetadata.msmetadata_bandwidths(self, *args, **kwargs)
467 def baseband(self, *args, **kwargs):
468 """
469 baseband(self, _spw) -> long
473 Summary:
474 Get the baseband for the specified spectral window.
476 Description:
479 Get the baseband for the specified spectral window.
482 Input Parameters:
483 spw Spectral window ID.
485 Example:
487 msmd.open('my.ms')
488 # get baseband for spectral window 2.
489 baseband = msmd.baseband(2)
490 msmd.done()
492 --------------------------------------------------------------------------------
494 """
495 return _msmetadata.msmetadata_baseband(self, *args, **kwargs)
498 def baselines(self):
499 """
500 baselines(self) -> casac::variant *
504 Summary:
505 Get a two dimensional boolean array representing baselines for data recorded in the MS.
507 Description:
510 Get a two dimensional boolean array representing baselines for data recorded in the MS. A value of True means
511 there is at least one row in the MS main table for that baseline, False means no rows for that baseline. Autocorrelation
512 'baseline' information is also present via the values along the diagonal.
515 Example:
517 msmd.open('my.ms')
518 # get the baseline matrix for this data set
519 baselines = msmd.baselines()
520 msmd.done()
522 --------------------------------------------------------------------------------
524 """
525 return _msmetadata.msmetadata_baselines(self)
528 def chanavgspws(self):
529 """
530 chanavgspws(self) -> std::vector< long >
534 Summary:
535 Get an array of spectral window IDs used for channel averages. These are windows that do have 1 channel.
537 Description:
541 Get an array of spectral window IDs used for channel averages. These are windows that do have 1 channel.
544 Example:
546 msmd.open('my.ms')
547 # get the spectral window IDs used for channel averages.
548 chan_avg_spws = msmd.chanavgspws()
549 msmd.done()
551 --------------------------------------------------------------------------------
553 """
554 return _msmetadata.msmetadata_chanavgspws(self)
557 def chaneffbws(self, *args, **kwargs):
558 """
559 chaneffbws(self, _spw, _unit, _asvel) -> std::vector< double >
563 Summary:
564 Get an array of channel effective bandwidths for the specified spectral window.
566 Description:
569 Get an array of channel effective bandwidths for the specified spectral window. The parameter
570 asvel indicates if velocity widths (True) or frequency widths (False) should be returned.
571 The unit parameter specifies the units that the returned values should have. If empty (default),
572 'Hz' will be used if asvel=False, or 'km/s' will be used if asvel=True.
575 Input Parameters:
576 spw Spectral window ID.
577 unit Desired unit of returned quantities. Empty means 'Hz' if asvel=False, 'km/s' if asvel=True.
578 asvel Should return values be equivalent velocity widths?
580 Example:
582 msmd.open('my.ms')
583 # get the channel effective bandwidths for spectral window 2, in m/s
584 chan_ebw = msmd.chaneffbws(2, 'm/s', True)
585 msmd.done()
587 --------------------------------------------------------------------------------
589 """
590 return _msmetadata.msmetadata_chaneffbws(self, *args, **kwargs)
593 def chanfreqs(self, *args, **kwargs):
594 """
595 chanfreqs(self, _spw, _unit) -> std::vector< double >
599 Summary:
600 Get an array of channel frequencies for the specified spectral window.
602 Description:
605 Get an array of channel frequencies for the specified spectral window.
608 Input Parameters:
609 spw Spectral window ID.
610 unit Convert frequencies to this unit.
612 Example:
614 msmd.open('my.ms')
615 # get the channel frequencies for spectral window 2.
616 chan_freqs = msmd.chanfreqs(2)
617 msmd.done()
619 --------------------------------------------------------------------------------
621 """
622 return _msmetadata.msmetadata_chanfreqs(self, *args, **kwargs)
625 def chanres(self, *args, **kwargs):
626 """
627 chanres(self, _spw, _unit, _asvel) -> std::vector< double >
631 Summary:
632 Get an array of channel resolutions for the specified spectral window.
634 Description:
637 Get an array of channel resolutions for the specified spectral window. The parameter
638 asvel indicates if velocity widths (True) or frequency widths (False) should be returned.
639 The unit parameter specifies the units that the returned values should have. If empty (default),
640 'Hz' will be used if asvel=False, or 'km/s' will be used if asvel=True.
643 Input Parameters:
644 spw Spectral window ID.
645 unit Desired unit of returned quantities. Empty means 'Hz' if asvel=False, 'km/s' if asvel=True.
646 asvel Should return values be equivalent velocity resolutions?
648 Example:
650 msmd.open('my.ms')
651 # get the channel resolutions for spectral window 2, in m/s
652 chan_res = msmd.chanres(2, 'm/s', True)
653 msmd.done()
655 --------------------------------------------------------------------------------
657 """
658 return _msmetadata.msmetadata_chanres(self, *args, **kwargs)
661 def chanwidths(self, *args, **kwargs):
662 """
663 chanwidths(self, _spw, _unit) -> std::vector< double >
667 Summary:
668 Get an array of channel widths for the specified spectral window.
670 Description:
673 Get an array of channel widths for the specified spectral window.
676 Input Parameters:
677 spw Spectral window ID.
678 unit Convert frequencies to this unit.
680 Example:
682 msmd.open('my.ms')
683 # get the channel widths for spectral window 2.
684 chan_freqs = msmd.chanwidths(2)
685 msmd.done()
687 --------------------------------------------------------------------------------
689 """
690 return _msmetadata.msmetadata_chanwidths(self, *args, **kwargs)
693 def close(self):
694 """
695 close(self) -> bool
699 Summary:
700 Close this tool and reclaim system resources associated with it.
702 Description:
705 This method will close the tool and reclaim system resources it has been using. Returns true if successful.
708 Example:
710 msmd.open('my.ms')
711 # do things with tool
712 # finish, close tool and free up resources.
713 msmd.close()
715 --------------------------------------------------------------------------------
717 """
718 return _msmetadata.msmetadata_close(self)
721 def corrbit(self, *args, **kwargs):
722 """
723 corrbit(self, _spw) -> casac::variant *
727 Summary:
728 Get the value of the SPECTRAL_WINDOW::SDM_CORR_BIT column for the specified spw.
730 Description:
733 Get the value of SPECTRAL_WINDOW::SDM_CORR_BIT column for the specified spw.
734 If spw >= 0 is specified, a string value is returned. If spw <0, a list
735 of string values with length equal to the number of spectral windows is returned.
736 If the SPECTRAL_WINDOW::SDM_CORR_BIT column does not exist, either
737 'UNKNOWN' is returned if spw>=0, or a list with nspw entries of
738 'UNKNOWN' is returned if spw<0. A list of integers may also be
739 supplied for the spw parameter. In this case, all integers should be in the
740 range [0, spw-1] or an exception will be thrown. The return value will
741 be a list containing the corresponding CORR_BIT values in the order
742 of the spws specified.
745 Input Parameters:
746 spw Spectral window ID(s). May be an integer or list of integers. If integer, <0 implies all.
748 Example:
750 msmd.open('my.ms')
751 # get value of SPECTRAL_WINDOW::SDM_CORR_BIT column for spw=2.
752 cb = msmd.corrbit(spw=2)
753 msmd.done()
755 --------------------------------------------------------------------------------
757 """
758 return _msmetadata.msmetadata_corrbit(self, *args, **kwargs)
761 def corrprodsforpol(self, *args, **kwargs):
762 """
763 corrprodsforpol(self, _pol) -> casac::variant *
767 Summary:
768 Get the correlation products associated with the specified polarization ID
770 Description:
773 Get the correlation products associated with the specified polarization ID.
776 Input Parameters:
777 pol Polarization ID. Must be nonnegative.
779 Example:
781 msmd.open('my.ms')
782 # get correlation products for polarization ID 3
783 corrprods = msmd.corrprodsforpol(3)
784 msmd.done()
786 --------------------------------------------------------------------------------
788 """
789 return _msmetadata.msmetadata_corrprodsforpol(self, *args, **kwargs)
792 def corrtypesforpol(self, *args, **kwargs):
793 """
794 corrtypesforpol(self, _pol) -> std::vector< long >
798 Summary:
799 Get the correlation types associated with the specified polarization ID
801 Description:
804 Get the correlation types associated with the specified polarization ID.
807 Input Parameters:
808 pol Polarization ID. Must be nonnegative.
810 Example:
812 msmd.open('my.ms')
813 # get correlation types for polarization ID 3
814 corrtypes = msmd.corrtypesforpol(3)
815 msmd.done()
817 --------------------------------------------------------------------------------
819 """
820 return _msmetadata.msmetadata_corrtypesforpol(self, *args, **kwargs)
823 def datadescids(self, *args, **kwargs):
824 """
825 datadescids(self, _spw, _pol) -> std::vector< long >
829 Summary:
830 Get the data description IDs associated with the specified spectral window and/or polarization ID
832 Description:
835 Get a list of data description IDs associated with the specified spectral window ID
836 and/or polarization ID. Values of less than zero for either means all IDs should be used
837 in the selection.
840 Input Parameters:
841 spw Spectral window ID. Less than zero implies any,
842 pol Polarization ID. Less than zero implies any.
844 Example:
846 msmd.open('my.ms')
847 # get all data description IDs associated with spw 2.
848 msmd.datadescids(spw=2)
849 # same as before but limit the IDs returned to those associated with
850 # polarization ID 3
851 msmd.datadescids(spw=2, pol=3)
852 msmd.done()
854 --------------------------------------------------------------------------------
856 """
857 return _msmetadata.msmetadata_datadescids(self, *args, **kwargs)
860 def done(self):
861 """
862 done(self) -> bool
866 Summary:
867 Close this tool and reclaim system resources associated with it.
869 Description:
872 This method will close the tool and reclaim system resources it has been using. Returns true if successful.
875 Example:
877 msmd.open('my.ms')
878 # do things with tool
879 # finish, close tool and free up resources.
880 msmd.done()
882 --------------------------------------------------------------------------------
884 """
885 return _msmetadata.msmetadata_done(self)
888 def effexposuretime(self):
889 """
890 effexposuretime(self) -> record *
894 Summary:
895 Get the effective exposure (on-source integration time)
897 Description:
900 Get the effective exposure time (equivalent to what might be more commonly known as total integration
901 time or total sample time) is calculated by summing over all rows in the main MS table, excluding
902 autocorrelations or rows where FLAG_ROW is false, thusly:
904 sum[over i] (exposure[i]*sum[over j](UFBW[i, j])/ncorrelations[i] )/ nmaxbaselines
906 where exposure[i] is the value of EXPOSURE for the ith row, the inner sum is performed over each correlation
907 for that row, UFBW is the unflagged fractional bandwidth is determined by summing all the widths of the
908 unflagged channels for that correlation and dividing by the total bandwidth of all spectral windows observed
909 at the timestamp of row i, ncorrelations is the number of correlations determined by the number of rows in
910 the FLAG matrix for MS row i, and nmaxbaselines is the maximum number of antenna pairs,
911 nantennas*(nantennas-1)/2, where nantennas is the number of antennas in the ANTENNA table. This method returns
912 a quantity (a dictionary having a numerical value and a string unit).
915 Example:
917 msmd.open('my.ms')
918 # get the effective exposure time.
919 exposure_time = msmd.effexposuretime()
920 msmd.done()
922 --------------------------------------------------------------------------------
924 """
925 return _msmetadata.msmetadata_effexposuretime(self)
928 def exposuretime(self, *args, **kwargs):
929 """
930 exposuretime(self, _scan, _spwid, _polid, _obsid, _arrayid) -> record *
934 Summary:
935 Get the exposure time for the specified scan, spwid, polarization ID, array ID, and observation ID.
937 Description:
940 Get the exposure time for the specified scan, spwid, polarization ID, array ID, and observation ID.
941 This is the exposure time of the record with the lowest time stamp of the records associated with
942 these parameters. Returns a quantity dictionary. If polid is not specified (or specified and negative)
943 and there is only one polarization ID in for the specified combination of scan, spwid, obsID, and
944 arrayID, then that polarization ID is used. If there are multiple polarization IDs for the
945 combination of other parameters, a list of these is logged and an empty dictionary is returned.
948 Input Parameters:
949 scan Scan number.
950 spwid Spectral window ID.
951 polid Polarization ID.
952 obsid Observation ID.
953 arrayid Array ID.
955 Example:
957 msmd.open('my.ms')
958 # get the exposure time for scan 1, spwid 2, and polid 3
959 # for obsid=0 and arrayid=0
960 integration_time = msmd.exposuretime(scan=1, spwid=2, polid=3)
961 msmd.done()
963 --------------------------------------------------------------------------------
965 """
966 return _msmetadata.msmetadata_exposuretime(self, *args, **kwargs)
969 def fdmspws(self):
970 """
971 fdmspws(self) -> std::vector< long >
975 Summary:
976 Get an array of spectral window IDs used for FDM.
978 Description:
981 Get an array of spectral window IDs used for FDM. These windows
982 are defined by the rules in the description of the method
983 almaspws().
986 Example:
988 msmd.open('my.ms')
989 # get the spectral window IDs used for FDM.
990 fdm_spws = msmd.fdmspws()
991 msmd.done()
993 --------------------------------------------------------------------------------
995 """
996 return _msmetadata.msmetadata_fdmspws(self)
999 def fieldnames(self):
1000 """
1001 fieldnames(self) -> std::vector< std::string >
1005 Summary:
1006 Get an array of field names as they appear in the FIELD table.
1008 Description:
1011 Get an array of field names as they appear in the FIELD table.
1014 Example:
1016 msmd.open('my.ms')
1017 # get list of field names in the ms
1018 fieldnames = msmd.fieldnames()
1019 msmd.done()
1021 --------------------------------------------------------------------------------
1023 """
1024 return _msmetadata.msmetadata_fieldnames(self)
1027 def fieldsforintent(self, *args, **kwargs):
1028 """
1029 fieldsforintent(self, _intent, _asnames) -> casac::variant *
1033 Summary:
1034 Get an array of the unique fields for the specified intent.
1036 Description:
1039 Get an array of the unique fields for the specified intent. Note that * matches any number of characters of all character classes.
1042 Input Parameters:
1043 intent Intent (case sensitive) for which to return the fields.
1044 asnames If true, return the field names. If false, return the zero-based field IDs.
1046 Example:
1048 msmd.open('my.ms')
1049 # get the field names for intent 'observe target'
1050 field_names = msmd.fieldsforintent('observe target', True, regex=False)
1051 # get the field IDs for intent 'observe target'
1052 field_IDs = msmd.fieldsforintent('observe target', False, regex=False)
1053 # get all field IDs for all intents which contain 'WVR'
1054 field_IDs = msmd.fieldsforIntent('*WVR*')
1055 msmd.done()
1057 --------------------------------------------------------------------------------
1059 """
1060 return _msmetadata.msmetadata_fieldsforintent(self, *args, **kwargs)
1063 def fieldsforname(self, *args, **kwargs):
1064 """
1065 fieldsforname(self, _name) -> std::vector< long >
1069 Summary:
1070 Get an array of the unique, zero-based field IDs for the specified field name.
1072 Description:
1075 Get an array of the unique, zero-based field IDs for the specified field name. If the field name is the
1076 empty string (the default), a list of all unique field IDs in the main table of the MS will be returned.
1079 Input Parameters:
1080 name Field name (case sensitive) for which to return the fields.
1082 Example:
1084 msmd.open('my.ms')
1085 # get the field IDs for field name 'Enceladus'
1086 fields = msmd.fieldsforname('Enceladus')
1087 msmd.done()
1089 --------------------------------------------------------------------------------
1091 """
1092 return _msmetadata.msmetadata_fieldsforname(self, *args, **kwargs)
1095 def fieldsforscan(self, *args, **kwargs):
1096 """
1097 fieldsforscan(self, _scan, _asnames, _obsid, _arrayid) -> casac::variant *
1101 Summary:
1102 Get an array of the unique fields for the specified scan number, observation ID, and array ID.
1104 Description:
1107 Get an array of the unique fields for the specified scan number, observation ID, and array ID.
1110 Input Parameters:
1111 scan Scan number for which to return the fields.
1112 asnames If true, return the field names. If false, return the zero-based field IDs.
1113 obsid Observation ID. A negative value means use all observation IDs.
1114 arrayid Array ID. A negative value means use all array IDs.
1116 Example:
1118 msmd.open('my.ms')
1119 # get the field names for scan number 5 (for all array IDs and all observation IDs).
1120 field_names = msmd.fieldsforscan(5, True)
1121 # get the field IDs for scan number 5 (for all array IDs and all observation IDs)
1122 field_IDs = msmd.fieldsforscan(5, False)
1123 msmd.done()
1125 --------------------------------------------------------------------------------
1127 """
1128 return _msmetadata.msmetadata_fieldsforscan(self, *args, **kwargs)
1131 def fieldsforscans(self, *args, **kwargs):
1132 """
1133 fieldsforscans(self, _scans, _asnames, _obsid, _arrayid, _asmap) -> casac::variant *
1137 Summary:
1138 Get an array or dictionary of the unique fields for the specified scan numbers, observationID, and array ID.
1140 Description:
1143 Get an array or dictionary of the unique fields for the specified scan numbers, observation ID, and array ID.
1144 If asnames=True, the values returned will be the field names, if False, they will be field IDs.
1145 If asmap=True, the structure returned will be a dictionary which maps scan number (as a string) to fields.
1146 In this case, both obsid and arrayid must be nonnegative. If asmap=False, a single array of fields is returned
1147 that matches the query. In this case, if obsid and/or arrayid are negative, then it indicates that all
1148 fields matching any obsid and/or arrayid should be returned. An empty array specified for scans means
1149 that all scans for the selected obsid and arrayid should be included.
1152 Input Parameters:
1153 scans Scan numbers for which to return the fields.
1154 asnames If true, return the field names. If false, return the zero-based field IDs.
1155 obsid Observation ID. A negative value means use all observation IDs.
1156 arrayid Array ID. A negative value means use all array IDs.
1157 asmap Return a dictionary mapping scan numbers to fields?
1159 Example:
1161 msmd.open('my.ms')
1162 # get the field names for scan numbers 5 and 10 (all obsids, all arrayids)
1163 field_names = msmd.fieldsforscan([5, 10], True)
1164 # get the field IDs for scan numbers 5 and 10 (all obsids, all arrayids)
1165 field_IDs = msmd.fieldsforscan([5, 10], False)
1166 # get mapping of scans to fields for arrayid=2 and obsid=4
1167 scans_to_fields = msmd.fieldsforscan(obsid=4, arrayid=2, asmap=True)
1168 msmd.done()
1170 --------------------------------------------------------------------------------
1172 """
1173 return _msmetadata.msmetadata_fieldsforscans(self, *args, **kwargs)
1176 def fieldsforsource(self, *args, **kwargs):
1177 """
1178 fieldsforsource(self, _source, _asnames) -> casac::variant *
1182 Summary:
1183 Get an array of the unique fields for the specified source ID.
1185 Description:
1188 Get an array of the unique fields for the specified source.
1191 Input Parameters:
1192 source Zero-based source ID for which to return the fields.
1193 asnames If true, return the field names. If false, return the zero-based field IDs.
1195 Example:
1197 msmd.open('my.ms')
1198 # get the field names for source ID 1
1199 field_names = msmd.fieldsforsource(1, True)
1200 # get the field IDs for source ID 1
1201 field_IDs = msmd.fieldsforsource(1, False)
1202 msmd.done()
1204 --------------------------------------------------------------------------------
1206 """
1207 return _msmetadata.msmetadata_fieldsforsource(self, *args, **kwargs)
1210 def fieldsforsources(self, *args, **kwargs):
1211 """
1212 fieldsforsources(self, _asnames) -> record *
1216 Summary:
1217 Get a map of source IDs to fields.
1219 Description:
1222 Get a map of source IDs to fields. The keys (source IDs) will be strings.
1225 Input Parameters:
1226 asnames If true, return the field names. If false, return the zero-based field IDs.
1228 Example:
1230 msmd.open('my.ms')
1231 # get the source to field name map
1232 sources_to_fields = msmd.fieldsforsources(True)
1233 # access the field names for source 1
1234 field = sources_to_fields['1']
1235 msmd.done()
1237 --------------------------------------------------------------------------------
1239 """
1240 return _msmetadata.msmetadata_fieldsforsources(self, *args, **kwargs)
1243 def fieldsforspw(self, *args, **kwargs):
1244 """
1245 fieldsforspw(self, _spw, _asnames) -> casac::variant *
1249 Summary:
1250 Get an array of the unique fields for the specified spectral window.
1252 Description:
1255 Get an array of the unique fields for the specified spectral window.
1258 Input Parameters:
1259 spw Zero-based spectral window ID for which to return the fields.
1260 asnames If true, return the field names. If false, return the zero-based field IDs.
1262 Example:
1264 msmd.open('my.ms')
1265 # get the field names for spectral window 1
1266 field_names = msmd.fieldsforspw(1, True)
1267 # get the field IDs for spectral window 1
1268 field_IDs = msmd.fieldsforspw(1, False)
1269 msmd.done()
1271 --------------------------------------------------------------------------------
1273 """
1274 return _msmetadata.msmetadata_fieldsforspw(self, *args, **kwargs)
1277 def fieldsfortimes(self, *args, **kwargs):
1278 """
1279 fieldsfortimes(self, _time, _tol) -> std::vector< long >
1283 Summary:
1284 Get an array of the unique, zero-based, field IDs for the specified time range (time-tol to time+tol).
1286 Description:
1289 Get an array of the unique, zero-based, fieldIDs for the specified time range (time-tol to time+tol).
1292 Input Parameters:
1293 time Time at center of time range.
1294 tol Time on either side of center for specifying range.
1296 Example:
1298 msmd.open('my.ms')
1299 # get the field IDs associated with the specified time range
1300 fields = msmd.fieldsfortimes(4.8428293714e+09, 20)
1301 msmd.done()
1303 --------------------------------------------------------------------------------
1305 """
1306 return _msmetadata.msmetadata_fieldsfortimes(self, *args, **kwargs)
1309 def intents(self):
1310 """
1311 intents(self) -> std::vector< std::string >
1315 Summary:
1316 Get an array of the unique intents associated with the MS.
1318 Description:
1321 Get an array of the unique intents associated with the MS.
1324 Example:
1326 msmd.open('my.ms')
1327 # get the intents associated with the MS
1328 intents = msmd.intents()
1329 msmd.done()
1331 --------------------------------------------------------------------------------
1333 """
1334 return _msmetadata.msmetadata_intents(self)
1337 def intentsforfield(self, *args, **kwargs):
1338 """
1339 intentsforfield(self, _field) -> std::vector< std::string >
1343 Summary:
1344 Get an array of the unique intents for the specified field.
1346 Description:
1349 Get an array of the unique intents for the specified field.
1352 Input Parameters:
1353 field Field ID or name for which to return the intents.
1355 Example:
1357 msmd.open('my.ms')
1358 # get the intents associated with field 4
1359 intents = msmd.intentsforfield(4)
1360 # get intents for field 'MOS'
1361 intents2 = msmd.intentsforfield('MOS')
1362 msmd.done()
1364 --------------------------------------------------------------------------------
1366 """
1367 return _msmetadata.msmetadata_intentsforfield(self, *args, **kwargs)
1370 def intentsforscan(self, *args, **kwargs):
1371 """
1372 intentsforscan(self, _scan, _obsid, _arrayid) -> std::vector< std::string >
1376 Summary:
1377 Get an array of the unique intents for the specified scan, obsservation ID, and array ID.
1379 Description:
1382 Get an array of the unique intents for the specified scan, observation ID, and array ID.
1385 Input Parameters:
1386 scan Scan number for which to return the intents.
1387 obsid Observation ID. A negative value means use all observation IDs.
1388 arrayid Array ID. A negative value means use all array IDs.
1390 Example:
1392 msmd.open('my.ms')
1393 # get the intents associated with scan 4 (all obsids, all arrayids)
1394 intents = msmd.intentsforscan(4)
1395 msmd.done()
1397 --------------------------------------------------------------------------------
1399 """
1400 return _msmetadata.msmetadata_intentsforscan(self, *args, **kwargs)
1403 def intentsforspw(self, *args, **kwargs):
1404 """
1405 intentsforspw(self, _spw) -> std::vector< std::string >
1409 Summary:
1410 Get an array of the unique intents for the specified spectral window ID.
1412 Description:
1415 Get an array of the unique intents for the specified spectral window ID.
1418 Input Parameters:
1419 spw Spectral window ID (>=0) for which to return the intents.
1421 Example:
1423 msmd.open('my.ms')
1424 # get the intents associated with spectral window ID 3
1425 intents = msmd.intentsforspw(3)
1426 msmd.done()
1428 --------------------------------------------------------------------------------
1430 """
1431 return _msmetadata.msmetadata_intentsforspw(self, *args, **kwargs)
1434 def meanfreq(self, *args, **kwargs):
1435 """
1436 meanfreq(self, _spw, _unit) -> double
1440 Summary:
1441 Get the mean frequency for the specified spectral window.
1443 Description:
1446 Get the mean frequency for the specified spectral window.
1449 Input Parameters:
1450 spw Spectral window ID.
1451 unit Convert frequencies to this unit.
1453 Example:
1455 msmd.open('my.ms')
1456 # get the mean frequency for spectral window 2.
1457 mean_freq = msmd.meanfreq(2)
1458 msmd.done()
1460 --------------------------------------------------------------------------------
1462 """
1463 return _msmetadata.msmetadata_meanfreq(self, *args, **kwargs)
1466 def name(self):
1467 """
1468 name(self) -> string
1472 Summary:
1473 Get the name of the attached MS.
1475 Description:
1478 Get the name of the attached MS.
1481 Example:
1483 msmd.open('my.ms')
1484 # get its name
1485 myname = msmd.name()
1486 msmd.done()
1488 --------------------------------------------------------------------------------
1490 """
1491 return _msmetadata.msmetadata_name(self)
1494 def namesforfields(self, *args, **kwargs):
1495 """
1496 namesforfields(self, _fieldids) -> std::vector< std::string >
1500 Summary:
1501 Get the name of the specified field.
1503 Description:
1506 Get the name of the specified field.
1509 Input Parameters:
1510 fieldids Zero-based field IDs for which to get the names (integer or interger array). Unspecified will return all field names.
1512 Example:
1514 msmd.open('my.ms')
1515 # get the name for field 8 and 2.
1516 field_names = msmd.namesforfields([8, 2])
1517 # get all field names
1518 all_field_nams = namesforfields()
1519 msmd.done()
1521 --------------------------------------------------------------------------------
1523 """
1524 return _msmetadata.msmetadata_namesforfields(self, *args, **kwargs)
1527 def namesforspws(self, *args, **kwargs):
1528 """
1529 namesforspws(self, _spwids) -> std::vector< std::string >
1533 Summary:
1534 Get the name of the specified spws.
1536 Description:
1539 Get the name of the specified spw(s).
1542 Input Parameters:
1543 spwids Zero-based spw ID(s) for which to get the names (integer or interger array). Unspecified will return all spw names.
1545 Example:
1547 msmd.open('my.ms')
1548 # get the name for spws 8 and 2.
1549 spw_names = msmd.namesforspws([8, 2])
1550 # get all spw names
1551 all_spw_names = msmd.namesforspws()
1552 msmd.done()
1554 --------------------------------------------------------------------------------
1556 """
1557 return _msmetadata.msmetadata_namesforspws(self, *args, **kwargs)
1560 def nantennas(self):
1561 """
1562 nantennas(self) -> long
1566 Summary:
1567 Get the number of antennas associated with the MS.
1569 Description:
1572 Get the number of antennas associated with the MS.
1575 Example:
1577 msmd.open('my.ms')
1578 number_of_antennas = msmd.nantennas()
1579 msmd.done()
1581 --------------------------------------------------------------------------------
1583 """
1584 return _msmetadata.msmetadata_nantennas(self)
1587 def narrays(self):
1588 """
1589 narrays(self) -> long
1593 Summary:
1594 Get the number of arrays associated with the MS from the ARRAY table.
1596 Description:
1599 Get the number of arrays associated with the MS from the ARRAY table.
1602 Example:
1604 msmd.open('my.ms')
1605 number_of_array_ids = msmd.narrays()
1606 msmd.done()
1608 --------------------------------------------------------------------------------
1610 """
1611 return _msmetadata.msmetadata_narrays(self)
1614 def nbaselines(self, *args, **kwargs):
1615 """
1616 nbaselines(self, _ac) -> long
1620 Summary:
1621 Get the number of baselines represented in the main MS table.
1623 Description:
1626 Get the number of unique baselines (antenna pairs) represented in the main MS table. This can, in theory, be less than
1627 n*(n-1)/2 (n being the number of antennas in the ANTENNA table), if data for certain baselines
1628 are not included in the main MS table. Autocorrelation 'baselines' are included in this count if ac=True.
1631 Input Parameters:
1632 ac Include auto-correlation 'baselines'?
1634 Example:
1636 msmd.open('my.ms')
1637 number_of_baselines = msmd.nbaselines()
1638 number_of_baselines_including_ac = msmd.nbaselines(True)
1639 msmd.done()
1641 --------------------------------------------------------------------------------
1643 """
1644 return _msmetadata.msmetadata_nbaselines(self, *args, **kwargs)
1647 def nchan(self, *args, **kwargs):
1648 """
1649 nchan(self, _spw) -> long
1653 Summary:
1654 Get the number of channels associated with the specified spectral window.
1656 Description:
1659 Get the number of channels associated with the specified spectral window.
1662 Input Parameters:
1663 spw Zero-based spw ID for which to get the number of channels.
1665 Example:
1667 msmd.open('my.ms')
1668 nchan = msmd.nchan(3)
1669 msmd.done()
1671 --------------------------------------------------------------------------------
1673 """
1674 return _msmetadata.msmetadata_nchan(self, *args, **kwargs)
1677 def ncorrforpol(self, *args, **kwargs):
1678 """
1679 ncorrforpol(self, _polid) -> casac::variant *
1683 Summary:
1684 Get the number of correlations for the specified polarization ID.
1686 Description:
1689 Get the number of correlations for the specified polarization ID. If the specified polarization ID
1690 is negative, an array of numbers of correlations is returned. The indices of that array represent polarization IDs.
1693 Input Parameters:
1694 polid Zero-based polarization ID. A negative number will cause all the numbers of correlations to be returned.
1696 Example:
1698 msmd.open('my.ms')
1699 # get the number of correlations associated with polarization ID 4
1700 polid = msmd.ncorrforpol(4)
1701 # get the array of numbers of correlations from the POLARIZATION table
1702 polids = msmd.ncorrforpol(-1)
1703 msmd.done()
1705 --------------------------------------------------------------------------------
1707 """
1708 return _msmetadata.msmetadata_ncorrforpol(self, *args, **kwargs)
1711 def nfields(self):
1712 """
1713 nfields(self) -> long
1717 Summary:
1718 Get the number of fields associated with the MS.
1720 Description:
1723 Get the number of fields associated with the MS.
1726 Example:
1728 msmd.open('my.ms')
1729 number_of_fields = msmd.nfields()
1730 msmd.done()
1732 --------------------------------------------------------------------------------
1734 """
1735 return _msmetadata.msmetadata_nfields(self)
1738 def nobservations(self):
1739 """
1740 nobservations(self) -> long
1744 Summary:
1745 Get the number of observations associated with the MS from the OBSERVATIONS table.
1747 Description:
1750 Get the number of observations associated with the MS from the OBSERVATIONS table.
1753 Example:
1755 msmd.open('my.ms')
1756 number_of_obs_ids = msmd.nobservations()
1757 msmd.done()
1759 --------------------------------------------------------------------------------
1761 """
1762 return _msmetadata.msmetadata_nobservations(self)
1765 def nspw(self, *args, **kwargs):
1766 """
1767 nspw(self, _includewvr) -> long
1771 Summary:
1772 Get the number of spectral windows associated with the MS.
1774 Description:
1777 This method will return the number of spectral windows in the associated MS.
1780 Input Parameters:
1781 includewvr Include wvr spectral windows? If false, exclude wvr windows from count.
1783 Example:
1785 msmd.open('my.ms')
1786 number_of_spectral_windows = msmd.nspw()
1787 msmd.done()
1789 --------------------------------------------------------------------------------
1791 """
1792 return _msmetadata.msmetadata_nspw(self, *args, **kwargs)
1795 def nstates(self):
1796 """
1797 nstates(self) -> long
1801 Summary:
1802 Get the number of states (from the STATE table) associated with the MS.
1804 Description:
1807 This method will return the number of states (number of rows in the STATES table) in the associated MS.
1810 Example:
1812 msmd.open('my.ms')
1813 number_of_states = msmd.nstates()
1814 msmd.done()
1816 --------------------------------------------------------------------------------
1818 """
1819 return _msmetadata.msmetadata_nstates(self)
1822 def nscans(self):
1823 """
1824 nscans(self) -> long
1828 Summary:
1829 Get the number of scans associated with the MS.
1831 Description:
1834 Get the number of scans associated with the MS.
1837 Example:
1839 msmd.open('my.ms')
1840 number_of_scans = msmd.nscans()
1841 msmd.done()
1843 --------------------------------------------------------------------------------
1845 """
1846 return _msmetadata.msmetadata_nscans(self)
1849 def nsources(self):
1850 """
1851 nsources(self) -> long
1855 Summary:
1856 Get the number of unique values from the SOURCE_ID column in the SOURCE table.
1858 Description:
1861 Get the number of unique values from the SOURCE_ID column in the SOURCE table. The number of rows in the
1862 SOURCE table may be greater than this value.
1865 Example:
1867 msmd.open('my.ms')
1868 number_of_unique_source_ids = msmd.nsources()
1869 msmd.done()
1871 --------------------------------------------------------------------------------
1873 """
1874 return _msmetadata.msmetadata_nsources(self)
1877 def nrows(self, *args, **kwargs):
1878 """
1879 nrows(self, _autoc, _flagged) -> double
1883 Summary:
1884 Get the number of visibilities (from the main table) associated with the MS.
1886 Description:
1889 Get the number of visibilities (from the main table) associated with the MS.
1892 Input Parameters:
1893 autoc Include autocorrelation data? If False, only cross correlation rows will be summed.
1894 flagged Include flagged data? If False, only unflagged or patially flagged rows will be summed.
1896 Example:
1898 msmd.open('my.ms')
1899 # get the total number of rows
1900 nrows = msmd.nrows()
1901 # got the number of cross correlation rows
1902 ncross = msmd.nrows(auto=False)
1903 # get the number of unflagged rows
1904 ngood = msmd.nrows(flagged=False)
1905 # get the number of unflagged cross correlation rows
1906 ncrossunflagged = msmd.nrows(auto=False, flagged=False)
1907 msmd.done()
1909 --------------------------------------------------------------------------------
1911 """
1912 return _msmetadata.msmetadata_nrows(self, *args, **kwargs)
1915 def observers(self):
1916 """
1917 observers(self) -> std::vector< std::string >
1921 Summary:
1922 Get an array observers as they are listed in the OBSERVATIONS table.
1924 Description:
1927 Get an array of observers as they are listed in the OBSERVATIONS table.
1930 Example:
1932 msmd.open('my.ms')
1933 # get the observers
1934 observers = msmd.observers()
1935 msmd.done()
1937 --------------------------------------------------------------------------------
1939 """
1940 return _msmetadata.msmetadata_observers(self)
1943 def observatorynames(self):
1944 """
1945 observatorynames(self) -> std::vector< std::string >
1949 Summary:
1950 Get an array of MS telescope (observatory) names as they are listed in the OBSERVATIONS table.
1952 Description:
1955 Get an array of MS telescope (observatory) names as they are listed in the OBSERVATIONS table.
1958 Example:
1960 msmd.open('my.ms')
1961 # get the telescope names
1962 telescope_names = msmd.telescopenames()
1963 msmd.done()
1965 --------------------------------------------------------------------------------
1967 """
1968 return _msmetadata.msmetadata_observatorynames(self)
1971 def observatoryposition(self, *args, **kwargs):
1972 """
1973 observatoryposition(self, _which) -> record *
1977 Summary:
1978 Get the position of the specified telescope.
1980 Description:
1983 Get the position of the specified telescope.
1986 Input Parameters:
1987 which Zero-based telescope position in the OBSERVATIONS table (see msmd.telescopenames()).
1989 Example:
1991 msmd.open('my.ms')
1992 # get the position of the 0th telescope
1993 telescope_position = msmd.telescopeposition(0)
1994 msmd.done()
1996 --------------------------------------------------------------------------------
1998 """
1999 return _msmetadata.msmetadata_observatoryposition(self, *args, **kwargs)
2002 def open(self, *args, **kwargs):
2003 """
2004 open(self, _msfile, _maxcache) -> bool
2008 Summary:
2009 Attach the MS metadata tool to the specified MS
2011 Description:
2014 Attach this tool to the specified MS. This method runs a few basic MS validation tests, and if any of these
2015 fail (which indicates that the MS is invalid), an error occurs and the tool is not attached to the MS.
2016 Note that it is ultimately the user's responsibility to ensure that the MS is valid. Running the methods
2017 of this tool on an invalid MS may result in incorrect results or even a crash of CASA. Such invalidities
2018 include any MS subtable not having appropriate information (eg, an OBSERVATION subtable not having enough rows
2019 to account for all the OBSERVATION_IDs in the main table).
2022 Input Parameters:
2023 msfile Name of the existing measurement set
2024 maxcache Maximum cache size, in megabytes, to use.
2026 Example:
2028 msmd.open('my.ms')
2029 # do stuff and close it
2030 msmd.done()
2032 --------------------------------------------------------------------------------
2034 """
2035 return _msmetadata.msmetadata_open(self, *args, **kwargs)
2038 def phasecenter(self, *args, **kwargs):
2039 """
2040 phasecenter(self, _fieldid, _epoch) -> record *
2044 Summary:
2045 Get the phasecenter direction from a field ID and time if necessary
2047 Description:
2050 Get a direction measures for the phasecenter of the field id and time specified
2053 Input Parameters:
2054 fieldid Zero-based field ID for which to get the phasecenter; default fieldid=0
2055 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
2057 Example:
2059 msmd.open('my.ms')
2060 # get phasecenter for field ID 1
2061 mydir = msmd.phasecenter(1);
2062 # if the phasecenter is a polynomial or has an ephemerides attached to
2063 # it a time is needed to get the phase direction
2064 ep=me.epoch('utc', '2015/03/15/15:30:55')
2065 mydir2=msmd.phasecenter(2, ep)
2066 msmd.done()
2068 --------------------------------------------------------------------------------
2070 """
2071 return _msmetadata.msmetadata_phasecenter(self, *args, **kwargs)
2074 def pointingdirection(self, *args, **kwargs):
2075 """
2076 pointingdirection(self, _rownum, _interpolate, _initialrow) -> record *
2080 Summary:
2081 Get the pointing direction for antennas at the specified row number in the main MS table.
2083 Description:
2086 Get the pointing direction for antennas at the specified row number in the main MS table. Returns a record
2087 containing the time, antenna IDs and corresponding pointing directions.
2090 Input Parameters:
2091 rownum Row number in the main MS table.
2092 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)
2093 initialrow Initial guess of row index in pointing table to start search.
2095 Example:
2097 msmd.open('my.ms')
2098 # get the pointing directions for row ID 500
2099 dirs = msmd.pointingdirection(500)
2100 msmd.done()
2102 --------------------------------------------------------------------------------
2104 """
2105 return _msmetadata.msmetadata_pointingdirection(self, *args, **kwargs)
2108 def polidfordatadesc(self, *args, **kwargs):
2109 """
2110 polidfordatadesc(self, _ddid) -> casac::variant *
2114 Summary:
2115 Get the polarization ID associated with the specified data description ID.
2117 Description:
2120 Get the polarization ID associated with the specified data description ID. If the specified data description ID
2121 is negative, an array of polarization IDs is returned. The indices of that array represent data description IDs.
2124 Input Parameters:
2125 ddid Zero-based data description ID. A negative number will cause all the polarization IDs to be returned.
2127 Example:
2129 msmd.open('my.ms')
2130 # get the polarization ID associated with data description ID 3
2131 polid = msmd.polidfordatadesc(3)
2132 # get the array of polarization IDs in the order they appear in the DATA_DESCRIPTION table
2133 polids = msmd.polidfordatadesc(-1)
2134 msmd.done()
2136 --------------------------------------------------------------------------------
2138 """
2139 return _msmetadata.msmetadata_polidfordatadesc(self, *args, **kwargs)
2142 def projects(self):
2143 """
2144 projects(self) -> std::vector< std::string >
2148 Summary:
2149 Get an array projects as they are listed in the OBSERVATIONS table.
2151 Description:
2154 Get an array of projects as they are listed in the OBSERVATIONS table.
2157 Example:
2159 msmd.open('my.ms')
2160 # get the projects
2161 projects = msmd.projects()
2162 msmd.done()
2164 --------------------------------------------------------------------------------
2166 """
2167 return _msmetadata.msmetadata_projects(self)
2170 def propermotions(self):
2171 """
2172 propermotions(self) -> record *
2176 Summary:
2177 Get the values of the PROPER_MOTION column from the SOURCE table.
2179 Description:
2182 Get the values of the DIRECTION column from the SOURCE table. Returns a dictionary in which the
2183 keys are the associated zero-based row numbers, represented as strings, in the SOURCE table. The
2184 associated values are two element dictionaries, with keys 'longitude' and 'latitude', containing
2185 the longitudinal and latidinal components of the proper motion, which are valid quantity dictionaries.
2188 Example:
2190 msmd.open('my.ms')
2191 # get PROPER_MOTION column values from the SOURCE table
2192 mu = msmd.propermotions()
2193 msmd.done()
2194 # the direction associated with zero-based row number 10
2195 mu10 = mu['10']
2197 --------------------------------------------------------------------------------
2199 """
2200 return _msmetadata.msmetadata_propermotions(self)
2203 def refdir(self, *args, **kwargs):
2204 """
2205 refdir(self, _field, _epoch) -> record *
2209 Summary:
2210 Get the reference direction from a field ID and time if necessary
2212 Description:
2215 Get a direction measure for the reference direction of the field and time specified
2218 Input Parameters:
2219 field Zero-based field ID or field name for which to get the reference direction; default field=0
2220 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
2222 Example:
2224 msmd.open('my.ms')
2225 # get reference direction for field ID 1
2226 mydir = msmd.refdir(1);
2227 # if the reference direction is a polynomial or has an ephemerides attached to
2228 # it a time is needed to get the reference direction
2229 ep=me.epoch('utc', '2015/03/15/15:30:55')
2230 mydir2=msmd.phasecenter(2, ep)
2231 msmd.done()
2233 --------------------------------------------------------------------------------
2235 """
2236 return _msmetadata.msmetadata_refdir(self, *args, **kwargs)
2239 def reffreq(self, *args, **kwargs):
2240 """
2241 reffreq(self, _spw) -> record *
2245 Summary:
2246 Get the reference frequency of the specified spectral window.
2248 Description:
2251 Get the reference frequency of the specified spectral window. The returned frequency is in
2252 the form of a valid measures dictionary.
2255 Input Parameters:
2256 spw Zero-based spectral window ID.
2258 Example:
2260 msmd.open('my.ms')
2261 # get the reference frequency for spw ID 20
2262 reffreq = msmd.reffreq(20)
2263 msmd.done()
2265 --------------------------------------------------------------------------------
2267 """
2268 return _msmetadata.msmetadata_reffreq(self, *args, **kwargs)
2271 def restfreqs(self, *args, **kwargs):
2272 """
2273 restfreqs(self, _sourceid, _spw) -> casac::variant *
2277 Summary:
2278 Get the rest frequencies from the SOURCE table for the specified source and spectral window.
2280 Description:
2283 Get the rest frequencies from the SOURCE table for the specified source and spectral window.
2284 The return value will be a dictionary of frequency measures if the rest frequencies are
2285 defined for the specified inputs, or False if they do not.
2288 Input Parameters:
2289 sourceid Zero-based source ID (from the SOURCE::SOURCE_ID column).
2290 spw Zero-based spectral window ID.
2292 Example:
2294 msmd.open('my.ms')
2295 # get the rest frequencies for source ID 2 and spw ID 20
2296 reffreq = msmd.restfreqs(2, 20)
2297 msmd.done()
2299 --------------------------------------------------------------------------------
2301 """
2302 return _msmetadata.msmetadata_restfreqs(self, *args, **kwargs)
2305 def rxbands(self, *args, **kwargs):
2306 """
2307 rxbands(self, _spwids) -> std::vector< long >
2311 Summary:
2312 ALMA-specific. Get the values of the receiver bands for the specified spws.
2314 Description:
2317 ALMA-only. Returns an integer array containing the receiver band
2318 of the specified spw(s). A return value of -1 means no receiver
2319 band number could be determined. The name of the spw is first
2320 checked to determine if the receiver band value is encoded
2321 there. If not, the corresponding spectral window ID is sought in
2322 the ASDM_RECEIVER table, if it exists, and if it has less than
2323 or equal number of rows compared to the SPECTRAL_WINDOW table.
2324 If the corresponding spectral window can be found in the
2325 ASDM_RECEIVER table, then the corresponding frequencyBand column
2326 value is checked to determine if the receiver band information
2327 is encoded there. In the case where the spectral window ID is
2328 present in multiple cells of the spectralWindowId column, the
2329 first row in which the ID is found is used to determine the
2330 receiver band. If all these tests fail, -1 is returned for the
2331 specified spectral window.
2334 Input Parameters:
2335 spwids Zero-based spw ID(s) for which to get the values (integer or interger array). Unspecified will return all receiver band values.
2337 Example:
2339 msmd.open('my.ms')
2340 # get the receiver bands for spws 8 and 2.
2341 rx_bands = msmd.rxbands([8, 2])
2342 # get all receiver bands
2343 all_rx_bands = msmd.rxbands()
2344 msmd.done()
2346 --------------------------------------------------------------------------------
2348 """
2349 return _msmetadata.msmetadata_rxbands(self, *args, **kwargs)
2352 def scannumbers(self, *args, **kwargs):
2353 """
2354 scannumbers(self, _obsid, _arrayid) -> std::vector< long >
2358 Summary:
2359 Get an array of the unique scan numbers associated with the MS for the specified observation ID and array ID.
2361 Description:
2364 This method will return an array of unique scan numbers in the associated MS for the specified observation ID and array ID.
2367 Input Parameters:
2368 obsid Observation ID. A negative value indicates all observation IDs should be used.
2369 arrayid Array ID. A negative value indicates all array IDs should be used.
2371 Example:
2373 msmd.open('my.ms')
2374 # scan numbers for all obsids and all arrayids
2375 scan_numbers = msmd.scannumbers()
2376 msmd.done()
2378 --------------------------------------------------------------------------------
2380 """
2381 return _msmetadata.msmetadata_scannumbers(self, *args, **kwargs)
2384 def scansforfield(self, *args, **kwargs):
2385 """
2386 scansforfield(self, _field, _obsid, _arrayid) -> std::vector< long >
2390 Summary:
2391 Get an array of the unique scan numbers associated with the specified field, observation ID, and array ID.
2393 Description:
2396 Get an array of the unique scan numbers associated with the specified field, observation ID, and array ID.
2399 Input Parameters:
2400 field Field ID or field name (case sensitive) for which to return the scan numbers.
2401 obsid Observation ID. A negative value indicates all observation IDs should be used.
2402 arrayid Array ID. A negative value indicates all array IDs should be used.
2404 Example:
2406 msmd.open('my.ms')
2407 # get the scan numbers associated with field 'planet Z' (all obsids, all arrayids)
2408 scan_numbers = msmd.scansforfield('planet Z')
2409 # get the scan numbers associated with field ID 5 (all obsids, all arrayids)
2410 scan_numbers = msmd.scansforfield(5)
2411 msmd.done()
2413 --------------------------------------------------------------------------------
2415 """
2416 return _msmetadata.msmetadata_scansforfield(self, *args, **kwargs)
2419 def scansforfields(self, *args, **kwargs):
2420 """
2421 scansforfields(self, _obsid, _arrayid) -> record *
2425 Summary:
2426 Get a dictionary of which maps field ID to scan numbers for the specified observation ID and array ID.
2428 Description:
2431 Get a dictionary of which maps field ID to scan numbers for the specified observation ID
2432 and array ID. The keys (field IDs) will be strings. obsid and arrayid must both
2433 be non-negative.
2436 Input Parameters:
2437 obsid Observation ID. Must be non-negative.
2438 arrayid Array ID. Must be non-negative.
2440 Example:
2442 msmd.open('my.ms')
2443 # get the field - scan map for arrayID 1 and obsID 2
2444 field_to_scans = msmd.scansforfields(arrayid=1, obsid=2)
2445 # access the scans associated with field ID 2
2446 field_to_scans2 = field_to_scans['2']
2447 msmd.done()
2449 --------------------------------------------------------------------------------
2451 """
2452 return _msmetadata.msmetadata_scansforfields(self, *args, **kwargs)
2455 def scansforintent(self, *args, **kwargs):
2456 """
2457 scansforintent(self, _intent, _obsid, _arrayid) -> std::vector< long >
2461 Summary:
2462 Get an array of the unique scan numbers associated with the specified intent, observation ID, and arrayID.
2464 Description:
2467 Get an array of the unique scan numbers associated with the specified intent, observation ID, and arrayID.
2468 The '*' character matches any number of characters from all character classes.
2471 Input Parameters:
2472 intent Intent (case-sensitive) for which to return the scan numbers.
2473 obsid Observation ID. A negative value indicates all observation IDs should be used.
2474 arrayid Array ID. A negative value indicates all array IDs should be used.
2476 Example:
2478 msmd.open('my.ms')
2479 # get the scan numbers associated with intent 'detect planet X' (all obsids, all arrayids)
2480 scan_numbers = msmd.scansforintent('detect planet X', regex=False)
2481 # got all the scan numbers associated with all intents which contain 'WVR' (all obsids, all arrayids)
2482 scan_numbers = msmd.scansforintent('*WVR*')
2483 msmd.done()
2485 --------------------------------------------------------------------------------
2487 """
2488 return _msmetadata.msmetadata_scansforintent(self, *args, **kwargs)
2491 def scansforspw(self, *args, **kwargs):
2492 """
2493 scansforspw(self, _spw, _obsid, _arrayid) -> std::vector< long >
2497 Summary:
2498 Get an array of the unique scan numbers associated with the specified zero-based spectral window ID, observation ID, and array ID.
2500 Description:
2503 Get an array of the unique scan numbers associated with the specified zero-based spectral window ID, observation ID, and array ID.
2506 Input Parameters:
2507 spw Zero-based spectral window ID for which to return the scan numbers.
2508 obsid Observation ID. A negative value indicates all observation IDs should be used.
2509 arrayid Array ID. A negative value indicates all array IDs should be used.
2511 Example:
2513 msmd.open('my.ms')
2514 # get the scan numbers associated with spectral window ID 14, all obsids, all arrayids
2515 scan_numbers = msmd.scansforspw(14)
2516 msmd.done()
2518 --------------------------------------------------------------------------------
2520 """
2521 return _msmetadata.msmetadata_scansforspw(self, *args, **kwargs)
2524 def scansforspws(self, *args, **kwargs):
2525 """
2526 scansforspws(self, _obsid, _arrayid) -> record *
2530 Summary:
2531 Get a dictionary of which maps spw ID to scan numbers for the specified observation ID and array ID.
2533 Description:
2536 Get a dictionary of which maps spw ID to scan numbers for the specified observation ID
2537 and array ID. The keys (spectral window IDs) will be strings. obsid and arrayid must both
2538 be non-negative.
2541 Input Parameters:
2542 obsid Observation ID. Must be non-negative.
2543 arrayid Array ID. Must be non-negative.
2545 Example:
2547 msmd.open('my.ms')
2548 # get the spw - scan map for arrayID 1 and obsID 2
2549 spw_to_scans = msmd.scansforspws(arrayid=1, obsid=2)
2550 # access the scans associated with spw ID 2
2551 spw_to_scans2 = spw_to_scans['2']
2552 msmd.done()
2554 --------------------------------------------------------------------------------
2556 """
2557 return _msmetadata.msmetadata_scansforspws(self, *args, **kwargs)
2560 def scansforstate(self, *args, **kwargs):
2561 """
2562 scansforstate(self, _state, _obsid, _arrayid) -> std::vector< long >
2566 Summary:
2567 Get an array of the unique scan numbers for the specified state, observation ID, and array ID.
2569 Description:
2572 Get an array of the unique scan numbers for the specified state, observation ID, and array ID.
2575 Input Parameters:
2576 state ID of state for which to return the scan numbers.
2577 obsid Observation ID. A negative value indicates all observation IDs should be used.
2578 arrayid Array ID. A negative value indicates all array IDs should be used.
2580 Example:
2582 msmd.open('my.ms')
2583 # get the scan numbers associated with state 2, all obsids, all arrayids
2584 scans = msmd.scansforstate(2)
2585 msmd.done()
2587 --------------------------------------------------------------------------------
2589 """
2590 return _msmetadata.msmetadata_scansforstate(self, *args, **kwargs)
2593 def scansfortimes(self, *args, **kwargs):
2594 """
2595 scansfortimes(self, _time, _tol, _obsid, _arrayid) -> std::vector< long >
2599 Summary:
2600 Get an array of the unique scan numbers for the specified time range (time-tol to time+tol), observation ID, and array ID.
2602 Description:
2605 Get an array of the unique scan numbers for the specified time range (time-tol to time+tol), observation ID, and array ID.
2608 Input Parameters:
2609 time Time at center of time range.
2610 tol Time difference on either side of center for specifying range.
2611 obsid Observation ID. A negative value indicates all observation IDs should be used.
2612 arrayid Array ID. A negative value indicates all array IDs should be used.
2614 Example:
2616 msmd.open('my.ms')
2617 # get the scan numbers associated with the specified time range (all obsids, all array ids)
2618 scans = msmd.scansfortimes(4.84282937e+09, 20)
2619 msmd.done()
2621 --------------------------------------------------------------------------------
2623 """
2624 return _msmetadata.msmetadata_scansfortimes(self, *args, **kwargs)
2627 def schedule(self, *args, **kwargs):
2628 """
2629 schedule(self, _obsid) -> std::vector< std::string >
2633 Summary:
2634 Get the schedule information for the specified observation ID.
2636 Description:
2639 Get the schedule information for the specified observation ID.
2642 Input Parameters:
2643 obsid Observation ID.
2645 Example:
2647 msmd.open('my.ms')
2648 # get the schdule information for observation ID = 2
2649 schedule = msmd.schedule()[2]
2650 msmd.done()
2652 --------------------------------------------------------------------------------
2654 """
2655 return _msmetadata.msmetadata_schedule(self, *args, **kwargs)
2658 def sideband(self, *args, **kwargs):
2659 """
2660 sideband(self, _spw) -> long
2664 Summary:
2665 Get the sideband for the specified spectral window.
2667 Description:
2670 Get the sideband for the specified spectral window.
2673 Input Parameters:
2674 spw Spectral window ID.
2676 Example:
2678 msmd.open('my.ms')
2679 # get sideband for spectral window 2.
2680 sideband = msmd.sideband(2)
2681 msmd.done()
2683 --------------------------------------------------------------------------------
2685 """
2686 return _msmetadata.msmetadata_sideband(self, *args, **kwargs)
2689 def sourcedirs(self):
2690 """
2691 sourcedirs(self) -> record *
2695 Summary:
2696 Get the values of the DIRECTION column from the SOURCE table.
2698 Description:
2701 Get the values of the DIRECTION column from the SOURCE table. Returns a dictionary in which the
2702 keys are the associated row numbers, represented as strings, in the SOURCE table. Each value
2703 in the returned dictionary is a valid direction measure.
2706 Example:
2708 msmd.open('my.ms')
2709 # get DIRECTION column values from the SOURCE table
2710 sourcedirs = msmd.sourcedirs()
2711 msmd.done()
2712 # the direction associated with zero-based row number 10
2713 dir10 = sourcedirs['10']
2714 # convert it to B1950, using the measure interface
2715 dir10_B1950 = me.convert(dir10, 'B1950')
2717 --------------------------------------------------------------------------------
2719 """
2720 return _msmetadata.msmetadata_sourcedirs(self)
2723 def sourcetimes(self):
2724 """
2725 sourcetimes(self) -> record *
2729 Summary:
2730 Get the values of the TIME column from the SOURCE table.
2732 Description:
2735 Get the values of the TIME column from the SOURCE table. Returns a dictionary in which the
2736 keys are the associated row numbers, represented as strings, in the SOURCE table. Each value
2737 in the returned dictionary is a valid time quantity.
2740 Example:
2742 msmd.open('my.ms')
2743 # get TIME column values from the SOURCE table
2744 sourcetimes = msmd.sourcetimes()
2745 msmd.done()
2746 # the time associated with zero-based row number 10
2747 time10 = sourcetimes['10']
2749 --------------------------------------------------------------------------------
2751 """
2752 return _msmetadata.msmetadata_sourcetimes(self)
2755 def sourceidforfield(self, *args, **kwargs):
2756 """
2757 sourceidforfield(self, _field) -> long
2761 Summary:
2762 Get the source ID from the field table for the specified field ID.
2764 Description:
2767 Get the source ID from the field table for the specified field ID.
2770 Input Parameters:
2771 field Zero-based field ID for which to return the source ID from the field table.
2773 Example:
2775 msmd.open('my.ms')
2776 # get source ID associated with field ID 2
2777 sourceid = msmd.sourceidforfield(2)
2778 msmd.done()
2780 --------------------------------------------------------------------------------
2782 """
2783 return _msmetadata.msmetadata_sourceidforfield(self, *args, **kwargs)
2786 def sourceidsfromsourcetable(self):
2787 """
2788 sourceidsfromsourcetable(self) -> std::vector< long >
2792 Summary:
2793 Get the values of the SOURCE_ID column from the SOURCE table.
2795 Description:
2798 Get the values of the SOURCE_ID column from the SOURCE table. It is unfortunate that the SOURCE
2799 table has a column named SOURCE_ID, because implicitly the 'ID' of a row in an MS subtable is
2800 generally meant to reflect a row number in that table, but that is not the case for the SOURCE table.
2803 Example:
2805 msmd.open('my.ms')
2806 # get SOURCE_ID column values from the SOURCE table
2807 sourceids = msmd.sourceidsfromsourcetable()
2808 msmd.done()
2810 --------------------------------------------------------------------------------
2812 """
2813 return _msmetadata.msmetadata_sourceidsfromsourcetable(self)
2816 def sourcenames(self):
2817 """
2818 sourcenames(self) -> std::vector< std::string >
2822 Summary:
2823 Get the values of the SOURCE_NAME column from the SOURCE table.
2825 Description:
2828 Get the values of the SOURCE_NAME column from the SOURCE table.
2831 Example:
2833 msmd.open('my.ms')
2834 # get SOURCE_NAME column values from the SOURCE table
2835 sourcenames = msmd.sourcenames()
2836 msmd.done()
2838 --------------------------------------------------------------------------------
2840 """
2841 return _msmetadata.msmetadata_sourcenames(self)
2844 def spwsforbaseband(self, *args, **kwargs):
2845 """
2846 spwsforbaseband(self, _baseband, _sqldmode) -> casac::variant *
2850 Summary:
2851 Get the spws associated with the specified baseband or dictionary that maps baseband to spws.
2853 Description:
2856 Get the spectral windows associated with the specified baseband or dictionary that maps baseband to spectral windows.
2859 Input Parameters:
2860 baseband Baseband number. If <0, return a dictionary mapping basebands to spws.
2861 sqldmode If 'include', include SQLD windows, if 'exclude', exclude SQLD windows, if 'only', include only SQLD windows. Case insenstive, inimum match honored.
2863 Example:
2865 msmd.open('my.ms')
2866 # get the spectral window IDs associated with all the basebands in this dataset
2867 basebandtospwdict = msmd.spwsforbasebands()
2868 # get an array of spws associated with baseband 2.
2869 spwsforbb2 = msmd.spwsforbasebands(2)
2870 msmd.done()
2872 --------------------------------------------------------------------------------
2874 """
2875 return _msmetadata.msmetadata_spwsforbaseband(self, *args, **kwargs)
2878 def spwfordatadesc(self, *args, **kwargs):
2879 """
2880 spwfordatadesc(self, _ddid) -> casac::variant *
2884 Summary:
2885 Get the spectral window ID associated with the specified data description ID.
2887 Description:
2890 Get the spectral window ID associated with the specified data description ID. If the specified data description ID
2891 is negative, an array of spectral window IDs is returned. The indices of that array represent data description IDs.
2894 Input Parameters:
2895 ddid Zero-based data description ID. A negative number will cause all the spectral window IDs to be returned.
2897 Example:
2899 msmd.open('my.ms')
2900 # get the spectral window ID associated with data description ID 3
2901 spw = msmd.spwfordatadesc(3)
2902 # get the array of spectral window IDs in the order they appear in the DATA_DESCRIPTION table
2903 spws = msmd.spwfordatadesc(-1)
2904 msmd.done()
2906 --------------------------------------------------------------------------------
2908 """
2909 return _msmetadata.msmetadata_spwfordatadesc(self, *args, **kwargs)
2912 def spwsforfield(self, *args, **kwargs):
2913 """
2914 spwsforfield(self, _field) -> std::vector< long >
2918 Summary:
2919 Get an array of the unique spectral window IDs for the specified field.
2921 Description:
2924 Get an array of the unique spectral window IDs for the specified field.
2927 Input Parameters:
2928 field Field (case sensitive string or zero-based integer ID) for which to return the spectral window IDs.
2930 Example:
2932 msmd.open('my.ms')
2933 # get the spectral window IDs associated with field 'Fomalhaut'
2934 spws = msmd.spwsforfield('Fomalhaut')
2935 # get spectral window IDs associated with field ID 2
2936 spws = msmd.spwsforfield(2)
2937 msmd.done()
2939 --------------------------------------------------------------------------------
2941 """
2942 return _msmetadata.msmetadata_spwsforfield(self, *args, **kwargs)
2945 def spwsforfields(self):
2946 """
2947 spwsforfields(self) -> record *
2951 Summary:
2952 Get a dictionary which maps field IDs to spectral window IDs.
2954 Description:
2957 Get a dictionary which maps field IDs to spectral window IDs. The field IDs are keys in the
2958 returned dictionary. To access a particular element, one must ensure the key is a string.
2961 Example:
2963 msmd.open('my.ms')
2964 # get the map of field IDs to spw IDs
2965 field_to_spw_map = msmd.spwsforfields()
2966 spws_for_field_5 = field_to_spw_map[str(5)]
2967 msmd.done()
2969 --------------------------------------------------------------------------------
2971 """
2972 return _msmetadata.msmetadata_spwsforfields(self)
2975 def spwsforintent(self, *args, **kwargs):
2976 """
2977 spwsforintent(self, _intent) -> std::vector< long >
2981 Summary:
2982 Get an array of the unique spectral window IDs for the specified intent.
2984 Description:
2987 Get an array of the unique spectral window IDs for the specified intent. The '*' character matches any number of characters from all character classes.
2990 Input Parameters:
2991 intent Intent (case sensitive) for which to return the spectral window IDs.
2993 Example:
2995 msmd.open('my.ms')
2996 # get the spectral window IDs associated with 'MY COOL INTENT'
2997 spws = msmd.spwsforintent('MY COOL INTENT')
2998 # got all the spw IDs associated with all intents which contain 'WVR'
2999 scan_numbers = msmd.spwsforintent('*WVR*')
3000 msmd.done()
3001 msmd.done()
3003 --------------------------------------------------------------------------------
3005 """
3006 return _msmetadata.msmetadata_spwsforintent(self, *args, **kwargs)
3009 def spwsfornames(self, *args, **kwargs):
3010 """
3011 spwsfornames(self, _spwids) -> record *
3015 Summary:
3016 Get the IDs of the specified spw names.
3018 Description:
3021 Get the IDs of the specified spw(s). Returns a dictionary where the keys
3022 are the requested spectral window names that are present in the data set
3023 and the values are arrays of the spectral window IDs corresponding to the
3024 name. If a specified name is not present, a warning message is logged and
3025 that name is not included in the returned dictionary. Specifying no names
3026 results in a dictionary containing the name to spw ID mapping for the
3027 entire data set.
3030 Input Parameters:
3031 spwids Names of the spws for which IDs are needed (string or string array). Unspecified will return all spw names.
3033 Example:
3035 msmd.open('my.ms')
3036 # get the IDs for spws named 'CO' and 'HCN'
3037 spw_ids = msmd.spwsfornames(['CO', 'HCN'])
3038 # get the complete spw name to ID map
3039 spw_names_to_ids = msmd.spwsfornames()
3040 msmd.done()
3042 --------------------------------------------------------------------------------
3044 """
3045 return _msmetadata.msmetadata_spwsfornames(self, *args, **kwargs)
3048 def spwsforscan(self, *args, **kwargs):
3049 """
3050 spwsforscan(self, _scan, _obsid, _arrayid) -> std::vector< long >
3054 Summary:
3055 Get an array of the unique spectral window IDs for the specified scan number, observation ID, and array ID.
3057 Description:
3060 Get an array of the unique spectral window IDs for the specified scan number, observation ID, and array ID.
3063 Input Parameters:
3064 scan Scan number for which to return the spectral window IDs.
3065 obsid Observation ID. A negative value means that all observation IDs should be used.
3066 arrayid Array ID. A negative value means that all array IDs should be used.
3068 Example:
3070 msmd.open('my.ms')
3071 # get the spectral window IDs associated with scan number 20, all obsids, all arrayids.
3072 spws = msmd.spwsforscan(20)
3073 msmd.done()
3075 --------------------------------------------------------------------------------
3077 """
3078 return _msmetadata.msmetadata_spwsforscan(self, *args, **kwargs)
3081 def spwsforscans(self, *args, **kwargs):
3082 """
3083 spwsforscans(self, _obsid, _arrayid) -> record *
3087 Summary:
3088 Get a dictionary of which maps scan number to spectral windows for the specified observation ID and array ID.
3090 Description:
3093 Get a dictionary of which maps scan number to spectral windows for the specified observation ID and array ID. The keys (scan
3094 numbers) will be strings. obsid and arrayid must both be non-negative.
3097 Input Parameters:
3098 obsid Observation ID. Must be non-negative.
3099 arrayid Array ID. Must be non-negative.
3101 Example:
3103 msmd.open('my.ms')
3104 # get the scan - spw map for arrayID 1 and obsID 2
3105 scan_to_spws = msmd.spwsforscans(arrayid=1, obsid=2)
3106 # access the spws associated with scan 2
3107 spws_for_scan2 = scan_to_spws['2']
3108 msmd.done()
3110 --------------------------------------------------------------------------------
3112 """
3113 return _msmetadata.msmetadata_spwsforscans(self, *args, **kwargs)
3116 def subwindows(self, *args, **kwargs):
3117 """
3118 subwindows(self, _spwids) -> std::vector< long >
3122 Summary:
3123 ALMA-specific. Get the values of the subwindows for the specified spws.
3125 Description:
3128 ALMA-only. Returns an integer array containing the subwindow of
3129 the specified spw(s). The spw name is checked to determine if
3130 the subwindow value is encoded within it. A return value of -1
3131 indicates that a subwindow number could be determined.
3134 Input Parameters:
3135 spwids Zero-based spw ID(s) for which to get the values (integer or interger array). Unspecified will return all receiver band values.
3137 Example:
3139 msmd.open('my.ms')
3140 # get the subwindows for spws 8 and 2.
3141 sws = msmd.subwindows([8, 2])
3142 # get all subwindows
3143 all_sws = msmd.subwindows()
3144 msmd.done()
3146 --------------------------------------------------------------------------------
3148 """
3149 return _msmetadata.msmetadata_subwindows(self, *args, **kwargs)
3152 def statesforscan(self, *args, **kwargs):
3153 """
3154 statesforscan(self, _scan, _obsid, _arrayid) -> std::vector< long >
3158 Summary:
3159 Get an array of the unique state IDs for the specified scan number, observation ID, and array ID.
3161 Description:
3164 Get an array of the unique state IDs for the specified scan number, observation ID, and array ID.
3167 Input Parameters:
3168 scan Scan number for which to return the state IDs.
3169 obsid Observation ID. A negative value means that all observation IDs should be used.
3170 arrayid Array ID. A negative value means that all array IDs should be used.
3172 Example:
3174 msmd.open('my.ms')
3175 # get the state IDs associated with scan number 251, all obsids, all arrayids
3176 states = msmd.statesforscan(251)
3177 msmd.done()
3179 --------------------------------------------------------------------------------
3181 """
3182 return _msmetadata.msmetadata_statesforscan(self, *args, **kwargs)
3185 def statesforscans(self, *args, **kwargs):
3186 """
3187 statesforscans(self, _obsid, _arrayid) -> record *
3191 Summary:
3192 Get a dictionary which maps scan numbers to state IDs for the specified array and observation IDs.
3194 Description:
3197 Get a dictionary which maps scan numbers to state IDs for the specified array and observation IDs. The returned dictionary
3198 will have scan numbers, as strings, as keys.
3201 Input Parameters:
3202 obsid Observation ID, must be nonnegative.
3203 arrayid Array ID, must be nonnegative.
3205 Example:
3207 msmd.open('my.ms')
3208 # get the map of scan numbers to state IDs for arrayID=1, obsID=2
3209 scans_to_states = msmd.statesforscans(obsID=2, arrayID=1)
3210 states_for_scan_5 = scans_to_states[str(5)]
3211 msmd.done()
3213 --------------------------------------------------------------------------------
3215 """
3216 return _msmetadata.msmetadata_statesforscans(self, *args, **kwargs)
3219 def summary(self):
3220 """
3221 summary(self) -> record *
3225 Summary:
3226 Get dictionary summarizing the MS.
3228 Description:
3231 Get dictionary summarizing the MS.
3234 Example:
3236 msmd.open('my.ms')
3237 # get the summary
3238 summary = msmd.summary()
3239 msmd.done()
3241 --------------------------------------------------------------------------------
3243 """
3244 return _msmetadata.msmetadata_summary(self)
3247 def tdmspws(self):
3248 """
3249 tdmspws(self) -> std::vector< long >
3253 Summary:
3254 Get an array of spectral window IDs used for TDM.
3256 Description:
3259 Get an array of spectral window IDs used for TDM. These windows
3260 are defined by the rules in the description of the method
3261 almaspws().
3264 Example:
3266 msmd.open('my.ms')
3267 # get the spectral window IDs used for TDM.
3268 tdm_spws = msmd.tdmspws()
3269 msmd.done()
3271 --------------------------------------------------------------------------------
3273 """
3274 return _msmetadata.msmetadata_tdmspws(self)
3277 def timerangeforobs(self, *args, **kwargs):
3278 """
3279 timerangeforobs(self, _obsid) -> record *
3283 Summary:
3284 Get the time range for the specified observation ID
3286 Description:
3289 Get the time range for the specified observation ID. The return value is a dictionary containing
3290 keys 'begin' and 'end'. Each of the associated value are dictionaries representing epochs which
3291 are valid measure records. The values are taken directly from the OBSERVATION subtable; no
3292 half-intervals are added or subtracted.
3295 Input Parameters:
3296 obsid Zero-based observation ID for which to get the time range.
3298 Example:
3300 msmd.open('my.ms')
3301 # get the time range associated with observation ID 3
3302 timerange = msmd.timerangeforobs(3)
3303 msmd.done()
3305 --------------------------------------------------------------------------------
3307 """
3308 return _msmetadata.msmetadata_timerangeforobs(self, *args, **kwargs)
3311 def timesforfield(self, *args, **kwargs):
3312 """
3313 timesforfield(self, _field) -> std::vector< double >
3317 Summary:
3318 Get an array of the unique times for the specified field.
3320 Description:
3323 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.
3326 Input Parameters:
3327 field Zero-based field ID for which to return the times.
3329 Example:
3331 msmd.open('my.ms')
3332 # get the times associated with field 3
3333 times = msmd.timesforfield(3)
3334 msmd.done()
3336 --------------------------------------------------------------------------------
3338 """
3339 return _msmetadata.msmetadata_timesforfield(self, *args, **kwargs)
3342 def timesforintent(self, *args, **kwargs):
3343 """
3344 timesforintent(self, _intent) -> std::vector< double >
3348 Summary:
3349 Get an array of the unique times for the specified intent.
3351 Description:
3354 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.
3357 Input Parameters:
3358 intent Intent for which to return the times.
3360 Example:
3362 msmd.open('my.ms')
3363 # get the times associated with intent 'myintent'
3364 times = msmd.timesforintent('myintent')
3365 msmd.done()
3367 --------------------------------------------------------------------------------
3369 """
3370 return _msmetadata.msmetadata_timesforintent(self, *args, **kwargs)
3373 def timesforscan(self, *args, **kwargs):
3374 """
3375 timesforscan(self, _scan, _obsid, _arrayid, _perspw) -> casac::variant *
3379 Summary:
3380 Get the unique times for the specified scan number, observation ID, and array ID.
3382 Description:
3385 Get the unique times for the specified scan number, observation ID, and array ID. If perspw=True, the returned data structure is
3386 a dictionary that has keys representing zero-based spectral window IDs and values representing the unique values of the TIME column
3387 corrsponding to the specified scan and that corresponding spectral window ID. If False, an array of unique values from the TIME
3388 column for the specified scan is returned; there is no separation into spectral window IDs.
3391 Input Parameters:
3392 scan Scan number for which to return the times.
3393 obsid Observation ID. A negative value indicates all observation IDs should be used.
3394 arrayid Array ID. A negative value indicates all array IDs should be used.
3395 perspw Return output dictionary with keys representing spectral window IDs (True), or an array of all times (False).
3397 Example:
3399 msmd.open('my.ms')
3400 # get the times associated with scan number 10, all obsids, all arrayids.
3401 times = msmd.timesforscan(10)
3402 msmd.done()
3404 --------------------------------------------------------------------------------
3406 """
3407 return _msmetadata.msmetadata_timesforscan(self, *args, **kwargs)
3410 def timesforscans(self, *args, **kwargs):
3411 """
3412 timesforscans(self, _scans, _obsid, _arrayid) -> std::vector< double >
3416 Summary:
3417 Get an array of the unique times for the specified scan numbers, observation ID, and array ID.
3419 Description:
3422 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.
3425 Input Parameters:
3426 scans Scan number(s) for which to return the times.
3427 obsid Observation ID. A negative value indicates all observation IDs should be used.
3428 arrayid Array ID. A negative value indicates all array IDs should be used.
3430 Example:
3432 msmd.open('my.ms')
3433 # get the times associated with scan numbers 10 and 20, all obsids, all arrayids
3434 times = msmd.timesforscans([10,20])
3435 msmd.done()
3437 --------------------------------------------------------------------------------
3439 """
3440 return _msmetadata.msmetadata_timesforscans(self, *args, **kwargs)
3443 def timesforspws(self, *args, **kwargs):
3444 """
3445 timesforspws(self, _spw) -> casac::variant *
3449 Summary:
3450 Get the unique times corresponding to the specified spectral window(s).
3452 Description:
3455 Get the unique times corresponding to the specified spectral window(s). The input indicates the
3456 spws for which times are to be retrieved, and can be a single integer or an array of
3457 integers. If a single, non-negative integer, an array of unique times associated with
3458 that spectral window are returned. Otherwise, a dictionary of times associated with the
3459 specified spectral windows are returned, with the spws (as strings) as the keys and the
3460 times as the values. A negative integer will cause a dictionary of all spws and their
3461 associated times to be returned.
3464 Input Parameters:
3465 spw Zero-based spectral window ID(s). A negative integer will cause the all the times for all spws to be returned.
3467 Example:
3469 msmd.open('my.ms')
3470 # get the times associated with spws 10 and 20
3471 times = msmd.timesforspws([10,20])
3472 # print the times for spw 10
3473 print times['10']
3474 msmd.done()
3476 --------------------------------------------------------------------------------
3478 """
3479 return _msmetadata.msmetadata_timesforspws(self, *args, **kwargs)
3482 def transitions(self, *args, **kwargs):
3483 """
3484 transitions(self, _sourceid, _spw) -> casac::variant *
3488 Summary:
3489 Get the spectral transitions from the SOURCE table for the specified source and spectral window.
3491 Description:
3494 Get the spectral transitions from the SOURCE table for the specified source and spectral window.
3495 The return value will be an array of transitions if the transitions are
3496 defined for the specified inputs, or False if they do not.
3499 Input Parameters:
3500 sourceid Zero-based source ID (from the SOURCE::SOURCE_ID column).
3501 spw Zero-based spectral window ID.
3503 Example:
3505 msmd.open('my.ms')
3506 # get the transitions for source ID 2 and spw ID 20
3507 reffreq = msmd.transitions(2, 20)
3508 msmd.done()
3510 --------------------------------------------------------------------------------
3512 """
3513 return _msmetadata.msmetadata_transitions(self, *args, **kwargs)
3516 def wvrspws(self, *args, **kwargs):
3517 """
3518 wvrspws(self, _complement) -> std::vector< long >
3522 Summary:
3523 Get an array of spectral window IDs used for WVR. These are windows that have 4 channels.
3525 Description:
3529 Get an array of spectral window IDs used for WVR. These are windows that have 4 channels.
3530 If complement is True, return the complement set instead (all non-wvr spw IDs). WVR windows
3531 are identified using the algorithm
3532 1. check for water vapor radiometer (WVR) spectral windows using the spectral window
3533 name 'WVR#NOMINAL' and report these.
3534 2. If no SPWs match that string, then the names are checked for 'WVR' and are reported instead.
3537 Input Parameters:
3538 complement If True, return all non-wvr spws.
3540 Example:
3542 msmd.open('my.ms')
3543 # get the spectral window IDs used for WVR.
3544 wvr_spws = msmd.wvrspws()
3545 msmd.done()
3547 --------------------------------------------------------------------------------
3549 """
3550 return _msmetadata.msmetadata_wvrspws(self, *args, **kwargs)
3552 __swig_destroy__ = _msmetadata.delete_msmetadata
3553 __del__ = lambda self: None
3554msmetadata_swigregister = _msmetadata.msmetadata_swigregister
3555msmetadata_swigregister(msmetadata)
3557# This file is compatible with both classic and new-style classes.