Coverage for /wheeldirectory/casa-6.7.0-12-py3.10.el8/lib/py/lib/python3.10/site-packages/casatools/__casac__/atcafiller.py: 37%
100 statements
« prev ^ index » next coverage.py v7.6.4, created at 2024-10-31 19:10 +0000
« prev ^ index » next coverage.py v7.6.4, created at 2024-10-31 19:10 +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, '_atcafiller')).lstrip('.')
13 try:
14 return importlib.import_module(mname)
15 except ImportError:
16 return importlib.import_module('_atcafiller')
17 _atcafiller = 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('_atcafiller', [dirname(__file__)])
26 except ImportError:
27 import _atcafiller
28 return _atcafiller
29 try:
30 _mod = imp.load_module('_atcafiller', fp, pathname, description)
31 finally:
32 if fp is not None:
33 fp.close()
34 return _mod
35 _atcafiller = swig_import_helper()
36 del swig_import_helper
37else:
38 import _atcafiller
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 atcafiller(_object):
99 """Proxy of C++ casac::atcafiller class."""
101 __swig_setmethods__ = {}
102 __setattr__ = lambda self, name, value: _swig_setattr(self, atcafiller, name, value)
103 __swig_getmethods__ = {}
104 __getattr__ = lambda self, name: _swig_getattr(self, atcafiller, name)
105 __repr__ = _swig_repr
107 def __init__(self):
108 """__init__(self) -> atcafiller"""
109 this = _atcafiller.new_atcafiller()
110 try:
111 self.this.append(this)
112 except __builtin__.Exception:
113 self.this = this
115 def open(self, *args, **kwargs):
116 """
117 open(self, _msname, _filenames, _options) -> bool
121 Summary:
122 Specify the names of the data files and MeasurementSet
124 Description:
127 This function does the actual filling of the data from rpfits format
128 files to a MeasurementSet. After the completion of the fill operation
129 you should call the done method to avoid problems with incomplete
130 flushing of the data to disk. You may want to run select before fill, to
131 reduce the amount of data you read in.
133 In the filenames argument commas are not allowed because of the
134 wildcard capability.
136 The options argument allows for special processing options during the
137 filling process.
139 * birdie: remove self generated birdies in 128 MHz
140 data by deleting every other channel and the edge
141 channels
142 * reweight: suppress ringing of interference spikes by
143 reweighting the lag spectrum for minimum spectral sidelobe response
144 * noxycorr: do not apply the xyphase
145 correction using the noise cal xy phase measurements (use if you
146 know there was a problem with the measurements)
147 * compress: Compress the data, model, corrected data and imaging weight
148 columns (may reduce dynamic range)
149 * fastmosaic: Produce a MeasurementSet with small tiles to optimize I/O
150 for observations with a large number of pointings and a short time (a few
151 integrations) on each pointing. Failing to use this options for such data
152 may cause very inefficient access, especially for continuum data
153 (10-100 times slower)
154 * hires: For data taken in binning mode: set the TIME_CENTROID column to
155 the center of each bin (normally center of integration interval). The TIME column is
156 unaffected. TIME_CENTROID will no longer be in time order for dual frequency
157 mode.
158 * noac : Do not load the autocorrelations
160 Input Parameters:
161 msname Filename for MeasurementSet to create
162 filenames Existing RPFITS files to read; wild cards accepted, don't use commas
163 options Processing options: birdie, rfiflag, noxycorr, compress, fastmosaic, hires, reweight, noac
165 Example:
167 #Specify that we want to load the data from files 1999-01-01_0101.C999 and
168 #1999-01-01_0202.C999 in the directory /data/RPFITS into the MeasurementSet
169 #myms.
170 atf = atcafiller()
171 atf.open('myms',
172 '/data/RPFITS/1999-01-01_0101.C999 /data/RPFITS/1999-01-01_0202.C999',
173 'birdie reweight')
174 atf.fill()
175 del atf
176 myms:=ms('myms')
177 myms.nrow()
178 #1204
179 myms.close()
181 --------------------------------------------------------------------------------
183 """
184 return _atcafiller.atcafiller_open(self, *args, **kwargs)
187 def fill(self):
188 """
189 fill(self) -> bool
193 Summary:
194 Fill the MeasurementSet
196 Description:
199 This function does the actual filling of the data from rpfits format
200 files to a MeasurementSet. You may want to run select before fill, to
201 reduce the amount of data you read in.
203 Example:
205 #Specify that we want to load the data from files 1999-01-01_0101.C999 and
206 #1999-01-01_0202.C999 in the directory /data/RPFITS into the MeasurementSet #myms.
207 atf = atcafiller()
208 atf.open('myms',
209 '/data/RPFITS/1999-01-01_0101.C999 /data/RPFITS/1999-01-01_0202.C999',
210 'birdie reweight')
211 atf.fill()
212 del atf
213 myms:=ms('myms')
214 myms.nrow()
215 #1204
216 myms.close()
218 --------------------------------------------------------------------------------
220 """
221 return _atcafiller.atcafiller_fill(self)
224 def select(self, *args, **kwargs):
225 """
226 select(self, _firstscan, _lastscan, _spw, _lowfreq, _highfreq, _fields, _edge) -> bool
230 Summary:
231 Select the data to fill
233 Description:
237 Select on various items, to load only a subset of the data present in
238 the input file. The default is to load everything.
239 Note that the frequency selection using lowfreq and highfreq acts purely on
240 center (reference) frequencies, channel selection is not available at this stage.
241 Use freqchain to select the frequency chain (or IF) to load,
242 specify either 1 or 2, the default of zero will load both.
243 Use the fields parameter to specify a list of field names (sources) you
244 want to load.
245 For detailed selection of complex observations the last two parameters let
246 you specify the required bandwidth (in whole MHz) and number of channels
247 of the first frequency chain.
249 Input Parameters:
250 firstscan First scan to read
251 lastscan Last scan to read
252 spw Select one or more spectralwindows , -1=all
253 lowfreq Lowest reference frequency to select
254 highfreq Highest reference frequency to select
255 fields List of field names (sources) to select
256 edge Percentage of edge channels to flag
258 Example:
260 #Select scans 4 to 10 inclusive, frequency chain 1, all data with a
261 #reference frequency of more than 1.4 GHz.
262 atf = atcafiller()
263 atf.open('myms', '/data/RPFITS/1999-01-01_0101.C999')
264 atf.select(firstscan=4, lastscan=10, freqchain=1, lowfreq=1.4,edge=10)
265 atf.fill()
266 del atf
268 --------------------------------------------------------------------------------
270 """
271 return _atcafiller.atcafiller_select(self, *args, **kwargs)
274 def opacities(self, *args, **kwargs):
275 """
276 opacities(self, _fghz, _tempk, _humi, _press, _height) -> std::vector< double >
280 Summary:
281 Calculate opacity correction
283 Description:
286 This function does the actual filling of the data from rpfits format
287 files to a MeasurementSet. You may want to run select before fill, to
288 reduce the amount of data you read in.
290 Input Parameters:
291 fghz array of frequencies
292 tempk surface temperature in K
293 humi humidity in %
294 press surface pressure in hPa
295 height observatory height in m
297 Example:
299 #
300 atf = atcafiller()
301 opac=atf.opacities([22.0,23.0],300.,50.,1013.,200.)
302 print opac
303 del atf
305 --------------------------------------------------------------------------------
307 """
308 return _atcafiller.atcafiller_opacities(self, *args, **kwargs)
310 __swig_destroy__ = _atcafiller.delete_atcafiller
311 __del__ = lambda self: None
312atcafiller_swigregister = _atcafiller.atcafiller_swigregister
313atcafiller_swigregister(atcafiller)
315# This file is compatible with both classic and new-style classes.