Produced by IDL 7.1.1
Developer Documentation

./toolbox/io
io_sdfits_line__define.pro

IO
|
+-IO_SDFITS
  |
  +-io_sdfits_line

All known superclasses:
IO_SDFITS, IO
Last modification date:
Wed Sep 28 13:27:14 2016

IO_SDFITS_LINE is intended for end users wishing to work with spectral line data. It's the child class of IO_SDFITS used for reading, writing, navigating sdfits spectrual line files, and for translating their info to spectrum data containers. See UML for all IO Classes, or IO_SDFITS UML for just the line and continuum sdfits classes.

Routine Summary  23 routines

procedure io_sdfits_line__define

IO_SDFITS_LINE is intended for end users wishing to work with spectral line data.

function IO_SDFITS_LINE::init(index_file=index_file)

private

Called upon instantiation of this class.

function IO_SDFITS_LINE::shared_init(index_file=index_file, version=version)

private

Shared initialization of this class and derived classes

procedure IO_SDFITS_LINE::cleanup

Class destructor

procedure IO_SDFITS_LINE::update_index_with_fits_file, fits_obj

private

Reads in all the rows from every extension in the fits file represented by the passed in sdfits object, and passes this on to the index object so that the index file can be updated.

procedure IO_SDFITS::update_index_obj_with_fits_obj, index_obj, fits_obj

Given an object that manages a fits file, and an object for the index file, use the fits object to update the index object.

function IO_SDFITS_LINE::group_row_info(row_info)

private

Groups a collection of rows from the index file by file and extension.

function IO_SDFITS_LINE::rows_to_dc(rows, group, missing, virtuals, apply_offsets)

private

Function to convert rows into data containers.

function IO_SDFITS_LINE::get_spectra([count][, indicies], [_EXTRA=_EXTRA], [srow=int], [nrow=int], useflag=useflag, skipflag=skipflag)

This function searches the index file using the keyword parameters passed into it, reads the appropriate parts of the sdfits files, and tranlates this data into spectrum structures, which are returned.

function IO_SDFITS_LINE::rows_to_spectra(sdfits_rows, integrations, if_numbers, feed_nums, pol_nums, nsaves, missing[, virtuals], apply_offsets)

private

Handles the translation of several sdfits rows to spectrum data containers.

function IO_SDFITS_LINE::sdfits_row_to_spectrum(row, integration, if_number, feed_num, pol_num, nsave, missing[, virtuals], apply_offsets)

private

Handles the translation of an sdfits row to a spectrum data container.

procedure IO_SDFITS_LINE::free_group_row_info, row_info

private

Frees the memory referenced by pointers in the passed in structure

function IO_SDFITS_LINE::get_new_fits_obj(file_name, _EXTRA=_EXTRA)

private

Creates and returns a line_sdfits object

procedure IO_SDFITS_LINE::load_new_sdfits_rows

Determines if any files have grown, and appends new rows to the index file

function IO_SDFITS_LINE::group_locations(locations)

private

Like other group functions in I/O, groups an array of structures by their filename, and extension tags.

function IO_SDFITS_LINE::get_new_row_locations(filename, status)

private

Compares index file with sdfits files listed in it, and looks for new rows in the sdfits file.

function IO_SDFITS_LINE::get_online_files([newest_acs][, newest_dcr][, newest_sp][, newest_zpec][, newest_vegas][, status])

Finds the latest files in the online directory (reads status file produced by online sdfits).

function IO_SDFITS_LINE::get_online_infos([newest_acs][, newest_dcr][, newest_sp][, newest_zpec][, newest_vegas][, status])

Finds the latest online info structs for all of the lines in the current online sdfits info file.

procedure IO_SDFITS_LINE::set_online, file_name, [test=bool]

Connects to a file in the online directory, and sets up object so that every time a query of the index file is done, the update method is called.

procedure IO_SDFITS_LINE::update

Reads the new lines in an index file into memory, if the size of the index file has changed.

function IO_SDFITS_LINE::get_index_class_name()

function IO_SDFITS_LINE::get_index_section_class_name()

procedure IO_SDFITS_LINE::reflag_vegas_spurs, [/flagcenteradc]

Removes any VEGAS_SPUR flags from the flag file and resets those flags from the associated FITS files.

Routine Details

io_sdfits_line__define

procedure io_sdfits_line__define

IO_SDFITS_LINE is intended for end users wishing to work with spectral line data. It's the child class of IO_SDFITS used for reading, writing, navigating sdfits spectrual line files, and for translating their info to spectrum data containers. See UML for all IO Classes, or IO_SDFITS UML for just the line and continuum sdfits classes.

Inherits
io_sdfits
Uses
LINE_INDEX SDFITS
Version
$Id$

IO_SDFITS_LINE::init private

function IO_SDFITS_LINE::init(index_file=index_file)

Called upon instantiation of this class.

Uses
IO_SDFITS::init

Keywords
index_file
.

IO_SDFITS_LINE::shared_init private

function IO_SDFITS_LINE::shared_init(index_file=index_file, version=version)

Shared initialization of this class and derived classes

Keywords
index_file
.
version
.

IO_SDFITS_LINE::cleanup

procedure IO_SDFITS_LINE::cleanup

Class destructor

IO_SDFITS_LINE::update_index_with_fits_file private

procedure IO_SDFITS_LINE::update_index_with_fits_file, fits_obj

Reads in all the rows from every extension in the fits file represented by the passed in sdfits object, and passes this on to the index object so that the index file can be updated. Also, if an index file already exists for this fits file, this index is used to update the current index. If an index file doesn't already exist for this fits file, it is created first, and then used.

Uses
SDFITS::get_and_eval_rows SDFITS::get_number_extensions SDFITS::get_file_name SDFITS::get_extension_header_value LINE_INDEX::update_file

Parameters
fits_obj
in
object
sdfits object representing an sdfits file.

IO_SDFITS::update_index_obj_with_fits_obj

procedure IO_SDFITS::update_index_obj_with_fits_obj, index_obj, fits_obj

Given an object that manages a fits file, and an object for the index file, use the fits object to update the index object. Avoids making the costly effort of reading the DATA column from the fits file.

Parameters
index_obj
in, required
object
object representing an index file
fits_obj
in, required
object
object representing a fits file

IO_SDFITS_LINE::group_row_info private

function IO_SDFITS_LINE::group_row_info(row_info)

Groups a collection of rows from the index file by file and extension. This method is needed since we will want to access each files extension only once to read the pertinent rows (for efficiancy reasons).

Returns
array of group_row_info structures: rows that share a file and extension

Parameters
row_info
in
array
array of structs, where each struct represents a row of the index file

IO_SDFITS_LINE::rows_to_dc private

function IO_SDFITS_LINE::rows_to_dc(rows, group, missing, virtuals, apply_offsets)

Function to convert rows into data containers. This is used internally in get_spectra.

Parameters
rows
.
group
.
missing
.
virtuals
.
apply_offsets
.

IO_SDFITS_LINE::get_spectra

function IO_SDFITS_LINE::get_spectra([count][, indicies], [_EXTRA=_EXTRA], [srow=int], [nrow=int], useflag=useflag, skipflag=skipflag)

This function searches the index file using the keyword parameters passed into it, reads the appropriate parts of the sdfits files, and tranlates this data into spectrum structures, which are returned.

Returns
Array of spectrum structures
Examples
 
Uses
LINE_INDEX::search_for_row_info SDFITS::get_and_eval_rows IO_SDFITS_LINE::rows_to_spectra

Parameters
count
out, optional
variable
number of spectra returned
indicies
out, optional
variable
index numbers corresponding to each returned spectrum. Can be used in flagging, future data retrieval, etc.

Keywords
_EXTRA
in, optional
see search_for_row_info for more info
srow
in, optional
int
starting row number to use in search. Used after scan_info has been used. Must be used with nrow.
nrow
in, optional
int
Number of rows to use in search. Used after scan_info has been used. Must be used with srow.
useflag
.
skipflag
.

IO_SDFITS_LINE::rows_to_spectra private

function IO_SDFITS_LINE::rows_to_spectra(sdfits_rows, integrations, if_numbers, feed_nums, pol_nums, nsaves, missing[, virtuals], apply_offsets)

Handles the translation of several sdfits rows to spectrum data containers. Utilizes additional info from the index file, as well as info on keywords in the extension roads are found in, and what ever expected columns were not found in the sdfits file.

Uses
io_sdfits_line::sdfits_row_to_spectrum

Parameters
sdfits_rows
in
array
an array of structures mirroring rows from an sdfits file extension containing spectral line data
integrations
in
array
the integration numbers for these spectra; from index file
if_numbers
in
array
the if numbers for these spectra; from index file
feed_nums
.
pol_nums
.
nsaves
in
array
the nsave numbers for these spectra; from index file
missing
in
array
array of column names that were expected in sdfits file extension, but not found.
virtuals
in, optional
struct
structure containing keywords found in the extension header.
apply_offsets
.

IO_SDFITS_LINE::sdfits_row_to_spectrum private

function IO_SDFITS_LINE::sdfits_row_to_spectrum(row, integration, if_number, feed_num, pol_num, nsave, missing[, virtuals], apply_offsets)

Handles the translation of an sdfits row to a spectrum data container. Utilizes additional info from the index file, as well as info on keywords in the extension roads are found in, and what ever expected columns were not found in the sdfits file.

Uses
io_sdfits::get_row_value io_sdfits::format_sdfits_freq_type io_sdfits::coord_mode_from_types io_sdfits::translate_sig io_sdfits::translate_cal io_sdfits::parse_sdfits_obsmode fitsdateparse juldate

Parameters
row
in
struct
a structure mirroring a row from an sdfits file extension containing spectral line data
integration
in
long
the integration number of this spectrum; from index file
if_number
in
long
the if number of this spectrum; from index file
feed_num
.
pol_num
.
nsave
in
long
the nsave number of this spectrum; from index file
missing
in
array
array of column names that were expected in sdfits file extension, but not found.
virtuals
in, optional
struct
structure containing keywords found in the extension header.
apply_offsets
.

IO_SDFITS_LINE::free_group_row_info private

procedure IO_SDFITS_LINE::free_group_row_info, row_info

Frees the memory referenced by pointers in the passed in structure

Parameters
row_info
in
struct
contains pointers to row number lists, integration and if number lists

IO_SDFITS_LINE::get_new_fits_obj private

function IO_SDFITS_LINE::get_new_fits_obj(file_name, _EXTRA=_EXTRA)

Creates and returns a line_sdfits object

Parameters
file_name
in
string
full path file name for sdfits file of with spectral line data

Keywords
_EXTRA
.

IO_SDFITS_LINE::load_new_sdfits_rows

procedure IO_SDFITS_LINE::load_new_sdfits_rows

Determines if any files have grown, and appends new rows to the index file

Examples
>io->set_file, 'filename' >io->list ; here you see contents of 'filename' >io->update ; even though 'filename' hasnt changed >'No sdfits file(s) in index need updating' ; now new rows are appended to 'filename' (by the online filler perhaps) >io->update >'Index file updated with 5 rows' >io->list ; here you see the original contents of 'filname' ; plus the extra 5 new rows. ; NOTE: the index file was NOT re-created from scatch
Uses
get_new_row_locations group_row_locations

IO_SDFITS_LINE::group_locations private

function IO_SDFITS_LINE::group_locations(locations)

Like other group functions in I/O, groups an array of structures by their filename, and extension tags. This is used so that rows in the same file-extension can be accessed all at once.

Returns
array of structures, each structure giving a filename, extension, and array of row nubmers

Parameters
locations
in, required
array
array of structures containing filenames, ext, and row #

IO_SDFITS_LINE::get_new_row_locations private

function IO_SDFITS_LINE::get_new_row_locations(filename, status)

Compares index file with sdfits files listed in it, and looks for new rows in the sdfits file.

Returns
array of structures, each giving location of file, extension, and row # of new sdfits row

Parameters
filename
.
status
.

IO_SDFITS_LINE::get_online_files

function IO_SDFITS_LINE::get_online_files([newest_acs][, newest_dcr][, newest_sp][, newest_zpec][, newest_vegas][, status])

Finds the latest files in the online directory (reads status file produced by online sdfits).

Returns
the newest spectral line fits file (ignoring any dcr and zpec fits files) in the online directory

Parameters
newest_acs
out, optional
variable
the newest spectrometer fits file in the online directory
newest_dcr
out, optional
variable
the newest dcr fits file in the online directory
newest_sp
out, optional
variable
the newest spectral processor fits file in the online directory
newest_zpec
out, optional
variable
the newest zpectrometer fits file in the online directory
newest_vegas
out, optional
variable
the newest vegas fits directory in the online directory
status
out, optional
variable
0 - error, 1 - success

IO_SDFITS_LINE::get_online_infos

function IO_SDFITS_LINE::get_online_infos([newest_acs][, newest_dcr][, newest_sp][, newest_zpec][, newest_vegas][, status])

Finds the latest online info structs for all of the lines in the current online sdfits info file.

Returns
the newest spectral line fits file info structure (ignoring any dcr and zpec fits files) in the online directory

Parameters
newest_acs
out, optional
variable
the current spectrometer fits file info structure in the online directory
newest_dcr
out, optional
variable
the current dcr fits file info structure in the online directory
newest_sp
out, optional
variable
the current spectral processor fits file info structure in the online directory
newest_zpec
out, optional
variable
the current zpectrometer fits file info structure in the online directory
newest_vegas
out, optional
variable
the current vegas fits directory info struture in the online directory
status
out, optional
variable
0 - error, 1 - success

IO_SDFITS_LINE::set_online

procedure IO_SDFITS_LINE::set_online, file_name, [test=bool]

Connects to a file in the online directory, and sets up object so that every time a query of the index file is done, the update method is called. This depends on another process(es) that should be updating the sdfits and index files for the current project.

Parameters
file_name
in, required
string
base or full filename to connect to (may be a directory)

Keywords
test
in, optional
bool
if true, this is a test, and the online directory does not need to be visible

IO_SDFITS_LINE::update

procedure IO_SDFITS_LINE::update

Reads the new lines in an index file into memory, if the size of the index file has changed. Uses a lock file since other processes might be reading/writing the index file.

Uses
INDEX_FILE::read_new_rows

IO_SDFITS_LINE::get_index_class_name

function IO_SDFITS_LINE::get_index_class_name()

IO_SDFITS_LINE::get_index_section_class_name

function IO_SDFITS_LINE::get_index_section_class_name()

IO_SDFITS_LINE::reflag_vegas_spurs

procedure IO_SDFITS_LINE::reflag_vegas_spurs, [/flagcenteradc]

Removes any VEGAS_SPUR flags from the flag file and resets those flags from the associated FITS files. The FITS files should be raw FITS files. The checks on that are the presence of the SDFITSVER keyword (any value) and the INSTRUME keyword must be present and have a value of "VEGAS"

Keywords
flagcenteradc
in, optional
boolean
When set, the center ADC spur is also flagged. Normally that spur is left unflagged because sdfits usually replaces the value at that location with an average of the two adjacent channels and so that spur does not need to be flagged since it's been interpolated.


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