|
Developer Documentation |
|||||||||
prev file | next file | ||||||||||
SUMMARY: fields | routine DETAILS: routine | ||||||||||
./toolbox/io io_sdfits_writer__define.pro
IO | +-IO_SDFITS | +-IO_SDFITS_LINE | +-io_sdfits_writer
IO_SDFITS_WRITER is intended for use by users who wish to write spectral line data to sdfits. See UML for all IO Classes, or IO_SDFITS UML for just the line and continuum sdfits classes.
Fields Summary | |
SDFITS_DEF |
sdfits object used just for getting the definition of an sdfits row |
OUTPUT_FILE |
the name of the file to be written to. |
Fields inherited from IO_SDFITS_LINE: | ||||||
|
Fields inherited from IO_SDFITS: | ||||||||||||||||||||||
|
Fields inherited from IO: | ||
|
Routine Summary 27 routines |
procedure io_sdfits_writer__define | |
IO_SDFITS_WRITER is intended for use by users who wish to write spectral line data to sdfits. |
function IO_SDFITS_WRITER::init() | private |
Class Constructor |
procedure IO_SDFITS_WRITER::cleanup | private |
Class Destructor |
procedure IO_SDFITS_WRITER::set_output_file, file_name | |
Sets the name of the output file, and if the file exists, creates an sdfits object for it |
procedure IO_SDFITS_WRITER::set_file, file_name, file_path=string, index_name=string | |
Sets the file which this object will exclusively be writing to and reading from. |
procedure IO_SDFITS_WRITER::nsave_spectrum, spectrum, nsave[, status] | |
Writes a single spectrum to the sdfits file, saving an NSAVE number in the index file corresponding to this spectrum |
function IO_SDFITS_WRITER::get_nsave_index(nsave) | |
procedure IO_SDFITS_WRITER::overwrite_spectrum, index, spectrum | |
procedure IO_SDFITS_WRITER::write_spectra, spectra, file_name=string | |
Writes given spectra to an sdfits file. |
procedure IO_SDFITS_WRITER::write_rows_to_extension, rows, virtuals, ext, start_row | private |
Writes sdfits rows to the output file, managing wether to create new extension, or append to current one |
procedure IO_SDFITS_WRITER::update_index_with_spectra, spectra, extension, start_row | private |
If these spectra have just been written to the output file-extension, then call this function to update the index file with the latest info |
function IO_SDFITS_WRITER::get_uniques_string(arr) | private |
Sorts input array, and then reduces sorted array to unique values. |
function IO_SDFITS_WRITER::check_spectrum_size_uniformity(spectra) | private |
Goes through array of spectrum data containers and checks to see if they all have the same data length. |
function IO_SDFITS_WRITER::spectra_to_rows(spectra, virtuals) | private |
Translates an array of spectra into sdfits rows |
function IO_SDFITS_WRITER::spectrum_to_row(spec, virtuals, [data_mode=long]) | private |
Translates a spectrum data container into a structure that mirrors the sdfits (v1. |
function IO_SDFITS_WRITER::get_sdfits_row_sizes() | private |
Returns sizes needed for ASCII columns in sdfits. |
function IO_SDFITS_WRITER::define_sdfits_row(data_points) | private |
Defines an anonymous structure that can be used with mrdfits to write an sdfits row |
function IO_SDFITS_WRITER::buffer_string(str, length) | private |
Crops or pads the input string to exactly the length specified |
function IO_SDFITS_WRITER::create_obsmode(proc, swstate, swtchsig) | private |
Creates sdfits obsmode column value from the procedure, switch state, and switch signal obsmode = 'procedure:switchstate:swtchsig' |
function IO_SDFITS_WRITER::coord_types_from_mode(mode) | private |
Tranlate coordinate mode to the two values needed for long. |
function IO_SDFITS_WRITER::translate_bool_int(bool_int) | private |
converts spectrums integer value for columns such as cal or sig to ascii value used in sdfits |
function IO_SDFITS_WRITER::pol_to_sdfits(pol) | private |
Translates char polarization used by spectrum data container to integer values used by sdfits |
function IO_SDFITS_WRITER::frequency_type_to_ctype1(freq_type) | private |
Translates spectrum data container representation of frequency type to rep used by sdfits. |
procedure IO_SDFITS_WRITER::set_sprotect_on | |
Sets index file so nsave numbers cannot be overwritten |
procedure IO_SDFITS_WRITER::set_sprotect_off | |
Sets index file so nsave numbers can be overwritten |
function IO_SDFITS_WRITER::get_sprotect() | |
Retrieves the state of nsave protection |
function IO_SDFITS_WRITER::is_gbtidl_sdfits(version) | |
Does the passed in version string start with 'GBTIDL'? Only fits files with primary header keyword 'SDFITVER' values that are of the form 'GBTIDL ver#. |
Routine Details |
io_sdfits_writer__define |
procedure io_sdfits_writer__define |
IO_SDFITS_WRITER is intended for use by users who wish to write spectral line data to sdfits. See UML for all IO Classes, or IO_SDFITS UML for just the line and continuum sdfits classes.
IO_SDFITS_WRITER::init | private |
function IO_SDFITS_WRITER::init() |
Class Constructor
IO_SDFITS_WRITER::cleanup | private |
procedure IO_SDFITS_WRITER::cleanup |
Class Destructor
IO_SDFITS_WRITER::set_output_file |
procedure IO_SDFITS_WRITER::set_output_file, file_name |
Sets the name of the output file, and if the file exists, creates an sdfits object for it
Parameters | |
file_name |
full path name to the file to write to |
IO_SDFITS_WRITER::set_file |
procedure IO_SDFITS_WRITER::set_file, file_name, file_path=string, index_name=string |
Sets the file which this object will exclusively be writing to and reading from. Acts much like IO_SDFITS::set_file in the way it forces creation of a new index file
Parameters | |
file_name |
file name (full path or not) of file to use exclusively |
Keywords | |
file_path |
file path where file_name is found |
index_name |
name to use for the index file |
IO_SDFITS_WRITER::nsave_spectrum |
procedure IO_SDFITS_WRITER::nsave_spectrum, spectrum, nsave[, status] |
Writes a single spectrum to the sdfits file, saving an NSAVE number in the index file corresponding to this spectrum
IO_SDFITS_WRITER::get_nsave_index |
function IO_SDFITS_WRITER::get_nsave_index(nsave) |
Parameters | |
nsave |
. |
IO_SDFITS_WRITER::overwrite_spectrum |
procedure IO_SDFITS_WRITER::overwrite_spectrum, index, spectrum |
Parameters | |
index |
. |
spectrum |
. |
IO_SDFITS_WRITER::write_spectra |
procedure IO_SDFITS_WRITER::write_spectra, spectra, file_name=string |
Writes given spectra to an sdfits file. The spectra are translated to their proper form for sdfits, and the rows are written to the output file in extensions based off the data size of each spectrum.
Parameters | |
spectra |
array of spectrum data containers to write to disk |
Keywords | |
file_name |
if passed in, this is the name of the output file |
IO_SDFITS_WRITER::write_rows_to_extension | private |
procedure IO_SDFITS_WRITER::write_rows_to_extension, rows, virtuals, ext, start_row |
Writes sdfits rows to the output file, managing wether to create new extension, or append to current one
IO_SDFITS_WRITER::update_index_with_spectra | private |
procedure IO_SDFITS_WRITER::update_index_with_spectra, spectra, extension, start_row |
If these spectra have just been written to the output file-extension, then call this function to update the index file with the latest info
IO_SDFITS_WRITER::get_uniques_string | private |
function IO_SDFITS_WRITER::get_uniques_string(arr) |
Sorts input array, and then reduces sorted array to unique values. Unique values are then put in a comma separated string
Parameters | |
arr |
array to find uniques of |
IO_SDFITS_WRITER::check_spectrum_size_uniformity | private |
function IO_SDFITS_WRITER::check_spectrum_size_uniformity(spectra) |
Goes through array of spectrum data containers and checks to see if they all have the same data length.
Parameters | |
spectra |
array of spectrum data containers |
IO_SDFITS_WRITER::spectra_to_rows | private |
function IO_SDFITS_WRITER::spectra_to_rows(spectra, virtuals) |
Translates an array of spectra into sdfits rows
Parameters | |
spectra |
array of spectrum data containers |
virtuals |
keywords to be written to the file-extension header |
IO_SDFITS_WRITER::spectrum_to_row | private |
function IO_SDFITS_WRITER::spectrum_to_row(spec, virtuals, [data_mode=long]) |
Translates a spectrum data container into a structure that mirrors the sdfits (v1.2) row to be written
Parameters | |
spec |
spectrum data container to translate |
virtuals |
keywords to be written to the sdfits extension header |
Keywords | |
data_mode |
determines what data mode sdfits to be written in (not set uses raw mode) |
IO_SDFITS_WRITER::get_sdfits_row_sizes | private |
function IO_SDFITS_WRITER::get_sdfits_row_sizes() |
Returns sizes needed for ASCII columns in sdfits. Problems: this exists here AND in IO_SDFITS_WRITER.
IO_SDFITS_WRITER::define_sdfits_row | private |
function IO_SDFITS_WRITER::define_sdfits_row(data_points) |
Defines an anonymous structure that can be used with mrdfits to write an sdfits row
Parameters | |
data_points |
the size of the data array in data column |
IO_SDFITS_WRITER::buffer_string | private |
Crops or pads the input string to exactly the length specified
Parameters | |
str |
string to buffer |
length |
length that string should be buffered to |
IO_SDFITS_WRITER::create_obsmode | private |
function IO_SDFITS_WRITER::create_obsmode(proc, swstate, swtchsig) |
Creates sdfits obsmode column value from the procedure, switch state, and switch signal obsmode = 'procedure:switchstate:swtchsig'
Parameters | |
proc |
procedure |
swstate |
switch state |
swtchsig |
switch signal |
IO_SDFITS_WRITER::coord_types_from_mode | private |
function IO_SDFITS_WRITER::coord_types_from_mode(mode) |
Tranlate coordinate mode to the two values needed for long. type and lat. type
Parameters | |
mode |
. |
IO_SDFITS_WRITER::translate_bool_int | private |
function IO_SDFITS_WRITER::translate_bool_int(bool_int) |
converts spectrums integer value for columns such as cal or sig to ascii value used in sdfits
Parameters | |
bool_int |
0 or 1 |
IO_SDFITS_WRITER::pol_to_sdfits | private |
function IO_SDFITS_WRITER::pol_to_sdfits(pol) |
Translates char polarization used by spectrum data container to integer values used by sdfits
Parameters | |
pol |
char representation of polarization |
IO_SDFITS_WRITER::frequency_type_to_ctype1 | private |
function IO_SDFITS_WRITER::frequency_type_to_ctype1(freq_type) |
Translates spectrum data container representation of frequency type to rep used by sdfits. See comments in IO_SDFITS_LINE::ctype1_to_freq_type
Parameters | |
freq_type |
rep of frequency type |
IO_SDFITS_WRITER::set_sprotect_on |
procedure IO_SDFITS_WRITER::set_sprotect_on |
Sets index file so nsave numbers cannot be overwritten
IO_SDFITS_WRITER::set_sprotect_off |
procedure IO_SDFITS_WRITER::set_sprotect_off |
Sets index file so nsave numbers can be overwritten
IO_SDFITS_WRITER::get_sprotect |
function IO_SDFITS_WRITER::get_sprotect() |
Retrieves the state of nsave protection
IO_SDFITS_WRITER::is_gbtidl_sdfits |
function IO_SDFITS_WRITER::is_gbtidl_sdfits(version) |
Does the passed in version string start with 'GBTIDL'? Only fits files with primary header keyword 'SDFITVER' values that are of the form 'GBTIDL ver#.#' are allowed to be written to. This is the value that is used when GBTIDL creates an sdfits file.
Parameters | |
version |
string value for the keyword 'SDFITVER' in primary header |