📄 fitsio.h
字号:
OFF_T headend; /* byte offest in file to end of the current HDU header */
OFF_T nextkey; /* byte offset in file to beginning of next keyword */
OFF_T datastart;/* byte offset in file to start of the current data unit */
int tfield; /* number of fields in the table (primary array has 2 */
long origrows; /* original number of rows (value of NAXIS2 keyword) */
long numrows; /* number of rows in the table (dynamically updated) */
OFF_T rowlength; /* length of a table row or image size (bytes) */
tcolumn *tableptr; /* pointer to the table structure */
OFF_T heapstart; /* heap start byte relative to start of data unit */
long heapsize; /* size of the heap, in bytes */
/* the following elements are related to compressed images */
int request_compress_type; /* requested image compression algorithm */
long request_tilesize[MAX_COMPRESS_DIM]; /* requested tiling size */
int request_rice_nbits; /* requested noise bit parameter value */
int compressimg; /* 1 if HDU contains a compressed image, else 0 */
char zcmptype[12]; /* compression type string */
int compress_type; /* type of compression algorithm */
int zbitpix; /* FITS data type of image (BITPIX) */
int zndim; /* dimension of image */
long znaxis[MAX_COMPRESS_DIM]; /* length of each axis */
long tilesize[MAX_COMPRESS_DIM]; /* size of compression tiles */
long maxtilelen; /* max number of pixels in each image tile */
long maxelem; /* maximum length of variable length arrays */
int cn_compressed; /* column number for COMPRESSED_DATA column */
int cn_uncompressed; /* column number for UNCOMPRESSED_DATA column */
int cn_zscale; /* column number for ZSCALE column */
int cn_zzero; /* column number for ZZERO column */
int cn_zblank; /* column number for the ZBLANK column */
double zscale; /* scaling value, if same for all tiles */
double zzero; /* zero pt, if same for all tiles */
double cn_bscale; /* value of the BSCALE keyword in header */
double cn_bzero; /* value of the BZERO keyword in header */
int zblank; /* value for null pixels, if not a column */
int rice_blocksize; /* first compression parameter */
int rice_nbits; /* second compression parameter */
} FITSfile;
typedef struct /* structure used to store basic HDU information */
{
int HDUposition; /* HDU position in file; 0 = first HDU */
FITSfile *Fptr; /* pointer to FITS file structure */
}fitsfile;
typedef struct /* structure for the iterator function column information */
{
/* elements required as input to fits_iterate_data: */
fitsfile *fptr; /* pointer to the HDU containing the column */
int colnum; /* column number in the table (use name if < 1) */
char colname[70]; /* name (= TTYPEn value) of the column (optional) */
int datatype; /* output datatype (converted if necessary */
int iotype; /* = InputCol, InputOutputCol, or OutputCol */
/* output elements that may be useful for the work function: */
void *array; /* pointer to the array (and the null value) */
long repeat; /* binary table vector repeat value */
long tlmin; /* legal minimum data value */
long tlmax; /* legal maximum data value */
char tunit[70]; /* physical unit string */
char tdisp[70]; /* suggested display format */
} iteratorCol;
#define InputCol 0 /* flag for input only iterator column */
#define InputOutputCol 1 /* flag for input and output iterator column */
#define OutputCol 2 /* flag for output only iterator column */
/* error status codes */
#define CREATE_DISK_FILE -106 /* create disk file, without extended filename syntax */
#define OPEN_DISK_FILE -105 /* open disk file, without extended filename syntax */
#define SKIP_TABLE -104 /* move to 1st image when opening file */
#define SKIP_IMAGE -103 /* move to 1st table when opening file */
#define SKIP_NULL_PRIMARY -102 /* skip null primary array when opening file */
#define USE_MEM_BUFF -101 /* use memory buffer when opening file */
#define OVERFLOW_ERR -11 /* overflow during datatype conversion */
#define PREPEND_PRIMARY -9 /* used in ffiimg to insert new primary array */
#define SAME_FILE 101 /* input and output files are the same */
#define TOO_MANY_FILES 103 /* tried to open too many FITS files */
#define FILE_NOT_OPENED 104 /* could not open the named file */
#define FILE_NOT_CREATED 105 /* could not create the named file */
#define WRITE_ERROR 106 /* error writing to FITS file */
#define END_OF_FILE 107 /* tried to move past end of file */
#define READ_ERROR 108 /* error reading from FITS file */
#define FILE_NOT_CLOSED 110 /* could not close the file */
#define ARRAY_TOO_BIG 111 /* array dimensions exceed internal limit */
#define READONLY_FILE 112 /* Cannot write to readonly file */
#define MEMORY_ALLOCATION 113 /* Could not allocate memory */
#define BAD_FILEPTR 114 /* invalid fitsfile pointer */
#define NULL_INPUT_PTR 115 /* NULL input pointer to routine */
#define SEEK_ERROR 116 /* error seeking position in file */
#define BAD_URL_PREFIX 121 /* invalid URL prefix on file name */
#define TOO_MANY_DRIVERS 122 /* tried to register too many IO drivers */
#define DRIVER_INIT_FAILED 123 /* driver initialization failed */
#define NO_MATCHING_DRIVER 124 /* matching driver is not registered */
#define URL_PARSE_ERROR 125 /* failed to parse input file URL */
#define RANGE_PARSE_ERROR 126 /* failed to parse input file URL */
#define SHARED_ERRBASE (150)
#define SHARED_BADARG (SHARED_ERRBASE + 1)
#define SHARED_NULPTR (SHARED_ERRBASE + 2)
#define SHARED_TABFULL (SHARED_ERRBASE + 3)
#define SHARED_NOTINIT (SHARED_ERRBASE + 4)
#define SHARED_IPCERR (SHARED_ERRBASE + 5)
#define SHARED_NOMEM (SHARED_ERRBASE + 6)
#define SHARED_AGAIN (SHARED_ERRBASE + 7)
#define SHARED_NOFILE (SHARED_ERRBASE + 8)
#define SHARED_NORESIZE (SHARED_ERRBASE + 9)
#define HEADER_NOT_EMPTY 201 /* header already contains keywords */
#define KEY_NO_EXIST 202 /* keyword not found in header */
#define KEY_OUT_BOUNDS 203 /* keyword record number is out of bounds */
#define VALUE_UNDEFINED 204 /* keyword value field is blank */
#define NO_QUOTE 205 /* string is missing the closing quote */
#define BAD_KEYCHAR 207 /* illegal character in keyword name or card */
#define BAD_ORDER 208 /* required keywords out of order */
#define NOT_POS_INT 209 /* keyword value is not a positive integer */
#define NO_END 210 /* couldn't find END keyword */
#define BAD_BITPIX 211 /* illegal BITPIX keyword value*/
#define BAD_NAXIS 212 /* illegal NAXIS keyword value */
#define BAD_NAXES 213 /* illegal NAXISn keyword value */
#define BAD_PCOUNT 214 /* illegal PCOUNT keyword value */
#define BAD_GCOUNT 215 /* illegal GCOUNT keyword value */
#define BAD_TFIELDS 216 /* illegal TFIELDS keyword value */
#define NEG_WIDTH 217 /* negative table row size */
#define NEG_ROWS 218 /* negative number of rows in table */
#define COL_NOT_FOUND 219 /* column with this name not found in table */
#define BAD_SIMPLE 220 /* illegal value of SIMPLE keyword */
#define NO_SIMPLE 221 /* Primary array doesn't start with SIMPLE */
#define NO_BITPIX 222 /* Second keyword not BITPIX */
#define NO_NAXIS 223 /* Third keyword not NAXIS */
#define NO_NAXES 224 /* Couldn't find all the NAXISn keywords */
#define NO_XTENSION 225 /* HDU doesn't start with XTENSION keyword */
#define NOT_ATABLE 226 /* the CHDU is not an ASCII table extension */
#define NOT_BTABLE 227 /* the CHDU is not a binary table extension */
#define NO_PCOUNT 228 /* couldn't find PCOUNT keyword */
#define NO_GCOUNT 229 /* couldn't find GCOUNT keyword */
#define NO_TFIELDS 230 /* couldn't find TFIELDS keyword */
#define NO_TBCOL 231 /* couldn't find TBCOLn keyword */
#define NO_TFORM 232 /* couldn't find TFORMn keyword */
#define NOT_IMAGE 233 /* the CHDU is not an IMAGE extension */
#define BAD_TBCOL 234 /* TBCOLn keyword value < 0 or > rowlength */
#define NOT_TABLE 235 /* the CHDU is not a table */
#define COL_TOO_WIDE 236 /* column is too wide to fit in table */
#define COL_NOT_UNIQUE 237 /* more than 1 column name matches template */
#define BAD_ROW_WIDTH 241 /* sum of column widths not = NAXIS1 */
#define UNKNOWN_EXT 251 /* unrecognizable FITS extension type */
#define UNKNOWN_REC 252 /* unrecognizable FITS record */
#define END_JUNK 253 /* END keyword is not blank */
#define BAD_HEADER_FILL 254 /* Header fill area not blank */
#define BAD_DATA_FILL 255 /* Data fill area not blank or zero */
#define BAD_TFORM 261 /* illegal TFORM format code */
#define BAD_TFORM_DTYPE 262 /* unrecognizable TFORM datatype code */
#define BAD_TDIM 263 /* illegal TDIMn keyword value */
#define BAD_HEAP_PTR 264 /* invalid BINTABLE heap address */
#define BAD_HDU_NUM 301 /* HDU number < 1 or > MAXHDU */
#define BAD_COL_NUM 302 /* column number < 1 or > tfields */
#define NEG_FILE_POS 304 /* tried to move before beginning of file */
#define NEG_BYTES 306 /* tried to read or write negative bytes */
#define BAD_ROW_NUM 307 /* illegal starting row number in table */
#define BAD_ELEM_NUM 308 /* illegal starting element number in vector */
#define NOT_ASCII_COL 309 /* this is not an ASCII string column */
#define NOT_LOGICAL_COL 310 /* this is not a logical datatype column */
#define BAD_ATABLE_FORMAT 311 /* ASCII table column has wrong format */
#define BAD_BTABLE_FORMAT 312 /* Binary table column has wrong format */
#define NO_NULL 314 /* null value has not been defined */
#define NOT_VARI_LEN 317 /* this is not a variable length column */
#define BAD_DIMEN 320 /* illegal number of dimensions in array */
#define BAD_PIX_NUM 321 /* first pixel number greater than last pixel */
#define ZERO_SCALE 322 /* illegal BSCALE or TSCALn keyword = 0 */
#define NEG_AXIS 323 /* illegal axis length < 1 */
#define NOT_GROUP_TABLE 340
#define HDU_ALREADY_MEMBER 341
#define MEMBER_NOT_FOUND 342
#define GROUP_NOT_FOUND 343
#define BAD_GROUP_ID 344
#define TOO_MANY_HDUS_TRACKED 345
#define HDU_ALREADY_TRACKED 346
#define BAD_OPTION 347
#define IDENTICAL_POINTERS 348
#define BAD_GROUP_ATTACH 349
#define BAD_GROUP_DETACH 350
#define BAD_I2C 401 /* bad int to formatted string conversion */
#define BAD_F2C 402 /* bad float to formatted string conversion */
#define BAD_INTKEY 403 /* can't interprete keyword value as integer */
#define BAD_LOGICALKEY 404 /* can't interprete keyword value as logical */
#define BAD_FLOATKEY 405 /* can't interprete keyword value as float */
#define BAD_DOUBLEKEY 406 /* can't interprete keyword value as double */
#define BAD_C2I 407 /* bad formatted string to int conversion */
#define BAD_C2F 408 /* bad formatted string to float conversion */
#define BAD_C2D 409 /* bad formatted string to double conversion */
#define BAD_DATATYPE 410 /* bad keyword datatype code */
#define BAD_DECIM 411 /* bad number of decimal places specified */
#define NUM_OVERFLOW 412 /* overflow during datatype conversion */
# define DATA_COMPRESSION_ERR 413 /* error in imcompress routines */
# define DATA_DECOMPRESSION_ERR 414 /* error in imcompress routines */
# define NO_COMPRESSED_TILE 415 /* compressed tile doesn't exist */
#define BAD_DATE 420 /* error in date or time conversion */
#define PARSE_SYNTAX_ERR 431 /* syntax error in parser expression */
#define PARSE_BAD_TYPE 432 /* expression did not evaluate to desired type */
#define PARSE_LRG_VECTOR 433 /* vector result too large to return in array */
#define PARSE_NO_OUTPUT 434 /* data parser failed not sent an out column */
#define PARSE_BAD_COL 435 /* bad data encounter while parsing column */
#define PARSE_BAD_OUTPUT 436 /* Output file not of proper type */
#define ANGLE_TOO_BIG 501 /* celestial angle too large for projection */
#define BAD_WCS_VAL 502 /* bad celestial coordinate or pixel value */
#define WCS_ERROR 503 /* error in celestial coordinate calculation */
#define BAD_WCS_PROJ 504 /* unsupported type of celestial projection */
#define NO_WCS_KEY 505 /* celestial coordinate keywords not found */
#define APPROX_WCS_KEY 506 /* approximate WCS keywords were calculated */
#define NO_CLOSE_ERROR 999 /* special value used internally to switch off */
/* the error message from ffclos and ffchdu */
/*------- following error codes are used in the grparser.c file -----------*/
#define NGP_ERRBASE (360) /* base chosen so not to interfere with CFITSIO */
#define NGP_OK (0)
#define NGP_NO_MEMORY (NGP_ERRBASE + 0) /* malloc failed */
#define NGP_READ_ERR (NGP_ERRBASE + 1) /* read error from file */
#define NGP_NUL_PTR (NGP_ERRBASE + 2) /* null pointer passed as argument */
#define NGP_EMPTY_CURLINE (NGP_ERRBASE + 3) /* line read seems to be empty */
#define NGP_UNREAD_QUEUE_FULL (NGP_ERRBASE + 4) /* cannot unread more then 1 line (or single line twice) */
#define NGP_INC_NESTING (NGP_ERRBASE + 5) /* too deep include file nesting (inf. loop ?) */
#define NGP_ERR_FOPEN (NGP_ERRBASE + 6) /* fopen() failed, cannot open file */
#define NGP_EOF (NGP_ERRBASE + 7) /* end of file encountered */
#define NGP_BAD_ARG (NGP_ERRBASE + 8) /* bad arguments passed */
#define NGP_TOKEN_NOT_EXPECT (NGP_ERRBASE + 9) /* token not expected here */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -