oifile.c File Reference

Implementation of file-level API for OIFITS data. More...

#include <stdlib.h>
#include <string.h>
#include <fitsio.h>
#include "oifile.h"

Defines

#define WRITE_OI_LIST(fptr, list, type, link, write_func, extver, pStatus)
 Macro to write FITS table for each oi_* in GList.
#define FORMAT_OI_LIST_SUMMARY(pGStr, list, type, link)
 Macro to generate summary string for each oi_vis/vis2/t3 in GList.

Typedefs

typedef void(* free_func )(gpointer)
 Typedef to specify pointer to a function that frees its argument.

Functions

void init_oi_fits (oi_fits *pOi)
 Initialise empty oi_fits struct.
STATUS write_oi_fits (const char *filename, oi_fits oi, STATUS *pStatus)
 Write OIFITS tables to new FITS file.
STATUS read_oi_fits (const char *filename, oi_fits *pOi, STATUS *pStatus)
 Read all OIFITS tables from FITS file.
void free_oi_fits (oi_fits *pOi)
 Free storage used for OIFITS data.
oi_arrayoi_fits_lookup_array (const oi_fits *pOi, const char *arrname)
 Return oi_array corresponding to specified ARRNAME.
elementoi_fits_lookup_element (const oi_fits *pOi, const char *arrname, int staIndex)
 Lookup array element corresponding to specified ARRNAME & STA_INDEX.
oi_wavelengthoi_fits_lookup_wavelength (const oi_fits *pOi, const char *insname)
 Lookup oi_wavelength corresponding to specified INSNAME.
targetoi_fits_lookup_target (const oi_fits *pOi, int targetId)
 Lookup target record corresponding to specified TARGET_ID.
const char * format_oi_fits_summary (const oi_fits *pOi)
 Generate file summary string.
void print_oi_fits_summary (const oi_fits *pOi)
 Print file summary to stdout.
oi_targetdup_oi_target (const oi_target *pInTab)
 Make deep copy of a OI_TARGET table.
oi_arraydup_oi_array (const oi_array *pInTab)
 Make deep copy of a OI_ARRAY table.
oi_wavelengthdup_oi_wavelength (const oi_wavelength *pInTab)
 Make deep copy of a OI_WAVELENGTH table.
oi_visdup_oi_vis (const oi_vis *pInTab)
 Make deep copy of a OI_VIS table.
oi_vis2dup_oi_vis2 (const oi_vis2 *pInTab)
 Make deep copy of a OI_VIS2 table.
oi_t3dup_oi_t3 (const oi_t3 *pInTab)
 Make deep copy of a OI_T3 table.

Variables

GString * pGStr = NULL
 GLib expanding string buffer, for use within OIFITSlib.


Detailed Description

Implementation of file-level API for OIFITS data.

Copyright (C) 2007 John Young

This file is part of OIFITSlib.

OIFITSlib is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

OIFITSlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with OIFITSlib. If not, see http://www.gnu.org/licenses/


Define Documentation

#define WRITE_OI_LIST ( fptr,
list,
type,
link,
write_func,
extver,
pStatus   ) 

Value:

link = list; \
  extver = 1; \
  while(link != NULL) { \
    write_func(fptr, *((type *) link->data), extver++, pStatus); \
    link = link->next; \
  }
Macro to write FITS table for each oi_* in GList.

Referenced by write_oi_fits().

#define FORMAT_OI_LIST_SUMMARY ( pGStr,
list,
type,
link   ) 

Value:

{ link = list; \
    while(link != NULL) { \
      g_string_append_printf( \
       pGStr, \
       "    INSNAME='%s'  ARRNAME='%s'  DATE_OBS=%s\n" \
       "     %5ld records x %3d wavebands\n", \
       ((type *) (link->data))->insname,  \
       ((type *) (link->data))->arrname,  \
       ((type *) (link->data))->date_obs, \
       ((type *) (link->data))->numrec,   \
       ((type *) (link->data))->nwave);   \
      link = link->next; \
    } \
  }
Macro to generate summary string for each oi_vis/vis2/t3 in GList.

Referenced by format_oi_fits_summary().


Typedef Documentation

typedef void(* free_func)(gpointer)

Typedef to specify pointer to a function that frees its argument.


Variable Documentation

GString* pGStr = NULL

GLib expanding string buffer, for use within OIFITSlib.

Internal use GString, defined in oifile.c.

Referenced by format_check_result(), and format_oi_filter().


Generated on Mon Jun 8 12:45:07 2009 for OIFITSlib by  doxygen 1.5.7.1