Produced by IDL 7.1.1
Developer Documentation

./toolbox/io
fits__define.pro

Last modification date:
Wed Sep 28 13:27:14 2016

Provides basic interface for reading and writing fits files

Fields Summary
FILE_NAME
string
full path name to the fits file
NUM_EXTENSIONS
longword integer
number of extensions for this file
EXTENSION_NAMES
pointer
pointer to list of names for each extension
EXTENSION_TYPES
pointer
pointer to list of types for each extension
AXIS
pointer
pointer to 2-D array with info on each extension
PRIMARY_HEADER
object reference
fits_header_parser object for primary header
EXT_HEADER
object reference
fits_header_parsert object for last extension header
PROPERTIES_KNOWN
longword integer
flag signaling if above fields are valid798
DEBUG
longword integer
flag for determining if debug printouts occur
VERSION
string
string denoting what version of the io modules

Routine Summary  34 routines

procedure fits__define

Provides basic interface for reading and writing fits files

function FITS::init([file_name], version=version)

Class Constructor - if file name is passed and it exists, the properties of this file are determined and stored

procedure FITS::cleanup

private

Class Destructor

function FITS::get_version()

Retrieves this objects version number

procedure FITS::set_version, ver

Sets the version number of this object

procedure FITS::set_debug_on

Makes object verbose

procedure FITS::set_debug_off

Makes object quiet

procedure FITS::update_properties

Determins properties of file and last extension, and sotres them

procedure FITS::update_file_properties

Determines and stores the fits files number of extenions, names & types of each extension, and more info on each extension, plus read in primry header keywords

procedure FITS::update_last_extension_properties

Determines and stores info on the last extension of the file

procedure FITS::set_file_name, file_name

Sets the full path name of the fits file

function FITS::get_full_file_name()

Retrieves the full path name of the fits file

function FITS::get_file_name()

Retrieves just the file name of the fits file (no path)

function FITS::file_exists([file_name=string])

Checks if fits file represented by object (or keyword) exist on disk

function FITS::get_number_extensions()

Returns the number of extensions of this fits file

function FITS::get_extension_type(ext_num)

Returns the type of the given extension

function FITS::get_extension_name(ext_num)

Returns the name of the given extension

function FITS::get_ext_num_rows(ext_num)

REturns the number of rows for this extension

function FITS::get_rows([ext=long], [row_nums=array])

Returns the contents of the gvein extension and row numbers for this fits file.

procedure FITS::create_extension_header_struct, hdr_lines

private

Creates a new header struct using the string array from the extension header

procedure FITS::create_primary_header_struct, hdr_lines

private

Creates a new header struct using the string array from the primary header

procedure FITS::list_extension_header

Prints the contents of the header of the last read extension

function FITS::get_extension_header_value(keyword)

Retrieves the value of a keyword in the last read extension

procedure FITS::write_rows_new_extension, rows[, virtuals]

Appends a new extension to fits file and adds rows to it.

procedure FITS::append_rows_to_extension, rows

Appends rows to last extension in fits file

function FITS::get_column_type(extension[, column_number], [column_name=string])

Retrieves the TFROM# value for an extension column specified either by number or name

function FITS::row_compatible_with_extension(row, extension)

Called before an extension is appended to with new rows.

function FITS::make_header_array(virtuals)

Converts a structure containing keyword-values and returns a string array suitable for using to add to extension header

function FITS::get_logical_columns(forms, n_logic_cols)

private

Given the TFORMs found in extension header, finds which ones are of type '1L'

function FITS::fits_type_to_idl_type(fits_type[, idl_size])

private

Converts fits TFORM# keyword value to it's IDL integer type

procedure FITS::modify_row_column, extension, row_num, col_num, value

Overwrites a value in a fits file, identified by extension number, row number, and column number.

procedure FITS::modify_rows, extension, row_nums, rows

Overwrites entire rows in fits extension

function FITS::get_column_num(extension, col_name)

private

Retrieves the column number for a given column name and extension.

procedure FITS::modify_row_col_name, extension, row_num, column_name, value

Modifies a 'cell' in a fits file, by specifiying the extension, row number, column name, and the value to replace 'cell' with.

Routine Details

fits__define

procedure fits__define

Provides basic interface for reading and writing fits files

FITS::init

function FITS::init([file_name], version=version)

Class Constructor - if file name is passed and it exists, the properties of this file are determined and stored

Parameters
file_name
in, optional
string
full path name to fits file

Keywords
version
.

FITS::cleanup private

procedure FITS::cleanup

Class Destructor

FITS::get_version

function FITS::get_version()

Retrieves this objects version number

Returns
version number

FITS::set_version

procedure FITS::set_version, ver

Sets the version number of this object

Parameters
ver
.

FITS::set_debug_on

procedure FITS::set_debug_on

Makes object verbose

FITS::set_debug_off

procedure FITS::set_debug_off

Makes object quiet

FITS::update_properties

procedure FITS::update_properties

Determins properties of file and last extension, and sotres them

Uses
FITS::update_file_properties FITS::update_last_extension_properties

FITS::update_file_properties

procedure FITS::update_file_properties

Determines and stores the fits files number of extenions, names & types of each extension, and more info on each extension, plus read in primry header keywords

Uses
FITS_OPEN FITS_CLOSE

FITS::update_last_extension_properties

procedure FITS::update_last_extension_properties

Determines and stores info on the last extension of the file

Uses
FXBOPEN FXBCLOSE FITS_HEADER_PARSER::create_extension_header_struct

FITS::set_file_name

procedure FITS::set_file_name, file_name

Sets the full path name of the fits file

Parameters
file_name
in
string
full path name of fits file

FITS::get_full_file_name

function FITS::get_full_file_name()

Retrieves the full path name of the fits file

Returns
full path name of fits file

FITS::get_file_name

function FITS::get_file_name()

Retrieves just the file name of the fits file (no path)

Returns
file name of fits file

FITS::file_exists

function FITS::file_exists([file_name=string])

Checks if fits file represented by object (or keyword) exist on disk

Returns
0,1
Uses
file_info

Keywords
file_name
in, optional
string
full path name of file to check

FITS::get_number_extensions

function FITS::get_number_extensions()

Returns the number of extensions of this fits file

Returns
number of extensions

FITS::get_extension_type

function FITS::get_extension_type(ext_num)

Returns the type of the given extension

Returns
extension type

Parameters
ext_num
in
long
extension number in question

FITS::get_extension_name

function FITS::get_extension_name(ext_num)

Returns the name of the given extension

Returns
extension name

Parameters
ext_num
in
long
extension number in question

FITS::get_ext_num_rows

function FITS::get_ext_num_rows(ext_num)

REturns the number of rows for this extension

Returns
number of rows

Parameters
ext_num
in
long
extension number

FITS::get_rows

function FITS::get_rows([ext=long], [row_nums=array])

Returns the contents of the gvein extension and row numbers for this fits file. Also updates properties of this extension that was read.

Returns
array of structures representing each row read
Uses
mrdfits FITS::create_extension_header_struct

Keywords
ext
in, optional
long
extension to read, default = 1
row_nums
in, optional
array
array of row numbers to read (0-based), default=all

FITS::create_extension_header_struct private

procedure FITS::create_extension_header_struct, hdr_lines

Creates a new header struct using the string array from the extension header

Parameters
hdr_lines
in
array
string array of extension header returned by mrdfits

FITS::create_primary_header_struct private

procedure FITS::create_primary_header_struct, hdr_lines

Creates a new header struct using the string array from the primary header

Parameters
hdr_lines
in
array
string array of primary header returned by FITS_READ

FITS::list_extension_header

procedure FITS::list_extension_header

Prints the contents of the header of the last read extension

Uses
FITS_HEADER_PARSER::list

FITS::get_extension_header_value

function FITS::get_extension_header_value(keyword)

Retrieves the value of a keyword in the last read extension

Returns
value of keyword
Uses
FITS_HEADER_PARSER::get_key_value

Parameters
keyword
in
string
extension header keyword

FITS::write_rows_new_extension

procedure FITS::write_rows_new_extension, rows[, virtuals]

Appends a new extension to fits file and adds rows to it. Additional keywords are added to the extesnion header, and fits files properties are updated.

Uses
FITS::make_header_array mwrfits

Parameters
rows
in, required
array
array of structures that mirror rows to be writtein
virtuals
in, optional
struct
keywords to be written to new extension (other then column specs)

FITS::append_rows_to_extension

procedure FITS::append_rows_to_extension, rows

Appends rows to last extension in fits file

Uses
FXBOPEN FXBGROW FXBFIND FXBWRITE FXBFINISH FITS::get_logical_columsn

Parameters
rows
in
array
array of structs mirroring rows to be appended

FITS::get_column_type

function FITS::get_column_type(extension[, column_number], [column_name=string])

Retrieves the TFROM# value for an extension column specified either by number or name

Returns
string specifiying fits type ('1A','1024E').

Parameters
extension
in, required
long
extension number in which column is to be found
column_number
in, optional
long
column number to be queried

Keywords
column_name
in, optional
string
column name to be queried; overrides column number

FITS::row_compatible_with_extension

function FITS::row_compatible_with_extension(row, extension)

Called before an extension is appended to with new rows. Checks to see if a representative of these rows has properties that match the existing columns of the extension. For each tag in the row structure, its name and type is compared to the column, in increasing order.

Returns
0 - row not compatible to extension, 1 - row compatible to extension

Parameters
row
in, required
struct
structure representing first row to be appended to extension
extension
in, required
long
the extension number to be appended to

FITS::make_header_array

function FITS::make_header_array(virtuals)

Converts a structure containing keyword-values and returns a string array suitable for using to add to extension header

Returns
string array suitable for using to add to extension header.

Parameters
virtuals
in
struct
structure cointing keyword-values for header

FITS::get_logical_columns private

function FITS::get_logical_columns(forms, n_logic_cols)

Given the TFORMs found in extension header, finds which ones are of type '1L'

Returns
indicis where forms [i] is of type '1L'

Parameters
forms
in
array
string array of all TFORM#s foudn in extension header
n_logic_cols
out
variable
number of logic columns found

FITS::fits_type_to_idl_type private

function FITS::fits_type_to_idl_type(fits_type[, idl_size])

Converts fits TFORM# keyword value to it's IDL integer type

Returns
integer idl data type code

Parameters
fits_type
in, required
string
the value of the TFORM# keyword in the ext. header
idl_size
out, optional
variable
the size of this type (ex: string length)

FITS::modify_row_column

procedure FITS::modify_row_column, extension, row_num, col_num, value

Overwrites a value in a fits file, identified by extension number, row number, and column number.

Uses
FXBOPEN FXBFIND FXBWRITE FXBFINISH FITS::get_logical_columsn

Parameters
extension
in, required
long
extension number to modify
row_num
in, required
long
row number to modify in extension
col_num
in, required
long
column number to modify in extension
value
in, required
varies
value that will overwrite the row+column specified

FITS::modify_rows

procedure FITS::modify_rows, extension, row_nums, rows

Overwrites entire rows in fits extension

Uses
FXBOPEN FXBFIND FXBWRITE FXBFINISH FITS::get_logical_columsn

Parameters
extension
in, required
long
extension number to modify
row_nums
in, required
long array
row numbers to modify in extension
rows
in, required
array
array of structs that will overwrite the rows specified

FITS::get_column_num private

function FITS::get_column_num(extension, col_name)

Retrieves the column number for a given column name and extension. Note that column name refers to name in the header line: TTYPEn = 'name'

Returns
integer representing the column number of the name passed in.
Uses
FXBOPEN FXBFIND FXBFINISH

Parameters
extension
in, required
long
extension to retrieve column number from
col_name
in, required
string
column name whose number is retrieved

FITS::modify_row_col_name

procedure FITS::modify_row_col_name, extension, row_num, column_name, value

Modifies a 'cell' in a fits file, by specifiying the extension, row number, column name, and the value to replace 'cell' with.

Uses
modify_row_col get_column_num

Parameters
extension
in, required
long
extension number to modify
row_num
in, required
long
row number to modify in extension
column_name
in, required
string
column name to modify in extension
value
in, required
varies
value that will overwrite the row+column specified


Produced by IDLdoc 1.6 on Wed Sep 28 13:27:25 2016