Instrument Neutral Distributed Interface INDI  2.0.2
Modules | Classes | Macros | Functions
DSP API FITS Extensions functions

Modules

 DSP API SDFITS Extension
 
 DSP API FITSIDI Extension
 

Classes

struct  dsp_fits_format
 FITS format. More...
 
struct  dsp_fits_keyword
 FITS keyword. More...
 
struct  dsp_fits_column
 Binary table FITS extension column. More...
 
struct  dsp_fits_row
 Binary table FITS extension row. More...
 
struct  dsp_fits_axis
 Binary table FITS Matrix axis. More...
 
struct  dsp_fits_matrix
 Binary table FITS Matrix. More...
 

Macros

#define its(x)   #x
 Returns non-zero decimal conversion of integer into string. More...
 
#define itostr(x)   its(x)
 
#define EXTFITS_ELEMENT_STRING   (dsp_fits_format){"A", TSTRING, 0, 0}
 FITS element types. More...
 
#define EXTFITS_ELEMENT_LOGICAL   (dsp_fits_format){"L", TLOGICAL, 0, 0}
 
#define EXTFITS_ELEMENT_BIT   (dsp_fits_format){"X", TBIT, 0, 0}
 
#define EXTFITS_ELEMENT_BYTE   (dsp_fits_format){"B", TBYTE, 0, 0}
 
#define EXTFITS_ELEMENT_SBYTE   (dsp_fits_format){"S", TSBYTE, 0, 0}
 
#define EXTFITS_ELEMENT_SHORT   (dsp_fits_format){"I", TSHORT, 0, 0}
 
#define EXTFITS_ELEMENT_USHORT   (dsp_fits_format){"U", TUSHORT, 0, 0}
 
#define EXTFITS_ELEMENT_INT   (dsp_fits_format){"J", TINT, 0, 0}
 
#define EXTFITS_ELEMENT_UINT   (dsp_fits_format){"V", TUINT, 0, 0}
 
#define EXTFITS_ELEMENT_LONG   (dsp_fits_format){"K", TLONG, 0, 0}
 
#define EXTFITS_ELEMENT_FLOAT   (dsp_fits_format){"E", TFLOAT, 0, 0}
 
#define EXTFITS_ELEMENT_DOUBLE   (dsp_fits_format){"D", TDOUBLE, 0, 0}
 
#define EXTFITS_ELEMENT_COMPLEX   (dsp_fits_format){"C", TCOMPLEX, 0, 0}
 
#define EXTFITS_ELEMENT_DBLCOMPLEX   (dsp_fits_format){"M", TDBLCOMPLEX, 0, 0}
 
#define EXTFITS_MEASURE_UNIT_HZ   "Hz"
 FITS Measure units. More...
 
#define EXTFITS_MEASURE_UNIT_SECOND   "sec"
 
#define EXTFITS_MEASURE_UNIT_MINUTE   "min"
 
#define EXTFITS_MEASURE_UNIT_HOUR   "hour"
 
#define EXTFITS_MEASURE_UNIT_DAY   "day"
 
#define EXTFITS_MEASURE_UNIT_MONTH   "month"
 
#define EXTFITS_MEASURE_UNIT_YEAR   "year"
 
#define EXTFITS_MEASURE_UNIT_JANSKY   "Jy"
 
#define EXTFITS_MEASURE_UNIT_KELVIN   "K"
 
#define EXTFITS_MEASURE_UNIT_ANGSTROM   "Angstrom"
 
#define EXTFITS_MEASURE_UNIT_ARCSEC   "arcsec"
 
#define EXTFITS_MEASURE_UNIT_ARCMIN   "arcmin"
 
#define EXTFITS_MEASURE_UNIT_DEGREE   "degree"
 
#define EXTFITS_MEASURE_UNIT_PERCENT   "percent"
 
#define EXTFITS_MEASURE_UNIT_METER   "meter"
 
#define EXTFITS_MEASURE_UNIT_MILLIBAR   "millibar"
 
#define EXTFITS_KEYWORD_TTYPE(n)   (dsp_fits_keyword){"TTYPE" itostr(n), "8A", "", "", "Set to 'FLUX'", (char*[]){"FLUX", "DATA", ""}}
 Set to 'FLUX' or 'DATA' for matrix buffers. More...
 
#define EXTFITS_KEYWORD_TUNIT(n)   (dsp_fits_keyword){"TUNIT" itostr(n), "8A", "", "", "Shall have the value 'JY' or 'UNCALIB'", (char*[]){""}}
 shall have the value 'K', 'JY' or 'UNCALIB' More...
 
#define EXTFITS_KEYWORD_TDIM(n)   (dsp_fits_keyword){"TDIM" itostr(n), "8A", "", "", "Size in pixels of data buffer", (char*[]){""}}
 Size in pixels of data buffer. More...
 
#define EXTFITS_KEYWORD_TFORM(n)   (dsp_fits_keyword){"TFORM" itostr(n), "8A", "", "", "Shall be a character string", (char*[]){""}}
 shall have the format of the column More...
 
#define EXTFITS_KEYWORD_CTYPE(m)   (dsp_fits_keyword){"CTYPE" itostr(m), EXTFITS_ELEMENT_STRING.typestr, "", "", "Name of regular axis m = 1 to M", (char*[]){""}}
 Name of regular axis m = 1 to M. More...
 
#define EXTFITS_KEYWORD_CDELT(m)   (dsp_fits_keyword){"CDELT" itostr(m), EXTFITS_ELEMENT_FLOAT.typestr, "", "", "Coordinate increment on axis m = 1 to M", (char*[]){""}}
 Coordinate increment on axis m = 1 to M. More...
 
#define EXTFITS_KEYWORD_CRPIX(m)   (dsp_fits_keyword){"CRPIX" itostr(m), EXTFITS_ELEMENT_FLOAT.typestr, "", "", "Reference pixel on axis m = 1 to M", (char*[]){""}}
 Reference pixel on axis m = 1 to M. More...
 
#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*[]){""}}
 Coordinate value at reference pixel on axis m = 1 to M. More...
 
#define EXTFITS_KEYWORD_NMATRIX   (dsp_fits_keyword){"NMATRIX", EXTFITS_ELEMENT_SHORT.typestr, "", "1", "NMATRIX shall be present with the value 1", (char*[]){"1", ""}}
 NMATRIX shall be present with the value 1. More...
 
#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)}}
 Set to 'T' — column n contains the visibility matrix. More...
 
#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)}}
 M = number axes in regular matrix, Number pixels on axis m = 1 to M. More...
 
#define EXTFITS_KEYWORD_OBJCTRA   (dsp_fits_column){"OBJCTRA", EXTFITS_ELEMENT_STRING.typestr, EXTFITS_MEASURE_UNIT_DEGREE, "", "Target right ascension coordinate", (char*[]){""}}
 Target right ascension coordinate. More...
 
#define EXTFITS_KEYWORD_OBJCTDEC   (dsp_fits_column){"OBJCTDEC", EXTFITS_ELEMENT_STRING.typestr, EXTFITS_MEASURE_UNIT_DEGREE, "", "Target declination coordinate", (char*[]){""}}
 Target declination coordinate. More...
 
#define FITS_KEYWORD_EXTEND   (dsp_fits_keyword){"EXTEND", "A", "", "T", "", (char*[]){""}}
 
#define FITS_KEYWORD_EXTNAME   (dsp_fits_keyword){"EXTNAME", "", "", "", "", (char*[]){""}}
 

Functions

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. More...
 
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 components. More...
 
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. More...
 
int dsp_fits_append_fits_col (fitsfile *fptr, char *name, char *format)
 Add a column to the binary table. More...
 
void dsp_fits_delete_fits_col (fitsfile *fptr, char *name)
 Delete a column from the binary table. More...
 
size_t dsp_fits_get_element_size (int typecode)
 Obtain the single element size in bytes. More...
 
int dsp_fits_read_typecode (char *typestr, int *typecode, long *width, long *repeat)
 Decode a typecode format string. More...
 
int dsp_fits_get_value (fitsfile *fptr, char *column, long rown, void **retval)
 Obtain the value of the specified field. More...
 
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. More...
 
fitsfile * dsp_fits_create_fits (size_t *size, void **buf)
 Create an open fits file pointer to be updated later. More...
 
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. More...
 
int dsp_fits_close_fits (fitsfile *fptr)
 Close a fits file pointer. More...
 

Detailed Description

Macro Definition Documentation

◆ EXTFITS_ELEMENT_BIT

#define EXTFITS_ELEMENT_BIT   (dsp_fits_format){"X", TBIT, 0, 0}

Definition at line 154 of file fits.h.

◆ EXTFITS_ELEMENT_BYTE

#define EXTFITS_ELEMENT_BYTE   (dsp_fits_format){"B", TBYTE, 0, 0}

Definition at line 155 of file fits.h.

◆ EXTFITS_ELEMENT_COMPLEX

#define EXTFITS_ELEMENT_COMPLEX   (dsp_fits_format){"C", TCOMPLEX, 0, 0}

Definition at line 164 of file fits.h.

◆ EXTFITS_ELEMENT_DBLCOMPLEX

#define EXTFITS_ELEMENT_DBLCOMPLEX   (dsp_fits_format){"M", TDBLCOMPLEX, 0, 0}

Definition at line 165 of file fits.h.

◆ EXTFITS_ELEMENT_DOUBLE

#define EXTFITS_ELEMENT_DOUBLE   (dsp_fits_format){"D", TDOUBLE, 0, 0}

Definition at line 163 of file fits.h.

◆ EXTFITS_ELEMENT_FLOAT

#define EXTFITS_ELEMENT_FLOAT   (dsp_fits_format){"E", TFLOAT, 0, 0}

Definition at line 162 of file fits.h.

◆ EXTFITS_ELEMENT_INT

#define EXTFITS_ELEMENT_INT   (dsp_fits_format){"J", TINT, 0, 0}

Definition at line 159 of file fits.h.

◆ EXTFITS_ELEMENT_LOGICAL

#define EXTFITS_ELEMENT_LOGICAL   (dsp_fits_format){"L", TLOGICAL, 0, 0}

Definition at line 153 of file fits.h.

◆ EXTFITS_ELEMENT_LONG

#define EXTFITS_ELEMENT_LONG   (dsp_fits_format){"K", TLONG, 0, 0}

Definition at line 161 of file fits.h.

◆ EXTFITS_ELEMENT_SBYTE

#define EXTFITS_ELEMENT_SBYTE   (dsp_fits_format){"S", TSBYTE, 0, 0}

Definition at line 156 of file fits.h.

◆ EXTFITS_ELEMENT_SHORT

#define EXTFITS_ELEMENT_SHORT   (dsp_fits_format){"I", TSHORT, 0, 0}

Definition at line 157 of file fits.h.

◆ EXTFITS_ELEMENT_STRING

#define EXTFITS_ELEMENT_STRING   (dsp_fits_format){"A", TSTRING, 0, 0}

FITS element types.

Definition at line 152 of file fits.h.

◆ EXTFITS_ELEMENT_UINT

#define EXTFITS_ELEMENT_UINT   (dsp_fits_format){"V", TUINT, 0, 0}

Definition at line 160 of file fits.h.

◆ EXTFITS_ELEMENT_USHORT

#define EXTFITS_ELEMENT_USHORT   (dsp_fits_format){"U", TUSHORT, 0, 0}

Definition at line 158 of file fits.h.

◆ EXTFITS_KEYWORD_CDELT

#define EXTFITS_KEYWORD_CDELT (   m)    (dsp_fits_keyword){"CDELT" itostr(m), EXTFITS_ELEMENT_FLOAT.typestr, "", "", "Coordinate increment on axis m = 1 to M", (char*[]){""}}

Coordinate increment on axis m = 1 to M.

Definition at line 197 of file fits.h.

◆ EXTFITS_KEYWORD_CRPIX

#define EXTFITS_KEYWORD_CRPIX (   m)    (dsp_fits_keyword){"CRPIX" itostr(m), EXTFITS_ELEMENT_FLOAT.typestr, "", "", "Reference pixel on axis m = 1 to M", (char*[]){""}}

Reference pixel on axis m = 1 to M.

Definition at line 199 of file fits.h.

◆ EXTFITS_KEYWORD_CRVAL

#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*[]){""}}

Coordinate value at reference pixel on axis m = 1 to M.

Definition at line 201 of file fits.h.

◆ EXTFITS_KEYWORD_CTYPE

#define EXTFITS_KEYWORD_CTYPE (   m)    (dsp_fits_keyword){"CTYPE" itostr(m), EXTFITS_ELEMENT_STRING.typestr, "", "", "Name of regular axis m = 1 to M", (char*[]){""}}

Name of regular axis m = 1 to M.

Definition at line 195 of file fits.h.

◆ EXTFITS_KEYWORD_MAXIS

#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)}}

M = number axes in regular matrix, Number pixels on axis m = 1 to M.

Definition at line 208 of file fits.h.

◆ EXTFITS_KEYWORD_NMATRIX

#define EXTFITS_KEYWORD_NMATRIX   (dsp_fits_keyword){"NMATRIX", EXTFITS_ELEMENT_SHORT.typestr, "", "1", "NMATRIX shall be present with the value 1", (char*[]){"1", ""}}

NMATRIX shall be present with the value 1.

Definition at line 204 of file fits.h.

◆ EXTFITS_KEYWORD_OBJCTDEC

#define EXTFITS_KEYWORD_OBJCTDEC   (dsp_fits_column){"OBJCTDEC", EXTFITS_ELEMENT_STRING.typestr, EXTFITS_MEASURE_UNIT_DEGREE, "", "Target declination coordinate", (char*[]){""}}

Target declination coordinate.

Definition at line 213 of file fits.h.

◆ EXTFITS_KEYWORD_OBJCTRA

#define EXTFITS_KEYWORD_OBJCTRA   (dsp_fits_column){"OBJCTRA", EXTFITS_ELEMENT_STRING.typestr, EXTFITS_MEASURE_UNIT_DEGREE, "", "Target right ascension coordinate", (char*[]){""}}

Target right ascension coordinate.

Definition at line 211 of file fits.h.

◆ EXTFITS_KEYWORD_TDIM

#define EXTFITS_KEYWORD_TDIM (   n)    (dsp_fits_keyword){"TDIM" itostr(n), "8A", "", "", "Size in pixels of data buffer", (char*[]){""}}

Size in pixels of data buffer.

Definition at line 190 of file fits.h.

◆ EXTFITS_KEYWORD_TFORM

#define EXTFITS_KEYWORD_TFORM (   n)    (dsp_fits_keyword){"TFORM" itostr(n), "8A", "", "", "Shall be a character string", (char*[]){""}}

shall have the format of the column

Definition at line 192 of file fits.h.

◆ EXTFITS_KEYWORD_TMATX

#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)}}

Set to 'T' — column n contains the visibility matrix.

Definition at line 206 of file fits.h.

◆ EXTFITS_KEYWORD_TTYPE

#define EXTFITS_KEYWORD_TTYPE (   n)    (dsp_fits_keyword){"TTYPE" itostr(n), "8A", "", "", "Set to 'FLUX'", (char*[]){"FLUX", "DATA", ""}}

Set to 'FLUX' or 'DATA' for matrix buffers.

Definition at line 186 of file fits.h.

◆ EXTFITS_KEYWORD_TUNIT

#define EXTFITS_KEYWORD_TUNIT (   n)    (dsp_fits_keyword){"TUNIT" itostr(n), "8A", "", "", "Shall have the value 'JY' or 'UNCALIB'", (char*[]){""}}

shall have the value 'K', 'JY' or 'UNCALIB'

Definition at line 188 of file fits.h.

◆ EXTFITS_MEASURE_UNIT_ANGSTROM

#define EXTFITS_MEASURE_UNIT_ANGSTROM   "Angstrom"

Definition at line 177 of file fits.h.

◆ EXTFITS_MEASURE_UNIT_ARCMIN

#define EXTFITS_MEASURE_UNIT_ARCMIN   "arcmin"

Definition at line 179 of file fits.h.

◆ EXTFITS_MEASURE_UNIT_ARCSEC

#define EXTFITS_MEASURE_UNIT_ARCSEC   "arcsec"

Definition at line 178 of file fits.h.

◆ EXTFITS_MEASURE_UNIT_DAY

#define EXTFITS_MEASURE_UNIT_DAY   "day"

Definition at line 172 of file fits.h.

◆ EXTFITS_MEASURE_UNIT_DEGREE

#define EXTFITS_MEASURE_UNIT_DEGREE   "degree"

Definition at line 180 of file fits.h.

◆ EXTFITS_MEASURE_UNIT_HOUR

#define EXTFITS_MEASURE_UNIT_HOUR   "hour"

Definition at line 171 of file fits.h.

◆ EXTFITS_MEASURE_UNIT_HZ

#define EXTFITS_MEASURE_UNIT_HZ   "Hz"

FITS Measure units.

Definition at line 168 of file fits.h.

◆ EXTFITS_MEASURE_UNIT_JANSKY

#define EXTFITS_MEASURE_UNIT_JANSKY   "Jy"

Definition at line 175 of file fits.h.

◆ EXTFITS_MEASURE_UNIT_KELVIN

#define EXTFITS_MEASURE_UNIT_KELVIN   "K"

Definition at line 176 of file fits.h.

◆ EXTFITS_MEASURE_UNIT_METER

#define EXTFITS_MEASURE_UNIT_METER   "meter"

Definition at line 182 of file fits.h.

◆ EXTFITS_MEASURE_UNIT_MILLIBAR

#define EXTFITS_MEASURE_UNIT_MILLIBAR   "millibar"

Definition at line 183 of file fits.h.

◆ EXTFITS_MEASURE_UNIT_MINUTE

#define EXTFITS_MEASURE_UNIT_MINUTE   "min"

Definition at line 170 of file fits.h.

◆ EXTFITS_MEASURE_UNIT_MONTH

#define EXTFITS_MEASURE_UNIT_MONTH   "month"

Definition at line 173 of file fits.h.

◆ EXTFITS_MEASURE_UNIT_PERCENT

#define EXTFITS_MEASURE_UNIT_PERCENT   "percent"

Definition at line 181 of file fits.h.

◆ EXTFITS_MEASURE_UNIT_SECOND

#define EXTFITS_MEASURE_UNIT_SECOND   "sec"

Definition at line 169 of file fits.h.

◆ EXTFITS_MEASURE_UNIT_YEAR

#define EXTFITS_MEASURE_UNIT_YEAR   "year"

Definition at line 174 of file fits.h.

◆ FITS_KEYWORD_EXTEND

#define FITS_KEYWORD_EXTEND   (dsp_fits_keyword){"EXTEND", "A", "", "T", "", (char*[]){""}}

Definition at line 215 of file fits.h.

◆ FITS_KEYWORD_EXTNAME

#define FITS_KEYWORD_EXTNAME   (dsp_fits_keyword){"EXTNAME", "", "", "", "", (char*[]){""}}

Definition at line 216 of file fits.h.

◆ itostr

#define itostr (   x)    its(x)

Definition at line 148 of file fits.h.

◆ its

#define its (   x)    #x

Returns non-zero decimal conversion of integer into string.

Definition at line 147 of file fits.h.

Function Documentation

◆ dsp_fits_add_table()

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.

Parameters
fptrPointer to a fits file
columnsAn array of dsp_fits_column structs
ncolsThe dsp_fits_column array length
tablenameThe extension table name
Returns
non-zero if any error occured

◆ dsp_fits_alloc_fits_rows()

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 components.

Parameters
fptrThe fits file pointer created by dsp_fits_create_fits
num_rowsThe number of rows to be allocated
Returns
The number of rows incremented by the allocated ones
See also
dsp_fits_create_fits

Definition at line 27 of file fits.c.

◆ dsp_fits_append_fits_col()

int dsp_fits_append_fits_col ( fitsfile *  fptr,
char *  name,
char *  format 
)

Add a column to the binary table.

Parameters
fptrThe fits file pointer created by dsp_fits_create_fits
nameThe name of the column
formatThis field should indicate the element size, width of each element and repetition eventually
Returns
non-zero if any error occured

Definition at line 49 of file fits.c.

◆ dsp_fits_check_column()

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.

Parameters
fptrThe fits file pointer created by dsp_fits_create_fits
columnThe column name of the selected field
expectedA buffer array containing expected values, terminating with an empty value
rownThe row position of the field
Returns
zero if any of the values was matched

Definition at line 148 of file fits.c.

◆ dsp_fits_close_fits()

int dsp_fits_close_fits ( fitsfile *  fptr)

Close a fits file pointer.

Parameters
fptrThe fits file pointer created by dsp_fits_create_fits
Returns
non-zero if any error occured

Definition at line 121 of file fits.c.

◆ dsp_fits_create_fits()

fitsfile* dsp_fits_create_fits ( size_t *  size,
void **  buf 
)

Create an open fits file pointer to be updated later.

Parameters
sizeThis variable will contain the initial size of the fits file pointer
bufThis buffer will contain the fits memfile
Returns
fitsfile the fits file pointer

Definition at line 71 of file fits.c.

◆ dsp_fits_delete_fits_col()

void dsp_fits_delete_fits_col ( fitsfile *  fptr,
char *  name 
)

Delete a column from the binary table.

Parameters
fptrThe fits file pointer created by dsp_fits_create_fits
nameThe name of the column

Definition at line 62 of file fits.c.

◆ dsp_fits_fill_fits_col()

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.

Parameters
fptrThe fits file pointer created by dsp_fits_create_fits
nameThe name of the column
bufThe buffer that will be copied into the selected field.
typecodeThe element type size
num_elementsThe total field size in elements, this should take into account the width and repeat multipliers
rownThe row number where the field is located
Returns
non-zero if any error occured
See also
dsp_fits_create_fits

Definition at line 37 of file fits.c.

◆ dsp_fits_get_element_size()

size_t dsp_fits_get_element_size ( int  typecode)

Obtain the single element size in bytes.

Parameters
typecodeThe typecode of each single element
Returns
the size of the single element

Definition at line 244 of file fits.c.

◆ dsp_fits_get_value()

int dsp_fits_get_value ( fitsfile *  fptr,
char *  column,
long  rown,
void **  retval 
)

Obtain the value of the specified field.

Parameters
fptrThe fits file pointer created by dsp_fits_create_fits
columnThe column name of the selected field
rownThe row position of the field
retvalA preallocated buffer where the field value will be stored into
Returns
non-zero if any error occured

Definition at line 129 of file fits.c.

◆ dsp_fits_read_typecode()

int dsp_fits_read_typecode ( char *  typestr,
int *  typecode,
long *  width,
long *  repeat 
)

Decode a typecode format string.

Parameters
typestrThe element format string
typecodeThis function will return the typecode to this variable
widthThis function will return the width to this variable
repeatThis function will return the repeatition count to this variable
Returns
non-zero if any error occured

Definition at line 203 of file fits.c.

◆ dsp_fits_update_fits_key()

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.

Parameters
fptrThe fits file pointer created by dsp_fits_create_fits
typeThe typecode of the value
nameThe keyword to be updated
valueThe new value of the specified keyword
commentThe keyword or assigned value description or explanation
statusThis variable will be updated with the status of the update operation

Definition at line 22 of file fits.c.