Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

FileIO


Files

file  psFits.h
 Contains Fits I/O routines.
file  psFitsHeader.h
 Contains Fits header I/O routines.
file  psFitsImage.h
 Contains Fits I/O routines.
file  psFitsTable.h
 Contains Fits I/O routines.

Data Structures

struct  psFits
 FITS file object. More...

Enumerations

enum  psFitsType { PS_FITS_TYPE_NONE = -1, PS_FITS_TYPE_IMAGE = IMAGE_HDU, PS_FITS_TYPE_BINARY_TABLE = BINARY_TBL, PS_FITS_TYPE_ASCII_TABLE = ASCII_TBL, PS_FITS_TYPE_ANY = ANY_HDU }
 FITS HDU type. More...

Functions

psFitspsFitsOpen (const char *filename, const char *mode)
 Opens a FITS file and allocates the associated psFits object.
bool psFitsClose (psFits *fits)
 Closes a FITS file.
bool psMemCheckFits (psPtr ptr)
 Checks the type of a particular pointer.
bool psFitsMoveExtName (const psFits *fits, const char *extname)
 Moves the FITS HDU to the specified extension name.
bool psFitsMoveExtNum (const psFits *fits, int extnum, bool relative)
 Moves the FITS HDU to the specified extension number.
bool psFitsMoveLast (const psFits *fits)
 Moves the FITS HDU to the end of the file.
int psFitsGetExtNum (const psFits *fits)
 Get the current extension number, where 0 is the primary HDU.
psString psFitsGetExtName (const psFits *fits)
 Get the current extension name.
bool psFitsSetExtName (psFits *fits, const char *name)
 Set the current extension's name.
int psFitsGetSize (const psFits *fits)
 Get the total number of HDUs in the FITS file.
bool psFitsDeleteExtNum (psFits *fits, int extnum, bool relative)
 Remove the an HDU as specified by number.
bool psFitsDeleteExtName (psFits *fits, const char *extname)
 Remove the an HDU as specified by extension name.
psFitsType psFitsGetExtType (const psFits *fits)
 Get the extension type of the current HDU.
bool psFitsTruncate (psFits *fits)
 Delete all extensions after the current position.
psMetadatapsFitsReadHeader (psMetadata *out, const psFits *fits)
 Reads the header of the current HDU.
psMetadatapsFitsReadHeaderSet (psMetadata *out, const psFits *fits)
 Reads the header of all HDUs.
bool psFitsWriteHeader (const psMetadata *output, psFits *fits)
 Writes the values of the metadata to the current HDU header.
psMetadatapsFitsHeaderFromImage (psMetadata *header, psImage *image, const char *extname)
 Updates the given header to be compatible with the supplied image, updating BITPIX, NAXIS1, and NAXIS2.
psMetadatapsFitsHeaderFromTable (psMetadata *header, psArray *table, const char *extname)
 Updates the given header to be compatible with the given table, i.e.
psImagepsFitsReadImage (psImage *out, const psFits *fits, psRegion region, int z)
 Reads an image, given the desired region and z-plane.
bool psFitsWriteImage (psFits *fits, psMetadata *header, const psImage *input, int depth)
 Writes an image, given the desired region and z-plane.
bool psFitsUpdateImage (psFits *fits, const psImage *input, psRegion region, int z)
 Updates the FITS file image, given the desired region and z-plane.
psMetadatapsFitsReadTableRow (const psFits *fits, int row)
 Reads a table row.
psArraypsFitsReadTableColumn (const psFits *fits, const char *colname)
 Reads a table column.
psVectorpsFitsReadTableColumnNum (const psFits *fits, const char *colname)
 Reads a table column of numbers.
psArraypsFitsReadTable (psFits *fits)
 Reads a whole FITS table.
bool psFitsWriteTable (psFits *fits, const psMetadata *header, const psArray *table)
 Writes a whole FITS table.
bool psFitsUpdateTable (psFits *fits, const psMetadata *data, int row)
 Updates a FITS table.


Enumeration Type Documentation

enum psFitsType
 

FITS HDU type.

Enumeration for FITS HDU type.

Enumeration values:
PS_FITS_TYPE_NONE  Unknown HDU type.
PS_FITS_TYPE_IMAGE  Image HDU type.
PS_FITS_TYPE_BINARY_TABLE  Binary table HDU type.
PS_FITS_TYPE_ASCII_TABLE  ASCII table HDU type.
PS_FITS_TYPE_ANY  Any HDU type.

Definition at line 34 of file psFits.h.


Function Documentation

bool psFitsClose psFits fits  ) 
 

Closes a FITS file.

Returns:
bool TRUE if FITS file was successfully closed, otherwise FALSE
Parameters:
fits  psFits object to close

bool psFitsDeleteExtName psFits fits,
const char *  extname
 

Remove the an HDU as specified by extension name.

Returns:
bool TRUE if the specified HDU was removed, otherwise FALSE
Parameters:
fits  the psFits object
extname  the extension name to delete

bool psFitsDeleteExtNum psFits fits,
int  extnum,
bool  relative
 

Remove the an HDU as specified by number.

Returns:
bool TRUE if the specified HDU was removed, otherwise FALSE
Parameters:
fits  the psFits object
extnum  the extension number to delete (zero is primary HDU)
relative  if true, extnum is a relative number to the current position

psString psFitsGetExtName const psFits fits  ) 
 

Get the current extension name.

Returns:
int Current HDU name of the psFits file or NULL if an error occurred.
Parameters:
fits  the psFits object

int psFitsGetExtNum const psFits fits  ) 
 

Get the current extension number, where 0 is the primary HDU.

Returns:
int Current HDU number of the psFits file or < 0 if an error occurred.
Parameters:
fits  the psFits object

psFitsType psFitsGetExtType const psFits fits  ) 
 

Get the extension type of the current HDU.

Returns:
psFitsType The type of the current HDU. If PS_FITS_TYPE_UNKNOWN, the type could not be determined.
Parameters:
fits  the psFits object

int psFitsGetSize const psFits fits  ) 
 

Get the total number of HDUs in the FITS file.

Returns:
int The total number of HDUs in the FITS file or < 0 if an error occurred.
Parameters:
fits  the psFits object

psMetadata* psFitsHeaderFromImage psMetadata header,
psImage image,
const char *  extname
 

Updates the given header to be compatible with the supplied image, updating BITPIX, NAXIS1, and NAXIS2.

The extension name is (re)set to the given extname.

Returns:
psMetadata* updated header.
Parameters:
header  the header to update
image  the image to use to determine update values
extname  the extension name

psMetadata* psFitsHeaderFromTable psMetadata header,
psArray table,
const char *  extname
 

Updates the given header to be compatible with the given table, i.e.

psArray of psMetadata. The extension name is (re)set to the given extname.

Parameters:
header  the header to update
table  the table to use to update header
extname  the extension name

bool psFitsMoveExtName const psFits fits,
const char *  extname
 

Moves the FITS HDU to the specified extension name.

Returns:
bool TRUE if the extension name was found and move was successful, otherwise FALSE
Parameters:
fits  the psFits object to move
extname  the extension name

bool psFitsMoveExtNum const psFits fits,
int  extnum,
bool  relative
 

Moves the FITS HDU to the specified extension number.

Returns:
bool TRUE if the extension number was found and move was successful, otherwise FALSE
Parameters:
fits  the psFits object to move
extnum  the extension number to move to (zero is primary HDU)
relative  if true, extnum is a relative number to the current position

bool psFitsMoveLast const psFits fits  ) 
 

Moves the FITS HDU to the end of the file.

Returns:
bool TRUE if the move was successful, otherwise FALSE
Parameters:
fits  the psFits object to move

psFits* psFitsOpen const char *  filename,
const char *  mode
 

Opens a FITS file and allocates the associated psFits object.

Returns:
psFits* new psFits object for the FITS files specified or NULL if the open of the FITS file failed
Parameters:
filename  the FITS file name
mode  File open mode. Could be one of the following: 'r' (read only), 'r+' (read & write), 'rw' (same as 'r+'), or 'w' (create new file for writing)

psMetadata* psFitsReadHeader psMetadata out,
const psFits fits
 

Reads the header of the current HDU.

Returns:
psMetadata* the header data
Parameters:
out  The psMetadata to add the header data. If null, a new psMetadata is created.
fits  the psFits object

psMetadata* psFitsReadHeaderSet psMetadata out,
const psFits fits
 

Reads the header of all HDUs.

The current HDU is not changed.

Returns:
psMetadata* the header data set as a number of metadata entries
Parameters:
out  The psMetadata to add the header data via psMetadata items. If null, a new psMetadata is created. The keys of the psMetadata are the extension names of the cooresponding HDUs.
fits  the psFits object

psImage* psFitsReadImage psImage out,
const psFits fits,
psRegion  region,
int  z
 

Reads an image, given the desired region and z-plane.

Returns:
psImage* the read image or NULL if there was an error.
Parameters:
out  a psImage to recycle.
fits  the psFits object
region  the region in the FITS image to read
z  the z-plane in the FITS image cube to read

psArray* psFitsReadTable psFits fits  ) 
 

Reads a whole FITS table.

The current HDU type must be either PS_FITS_TYPE_BINARY_TABLE or PS_FITS_TYPE_ASCII_TABLE.

Returns:
psArray* Array of psMetadata items, which contains the output data items of each row.
See also:
psFitsReadTableRow
Parameters:
fits  the psFits object

psArray* psFitsReadTableColumn const psFits fits,
const char *  colname
 

Reads a table column.

The current HDU type must be either PS_FITS_TYPE_BINARY_TABLE or PS_FITS_TYPE_ASCII_TABLE.

Returns:
psArray* Array of data items for the specified column or NULL if an error occurred.
Parameters:
fits  the psFits object
colname  the column name

psVector* psFitsReadTableColumnNum const psFits fits,
const char *  colname
 

Reads a table column of numbers.

The current HDU type must be either PS_FITS_TYPE_BINARY_TABLE or PS_FITS_TYPE_ASCII_TABLE.

Returns:
psVector* Vector of data for the specified column or NULL if an error occurred.
Parameters:
fits  the psFits object
colname  the column name

psMetadata* psFitsReadTableRow const psFits fits,
int  row
 

Reads a table row.

The current HDU type must be either PS_FITS_TYPE_BINARY_TABLE or PS_FITS_TYPE_ASCII_TABLE.

Returns:
psMetadata* The table row's data. The keys are the column names.
Parameters:
fits  the psFits object
row  row number to read

bool psFitsSetExtName psFits fits,
const char *  name
 

Set the current extension's name.

Returns:
bool TRUE if the extension was successfully set, otherwise FALSE.
Parameters:
fits  the psFits object
name  the extension name

bool psFitsTruncate psFits fits  ) 
 

Delete all extensions after the current position.

Returns:
bool TRUE if the operation was successful, otherwise FALSE
Parameters:
fits  the psFits object

bool psFitsUpdateImage psFits fits,
const psImage input,
psRegion  region,
int  z
 

Updates the FITS file image, given the desired region and z-plane.

Returns:
bool TRUE is the write was successful, otherwise FALSE.
Parameters:
fits  the psFits object
input  the image to output
region  the region in the FITS image to write
z  the z-planes of the FITS image data cube to write

bool psFitsUpdateTable psFits fits,
const psMetadata data,
int  row
 

Updates a FITS table.

The current HDU type must be either PS_FITS_TYPE_BINARY_TABLE or PS_FITS_TYPE_ASCII_TABLE.

Returns:
bool TRUE if the write was successful, otherwise FALSE
See also:
psFitsWriteTable
Parameters:
fits  the psFits object
data  Array of psMetadata items, which contains the output data items of each row.
row  the row number to update.

bool psFitsWriteHeader const psMetadata output,
psFits fits
 

Writes the values of the metadata to the current HDU header.

Returns:
bool if TRUE, the write was successful, otherwise FALSE.
Parameters:
output  the psMetadata data in which to write
fits  the psFits object

bool psFitsWriteImage psFits fits,
psMetadata header,
const psImage input,
int  depth
 

Writes an image, given the desired region and z-plane.

Returns:
bool TRUE is the write was successful, otherwise FALSE.
Parameters:
fits  the psFits object
header  header items for the new HDU. Can be NULL.
input  the image to output
depth  the number of z-planes of the FITS image data cube

bool psFitsWriteTable psFits fits,
const psMetadata header,
const psArray table
 

Writes a whole FITS table.

The current HDU type must be either PS_FITS_TYPE_BINARY_TABLE or PS_FITS_TYPE_ASCII_TABLE.

Returns:
bool TRUE if the write was successful, otherwise FALSE
See also:
psFitsReadTableRow
Parameters:
fits  the psFits object
header  header items for the new HDU. Can be NULL.
table  Array of psMetadata items, which contains the output data items of each row.

bool psMemCheckFits psPtr  ptr  ) 
 

Checks the type of a particular pointer.

Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.

Returns:
bool: True if the pointer matches a psFits structure, false otherwise.
Parameters:
ptr  the pointer whose type to check


Generated on Tue Dec 6 17:18:43 2005 for Pan-STARRS Foundation Library by  doxygen 1.4.2