Common Pipeline Library Reference Manual  5.3.1
Functions
FITS related basic routines

Functions

int cpl_fits_count_extensions (const char *filename)
 Get the number of extensions contained in a FITS file.
int cpl_fits_find_extension (const char *filename, const char *extname)
 Get the place of a given extension in a FITS file.
int cpl_fits_get_extension_nb (const char *filename, const char *extname)
 Get the place of a given extension in a FITS file.
int cpl_fits_get_nb_extensions (const char *filename)
 Get the number of extensions contained in a FITS file.

Detailed Description

This module provides functions to get basic information on FITS files

Synopsis:
   #include "cpl_fits.h"

Function Documentation

int cpl_fits_count_extensions ( const char *  filename)

Get the number of extensions contained in a FITS file.

Parameters:
filenameThe file name
Returns:
The number of extensions or -1 in case of error
Note:
For a valid fits file without extensions zero is returned

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if the input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if the input file is not FITS
int cpl_fits_find_extension ( const char *  filename,
const char *  extname 
)

Get the place of a given extension in a FITS file.

Parameters:
filenameThe file name
extnameThe extension name
Returns:
the extension number, 0 if not found or -1 on error

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_FILE_IO if the file is not FITS
int cpl_fits_get_extension_nb ( const char *  filename,
const char *  extname 
)

Get the place of a given extension in a FITS file.

Parameters:
filenameThe file name
extnameThe extension name
Returns:
the extension place or -1 in case of error
See also:
cpl_fits_find_extension
Deprecated:
Replace this call with cpl_fits_find_extension().
int cpl_fits_get_nb_extensions ( const char *  filename)

Get the number of extensions contained in a FITS file.

Parameters:
filenameThe file name
Returns:
the number of extensions or -1 in case of error
See also:
cpl_fits_count_extensions()
Deprecated:
Replace this call with cpl_fits_count_extensions().