Data Structures | |
struct | oi_fits |
Data for OIFITS file. More... | |
Files | |
file | oifile.h |
Data structure definitions and function prototypes for file-level operations on OIFITS data. | |
file | oifile.c |
Implementation of file-level API for OIFITS data. | |
Defines | |
#define | MEMDUP(dest, src, size) { (dest) = malloc((size)); memcpy((dest), (src), (size)); } |
Functions | |
void | init_oi_fits (oi_fits *) |
Initialise empty oi_fits struct. | |
STATUS | write_oi_fits (const char *, oi_fits, STATUS *) |
Write OIFITS tables to new FITS file. | |
STATUS | read_oi_fits (const char *, oi_fits *, STATUS *) |
Read all OIFITS tables from FITS file. | |
void | free_oi_fits (oi_fits *) |
Free storage used for OIFITS data. | |
oi_array * | oi_fits_lookup_array (const oi_fits *, const char *) |
Return oi_array corresponding to specified ARRNAME. | |
element * | oi_fits_lookup_element (const oi_fits *, const char *, int) |
Lookup array element corresponding to specified ARRNAME & STA_INDEX. | |
oi_wavelength * | oi_fits_lookup_wavelength (const oi_fits *, const char *) |
Lookup oi_wavelength corresponding to specified INSNAME. | |
target * | oi_fits_lookup_target (const oi_fits *, int) |
Lookup target record corresponding to specified TARGET_ID. | |
const char * | format_oi_fits_summary (const oi_fits *) |
Generate file summary string. | |
void | print_oi_fits_summary (const oi_fits *) |
Print file summary to stdout. | |
oi_target * | dup_oi_target (const oi_target *) |
Make deep copy of a OI_TARGET table. | |
oi_array * | dup_oi_array (const oi_array *) |
Make deep copy of a OI_ARRAY table. | |
oi_wavelength * | dup_oi_wavelength (const oi_wavelength *) |
Make deep copy of a OI_WAVELENGTH table. | |
oi_vis * | dup_oi_vis (const oi_vis *) |
Make deep copy of a OI_VIS table. | |
oi_vis2 * | dup_oi_vis2 (const oi_vis2 *) |
Make deep copy of a OI_VIS2 table. | |
oi_t3 * | dup_oi_t3 (const oi_t3 *) |
Make deep copy of a OI_T3 table. |
Use read_oi_fits() to read a file. free_oi_fits() will free the storage allocated by read_oi_fits(). Use init_oi_fits() to initialise an empty dataset, then after filling in the contents call write_oi_fits() to write the dataset to a file.
Functions to format and display strings summarising the file contents are provided: format_oi_fits_summary() and print_oi_fits_summary()
A set of functions oi_fits_lookup_*() (e.g. oi_fits_lookup_array())) are also provided, to facilitate following cross-references between OI_FITS tables.
#define MEMDUP | ( | dest, | |||
src, | |||||
size | ) | { (dest) = malloc((size)); memcpy((dest), (src), (size)); } |
Referenced by dup_oi_array(), dup_oi_t3(), dup_oi_target(), dup_oi_vis(), dup_oi_vis2(), dup_oi_wavelength(), and filter_oi_target().
void init_oi_fits | ( | oi_fits * | pOi | ) |
Initialise empty oi_fits struct.
pOi | pointer to file data struct, see oifile.h |
References oi_fits::arrayHash, oi_fits::arrayList, oi_fits::numArray, oi_fits::numT3, oi_fits::numVis, oi_fits::numVis2, oi_fits::numWavelength, oi_fits::t3List, oi_fits::vis2List, oi_fits::visList, oi_fits::wavelengthHash, and oi_fits::wavelengthList.
Referenced by apply_oi_filter(), and merge_oi_fits_list().
Write OIFITS tables to new FITS file.
filename | name of file to create | |
oi | file data struct, see oifile.h | |
pStatus | pointer to status variable |
References oi_fits::arrayList, oi_hush_errors, oi_fits::t3List, oi_fits::targets, oi_fits::vis2List, oi_fits::visList, oi_fits::wavelengthList, write_oi_array(), WRITE_OI_LIST, write_oi_t3(), write_oi_target(), write_oi_vis(), write_oi_vis2(), and write_oi_wavelength().
Read all OIFITS tables from FITS file.
filename | name of file to read | |
pOi | pointer to uninitialised file data struct, see oifile.h | |
pStatus | pointer to status variable |
References oi_fits::arrayHash, oi_fits::arrayList, oi_t3::arrname, oi_vis2::arrname, oi_vis::arrname, oi_t3::insname, oi_vis2::insname, oi_vis::insname, oi_fits::numArray, oi_fits::numT3, oi_fits::numVis, oi_fits::numVis2, oi_fits::numWavelength, oi_hush_errors, read_next_oi_array(), read_next_oi_t3(), read_next_oi_vis(), read_next_oi_vis2(), read_next_oi_wavelength(), read_oi_target(), oi_fits::t3List, oi_fits::targets, oi_fits::vis2List, oi_fits::visList, oi_fits::wavelengthHash, and oi_fits::wavelengthList.
void free_oi_fits | ( | oi_fits * | pOi | ) |
Free storage used for OIFITS data.
pOi | pointer to file data struct, see oifile.h |
References oi_fits::arrayHash, oi_fits::arrayList, free_oi_array(), free_oi_t3(), free_oi_target(), free_oi_vis(), free_oi_vis2(), free_oi_wavelength(), oi_fits::t3List, oi_fits::targets, oi_fits::vis2List, oi_fits::visList, oi_fits::wavelengthHash, and oi_fits::wavelengthList.
Return oi_array corresponding to specified ARRNAME.
pOi | pointer to file data struct, see oifile.h | |
arrname | value of ARRNAME keyword |
References oi_fits::arrayHash.
Referenced by oi_fits_lookup_element().
Lookup array element corresponding to specified ARRNAME & STA_INDEX.
pOi | pointer to file data struct, see oifile.h | |
arrname | value of ARRNAME keyword | |
staIndex | value of STA_INDEX from data table |
References oi_array::elem, oi_array::nelement, oi_fits_lookup_array(), and element::sta_index.
Referenced by check_elements_present().
oi_wavelength* oi_fits_lookup_wavelength | ( | const oi_fits * | pOi, | |
const char * | insname | |||
) |
Lookup oi_wavelength corresponding to specified INSNAME.
pOi | pointer to file data struct, see oifile.h | |
insname | value of INSNAME keyword |
References oi_fits::wavelengthHash.
Lookup target record corresponding to specified TARGET_ID.
pOi | pointer to file data struct, see oifile.h | |
targetId | value of TARGET_ID from data table |
References oi_target::ntarget, oi_target::targ, target::target_id, and oi_fits::targets.
Referenced by check_targets_present().
const char* format_oi_fits_summary | ( | const oi_fits * | pOi | ) |
Generate file summary string.
pOi | pointer to oi_fits struct |
References oi_fits::arrayList, FORMAT_OI_LIST_SUMMARY, oi_fits::numArray, oi_fits::numT3, oi_fits::numVis, oi_fits::numVis2, oi_fits::numWavelength, oi_fits::t3List, oi_fits::vis2List, oi_fits::visList, and oi_fits::wavelengthList.
Referenced by print_oi_fits_summary().
void print_oi_fits_summary | ( | const oi_fits * | pOi | ) |
Print file summary to stdout.
pOi | pointer to oi_fits struct |
References format_oi_fits_summary().
Make deep copy of a OI_TARGET table.
pInTab | pointer to input table |
References MEMDUP, oi_target::ntarget, and oi_target::targ.
Make deep copy of a OI_ARRAY table.
pInTab | pointer to input table |
References oi_array::elem, MEMDUP, and oi_array::nelement.
Referenced by filter_all_oi_array().
oi_wavelength* dup_oi_wavelength | ( | const oi_wavelength * | pInTab | ) |
Make deep copy of a OI_WAVELENGTH table.
pInTab | pointer to input table |
References oi_wavelength::eff_band, oi_wavelength::eff_wave, MEMDUP, and oi_wavelength::nwave.
Referenced by merge_all_oi_wavelength().
Make deep copy of a OI_VIS table.
pInTab | pointer to input table |
References oi_vis_record::flag, MEMDUP, oi_vis::numrec, oi_vis::nwave, oi_vis::record, oi_vis_record::visamp, oi_vis_record::visamperr, oi_vis_record::visphi, and oi_vis_record::visphierr.
Referenced by merge_all_oi_vis().
Make deep copy of a OI_VIS2 table.
pInTab | pointer to input table |
References oi_vis2_record::flag, MEMDUP, oi_vis2::numrec, oi_vis2::nwave, oi_vis2::record, oi_vis2_record::vis2data, and oi_vis2_record::vis2err.
Referenced by merge_all_oi_vis2().
Make deep copy of a OI_T3 table.
pInTab | pointer to input table |
References oi_t3_record::flag, MEMDUP, oi_t3::numrec, oi_t3::nwave, oi_t3::record, oi_t3_record::t3amp, oi_t3_record::t3amperr, oi_t3_record::t3phi, and oi_t3_record::t3phierr.
Referenced by merge_all_oi_t3().