The Solar-Stellar Spectrograph

[ Home | About | Tech Info & Data | Publications | References ]      [ Site by Jeffrey Hall | Research funded by NSF ]



FITSdata is a container class that includes a BasicFITSHeader and an Image as data members. It provides a set of methods to perform combined I/O operations on the header and data in a FITS file.

Version History

2008 July 09 - Documentation written.


Data Members

Object Header

Object Image


Method List



get_header( )

get_image( )

init( )

is_valid( )







Method Descriptions


PRO cleanup

Destructor. Destroys the Header and Image objects it contains. Never call this procedure directly; it is invoked by IDL's Obj_Destroy function.


PRO define

Structure definition. Specifies the contents of the IDL structure instantiated by the FITSData class. Used by Obj_New; do not invoke directly.


FUNCTION get_header

Return Object Header

Returns a reference to its Header object.


FUNCTION get_image

Return Object Image

Returns a reference to its Image object.



argument string headerClass

argument string imageClass

Return bool TRUE

Constructor. It creates two objects of class specified by the arguments. Never call this function directly; it is invoked by IDL's Obj_New function.


FUNCTION is_valid

Calls HeaderClass::is_valid, ImageClass::is_valid

Return long[2][i] valid

Each OIL class has an is_valid function that performs class-specific tests on its data members. If all members are found to be valid, however validity is defined for that class, this funtion returns 1. Otherwise, a negative number is returned that contains a bitwise combination of all errors detected. In the case of FITSData, a 2D array is returned containing the result of is_valid called for each of the contained objects.


PRO read

Calls HeaderClass::read, HeaderClass::get_card_image, ImageClass::new_data_array, ImageClass::read, ImageClass::byteswap

Reads a FITS file into the header and image objects. A new data array is created in the Image object, and the routine ensures the data are properly byteswapped from the FITS big-endian standard for the local machine.


PRO set_datafile

argument string dataFile

Calls HeaderClass::set_datafile, ImageClass::set_datafile

Sets the value of the data file the object is linked to.


PRO set_header

argument Object Header

Calls HeaderClass::Obj_Destroy

Sets the Header data member to a new object reference, destroying the old object first.


PRO set_image

argument Object Image

Calls ImageClass::Obj_Destroy

Sets the Image data member to a new object reference, destroying the old object first.


PRO write

Calls HeaderClass::write, ImageClass::write, ImageClass::byteswap

Writes the header and the image data to the linked file.


Sample Usage

obj = Obj_New( 'FITSData', 'BasicFITSHeader', 'Image' )

Obj_Destroy( obj )


[Back to contents]

Supported by grants from the National Science Foundation.
[ Back to my home page | Email me: jch [at] lowell [dot] edu ]
The SSS is publicly funded. Unless explicitly noted otherwise, everything on this site is in the public domain.
If you use or quote our results or images, we appreciate an acknowledgment.
This site is best viewed with Mozilla Firefox.