Instrument Neutral Distributed Interface INDI  2.0.0
sdfits.h
Go to the documentation of this file.
1 /*
2 * DSP API - a digital signal processing library for astronomy usage
3 * Copyright © 2017-2022 Ilia Platone
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 3 of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this program; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19 
20 #ifndef _FITS_EXTENSION_SDFITS_H
21 #define _FITS_EXTENSION_SDFITS_H
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 #include <fits.h>
27 
29 
31 #define FITS_TABLE_SDFITS "SINGLE DISH"
32 
35 #define SDFITS_COLUMN_OBJECT (dsp_fits_column){"OBJECT", "8A", "", "", "common FITS usage", (char*[]){""}}
37 #define SDFITS_COLUMN_TELESCOP (dsp_fits_column){"TELESCOP", "8A", "", "", "common FITS keyword", (char*[]){""}}
39 #define SDFITS_COLUMN_FREQRES (dsp_fits_column){"FREQRES", EXTFITS_ELEMENT_DOUBLE.typestr, EXTFITS_MEASURE_UNIT_HZ, "", "resolution may differ from spacing of backend, not one channel", (char*[]){""}}
40 #define SDFITS_COLUMN_BANDWID (dsp_fits_column){"BANDWID", EXTFITS_ELEMENT_DOUBLE.typestr, EXTFITS_MEASURE_UNIT_HZ, "", "", (char*[]){""}}
42 #define SDFITS_COLUMN_DATE_OBS (dsp_fits_column){"DATE-OBS", "8A", "", "", "common FITS usage; JD preferable?", (char*[]){""}}
44 #define SDFITS_COLUMN_TIME (dsp_fits_column){"TIME", EXTFITS_ELEMENT_DOUBLE.typestr, EXTFITS_MEASURE_UNIT_SECOND, "", "UT time of day; UT seconds since Oh UT", (char*[]){""}}
46 #define SDFITS_COLUMN_EXPOSURE (dsp_fits_column){"EXPOSURE", EXTFITS_ELEMENT_DOUBLE.typestr, EXTFITS_MEASURE_UNIT_SECOND, "", "effective integration time", (char*[]){""}}
48 #define SDFITS_COLUMN_TSYS (dsp_fits_column){"TSYS", EXTFITS_ELEMENT_DOUBLE.typestr, EXTFITS_MEASURE_UNIT_KELVIN, "", "system, not receiver, temperature", (char*[]){""}}
50 #define SDFITS_COLUMN_OBJCTRA (dsp_fits_column){"OBJCTRA", EXTFITS_ELEMENT_STRING.typestr, EXTFITS_MEASURE_UNIT_DEGREE, "", "Target right ascension coordinate", (char*[]){""}}
52 #define SDFITS_COLUMN_OBJCTDEC (dsp_fits_column){"OBJCTDEC", EXTFITS_ELEMENT_STRING.typestr, EXTFITS_MEASURE_UNIT_DEGREE, "", "Target declination coordinate", (char*[]){""}}
54 #define SDFITS_COLUMN_DATA (dsp_fits_column){"DATA", "", "", "", "", (char*[]){""}}
55 
58 #define OBSTYPE_LINE "LINE"
60 #define OBSTYPE_CONT "CONT"
62 #define OBSTYPE_PULS "PULS"
63 
65 #define OBSMODE_PSSW "PSSW"
67 #define OBSMODE_FQSW "FQSW"
69 #define OBSMODE_BMSW "BMSW"
71 #define OBSMODE_PLSW "PLSW"
73 #define OBSMODE_LDSW "LDSW"
75 #define OBSMODE_TLPW "TLPW"
76 
78 #define OBSMODE_LINE_PSSW OBSTYPE_LINE OBSMODE_PSSW
80 #define OBSMODE_LINE_FQSW OBSTYPE_LINE OBSMODE_FQSW
82 #define OBSMODE_LINE_BMSW OBSTYPE_LINE OBSMODE_BMSW
84 #define OBSMODE_LINE_PLSW OBSTYPE_LINE OBSMODE_PLSW
86 #define OBSMODE_LINE_LDSW OBSTYPE_LINE OBSMODE_LDSW
88 #define OBSMODE_LINE_TLPW OBSTYPE_LINE OBSMODE_TLPW
89 
92 #define OBSMODE_CONT_PSSW OBSTYPE_CONT OBSMODE_PSSW
94 #define OBSMODE_CONT_FQSW OBSTYPE_CONT OBSMODE_FQSW
96 #define OBSMODE_CONT_BMSW OBSTYPE_CONT OBSMODE_BMSW
98 #define OBSMODE_CONT_PLSW OBSTYPE_CONT OBSMODE_PLSW
100 #define OBSMODE_CONT_LDSW OBSTYPE_CONT OBSMODE_LDSW
102 #define OBSMODE_CONT_TLPW OBSTYPE_CONT OBSMODE_TLPW
103 
106 #define OBSMODE_PULS_PSSW OBSTYPE_PULS OBSMODE_PSSW
108 #define OBSMODE_PULS_FQSW OBSTYPE_PULS OBSMODE_FQSW
110 #define OBSMODE_PULS_BMSW OBSTYPE_PULS OBSMODE_BMSW
112 #define OBSMODE_PULS_PLSW OBSTYPE_PULS OBSMODE_PLSW
114 #define OBSMODE_PULS_LDSW OBSTYPE_PULS OBSMODE_LDSW
116 #define OBSMODE_PULS_TLPW OBSTYPE_PULS OBSMODE_TLPW
117 
119 #define TEMPSCAL_TB "TB"
120 #define TEMPSCAL_TA "TA"
121 #define TEMPSCAL_TA_TR "TA*TR"
122 #define TEMPSCAL_TR "TR*"
123 
125 #define VELDEF_RADI "*RADI"
126 #define VELDEF_OPTI "OPTI"
127 #define VELDEF_RELA "RELA"
128 #define VELDEF_LSR "LSR"
129 #define VELDEF_HELO "HELO"
130 #define VELDEF_EART "EART"
131 #define VELDEF_BARI "BARI"
132 #define VELDEF_OBS "-OBS"
133 
136 #define SDFITS_COLUMN_OBSERVER (dsp_fits_column){"OBSERVER", "8A", "", "", "Observer name", (char*[]){""}}
138 #define SDFITS_COLUMN_OBSID (dsp_fits_column){"OBSID", "8A", "", "", "Observer & operator initials", (char*[]){""}}
140 #define SDFITS_COLUMN_PROJID (dsp_fits_column){"PROJID", "8A", "", "", "Project ID", (char*[]){""}}
142 #define SDFITS_COLUMN_SCAN (dsp_fits_column){"SCAN", EXTFITS_ELEMENT_DOUBLE.typestr, "", "", "Scan number", (char*[]){""}}
144 #define SDFITS_COLUMN_OBSMODE (dsp_fits_column){"OBSMODE", "8A", "", "", "Type of data, observing mode", (char*[]){OBSMODE_LINE_PSSW, OBSMODE_LINE_FQSW, OBSMODE_LINE_BMSW, OBSMODE_LINE_PLSW, OBSMODE_LINE_LDSW, OBSMODE_LINE_TLPW, OBSMODE_CONT_PSSW, OBSMODE_CONT_FQSW, OBSMODE_CONT_BMSW, OBSMODE_CONT_PLSW, OBSMODE_CONT_LDSW, OBSMODE_CONT_TLPW, OBSMODE_PULS_PSSW, OBSMODE_PULS_FQSW, OBSMODE_PULS_BMSW, OBSMODE_PULS_PLSW, OBSMODE_PULS_LDSW, OBSMODE_PULS_TLPW}}
146 #define SDFITS_COLUMN_MOLECULE (dsp_fits_column){"MOLECULE", "8A", "", "", "Molecule observed or detected", (char*[]){""}}
148 #define SDFITS_COLUMN_TRANSITI (dsp_fits_column){"TRANSITI", "8A", "", "", "As appropriate", (char*[]){""}}
150 #define SDFITS_COLUMN_TEMPSCAL (dsp_fits_column){"TEMPSCAL", "8A", "", "", "Normalization of TA", (char*[]){""}}
152 #define SDFITS_COLUMN_FRONTEND (dsp_fits_column){"FRONTEND", "8A", "", "", "", (char*[]){""}}
154 #define SDFITS_COLUMN_TCAL (dsp_fits_column){"TCAL", EXTFITS_ELEMENT_DOUBLE.typestr, EXTFITS_MEASURE_UNIT_KELVIN, "", "Calibration Temp", (char*[]){""}}
156 #define SDFITS_COLUMN_THOT (dsp_fits_column){"THOT", EXTFITS_ELEMENT_DOUBLE.typestr, EXTFITS_MEASURE_UNIT_KELVIN, "", "Hot load temperature", (char*[]){""}}
158 #define SDFITS_COLUMN_TCOLD (dsp_fits_column){"TCOLD", EXTFITS_ELEMENT_DOUBLE.typestr, EXTFITS_MEASURE_UNIT_KELVIN, "", "Cold load temperature", (char*[]){""}}
160 #define SDFITS_COLUMN_TRX (dsp_fits_column){"TRX", EXTFITS_ELEMENT_DOUBLE.typestr, EXTFITS_MEASURE_UNIT_KELVIN, "", "Receiver Temp, Float", (char*[]){""}}
162 #define SDFITS_COLUMN_VELDEF (dsp_fits_column){"VELDEF", "8A", "", "", "Velocity definition & frame", (char*[]){VELDEF_RADI, VELDEF_OPTI, VELDEF_RELA, VELDEF_LSR, VELDEF_HELO, VELDEF_EART, VELDEF_BARI, VELDEF_OBS, ""}}
164 #define SDFITS_COLUMN_VCORR (dsp_fits_column){"VCORR", EXTFITS_ELEMENT_DOUBLE.typestr, "", "", "radial velocity correction; Vref - Vtel", (char*[]){""}}
166 #define SDFITS_COLUMN_OBSFREQ (dsp_fits_column){"OBSFREQ", EXTFITS_ELEMENT_DOUBLE.typestr, EXTFITS_MEASURE_UNIT_HZ, "", "Observed Frequency", (char*[]){""}}
168 #define SDFITS_COLUMN_IMAGFREQ (dsp_fits_column){"IMAGFREQ", EXTFITS_ELEMENT_DOUBLE.typestr, EXTFITS_MEASURE_UNIT_HZ, "", "Image sideband freq", (char*[]){""}}
170 #define SDFITS_COLUMN_LST (dsp_fits_column){"LST", EXTFITS_ELEMENT_DOUBLE.typestr, EXTFITS_MEASURE_UNIT_SECOND, "", "LST at start of scan", (char*[]){""}}
172 #define SDFITS_COLUMN_LST (dsp_fits_column){"LST", EXTFITS_ELEMENT_DOUBLE.typestr, EXTFITS_MEASURE_UNIT_SECOND, "", "LST at start of scan", (char*[]){""}}
174 #define SDFITS_COLUMN_AZIMUTH (dsp_fits_column){"AZIMUTH", EXTFITS_ELEMENT_DOUBLE.typestr, EXTFITS_MEASURE_UNIT_DEGREE, "", "Commanded Azimuth", (char*[]){""}}
176 #define SDFITS_COLUMN_ELEVATIO (dsp_fits_column){"ELEVATIO", EXTFITS_ELEMENT_DOUBLE.typestr, EXTFITS_MEASURE_UNIT_DEGREE, "", "Commanded Elevation", (char*[]){""}}
178 #define SDFITS_COLUMN_TAU (dsp_fits_column){"TAU", EXTFITS_ELEMENT_DOUBLE.typestr, EXTFITS_MEASURE_UNIT_PERCENT, "", "Opacity at signal freq", (char*[]){""}}
180 #define SDFITS_COLUMN_TAUIMAGE (dsp_fits_column){"TAUIMAGE", EXTFITS_ELEMENT_DOUBLE.typestr, EXTFITS_MEASURE_UNIT_PERCENT, "", "Opacity at image freq", (char*[]){""}}
182 #define SDFITS_COLUMN_TAUZENIT (dsp_fits_column){"TAUZENIT", EXTFITS_ELEMENT_DOUBLE.typestr, EXTFITS_MEASURE_UNIT_PERCENT, "", "Opacity per unit air mass", (char*[]){""}}
184 #define SDFITS_COLUMN_HUMIDITY (dsp_fits_column){"HUMIDITY", EXTFITS_ELEMENT_DOUBLE.typestr, "", "", "Decimal fraction 0..1", (char*[]){""}}
186 #define SDFITS_COLUMN_TAMBIENT (dsp_fits_column){"TAMBIENT", EXTFITS_ELEMENT_DOUBLE.typestr, EXTFITS_MEASURE_UNIT_KELVIN, "", "Ambient Temp (K)", (char*[]){""}}
188 #define SDFITS_COLUMN_PRESSURE (dsp_fits_column){"PRESSURE", EXTFITS_ELEMENT_DOUBLE.typestr, "mm Hg", "", "Barometer reading ", (char*[]){""}}
190 #define SDFITS_COLUMN_DEWPOINT (dsp_fits_column){"DEWPOINT", EXTFITS_ELEMENT_DOUBLE.typestr, EXTFITS_MEASURE_UNIT_KELVIN, "", "Dew point", (char*[]){""}}
192 #define SDFITS_COLUMN_WINDSPEE (dsp_fits_column){"WINDSPEE", EXTFITS_ELEMENT_DOUBLE.typestr, "m/s", "", "Wind speed", (char*[]){""}}
194 #define SDFITS_COLUMN_WINDDIRE (dsp_fits_column){"WINDDIRE", EXTFITS_ELEMENT_DOUBLE.typestr, EXTFITS_MEASURE_UNIT_DEGREE, "", "Degrees West of North", (char*[]){""}}
196 #define SDFITS_COLUMN_BEAMEFF (dsp_fits_column){"BEAMEFF", EXTFITS_ELEMENT_DOUBLE.typestr, EXTFITS_MEASURE_UNIT_PERCENT, "", "Main-beam efficiency", (char*[]){""}}
198 #define SDFITS_COLUMN_APEREFF (dsp_fits_column){"APEREFF", EXTFITS_ELEMENT_DOUBLE.typestr, EXTFITS_MEASURE_UNIT_PERCENT, "", "Antenna Aperature Efficiency", (char*[]){""}}
200 #define SDFITS_COLUMN_ETAL (dsp_fits_column){"ETAL", EXTFITS_ELEMENT_DOUBLE.typestr, "", "", "Rear spillover", (char*[]){""}}
202 #define SDFITS_COLUMN_ETAFSS (dsp_fits_column){"ETAFSS", EXTFITS_ELEMENT_DOUBLE.typestr, "", "", "Accounts for forward loss", (char*[]){""}}
204 #define SDFITS_COLUMN_ANTGAIN (dsp_fits_column){"ANTGAIN", EXTFITS_ELEMENT_DOUBLE.typestr, "K/Jy", "", "", (char*[]){""}}
206 #define SDFITS_COLUMN_BMAJ (dsp_fits_column){"BMAJ", EXTFITS_ELEMENT_DOUBLE.typestr, "", "", "Large main-beam FWHM", (char*[]){""}}
208 #define SDFITS_COLUMN_BMIN (dsp_fits_column){"BMIN", EXTFITS_ELEMENT_DOUBLE.typestr, "", "", "Small main-beam FWHM", (char*[]){""}}
210 #define SDFITS_COLUMN_BPA (dsp_fits_column){"BPA", EXTFITS_ELEMENT_DOUBLE.typestr, EXTFITS_MEASURE_UNIT_DEGREE, "", "Beam position angle", (char*[]){""}}
212 #define SDFITS_COLUMN_SITELONG (dsp_fits_column){"SITELONG", EXTFITS_ELEMENT_DOUBLE.typestr, EXTFITS_MEASURE_UNIT_DEGREE, "", "Site longitude", (char*[]){""}}
214 #define SDFITS_COLUMN_SITELAT (dsp_fits_column){"SITELAT", EXTFITS_ELEMENT_DOUBLE.typestr, EXTFITS_MEASURE_UNIT_DEGREE, "", "Site latitude", (char*[]){""}}
216 #define SDFITS_COLUMN_SITEELEV (dsp_fits_column){"SITEELEV", EXTFITS_ELEMENT_DOUBLE.typestr, EXTFITS_MEASURE_UNIT_METER, "", "site elevation", (char*[]){""}}
218 #define SDFITS_COLUMN_EPOCH (dsp_fits_column){"EPOCH", EXTFITS_ELEMENT_DOUBLE.typestr, EXTFITS_MEASURE_UNIT_YEAR, "", "Epoch of observation", (char*[]){""}}
220 #define SDFITS_COLUMN_EQUINOX (dsp_fits_column){"EQUINOX", EXTFITS_ELEMENT_DOUBLE.typestr, EXTFITS_MEASURE_UNIT_YEAR, "", "Equinox of coords", (char*[]){""}}
221 
222 #define SDFITS_TABLE_MAIN (dsp_fits_column[]){\
223 SDFITS_COLUMN_OBJECT,\
224 SDFITS_COLUMN_TELESCOP,\
225 SDFITS_COLUMN_FREQRES,\
226 SDFITS_COLUMN_BANDWID,\
227 SDFITS_COLUMN_DATE_OBS,\
228 SDFITS_COLUMN_TIME,\
229 SDFITS_COLUMN_EXPOSURE,\
230 SDFITS_COLUMN_TSYS,\
231 SDFITS_COLUMN_DATA,\
232 SDFITS_COLUMN_OBSERVER, \
233 SDFITS_COLUMN_OBSID, \
234 SDFITS_COLUMN_PROJID, \
235 SDFITS_COLUMN_SCAN, \
236 SDFITS_COLUMN_OBSMODE, \
237 SDFITS_COLUMN_MOLECULE, \
238 SDFITS_COLUMN_TRANSITI, \
239 SDFITS_COLUMN_TEMPSCAL, \
240 SDFITS_COLUMN_FRONTEND, \
241 SDFITS_COLUMN_TCAL, \
242 SDFITS_COLUMN_THOT, \
243 SDFITS_COLUMN_TCOLD, \
244 SDFITS_COLUMN_TRX, \
245 SDFITS_COLUMN_VELDEF, \
246 SDFITS_COLUMN_VCORR, \
247 SDFITS_COLUMN_OBSFREQ, \
248 SDFITS_COLUMN_IMAGFREQ, \
249 SDFITS_COLUMN_LST, \
250 SDFITS_COLUMN_LST, \
251 SDFITS_COLUMN_AZIMUTH, \
252 SDFITS_COLUMN_ELEVATIO, \
253 SDFITS_COLUMN_TAU, \
254 SDFITS_COLUMN_TAUIMAGE, \
255 SDFITS_COLUMN_TAUZENIT, \
256 SDFITS_COLUMN_HUMIDITY, \
257 SDFITS_COLUMN_TAMBIENT, \
258 SDFITS_COLUMN_PRESSURE, \
259 SDFITS_COLUMN_DEWPOINT, \
260 SDFITS_COLUMN_WINDSPEE, \
261 SDFITS_COLUMN_WINDDIRE, \
262 SDFITS_COLUMN_BEAMEFF, \
263 SDFITS_COLUMN_APEREFF, \
264 SDFITS_COLUMN_ETAL, \
265 SDFITS_COLUMN_ETAFSS, \
266 SDFITS_COLUMN_ANTGAIN, \
267 SDFITS_COLUMN_BMAJ, \
268 SDFITS_COLUMN_BMIN, \
269 SDFITS_COLUMN_BPA, \
270 SDFITS_COLUMN_SITELONG, \
271 SDFITS_COLUMN_SITELAT, \
272 SDFITS_COLUMN_SITEELEV, \
273 SDFITS_COLUMN_EPOCH, \
274 SDFITS_COLUMN_EQUINOX, \
275 }
276 
279 #define SDFITS_KEYWORD_TELESCOP (dsp_fits_keyword){"TELESCOP", "8A", "", "", "", (char*[]){""}}
281 #define SDFITS_KEYWORD_OBSERVER (dsp_fits_keyword){"OBSERVER", "8A", "", "", "", (char*[]){""}}
283 #define SDFITS_KEYWORD_DATE_OBS (dsp_fits_keyword){"DATE-OBS", "8A", "", "", "", (char*[]){""}}
285 #define SDFITS_KEYWORD_DATAMAX (dsp_fits_keyword){"DATAMAX", EXTFITS_ELEMENT_DOUBLE.typestr, "", "", "", (char*[]){""}}
287 #define SDFITS_KEYWORD_DATAMIN (dsp_fits_keyword){"DATAMIN", EXTFITS_ELEMENT_DOUBLE.typestr, "", "", "", (char*[]){""}}
288 
297 dsp_fits_row *dsp_fits_read_sdfits(char *filename, long *nstreams, long *maxes, long **maxis);
300 #ifdef __cplusplus
301 }
302 #endif
303 
304 #endif //_FITS_EXTENSION_SDFITS_H
dsp_fits_row * dsp_fits_read_sdfits(char *filename, long *nstreams, long *maxes, long **maxis)
read a fits file containing a SDFITS Extension
Definition: fits.c:286
Binary table FITS extension row.
Definition: fits.h:86