pyreduce-astro 0.6.0__cp312-cp312-macosx_11_0_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyreduce/__init__.py +67 -0
- pyreduce/__main__.py +106 -0
- pyreduce/clib/__init__.py +0 -0
- pyreduce/clib/_slitfunc_2d.cpython-311-darwin.so +0 -0
- pyreduce/clib/_slitfunc_2d.cpython-312-darwin.so +0 -0
- pyreduce/clib/_slitfunc_bd.cpython-311-darwin.so +0 -0
- pyreduce/clib/_slitfunc_bd.cpython-312-darwin.so +0 -0
- pyreduce/clib/build_extract.py +75 -0
- pyreduce/clib/slit_func_2d_xi_zeta_bd.c +1313 -0
- pyreduce/clib/slit_func_2d_xi_zeta_bd.h +55 -0
- pyreduce/clib/slit_func_bd.c +362 -0
- pyreduce/clib/slit_func_bd.h +17 -0
- pyreduce/clipnflip.py +147 -0
- pyreduce/combine_frames.py +855 -0
- pyreduce/configuration.py +186 -0
- pyreduce/continuum_normalization.py +329 -0
- pyreduce/cwrappers.py +404 -0
- pyreduce/datasets.py +231 -0
- pyreduce/echelle.py +413 -0
- pyreduce/estimate_background_scatter.py +129 -0
- pyreduce/extract.py +1361 -0
- pyreduce/extraction_width.py +77 -0
- pyreduce/instruments/__init__.py +0 -0
- pyreduce/instruments/andes.json +61 -0
- pyreduce/instruments/andes.py +102 -0
- pyreduce/instruments/common.json +46 -0
- pyreduce/instruments/common.py +683 -0
- pyreduce/instruments/crires_plus.json +63 -0
- pyreduce/instruments/crires_plus.py +103 -0
- pyreduce/instruments/filters.py +195 -0
- pyreduce/instruments/harpn.json +136 -0
- pyreduce/instruments/harpn.py +201 -0
- pyreduce/instruments/harps.json +155 -0
- pyreduce/instruments/harps.py +310 -0
- pyreduce/instruments/instrument_info.py +140 -0
- pyreduce/instruments/instrument_schema.json +318 -0
- pyreduce/instruments/jwst_miri.json +53 -0
- pyreduce/instruments/jwst_miri.py +29 -0
- pyreduce/instruments/jwst_niriss.json +52 -0
- pyreduce/instruments/jwst_niriss.py +98 -0
- pyreduce/instruments/lick_apf.json +53 -0
- pyreduce/instruments/lick_apf.py +35 -0
- pyreduce/instruments/mcdonald.json +59 -0
- pyreduce/instruments/mcdonald.py +123 -0
- pyreduce/instruments/metis_ifu.json +63 -0
- pyreduce/instruments/metis_ifu.py +45 -0
- pyreduce/instruments/metis_lss.json +65 -0
- pyreduce/instruments/metis_lss.py +45 -0
- pyreduce/instruments/micado.json +53 -0
- pyreduce/instruments/micado.py +45 -0
- pyreduce/instruments/neid.json +51 -0
- pyreduce/instruments/neid.py +154 -0
- pyreduce/instruments/nirspec.json +56 -0
- pyreduce/instruments/nirspec.py +215 -0
- pyreduce/instruments/nte.json +47 -0
- pyreduce/instruments/nte.py +42 -0
- pyreduce/instruments/uves.json +59 -0
- pyreduce/instruments/uves.py +46 -0
- pyreduce/instruments/xshooter.json +66 -0
- pyreduce/instruments/xshooter.py +39 -0
- pyreduce/make_shear.py +606 -0
- pyreduce/masks/mask_crires_plus_det1.fits.gz +0 -0
- pyreduce/masks/mask_crires_plus_det2.fits.gz +0 -0
- pyreduce/masks/mask_crires_plus_det3.fits.gz +0 -0
- pyreduce/masks/mask_ctio_chiron.fits.gz +0 -0
- pyreduce/masks/mask_elodie.fits.gz +0 -0
- pyreduce/masks/mask_feros3.fits.gz +0 -0
- pyreduce/masks/mask_flames_giraffe.fits.gz +0 -0
- pyreduce/masks/mask_harps_blue.fits.gz +0 -0
- pyreduce/masks/mask_harps_red.fits.gz +0 -0
- pyreduce/masks/mask_hds_blue.fits.gz +0 -0
- pyreduce/masks/mask_hds_red.fits.gz +0 -0
- pyreduce/masks/mask_het_hrs_2x5.fits.gz +0 -0
- pyreduce/masks/mask_jwst_miri_lrs_slitless.fits.gz +0 -0
- pyreduce/masks/mask_jwst_niriss_gr700xd.fits.gz +0 -0
- pyreduce/masks/mask_lick_apf_.fits.gz +0 -0
- pyreduce/masks/mask_mcdonald.fits.gz +0 -0
- pyreduce/masks/mask_nes.fits.gz +0 -0
- pyreduce/masks/mask_nirspec_nirspec.fits.gz +0 -0
- pyreduce/masks/mask_sarg.fits.gz +0 -0
- pyreduce/masks/mask_sarg_2x2a.fits.gz +0 -0
- pyreduce/masks/mask_sarg_2x2b.fits.gz +0 -0
- pyreduce/masks/mask_subaru_hds_red.fits.gz +0 -0
- pyreduce/masks/mask_uves_blue.fits.gz +0 -0
- pyreduce/masks/mask_uves_blue_binned_2_2.fits.gz +0 -0
- pyreduce/masks/mask_uves_middle.fits.gz +0 -0
- pyreduce/masks/mask_uves_middle_2x2_split.fits.gz +0 -0
- pyreduce/masks/mask_uves_middle_binned_2_2.fits.gz +0 -0
- pyreduce/masks/mask_uves_red.fits.gz +0 -0
- pyreduce/masks/mask_uves_red_2x2.fits.gz +0 -0
- pyreduce/masks/mask_uves_red_2x2_split.fits.gz +0 -0
- pyreduce/masks/mask_uves_red_binned_2_2.fits.gz +0 -0
- pyreduce/masks/mask_xshooter_nir.fits.gz +0 -0
- pyreduce/rectify.py +138 -0
- pyreduce/reduce.py +2205 -0
- pyreduce/settings/settings_ANDES.json +89 -0
- pyreduce/settings/settings_CRIRES_PLUS.json +89 -0
- pyreduce/settings/settings_HARPN.json +73 -0
- pyreduce/settings/settings_HARPS.json +69 -0
- pyreduce/settings/settings_JWST_MIRI.json +55 -0
- pyreduce/settings/settings_JWST_NIRISS.json +55 -0
- pyreduce/settings/settings_LICK_APF.json +62 -0
- pyreduce/settings/settings_MCDONALD.json +58 -0
- pyreduce/settings/settings_METIS_IFU.json +77 -0
- pyreduce/settings/settings_METIS_LSS.json +77 -0
- pyreduce/settings/settings_MICADO.json +78 -0
- pyreduce/settings/settings_NEID.json +73 -0
- pyreduce/settings/settings_NIRSPEC.json +58 -0
- pyreduce/settings/settings_NTE.json +60 -0
- pyreduce/settings/settings_UVES.json +54 -0
- pyreduce/settings/settings_XSHOOTER.json +78 -0
- pyreduce/settings/settings_pyreduce.json +178 -0
- pyreduce/settings/settings_schema.json +827 -0
- pyreduce/tools/__init__.py +0 -0
- pyreduce/tools/combine.py +117 -0
- pyreduce/trace_orders.py +645 -0
- pyreduce/util.py +1288 -0
- pyreduce/wavecal/MICADO_HK_3arcsec_chip5.npz +0 -0
- pyreduce/wavecal/atlas/thar.fits +4946 -13
- pyreduce/wavecal/atlas/thar_list.txt +4172 -0
- pyreduce/wavecal/atlas/une.fits +0 -0
- pyreduce/wavecal/convert.py +38 -0
- pyreduce/wavecal/crires_plus_J1228_Open_det1.npz +0 -0
- pyreduce/wavecal/crires_plus_J1228_Open_det2.npz +0 -0
- pyreduce/wavecal/crires_plus_J1228_Open_det3.npz +0 -0
- pyreduce/wavecal/harpn_harpn_2D.npz +0 -0
- pyreduce/wavecal/harps_blue_2D.npz +0 -0
- pyreduce/wavecal/harps_blue_pol_2D.npz +0 -0
- pyreduce/wavecal/harps_red_2D.npz +0 -0
- pyreduce/wavecal/harps_red_pol_2D.npz +0 -0
- pyreduce/wavecal/mcdonald.npz +0 -0
- pyreduce/wavecal/metis_lss_l_2D.npz +0 -0
- pyreduce/wavecal/metis_lss_m_2D.npz +0 -0
- pyreduce/wavecal/nirspec_K2.npz +0 -0
- pyreduce/wavecal/uves_blue_360nm_2D.npz +0 -0
- pyreduce/wavecal/uves_blue_390nm_2D.npz +0 -0
- pyreduce/wavecal/uves_blue_437nm_2D.npz +0 -0
- pyreduce/wavecal/uves_middle_2x2_2D.npz +0 -0
- pyreduce/wavecal/uves_middle_565nm_2D.npz +0 -0
- pyreduce/wavecal/uves_middle_580nm_2D.npz +0 -0
- pyreduce/wavecal/uves_middle_600nm_2D.npz +0 -0
- pyreduce/wavecal/uves_middle_665nm_2D.npz +0 -0
- pyreduce/wavecal/uves_middle_860nm_2D.npz +0 -0
- pyreduce/wavecal/uves_red_580nm_2D.npz +0 -0
- pyreduce/wavecal/uves_red_600nm_2D.npz +0 -0
- pyreduce/wavecal/uves_red_665nm_2D.npz +0 -0
- pyreduce/wavecal/uves_red_760nm_2D.npz +0 -0
- pyreduce/wavecal/uves_red_860nm_2D.npz +0 -0
- pyreduce/wavecal/xshooter_nir.npz +0 -0
- pyreduce/wavelength_calibration.py +1873 -0
- pyreduce_astro-0.6.0.dist-info/METADATA +114 -0
- pyreduce_astro-0.6.0.dist-info/RECORD +154 -0
- pyreduce_astro-0.6.0.dist-info/WHEEL +6 -0
- pyreduce_astro-0.6.0.dist-info/licenses/LICENSE +674 -0
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "pyreduce.instrument_schema",
|
|
4
|
+
"title": "PyReduce Instrument Settings",
|
|
5
|
+
"description": "Keywords that need to be set for the PyReduce to sort files correctly and interpret the header",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"__instrument__": {
|
|
9
|
+
"description": "Meta data, for which instrument this file is designed",
|
|
10
|
+
"type": "string"
|
|
11
|
+
},
|
|
12
|
+
"instrument": {
|
|
13
|
+
"description": "keyword for the instrument in the header",
|
|
14
|
+
"type": "string"
|
|
15
|
+
},
|
|
16
|
+
"id_instrument": {
|
|
17
|
+
"description": "Value of the instrument keyword, can be regex",
|
|
18
|
+
"type": "string"
|
|
19
|
+
},
|
|
20
|
+
"telescope": {
|
|
21
|
+
"description": "keyword for the telescope in the header",
|
|
22
|
+
"type": "string"
|
|
23
|
+
},
|
|
24
|
+
"target": {
|
|
25
|
+
"description": "keyword of the target in the header",
|
|
26
|
+
"type": "string"
|
|
27
|
+
},
|
|
28
|
+
"date": {
|
|
29
|
+
"description": "keyword of the datetime in the header",
|
|
30
|
+
"type": "string"
|
|
31
|
+
},
|
|
32
|
+
"date_format": {
|
|
33
|
+
"description": "format of the datetime in the header, e.g. fits (default), or mjd",
|
|
34
|
+
"type": "string"
|
|
35
|
+
},
|
|
36
|
+
"extension": {
|
|
37
|
+
"description": "the extension of the fits file to use to access the data",
|
|
38
|
+
"oneOf": [
|
|
39
|
+
{"type": "integer"},
|
|
40
|
+
{"type": "string"},
|
|
41
|
+
{
|
|
42
|
+
"type": "array",
|
|
43
|
+
"items": {
|
|
44
|
+
"oneOf": [
|
|
45
|
+
{"type": "integer"},
|
|
46
|
+
{"type": "string"}
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
"orientation": {
|
|
53
|
+
"description": "the orientation of the input files, equal to the number of 90 degree flips necessary",
|
|
54
|
+
"oneOf": [
|
|
55
|
+
{"type": "integer"},
|
|
56
|
+
{
|
|
57
|
+
"type": "array",
|
|
58
|
+
"items": {"type": "integer"}
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
"transpose": {
|
|
63
|
+
"description": "If true the image is transposed before rotation, thus flipping the image",
|
|
64
|
+
"type": "boolean"
|
|
65
|
+
},
|
|
66
|
+
"prescan_x": {
|
|
67
|
+
"description": "The horizontal prescan direction, before orientation, or the keyword that contains that value",
|
|
68
|
+
"oneOf": [
|
|
69
|
+
{"type": "integer"},
|
|
70
|
+
{"type": "string"}
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
"overscan_x": {
|
|
74
|
+
"description": "The overscan in horizontal direction, before orientation, or the keyword that contains that value",
|
|
75
|
+
"oneOf": [
|
|
76
|
+
{"type": "integer"},
|
|
77
|
+
{"type": "string"}
|
|
78
|
+
]
|
|
79
|
+
},
|
|
80
|
+
"prescan_y": {
|
|
81
|
+
"description": "The vertical prescan direction, before orientation, or the keyword that contains that value",
|
|
82
|
+
"oneOf": [
|
|
83
|
+
{"type": "integer"},
|
|
84
|
+
{"type": "string"}
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
"overscan_y": {
|
|
88
|
+
"description": "The overscan in vertical direction, before orientation, or the keyword that contains that value",
|
|
89
|
+
"oneOf": [
|
|
90
|
+
{"type": "integer"},
|
|
91
|
+
{"type": "string"}
|
|
92
|
+
]
|
|
93
|
+
},
|
|
94
|
+
"naxis_x": {
|
|
95
|
+
"description": "The size of the horizontal axis",
|
|
96
|
+
"oneOf": [
|
|
97
|
+
{"type": "integer"},
|
|
98
|
+
{"type": "string"}
|
|
99
|
+
]
|
|
100
|
+
},
|
|
101
|
+
"naxis_y": {
|
|
102
|
+
"description": "The size of the vertical axis",
|
|
103
|
+
"oneOf": [
|
|
104
|
+
{"type": "integer"},
|
|
105
|
+
{"type": "string"}
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
"gain": {
|
|
109
|
+
"description": "The gain of the instrument",
|
|
110
|
+
"oneOf": [
|
|
111
|
+
{"type": "number"},
|
|
112
|
+
{"type": "string"}
|
|
113
|
+
]
|
|
114
|
+
},
|
|
115
|
+
"readnoise": {
|
|
116
|
+
"description": "The readnoise of the instrument",
|
|
117
|
+
"oneOf": [
|
|
118
|
+
{"type": "number"},
|
|
119
|
+
{"type": "string"}
|
|
120
|
+
]
|
|
121
|
+
},
|
|
122
|
+
"dark": {
|
|
123
|
+
"description": "The dark current of the instrument",
|
|
124
|
+
"oneOf": [
|
|
125
|
+
{"type": "number"},
|
|
126
|
+
{"type": "string"}
|
|
127
|
+
]
|
|
128
|
+
},
|
|
129
|
+
"sky": {
|
|
130
|
+
"description": "The sky background of the instrument",
|
|
131
|
+
"oneOf": [
|
|
132
|
+
{"type": "number"},
|
|
133
|
+
{"type": "string"}
|
|
134
|
+
]
|
|
135
|
+
},
|
|
136
|
+
"exposure_time": {
|
|
137
|
+
"description": "The keyword for the exposure time in seconds of the observation",
|
|
138
|
+
"type": "string"
|
|
139
|
+
},
|
|
140
|
+
"ra": {
|
|
141
|
+
"description": "The keyword for the right acension of the observation",
|
|
142
|
+
"type": "string"
|
|
143
|
+
},
|
|
144
|
+
"dec": {
|
|
145
|
+
"description": "The keyword for the declination of the observation",
|
|
146
|
+
"type": "string"
|
|
147
|
+
},
|
|
148
|
+
"longitude": {
|
|
149
|
+
"description": "The longitude of the telescope on earth",
|
|
150
|
+
"oneOf": [
|
|
151
|
+
{"type": "number"},
|
|
152
|
+
{"type": "string"},
|
|
153
|
+
{"type": "null"}
|
|
154
|
+
]
|
|
155
|
+
},
|
|
156
|
+
"latitude": {
|
|
157
|
+
"description": "The latitude of the telescope on earth",
|
|
158
|
+
"oneOf": [
|
|
159
|
+
{"type": "number"},
|
|
160
|
+
{"type": "string"},
|
|
161
|
+
{"type": "null"}
|
|
162
|
+
]
|
|
163
|
+
},
|
|
164
|
+
"altitude": {
|
|
165
|
+
"description": "The altitude of the telescope on earth",
|
|
166
|
+
"oneOf": [
|
|
167
|
+
{"type": "number"},
|
|
168
|
+
{"type": "string"},
|
|
169
|
+
{"type": "null"}
|
|
170
|
+
]
|
|
171
|
+
},
|
|
172
|
+
"kw_bias": {
|
|
173
|
+
"description": "The keyword that identifies the bias files",
|
|
174
|
+
"oneOf": [
|
|
175
|
+
{"type": "string"},
|
|
176
|
+
{"type": "null"}
|
|
177
|
+
]
|
|
178
|
+
},
|
|
179
|
+
"kw_flat": {
|
|
180
|
+
"description": "The keyword that identifies the flat files",
|
|
181
|
+
"oneOf": [
|
|
182
|
+
{"type": "string"},
|
|
183
|
+
{"type": "null"}
|
|
184
|
+
]
|
|
185
|
+
},
|
|
186
|
+
"kw_curvature": {
|
|
187
|
+
"description": "The keyword that identifies the curvature files",
|
|
188
|
+
"oneOf": [
|
|
189
|
+
{"type": "string"},
|
|
190
|
+
{"type": "null"}
|
|
191
|
+
]
|
|
192
|
+
},
|
|
193
|
+
"kw_scatter": {
|
|
194
|
+
"description": "The keyword that identifies the background scatter files",
|
|
195
|
+
"oneOf": [
|
|
196
|
+
{"type": "string"},
|
|
197
|
+
{"type": "null"}
|
|
198
|
+
]
|
|
199
|
+
},
|
|
200
|
+
"kw_orders": {
|
|
201
|
+
"description": "The keyword that identifies the order definition files",
|
|
202
|
+
"oneOf": [
|
|
203
|
+
{"type": "string"},
|
|
204
|
+
{"type": "null"}
|
|
205
|
+
]
|
|
206
|
+
},
|
|
207
|
+
"kw_wave": {
|
|
208
|
+
"description": "The keyword that identifies the wavecal files",
|
|
209
|
+
"oneOf": [
|
|
210
|
+
{"type": "string"},
|
|
211
|
+
{"type": "null"}
|
|
212
|
+
]
|
|
213
|
+
},
|
|
214
|
+
"kw_comb": {
|
|
215
|
+
"description": "The keyword that identifies the laser frequency comb / fabry perot interferometer files",
|
|
216
|
+
"oneOf": [
|
|
217
|
+
{"type": "string"},
|
|
218
|
+
{"type": "null"}
|
|
219
|
+
]
|
|
220
|
+
},
|
|
221
|
+
"kw_spec": {
|
|
222
|
+
"description": "The keyword that identifies the science files",
|
|
223
|
+
"oneOf": [
|
|
224
|
+
{"type": "string"},
|
|
225
|
+
{"type": "null"}
|
|
226
|
+
]
|
|
227
|
+
},
|
|
228
|
+
"id_bias": {
|
|
229
|
+
"description": "The value that identifies the bias files",
|
|
230
|
+
"oneOf": [
|
|
231
|
+
{"type": "string"},
|
|
232
|
+
{"type": "null"}
|
|
233
|
+
]
|
|
234
|
+
},
|
|
235
|
+
"id_flat": {
|
|
236
|
+
"description": "The value that identifies the flat files",
|
|
237
|
+
"oneOf": [
|
|
238
|
+
{"type": "string"},
|
|
239
|
+
{"type": "null"}
|
|
240
|
+
]
|
|
241
|
+
},
|
|
242
|
+
"id_curvature": {
|
|
243
|
+
"description": "The value that identifies the curvature files",
|
|
244
|
+
"oneOf": [
|
|
245
|
+
{"type": "string"},
|
|
246
|
+
{"type": "null"}
|
|
247
|
+
]
|
|
248
|
+
},
|
|
249
|
+
"id_scatter": {
|
|
250
|
+
"description": "The value that identifies the background scatter files",
|
|
251
|
+
"oneOf": [
|
|
252
|
+
{"type": "string"},
|
|
253
|
+
{"type": "null"}
|
|
254
|
+
]
|
|
255
|
+
},
|
|
256
|
+
"id_orders": {
|
|
257
|
+
"description": "The value that identifies the order definition files",
|
|
258
|
+
"oneOf": [
|
|
259
|
+
{"type": "string"},
|
|
260
|
+
{"type": "null"}
|
|
261
|
+
]
|
|
262
|
+
},
|
|
263
|
+
"id_wave": {
|
|
264
|
+
"description": "The value that identifies the wavecal files",
|
|
265
|
+
"oneOf": [
|
|
266
|
+
{"type": "string"},
|
|
267
|
+
{"type": "null"}
|
|
268
|
+
]
|
|
269
|
+
},
|
|
270
|
+
"id_comb": {
|
|
271
|
+
"description": "The value that identifies the laser frequency comb / fabry perot interferometer files",
|
|
272
|
+
"oneOf": [
|
|
273
|
+
{"type": "string"},
|
|
274
|
+
{"type": "null"}
|
|
275
|
+
]
|
|
276
|
+
},
|
|
277
|
+
"id_spec": {
|
|
278
|
+
"description": "The value that identifies the science files",
|
|
279
|
+
"oneOf": [
|
|
280
|
+
{"type": "string"},
|
|
281
|
+
{"type": "null"}
|
|
282
|
+
]
|
|
283
|
+
}
|
|
284
|
+
},
|
|
285
|
+
"required": [
|
|
286
|
+
"instrument",
|
|
287
|
+
"id_instrument",
|
|
288
|
+
"telescope",
|
|
289
|
+
"target",
|
|
290
|
+
"date",
|
|
291
|
+
"extension",
|
|
292
|
+
"orientation",
|
|
293
|
+
"naxis_x",
|
|
294
|
+
"naxis_y",
|
|
295
|
+
"gain",
|
|
296
|
+
"readnoise",
|
|
297
|
+
"exposure_time",
|
|
298
|
+
"ra",
|
|
299
|
+
"dec",
|
|
300
|
+
"kw_bias",
|
|
301
|
+
"kw_flat",
|
|
302
|
+
"kw_curvature",
|
|
303
|
+
"kw_scatter",
|
|
304
|
+
"kw_orders",
|
|
305
|
+
"kw_wave",
|
|
306
|
+
"kw_comb",
|
|
307
|
+
"kw_spec",
|
|
308
|
+
"id_bias",
|
|
309
|
+
"id_flat",
|
|
310
|
+
"id_orders",
|
|
311
|
+
"id_curvature",
|
|
312
|
+
"id_scatter",
|
|
313
|
+
"id_wave",
|
|
314
|
+
"id_comb",
|
|
315
|
+
"id_spec"
|
|
316
|
+
],
|
|
317
|
+
"additionalProperties": true
|
|
318
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"__instrument__": "JWST_MIRI",
|
|
3
|
+
"instrument": "INSTRUME",
|
|
4
|
+
"id_instrument": "MIRI",
|
|
5
|
+
"telescope": "JWST",
|
|
6
|
+
"date": "DATE-OBS",
|
|
7
|
+
"date_format": "fits",
|
|
8
|
+
"time": "TIME-OBS",
|
|
9
|
+
"target": "OBJECT",
|
|
10
|
+
"instrument_mode": "EXP_TYPE",
|
|
11
|
+
"modes": [
|
|
12
|
+
"LRS_SLITLESS"
|
|
13
|
+
],
|
|
14
|
+
"modes_id": [
|
|
15
|
+
"MIR_LRS-SLITLESS"
|
|
16
|
+
],
|
|
17
|
+
"extension": [
|
|
18
|
+
"SCI"
|
|
19
|
+
],
|
|
20
|
+
"orientation": 3,
|
|
21
|
+
"transpose": false,
|
|
22
|
+
"overscan_x": 5,
|
|
23
|
+
"prescan_x": 15,
|
|
24
|
+
"prescan_y": 0,
|
|
25
|
+
"overscan_y": 0,
|
|
26
|
+
"naxis_x": "SUBSIZE1",
|
|
27
|
+
"naxis_y": "SUBSIZE2",
|
|
28
|
+
"nints": "NINTS",
|
|
29
|
+
"ngroups": "NGROUPS",
|
|
30
|
+
"gain": "GAINCF",
|
|
31
|
+
"readnoise": "RDNOISE",
|
|
32
|
+
"ra": "RA_V1",
|
|
33
|
+
"dec": "DEC_V1",
|
|
34
|
+
"pa": "PA_V3",
|
|
35
|
+
"exposure_time": "EXPTIME",
|
|
36
|
+
|
|
37
|
+
"kw_bias" : null,
|
|
38
|
+
"kw_flat" : null,
|
|
39
|
+
"kw_curvature": null,
|
|
40
|
+
"kw_scatter": null,
|
|
41
|
+
"kw_orders" : null,
|
|
42
|
+
"kw_wave": null,
|
|
43
|
+
"kw_comb": null,
|
|
44
|
+
"kw_spec": "FILETYPE",
|
|
45
|
+
"id_bias" : null,
|
|
46
|
+
"id_flat": null,
|
|
47
|
+
"id_orders": null,
|
|
48
|
+
"id_curvature": null,
|
|
49
|
+
"id_scatter": null,
|
|
50
|
+
"id_wave": null,
|
|
51
|
+
"id_comb": null,
|
|
52
|
+
"id_spec": "ILLUMINATION"
|
|
53
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Handles instrument specific info for the HARPS spectrograph
|
|
3
|
+
|
|
4
|
+
Mostly reading data from the header
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import logging
|
|
8
|
+
import os.path
|
|
9
|
+
|
|
10
|
+
from .common import Instrument
|
|
11
|
+
|
|
12
|
+
logger = logging.getLogger(__name__)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class JWST_MIRI(Instrument):
|
|
16
|
+
def add_header_info(self, header, mode, **kwargs):
|
|
17
|
+
"""read data from header and add it as REDUCE keyword back to the header"""
|
|
18
|
+
# "Normal" stuff is handled by the general version, specific changes to values happen here
|
|
19
|
+
# alternatively you can implement all of it here, whatever works
|
|
20
|
+
header = super().add_header_info(header, mode)
|
|
21
|
+
self.load_info()
|
|
22
|
+
return header
|
|
23
|
+
|
|
24
|
+
def get_wavecal_filename(self, header, mode, **kwargs):
|
|
25
|
+
"""Get the filename of the wavelength calibration config file"""
|
|
26
|
+
cwd = os.path.dirname(__file__)
|
|
27
|
+
fname = "{instrument}_{mode}_2D.npz".format(instrument="harps", mode=mode)
|
|
28
|
+
fname = os.path.join(cwd, "..", "wavecal", fname)
|
|
29
|
+
return fname
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"__comment__": "red and middle are in the same fits file, with different extensions, i.e. share the same mode identifier, but have different extensions",
|
|
3
|
+
"__instrument__": "JWST_NIRISS",
|
|
4
|
+
"instrument": "INSTRUME",
|
|
5
|
+
"id_instrument": "NIRISS",
|
|
6
|
+
"telescope": "JWST",
|
|
7
|
+
"date": "DATE-OBS",
|
|
8
|
+
"date_format": "iso",
|
|
9
|
+
"instrument_mode": "PUPIL",
|
|
10
|
+
"modes": ["GR700XD"],
|
|
11
|
+
"modes_id": ["GR700XD"],
|
|
12
|
+
"extension": ["SCI"],
|
|
13
|
+
"orientation": 0,
|
|
14
|
+
"transpose": false,
|
|
15
|
+
"prescan_y": 0,
|
|
16
|
+
"overscan_y": 4,
|
|
17
|
+
"prescan_x": 3,
|
|
18
|
+
"overscan_x": 4,
|
|
19
|
+
"naxis_x": "NAXIS1",
|
|
20
|
+
"naxis_y": "NAXIS2",
|
|
21
|
+
"gain": "R_GAIN",
|
|
22
|
+
"readnoise": "R_READNO",
|
|
23
|
+
"exposure_time": "EXPTIME",
|
|
24
|
+
"image_type": "OBJECT",
|
|
25
|
+
"ra": "TARG_RA",
|
|
26
|
+
"dec": "TARG_DEC",
|
|
27
|
+
"position.x": "JWST_X",
|
|
28
|
+
"position.y": "JWST_Y",
|
|
29
|
+
"position.z": "JWST_Z",
|
|
30
|
+
"position.vx": "JWST_DX",
|
|
31
|
+
"position.vy": "JWST_DY",
|
|
32
|
+
"position.vz": "JWST_DZ",
|
|
33
|
+
"target": "TARGNAME",
|
|
34
|
+
"observation_type": "FILETYPE",
|
|
35
|
+
|
|
36
|
+
"kw_bias" : null,
|
|
37
|
+
"kw_flat" : "FILENAME",
|
|
38
|
+
"kw_curvature": null,
|
|
39
|
+
"kw_scatter": "FILENAME",
|
|
40
|
+
"kw_orders" : "FILENAME",
|
|
41
|
+
"kw_wave": null,
|
|
42
|
+
"kw_comb": null,
|
|
43
|
+
"kw_spec": "INSTRUME",
|
|
44
|
+
"id_bias" : null,
|
|
45
|
+
"id_flat": "flat.fits",
|
|
46
|
+
"id_orders": "flat.fits",
|
|
47
|
+
"id_curvature": null,
|
|
48
|
+
"id_scatter": "flat.fits",
|
|
49
|
+
"id_wave": null,
|
|
50
|
+
"id_comb": null,
|
|
51
|
+
"id_spec": "NIRISS"
|
|
52
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Handles instrument specific info for the HARPS spectrograph
|
|
3
|
+
|
|
4
|
+
Mostly reading data from the header
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import logging
|
|
8
|
+
import os.path
|
|
9
|
+
|
|
10
|
+
from astropy import units as q
|
|
11
|
+
from astropy.io import fits
|
|
12
|
+
from astropy.time import Time
|
|
13
|
+
|
|
14
|
+
from .common import Instrument
|
|
15
|
+
|
|
16
|
+
logger = logging.getLogger(__name__)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class JWST_NIRISS(Instrument):
|
|
20
|
+
def add_header_info(self, header, mode, **kwargs):
|
|
21
|
+
"""read data from header and add it as REDUCE keyword back to the header"""
|
|
22
|
+
# "Normal" stuff is handled by the general version, specific changes to values happen here
|
|
23
|
+
# alternatively you can implement all of it here, whatever works
|
|
24
|
+
header = super().add_header_info(header, mode)
|
|
25
|
+
self.load_info()
|
|
26
|
+
|
|
27
|
+
# TODO: this references some files, I dont know where they should be
|
|
28
|
+
header["e_gain"] = 1.61
|
|
29
|
+
header["e_readn"] = 18.32
|
|
30
|
+
header["e_dark"] = 0.0257
|
|
31
|
+
|
|
32
|
+
# total exposure time
|
|
33
|
+
header["exptime"] = header.get("TFRAME", 0)
|
|
34
|
+
|
|
35
|
+
return header
|
|
36
|
+
|
|
37
|
+
def split_observation(self, fname, mode):
|
|
38
|
+
hdu = fits.open(fname)
|
|
39
|
+
dirname = os.path.dirname(fname)
|
|
40
|
+
fname = os.path.basename(fname)
|
|
41
|
+
|
|
42
|
+
header = hdu[0].header
|
|
43
|
+
if "mjd-obs" not in header:
|
|
44
|
+
if len(header["DATE-OBS"]) <= 10:
|
|
45
|
+
time = header["DATE-OBS"] + "T" + header["TIME-OBS"]
|
|
46
|
+
else:
|
|
47
|
+
time = header["DATE-OBS"]
|
|
48
|
+
header["MJD-OBS"] = Time(time).mjd
|
|
49
|
+
|
|
50
|
+
header2 = fits.Header()
|
|
51
|
+
header2["EXTNAME"] = "SCI"
|
|
52
|
+
shape = hdu["SCI"].data.shape
|
|
53
|
+
|
|
54
|
+
nframes = shape[0]
|
|
55
|
+
ngroups = shape[1]
|
|
56
|
+
|
|
57
|
+
if nframes == 1 and ngroups == 1:
|
|
58
|
+
return [os.path.join(dirname, fname)]
|
|
59
|
+
|
|
60
|
+
data = hdu["SCI"].data.reshape((-1, *shape[-2:]))
|
|
61
|
+
bias = data[0]
|
|
62
|
+
primary = fits.PrimaryHDU(header=header)
|
|
63
|
+
files = []
|
|
64
|
+
os.makedirs(os.path.join(dirname, "split"), exist_ok=True)
|
|
65
|
+
for i in range(1, nframes * ngroups):
|
|
66
|
+
data[i] - bias
|
|
67
|
+
bias = data[i]
|
|
68
|
+
fname_this = os.path.join(dirname, "split", f"pyreduce_{i}_{fname}")
|
|
69
|
+
|
|
70
|
+
header["MJD-OBS"] += header["TFRAME"] * q.s.to(q.day)
|
|
71
|
+
secondary = fits.ImageHDU(data=data, header=header2)
|
|
72
|
+
hdu_this = fits.HDUList([primary, secondary])
|
|
73
|
+
hdu_this.writeto(fname_this, overwrite=True)
|
|
74
|
+
files.append(fname_this)
|
|
75
|
+
hdu.close()
|
|
76
|
+
return files
|
|
77
|
+
|
|
78
|
+
def sort_files(self, input_dir, target, night, mode, allow_calibration_only=False):
|
|
79
|
+
files = super().sort_files(
|
|
80
|
+
input_dir,
|
|
81
|
+
target,
|
|
82
|
+
night,
|
|
83
|
+
mode,
|
|
84
|
+
allow_calibration_only=allow_calibration_only,
|
|
85
|
+
)
|
|
86
|
+
for i, (_k, file) in enumerate(files):
|
|
87
|
+
files_split = []
|
|
88
|
+
for f in file["science"]:
|
|
89
|
+
files_split += self.split_observation(f, mode)
|
|
90
|
+
files[i][1]["science"] = files_split
|
|
91
|
+
return files
|
|
92
|
+
|
|
93
|
+
def get_wavecal_filename(self, header, mode, **kwargs):
|
|
94
|
+
"""Get the filename of the wavelength calibration config file"""
|
|
95
|
+
cwd = os.path.dirname(__file__)
|
|
96
|
+
fname = "{instrument}_{mode}_2D.npz".format(instrument="harps", mode=mode)
|
|
97
|
+
fname = os.path.join(cwd, "..", "wavecal", fname)
|
|
98
|
+
return fname
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"__comment__": "red and middle are in the same fits file, with different extensions, i.e. share the same mode identifier, but have different extensions",
|
|
3
|
+
"__instrument__": "LICK_APF",
|
|
4
|
+
"instrument": "version",
|
|
5
|
+
"id_instrument": "apf",
|
|
6
|
+
"telescope": "Lick",
|
|
7
|
+
"date": "DATE",
|
|
8
|
+
"date_format": "fits",
|
|
9
|
+
"modes": [""],
|
|
10
|
+
"modes_id": [""],
|
|
11
|
+
"extension": [0],
|
|
12
|
+
"orientation": 3,
|
|
13
|
+
"transpose": false,
|
|
14
|
+
"prescan_y": "TCPR1",
|
|
15
|
+
"overscan_y": "TCPR2",
|
|
16
|
+
"prescan_x": "PPRERD",
|
|
17
|
+
"overscan_x": "PPRERD",
|
|
18
|
+
"naxis_x": "NAXIS1",
|
|
19
|
+
"naxis_y": "NAXIS2",
|
|
20
|
+
"gain": "GAIN",
|
|
21
|
+
"readnoise": 0,
|
|
22
|
+
"dark": 0,
|
|
23
|
+
"sky": 0,
|
|
24
|
+
"exposure_time": "EXPTIME",
|
|
25
|
+
"category": "",
|
|
26
|
+
"ra": "RA",
|
|
27
|
+
"dec": "DEC",
|
|
28
|
+
"longitude": -121.63667,
|
|
29
|
+
"latitude": 37.34334,
|
|
30
|
+
"altitude": 1290,
|
|
31
|
+
"target": "OBJECT",
|
|
32
|
+
"observation_type": "OBSTYPE",
|
|
33
|
+
|
|
34
|
+
"kw_mode": null,
|
|
35
|
+
"kw_bias" : "OBSTYPE",
|
|
36
|
+
"kw_flat" : "OBJECT",
|
|
37
|
+
"kw_curvature": "OBJECT",
|
|
38
|
+
"kw_scatter": "OBJECT",
|
|
39
|
+
"kw_orders" : "OBJECT",
|
|
40
|
+
"kw_wave": "OBJECT",
|
|
41
|
+
"kw_comb": null,
|
|
42
|
+
"kw_spec": "OBSTYPE",
|
|
43
|
+
|
|
44
|
+
"id_mode": null,
|
|
45
|
+
"id_bias": "DARK",
|
|
46
|
+
"id_flat": "WideFlat",
|
|
47
|
+
"id_orders": "NarrowFlat",
|
|
48
|
+
"id_curvature": "ThAr",
|
|
49
|
+
"id_scatter": "NarrowFlat",
|
|
50
|
+
"id_wave": "ThAr",
|
|
51
|
+
"id_comb": null,
|
|
52
|
+
"id_spec": "OBJECT"
|
|
53
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Handles instrument specific info for the HARPS spectrograph
|
|
3
|
+
|
|
4
|
+
Mostly reading data from the header
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import logging
|
|
8
|
+
import os.path
|
|
9
|
+
|
|
10
|
+
from .common import Instrument
|
|
11
|
+
|
|
12
|
+
logger = logging.getLogger(__name__)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class LICK_APF(Instrument):
|
|
16
|
+
def add_header_info(self, header, mode, **kwargs):
|
|
17
|
+
"""read data from header and add it as REDUCE keyword back to the header"""
|
|
18
|
+
# "Normal" stuff is handled by the general version, specific changes to values happen here
|
|
19
|
+
# alternatively you can implement all of it here, whatever works
|
|
20
|
+
header = super().add_header_info(header, mode)
|
|
21
|
+
self.load_info()
|
|
22
|
+
|
|
23
|
+
# pos = EarthLocation.of_site("Lick Observatory")
|
|
24
|
+
# header["e_obslon"] = pos.lon.to_value("deg")
|
|
25
|
+
# header["e_obslat"] = pos.lat.to_value("deg")
|
|
26
|
+
# header["e_obsalt"] = pos.height.to_value("m")
|
|
27
|
+
|
|
28
|
+
return header
|
|
29
|
+
|
|
30
|
+
def get_wavecal_filename(self, header, mode, **kwargs):
|
|
31
|
+
"""Get the filename of the wavelength calibration config file"""
|
|
32
|
+
cwd = os.path.dirname(__file__)
|
|
33
|
+
fname = "lick_apf_2D.npz"
|
|
34
|
+
fname = os.path.join(cwd, "..", "wavecal", fname)
|
|
35
|
+
return fname
|