The Solar-Stellar Spectrograph

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

ARTICLE

BasicFITSHeader

The BasicFITSHeader class implements a one-unit FITS header of 36 fields with 80 characters each. (This is the format used by all SSS raw data files.) It inherits Filelink.

Version History

2008 July 08 - Documentation written.

 

Data Members

struct pointer[ ] hdr { fields:StrArr(numFields) }

 

Method List

cleanup

define

dump_header

dump_stat

get_card_image( )

init( )

is_valid( )

read( )

set_card_image( )

set_mandatory

write

 

Method Descriptions

 

PRO cleanup

Calls Filelink::cleanup

Destructor. Clears its history list by calling Filelink::cleanup, and freeing its own hdr pointer. 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 BasicFITSHeader class. Used by Obj_New; do not invoke directly.

 

PRO dump_header

Prints the content of the hdr data member to stdout.

 

PRO dump_stat

Calls Filelink::dump_stat

This is a standard OIL class method. For the BasicFITSHeader class, it dumps the current header, followed by the data members of the parent Filelink object, to the command output window. The dump will look best if the output font is fixed rather than proportional width.

 

FUNCTION get_card_image

keyword int num

keyword int keyword

Calls Root::add_history

Return bool, string field

Returns card image num or having keyword keyword from the object's hdr data member, or FALSE if hdr is invalid. This function can throw two errors to the event history list (if the header is an invalid pointer, if the field number is out of range, or if no keyword match is found in the header).

 

FUNCTION init

keyword struct _EXTRA

Return pointer subImage

Constructor. The obect's hdr data member is set to be a 36-element array of strings. Never call this function directly; it is invoked by IDL's Obj_New function.

 

FUNCTION is_valid

Calls Root::add_history, Filelink::is_valid

Return long[3] 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 BasicFITSHeader, the validity state is -1 if the header is NULL. The function returns a three-element array of longs, the first element containing the validity state of the Root, and the second that of the Filelink. An event is written to the log if the BasicFITSHeader is invalid.

 

FUNCTION read

Calls Filelink::open_datafile, Filelink::close_datafile, Filelink::modified, Root::add_history

Return bool b

Reads the FITS header from the linked file and stores it in the object's hdr data member. Returns TRUE if read successfully and FALSE if there was an error.

 

FUNCTION set_card_image

argument long num

argument string value

argument string cardImNum

keyword string comment

keyword int sigFig

Calls Root::add_history

Return bool b

Sets the card image num to have keyword keyword and value value, returning TRUE. It throws an error if the header is null or the field numer is out of range, and returns FALSE in those cases. A comment is added if the comment keyword is set, and the number of significant figures can be controlled using the sigFig keyword.

 

PRO set_mandatory

argument int bitpix

argument int nAxis1

argument int nAxis2

Calls BasicFITSHeader::set_card_image, Root::add_history

Return bool b

Generates the five mandatory fields at the start of the FITS header, setting them to the values specified by the arguments. Additionally, the SIMPLE card image is set to "T" and the NAXIS card image to 2.

 

PRO write

Calls Filelink::open_datafile, Filelink::close_datafile, Filelink::modified, Root::add_history

Return bool b

Writes the header to the linked file. Returns TRUE if read successfully and FALSE if there was an error.

 

Sample Usage

obj = Obj_New( 'BasicFITSHeader', logCodes = !OIL_ALL, f = 'C:\mydir\somefile' )

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.