Main Page | Modules | Data Structures | File List | Data Fields | Globals | Related Pages

lib/external.c File Reference

External calibration file related procedures. More...

Go to the source code of this file.

Functions

long RD_2col (TABLE *table, int col1, double *data1, int col2, double *data2)
 Read two identified columns from an open table.

int read_2columns (char *tablename, char *col1name, char *col2name, int fclass, double **array1, double **array2)
 Read two real columns from a table.

int read_fluxref_table (char *tablename, char *lbdacolname, char *fluxcolname, double **lbda, double **flux, char *flxunits, char *rescolname, double **specres)
 Read reference flux table.

int read_lbdaref_table (char *tablename, char *lbdaname, char *flagname, float **lbda, float lbda_inf, float lbda_sup)
 Read selected reference wavelengthes from a Reference wavelength table.


Detailed Description

External calibration file related procedures.

Copyright:
(c) 2005 IPNL - Universite Lyon I
Author:
Yannick Copin <y.copin@ipnl.in2p3.fr>

Author
ycopin
Version:
Revision
1.4
Id
external.c,v 1.4 2005/10/23 23:32:16 ycopin Exp

Definition in file external.c.


Function Documentation

long RD_2col TABLE *  table,
int  col1,
double *  data1,
int  col2,
double *  data2
 

Read two identified columns from an open table.

Routine used to read the contents of two identified columns (which can contain either DOUBLE or FLOAT data) and to store them into two DOUBLE arrays.

Parameters:
table Input table (previously open)
col1 First column index
data1 First storage array (previously allocated to table.row)
col2 Second column index (or 0 if none)
data2 Second storage array (previously allocated to table.row)
Returns:
Effective number of lines read or error status.

Definition at line 101 of file external.c.

Referenced by read_2columns(), and read_fluxref_table().

int read_2columns char *  tablename,
char *  col1name,
char *  col2name,
int  fclass,
double **  array1,
double **  array2
 

Read two real columns from a table.

The routine open the table, check its fclass if needed, read the two named columns, store the result in internally allocated DOUBLE arrays (to be freed latter), and close the table.

Parameters:
tablename Input table
col1name First column name
col2name Second column name
fclass Fclass to be tested (if >0)
array1 Pointer to the array for the first column (to be freed)
array2 Pointer to the array for the second column (to be freed)
Returns:
Number of points in data arrays or error status

Todo:
Could be generalized to any number of columns if needed.

Definition at line 170 of file external.c.

References RD_2col().

Referenced by main().

Here is the call graph for this function:

int read_fluxref_table char *  tablename,
char *  lbdacolname,
char *  fluxcolname,
double **  lbda,
double **  flux,
char *  flxunits,
char *  rescolname,
double **  specres
 

Read reference flux table.

The routine open the reference flux table, check fclass=TBL_FLUX_REF, apply selection if any, read the two named columns (typically LAMBDA and FLUX), store the result in internally allocated DOUBLE arrays (to be freed latter), and close the table.

Parameters:
tablename Input table
lbdacolname Wavelength column name
fluxcolname Flux column name
lbda Pointer to the wavelength array (locally allocated, to be freed)
flux Pointer to the reference flux array (locally allocated, to be freed)
flxunits Flux units (string of length lg_units+1 previously allocated)
rescolname Spectral resolution column name (or NULL)
specres Pointer to the spectral resolution array (or NULL) (locally allocated, to be freed)
Returns:
Number of points in output arrays (<0 if error)
Note:
See Reference flux table description for column formats.

Definition at line 238 of file external.c.

References FLXUNITS, and RD_2col().

Referenced by main().

Here is the call graph for this function:

int read_lbdaref_table char *  tablename,
char *  lbdaname,
char *  flagname,
float **  lbda,
float  lbda_inf,
float  lbda_sup
 

Read selected reference wavelengthes from a Reference wavelength table.

The routine open the wavelength reference table, apply selection if any, read the two named columns (typically LAMBDA and MASK or CALIB), store the result in internally allocated FLOAT array (to be freed latter), and close the table.

Parameters:
tablename Input table name
lbdaname Wavelength column name
flagname Flag column name
lbda Pointer to the output wavelength array (locally allocated)
lbda_inf Minimal wavelength
lbda_sup Maximal wavelength
Returns:
Number of lines selected (<0 if error)
Note:
See Reference wavelength table description for column formats.

Definition at line 343 of file external.c.

Referenced by main().


Generated on Thu Oct 27 00:00:21 2005 for Snifs by doxygen 1.3.5