-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoifits.txt
349 lines (319 loc) · 13.3 KB
/
oifits.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
NAME
oifits - A module for reading/writing OIFITS (v1, v2) files
DESCRIPTION
To open an existing OIFITS file, use the oifits.open(filename) function, where
'filename' can be either a filename or HDUList object. This will return an
oifits object with the following members (any of which can be empty
dictionaries or numpy arrays):
array: a dictionary of interferometric arrays, as defined by the OI_ARRAY
tables. The dictionary key is the name of the array (ARRNAME).
header: the header from the primary HDU of the file.
target: a numpy array of targets, as defined by the rows of the OI_TARGET
table.
wavelength: a dictionary of wavelength tables (OI_WAVELENGTH). The
dictionary key is the name of the instrument/settings (INSNAME).
vis, vis2, t3 and flux: numpy arrays of objects containing all the
measurement information. Each list member corresponds to a row in an
OI_VIS/OI_VIS2/OI_T3/OI_FLUX table.
A summary of the information in the oifits object can be obtained by
using the info() method:
> import oifits
> oifitsobj = oifits.open('foo.fits')
> oifitsobj.info()
This module makes an ad-hoc, backwards-compatible change to the OIFITS revision
1 standard originally described by Pauls et al., 2005, PASP, 117, 1255. The
OI_VIS and OI_VIS2 tables in OIFITS files produced by this file contain two
additional columns for the correlated flux, CFLUX and CFLUXERR , which are
arrays with a length corresponding to the number of wavelength elements (just
as VISAMP/VIS2DATA).
As of version 0.4, revision 2 of the OIFITS standard (Duvert, Young & Hummel,
2017, A&A 597, A8) is supported, with the exception of correlations and
polarization.
The main purpose of this module is to allow easy access to your OIFITS data
within Python, where you can then analyze it in any way you want. As of
version 0.3, the module can now be used to create OIFITS files from scratch
without serious pain. Be warned, creating an array table from scratch is
probably like nailing jelly to a tree. In a future verison this may become
easier. Note that array tables are a requirement only for OIFITS2.
The module also provides a simple mechanism for combining multiple oifits
objects, achieved by using the '+' operator on two oifits objects: result = a +
b. The result can then be written to a file using result.save(filename).
Many of the parameters and their meanings are not specifically documented here.
However, the nomenclature mirrors that of the OIFITS standard, so it is
recommended to use this module with the OIFITS1/OIFITS2 references above in
hand.
Beginning with version 0.3, the OI_VIS/OI_VIS2/OI_T3 classes now use masked
arrays for convenience, where the mask is defined via the 'flag' member of
these classes. This also concerns the OI_FLUX tables from OIFITS2. Beware of
the following subtlety: as before, the array data are accessed via (for
example) OI_VIS.visamp; however, OI_VIS.visamp is just a method which
constructs (on the fly) a masked array from OI_VIS._visamp, which is where the
data are actually stored. This is done transparently, and the data can be
accessed and modified transparently via the "visamp" hidden attribute. The
same goes for correlated fluxes, differential/closure phases, triple products,
total flux measurements, etc. See the notes on the individual classes for a
list of all the "hidden" attributes.
For further information, contact Paul Boley ([email protected]) or open an issue
on Github (https://github.com/pboley/oifits/).
CLASSES
builtins.object
OI_ARRAY
OI_FLUX
OI_STATION
OI_T3
OI_TARGET
OI_VIS
OI_VIS2
OI_WAVELENGTH
oifits
class OI_ARRAY(builtins.object)
| OI_ARRAY(frame, arrxyz, stations=(), revision=1)
|
| Contains all the data for a single OI_ARRAY table. Note the
| hidden convenience attributes latitude, longitude, and altitude.
|
| Methods defined here:
|
| __eq__(self, other)
| Return self==value.
|
| __getattr__(self, attrname)
|
| __init__(self, frame, arrxyz, stations=(), revision=1)
| Initialize self. See help(type(self)) for accurate signature.
|
| __ne__(self, other)
| Return self!=value.
|
| __repr__(self)
| Return repr(self).
|
| get_station_by_name(self, name)
|
| info(self, verbose=0)
| Print the array's center coordinates. If verbosity >= 1,
| print information about each station.
class OI_FLUX(builtins.object)
| OI_FLUX(timeobs, int_time, fluxdata, fluxerr, flag, wavelength, target, calibrated, array=None, station=None, fov=None, fovtype=None, revision=1)
|
| Class for storing raw or calibrated flux measurements.
| To access the data, use the following hidden attributes:
|
| fluxdata, fluxerr
|
| Methods defined here:
|
| __eq__(self, other)
| Return self==value.
|
| __getattr__(self, attrname)
|
| __init__(self, timeobs, int_time, fluxdata, fluxerr, flag, wavelength, target, calibrated, array=None, station=None, fov=None, fovtype=None, revision=1)
| Initialize self. See help(type(self)) for accurate signature.
|
| __ne__(self, other)
| Return self!=value.
|
| __repr__(self)
| Return repr(self).
|
| __setattr__(self, attrname, value)
| Implement setattr(self, name, value).
|
| info(self)
class OI_STATION(builtins.object)
| OI_STATION(tel_name=None, sta_name=None, diameter=None, staxyz=[None, None, None], fov=None, fovtype=None, revision=1)
|
| This class corresponds to a single row (i.e. single
| station/telescope) of an OI_ARRAY table.
|
| Methods defined here:
|
| __eq__(self, other)
| Return self==value.
|
| __init__(self, tel_name=None, sta_name=None, diameter=None, staxyz=[None, None, None], fov=None, fovtype=None, revision=1)
| Initialize self. See help(type(self)) for accurate signature.
|
| __ne__(self, other)
| Return self!=value.
|
| __repr__(self)
| Return repr(self).
class OI_T3(builtins.object)
| OI_T3(timeobs, int_time, t3amp, t3amperr, t3phi, t3phierr, flag, u1coord, v1coord, u2coord, v2coord, wavelength, target, array=None, station=(None, None, None), revision=1)
|
| Class for storing triple product and closure phase data.
| To access the data, use the following hidden attributes:
|
| t3amp, t3amperr, t3phi, t3phierr
|
| Methods defined here:
|
| __eq__(self, other)
| Return self==value.
|
| __getattr__(self, attrname)
|
| __init__(self, timeobs, int_time, t3amp, t3amperr, t3phi, t3phierr, flag, u1coord, v1coord, u2coord, v2coord, wavelength, target, array=None, station=(None, None, None), revision=1)
| Initialize self. See help(type(self)) for accurate signature.
|
| __ne__(self, other)
| Return self!=value.
|
| __repr__(self)
| Return repr(self).
|
| __setattr__(self, attrname, value)
| Implement setattr(self, name, value).
|
| info(self)
|
class OI_TARGET(builtins.object)
| OI_TARGET(target, raep0, decep0, equinox=2000.0, ra_err=0.0, dec_err=0.0, sysvel=0.0, veltyp='TOPCENT', veldef='OPTICAL', pmra=0.0, pmdec=0.0, pmra_err=0.0, pmdec_err=0.0, parallax=0.0, para_err=0.0, spectyp='UNKNOWN', category=None, revision=1)
|
| Methods defined here:
|
| __eq__(self, other)
| Return self==value.
|
| __init__(self, target, raep0, decep0, equinox=2000.0, ra_err=0.0, dec_err=0.0, sysvel=0.0, veltyp='TOPCENT', veldef='OPTICAL', pmra=0.0, pmdec=0.0, pmra_err=0.0, pmdec_err=0.0, parallax=0.0, para_err=0.0, spectyp='UNKNOWN', category=None, revision=1)
| Initialize self. See help(type(self)) for accurate signature.
|
| __ne__(self, other)
| Return self!=value.
|
| __str__(self)
| Return str(self).
|
| info(self)
class OI_VIS(builtins.object)
| OI_VIS(timeobs, int_time, visamp, visamperr, visphi, visphierr, flag, ucoord, vcoord, wavelength, target, array=None, station=(None, None), cflux=None, cfluxerr=None, revision=1, amptyp=None, phityp=None, amporder=None, phiorder=None, visrefmap=None, rvis=None, rviserr=None, ivis=None, iviserr=None)
|
| Class for storing visibility amplitude and differential phase data.
| To access the data, use the following hidden attributes:
|
| visamp, visamperr, visphi, visphierr, flag;
| and possibly cflux, cfluxerr.
|
| Methods defined here:
|
| __eq__(self, other)
| Return self==value.
|
| __getattr__(self, attrname)
|
| __init__(self, timeobs, int_time, visamp, visamperr, visphi, visphierr, flag, ucoord, vcoord, wavelength, target, array=None, station=(None, None), cflux=None, cfluxerr=None, revision=1, amptyp=None, phityp=None, amporder=None, phiorder=None, visrefmap=None, rvis=None, rviserr=None, ivis=None, iviserr=None)
| Initialize self. See help(type(self)) for accurate signature.
|
| __ne__(self, other)
| Return self!=value.
|
| __repr__(self)
| Return repr(self).
|
| __setattr__(self, attrname, value)
| Implement setattr(self, name, value).
|
| info(self)
class OI_VIS2(builtins.object)
| OI_VIS2(timeobs, int_time, vis2data, vis2err, flag, ucoord, vcoord, wavelength, target, array=None, station=(None, None), revision=1)
|
| Class for storing squared visibility amplitude data.
| To access the data, use the following hidden attributes:
|
| vis2data, vis2err
|
| Methods defined here:
|
| __eq__(self, other)
| Return self==value.
|
| __getattr__(self, attrname)
|
| __init__(self, timeobs, int_time, vis2data, vis2err, flag, ucoord, vcoord, wavelength, target, array=None, station=(None, None), revision=1)
| Initialize self. See help(type(self)) for accurate signature.
|
| __ne__(self, other)
| Return self!=value.
|
| __repr__(self)
| Return repr(self).
|
| __setattr__(self, attrname, value)
| Implement setattr(self, name, value).
|
| info(self)
class OI_WAVELENGTH(builtins.object)
| OI_WAVELENGTH(eff_wave, eff_band=None, revision=1)
|
| Methods defined here:
|
| __eq__(self, other)
| Return self==value.
|
| __init__(self, eff_wave, eff_band=None, revision=1)
| Initialize self. See help(type(self)) for accurate signature.
|
| __ne__(self, other)
| Return self!=value.
|
| __repr__(self)
| Return repr(self).
|
| info(self)
class oifits(builtins.object)
| Methods defined here:
|
| __add__(self, other)
| Consistently combine two separate oifits objects. Note
| that targets can be matched by name only (e.g. if coordinates
| differ) by setting oifits.matchtargetbyname to True. The same
| goes for stations of the array (controlled by
| oifits.matchstationbyname)
|
| __eq__(self, other)
| Return self==value.
|
| __init__(self)
| Initialize self. See help(type(self)) for accurate signature.
|
| __ne__(self, other)
| Return self!=value.
|
| info(self, recursive=True, verbose=0)
| Print out a summary of the contents of the oifits object.
| Set recursive=True to obtain more specific information about
| each of the individual components, and verbose to an integer
| to increase the verbosity level.
|
| isconsistent(self)
| Returns True if the object is entirely self-contained,
| i.e. all cross-references to wavelength tables, arrays,
| stations etc. in the measurements refer to elements which are
| stored in the oifits object. Note that an oifits object can
| be 'consistent' in this sense without being 'valid' as checked
| by isvalid().
|
| isvalid(self)
| Returns True of the oifits object is both consistent (as
| determined by isconsistent()) and conforms to the OIFITS
| standard (according to Pauls et al., 2005, PASP, 117, 1255).
|
| save(self, filename)
| Write the contents of the oifits object to a file in OIFITS
| format.
FUNCTIONS
open(filename, quiet=False)
Open an OIFITS file.
DATA
__email__ = '[email protected]'
matchstationbyname = False
matchtargetbyname = False
refdate = datetime.datetime(2000, 1, 1, 0, 0)
VERSION
0.4-dev
DATE
13 January 2021
AUTHOR
Paul Boley