147#define itostr(x) its(x)
151#define EXTFITS_ELEMENT_STRING (dsp_fits_format){"A", TSTRING, 0, 0}
152#define EXTFITS_ELEMENT_LOGICAL (dsp_fits_format){"L", TLOGICAL, 0, 0}
153#define EXTFITS_ELEMENT_BIT (dsp_fits_format){"X", TBIT, 0, 0}
154#define EXTFITS_ELEMENT_BYTE (dsp_fits_format){"B", TBYTE, 0, 0}
155#define EXTFITS_ELEMENT_SBYTE (dsp_fits_format){"S", TSBYTE, 0, 0}
156#define EXTFITS_ELEMENT_SHORT (dsp_fits_format){"I", TSHORT, 0, 0}
157#define EXTFITS_ELEMENT_USHORT (dsp_fits_format){"U", TUSHORT, 0, 0}
158#define EXTFITS_ELEMENT_INT (dsp_fits_format){"J", TINT, 0, 0}
159#define EXTFITS_ELEMENT_UINT (dsp_fits_format){"V", TUINT, 0, 0}
160#define EXTFITS_ELEMENT_LONG (dsp_fits_format){"K", TLONG, 0, 0}
161#define EXTFITS_ELEMENT_FLOAT (dsp_fits_format){"E", TFLOAT, 0, 0}
162#define EXTFITS_ELEMENT_DOUBLE (dsp_fits_format){"D", TDOUBLE, 0, 0}
163#define EXTFITS_ELEMENT_COMPLEX (dsp_fits_format){"C", TCOMPLEX, 0, 0}
164#define EXTFITS_ELEMENT_DBLCOMPLEX (dsp_fits_format){"M", TDBLCOMPLEX, 0, 0}
167#define EXTFITS_MEASURE_UNIT_HZ "Hz"
168#define EXTFITS_MEASURE_UNIT_SECOND "sec"
169#define EXTFITS_MEASURE_UNIT_MINUTE "min"
170#define EXTFITS_MEASURE_UNIT_HOUR "hour"
171#define EXTFITS_MEASURE_UNIT_DAY "day"
172#define EXTFITS_MEASURE_UNIT_MONTH "month"
173#define EXTFITS_MEASURE_UNIT_YEAR "year"
174#define EXTFITS_MEASURE_UNIT_JANSKY "Jy"
175#define EXTFITS_MEASURE_UNIT_KELVIN "K"
176#define EXTFITS_MEASURE_UNIT_ANGSTROM "Angstrom"
177#define EXTFITS_MEASURE_UNIT_ARCSEC "arcsec"
178#define EXTFITS_MEASURE_UNIT_ARCMIN "arcmin"
179#define EXTFITS_MEASURE_UNIT_DEGREE "degree"
180#define EXTFITS_MEASURE_UNIT_PERCENT "percent"
181#define EXTFITS_MEASURE_UNIT_METER "meter"
182#define EXTFITS_MEASURE_UNIT_MILLIBAR "millibar"
185#define EXTFITS_KEYWORD_TTYPE(n) (dsp_fits_keyword){"TTYPE" itostr(n), "8A", "", "", "Set to 'FLUX'", (char*[]){"FLUX", "DATA", ""}}
187#define EXTFITS_KEYWORD_TUNIT(n) (dsp_fits_keyword){"TUNIT" itostr(n), "8A", "", "", "Shall have the value 'JY' or 'UNCALIB'", (char*[]){""}}
189#define EXTFITS_KEYWORD_TDIM(n) (dsp_fits_keyword){"TDIM" itostr(n), "8A", "", "", "Size in pixels of data buffer", (char*[]){""}}
191#define EXTFITS_KEYWORD_TFORM(n) (dsp_fits_keyword){"TFORM" itostr(n), "8A", "", "", "Shall be a character string", (char*[]){""}}
194#define EXTFITS_KEYWORD_CTYPE(m) (dsp_fits_keyword){"CTYPE" itostr(m), EXTFITS_ELEMENT_STRING.typestr, "", "", "Name of regular axis m = 1 to M", (char*[]){""}}
196#define EXTFITS_KEYWORD_CDELT(m) (dsp_fits_keyword){"CDELT" itostr(m), EXTFITS_ELEMENT_FLOAT.typestr, "", "", "Coordinate increment on axis m = 1 to M", (char*[]){""}}
198#define EXTFITS_KEYWORD_CRPIX(m) (dsp_fits_keyword){"CRPIX" itostr(m), EXTFITS_ELEMENT_FLOAT.typestr, "", "", "Reference pixel on axis m = 1 to M", (char*[]){""}}
200#define EXTFITS_KEYWORD_CRVAL(m) (dsp_fits_keyword){"CRVAL" itostr(m), EXTFITS_ELEMENT_FLOAT.typestr, "", "", "Coordinate value at reference pixel on axis m = 1 to M", (char*[]){""}}
203#define EXTFITS_KEYWORD_NMATRIX (dsp_fits_keyword){"NMATRIX", EXTFITS_ELEMENT_SHORT.typestr, "", "1", "NMATRIX shall be present with the value 1", (char*[]){"1", ""}}
205#define EXTFITS_KEYWORD_TMATX(n) (dsp_fits_matrix){"TMATX" itostr(n), "8A", "T", "Set to 'T'", {EXTFITS_KEYWORD_TTYPE(n), EXTFITS_KEYWORD_TFORM(n), EXTFITS_KEYWORD_TUNIT(n), EXTFITS_KEYWORD_TDIM(n)}}
207#define EXTFITS_KEYWORD_MAXIS(m) (dsp_fits_axis){"MAXIS" itostr(m), EXTFITS_ELEMENT_SHORT.typestr, "", "", "M = number axes in regular matrix, Number pixels on axis m = 1 to M", {EXTFITS_KEYWORD_CTYPE(m), EXTFITS_KEYWORD_CDELT(m), EXTFITS_KEYWORD_CRPIX(m), EXTFITS_KEYWORD_CRVAL(m)}}
210#define EXTFITS_KEYWORD_OBJCTRA (dsp_fits_column){"OBJCTRA", EXTFITS_ELEMENT_STRING.typestr, EXTFITS_MEASURE_UNIT_DEGREE, "", "Target right ascension coordinate", (char*[]){""}}
212#define EXTFITS_KEYWORD_OBJCTDEC (dsp_fits_column){"OBJCTDEC", EXTFITS_ELEMENT_STRING.typestr, EXTFITS_MEASURE_UNIT_DEGREE, "", "Target declination coordinate", (char*[]){""}}
214#define FITS_KEYWORD_EXTEND (dsp_fits_keyword){"EXTEND", "A", "", "T", "", (char*[]){""}}
215#define FITS_KEYWORD_EXTNAME (dsp_fits_keyword){"EXTNAME", "", "", "", "", (char*[]){""}}
DLL_EXPORT int dsp_fits_fill_fits_col(fitsfile *fptr, char *name, unsigned char *buf, int typecode, long num_elements, unsigned long rown)
Fill a column at the given row position with the valued buffer.
DLL_EXPORT int dsp_fits_close_fits(fitsfile *fptr)
Close a fits file pointer.
DLL_EXPORT int dsp_fits_append_fits_col(fitsfile *fptr, char *name, char *format)
Add a column to the binary table.
DLL_EXPORT int dsp_fits_add_table(fitsfile *fptr, dsp_fits_column *columns, int ncols, const char *tablename)
Add a binary table extension into a fits file.
DLL_EXPORT int dsp_fits_get_value(fitsfile *fptr, char *column, long rown, void **retval)
Obtain the value of the specified field.
DLL_EXPORT long dsp_fits_alloc_fits_rows(fitsfile *fptr, unsigned long num_rows)
Convert an RGB color dsp_t array into a dsp_stream_p array each element containing the single compone...
DLL_EXPORT int dsp_fits_read_typecode(char *typestr, int *typecode, long *width, long *repeat)
Decode a typecode format string.
DLL_EXPORT int dsp_fits_check_column(fitsfile *fptr, char *column, char **expected, long rown)
Check if the value of the specified field corresponds to a subset of values.
DLL_EXPORT fitsfile * dsp_fits_create_fits(size_t *size, void **buf)
Create an open fits file pointer to be updated later.
DLL_EXPORT void dsp_fits_update_fits_key(fitsfile *fptr, int type, char *name, void *value, char *comment, int *status)
Create or update a new fits header key.
DLL_EXPORT size_t dsp_fits_get_element_size(int typecode)
Obtain the single element size in bytes.
DLL_EXPORT void dsp_fits_delete_fits_col(fitsfile *fptr, char *name)
Delete a column from the binary table.
Binary table FITS Matrix axis.
Definition fits.h:94
dsp_fits_keyword refpix
Data reference pixel.
Definition fits.h:113
char * unit
Axis measure unit string.
Definition fits.h:100
dsp_fits_keyword value
Data reference pixel value.
Definition fits.h:115
char * name
Axis name.
Definition fits.h:96
dsp_fits_keyword increment
Data increment step.
Definition fits.h:111
dsp_fits_keyword name
Data name.
Definition fits.h:109
char * comment
Axis description.
Definition fits.h:104
char * value
Axis default value.
Definition fits.h:102
char * format
Axis format string.
Definition fits.h:98
Binary table FITS extension column.
Definition fits.h:68
char * format
Format string of the content of the column (TFORM)
Definition fits.h:72
char * comment
Description of the column or data.
Definition fits.h:78
char * name
Name of the column (title, TTYPE)
Definition fits.h:70
char * unit
Measure unit of the column elements (TUNIT)
Definition fits.h:74
char ** expected
Expected values if checking when read.
Definition fits.h:80
char * value
Default initial value.
Definition fits.h:76
FITS keyword.
Definition fits.h:51
char * name
Name of the keyword.
Definition fits.h:53
char * format
Format of the content of the keyword.
Definition fits.h:55
char * comment
Description of the keyword or value.
Definition fits.h:61
char * value
Value.
Definition fits.h:59
char * unit
Measure unit of the value.
Definition fits.h:57
char ** expected
Expected value if checking when read.
Definition fits.h:63
Binary table FITS Matrix.
Definition fits.h:121
char * name
Matrix name.
Definition fits.h:123
char * value
Matrix measure unit string.
Definition fits.h:127
char * comment
Matrix description.
Definition fits.h:129
dsp_fits_keyword unit
Axes measure unit.
Definition fits.h:138
dsp_fits_keyword dims
Axes quantity.
Definition fits.h:140
dsp_fits_keyword name
Axes name.
Definition fits.h:134
char * format
Matrix format string.
Definition fits.h:125
dsp_fits_keyword format
Axes format.
Definition fits.h:136
Binary table FITS extension row.
Definition fits.h:85
size_t num_columns
Columns data.
Definition fits.h:89
dsp_fits_column * columns
Columns array.
Definition fits.h:87