UVES Pipeline Reference Manual  5.4.6
Data Structures | Macros | Functions | Variables
MIDAS <-> CPL interface

Data Structures

struct  frame
 

Macros

#define COLNAME   "ColName"
 

Functions

static bool invariant (int id)
 Structure invariant. More...
 
static bool frame_is_open (int id)
 Tell if frame is open. More...
 
static void frame_new_image (int id, const char *filename, uves_propertylist *header, bool need_to_save, cpl_image *image, cpl_type type, int dtype)
 Create new image frame. More...
 
static void frame_new_table (int id, const char *filename, uves_propertylist *header, bool need_to_save, cpl_table *table, int maxrow, cpl_table *colnames)
 Create new table frame. More...
 
static void frame_free (int id)
 Deallocate frame. More...
 
static bool is_special_midas_descr (const char *descr)
 Find out if FITS descriptor has a different name from MIDAS. More...
 
static const char * convert_to_fits (const char *descr, int indx)
 Map MIDAS descriptors to FITS equivalents. More...
 
static void convert_to_history (uves_propertylist **header)
 Convert header for output. More...
 
static uves_propertylistload_header (const char *filename, int extension)
 Load + parse FITS header HISTORY keywords. More...
 
cpl_type flames_midas_image_dtype_to_cpltype (int dtype)
 Map MIDAS dtypes to CPL types. More...
 
static void load_frame_header (int id)
 Load frame FITS header if not already in memory. More...
 
static void set_column_format_unit_tnull (cpl_table *t, const uves_propertylist *theader)
 CPL workaround DFS03746. More...
 
static void load_frame (int id)
 Load image/table if not already in memory. More...
 
static cpl_property ** create_descr (uves_propertylist *header, const char *descr, char type, int length, int nexist)
 Create descriptors. More...
 
static cpl_property ** get_descr_info (int id, const char *descr, char *type, int *length, int *bytelem)
 Get descriptor information. More...
 
int flames_midas_scspro (const char *name)
 Get into the MIDAS environment. More...
 
int flames_midas_scsepi (void)
 Deinitialize interface. More...
 
int flames_midas_error_macro (const char *file, const char *function, int line, int status)
 Print debugging info when function returns error. More...
 
int flames_midas_fail_macro (const char *file, const char *function, int line)
 Deinitialize interface, cleanup and return failure. More...
 
int flames_midas_sckwri (int *key, const int *values, int felem, int maxvals, int *unit)
 Write data into integer keyword. More...
 
int flames_midas_sckwrd (double *key, const double *values, int felem, int maxvals, int *unit)
 Write data into double keyword. More...
 
int flames_midas_sckwrc (char *key, int noelem, const char *values, int felem, int maxvals, int *unit)
 Write data into character keyword. More...
 
int flames_midas_sckgetc (const char *key, int felem, int maxvals, int *actvals, char *values)
 Get data from character keyword. More...
 
int flames_midas_sckgetc_fs (const cpl_frameset *key, int felem, int maxvals, int *actvals, const cpl_frameset **values)
 Get data from character keyword (catalogue) More...
 
int flames_midas_sckgetc_fsp (cpl_frameset **key, int felem, int maxvals, int *actvals, cpl_frameset ***values)
 Get data from character keyword (frame set pointer) More...
 
int flames_midas_sckrdd (const double *key, int felem, int maxvals, int *actvals, double *values, int *unit, int *null)
 Read data from double precision keyword. More...
 
int flames_midas_sckrdr (const float *key, int felem, int maxvals, int *actvals, float *values, int *unit, int *null)
 Read data from real precision keyword. More...
 
int flames_midas_sckrdi (const int *key, int felem, int maxvals, int *actvals, int *values, int *unit, int *null)
 Read data from integer keyword. More...
 
int flames_midas_sckrdc (const char *key, int noelm, int felem, int maxvals, int *actvals, char *values, int *unit, int *null)
 Read data from string keyword. More...
 
static int sckfnd (const char the_type, const void *key, char *type, int *noelem, int *bytelem)
 Find keyword and provide info on it. More...
 
int flames_midas_sckfnd_double (const double *key, char *type, int *noelem, int *bytelem)
 
int flames_midas_sckfnd_float (const float *key, char *type, int *noelem, int *bytelem)
 
int flames_midas_sckfnd_int (const int *key, char *type, int *noelem, int *bytelem)
 
int flames_midas_sckfnd_string (const char *key, char *type, int *noelem, int *bytelem)
 
int flames_midas_sctput (const char *msg, const char *function, const char *file, int line)
 Display message. More...
 
int flames_midas_scfinf (const char *name, int fno, int *ibuf)
 Open the frame and return file info in buffer up to 5 integers. More...
 
int flames_midas_scfopn (const char *name, int dattype, int newopn, int filtype, int *imno)
 Open an existing image and return its internal file no. More...
 
int flames_midas_scfcre (const char *name, int dattype, int iomode, int filtype, int size, int *imno)
 Create an image frame with data of given type and return its internal file no. More...
 
static int frame_close (int id)
 Close a frame, save to disk if necessary. More...
 
int flames_midas_scfclo (int imno)
 Close an image frame. More...
 
int flames_midas_scfget (int imno, int felem, int size, int *actsize, char *bufadr)
 Read data from disk frame into memory. More...
 
int flames_midas_scfput (int imno, int felem, int size, const char *bufadr)
 Write data from memory into disk frame. More...
 
int flames_midas_scdfnd (int id, const char *descr, char *type, int *noelem, int *bytelem)
 Provide info about descriptor. More...
 
int flames_midas_scdprs (int id, const char *descr, char *type, int *noelem, int *bytelem)
 Provide info about descriptor. More...
 
static int scdrd (char expected_type, int id, const char *descr, int felem, int maxvals, int *actvals, void *values, int *unit, int *null)
 Read contents of integer descriptor. More...
 
int flames_midas_scdrdi (int id, const char *descr, int felem, int maxvals, int *actvals, int *values, int *unit, int *null)
 Read contents of integer descriptor. More...
 
int flames_midas_scdrdd (int id, const char *descr, int felem, int maxvals, int *actvals, double *values, int *unit, int *null)
 Read contents of double descriptor. More...
 
int flames_midas_scdrdr (int id, const char *descr, int felem, int maxvals, int *actvals, float *values, int *unit, int *null)
 Read contents of double descriptor. More...
 
int flames_midas_scdrdc (int id, const char *descr, int noelem, int felem, int maxvals, int *actvals, char *values, int *unit, int *null)
 Read contents of string descriptor. More...
 
static int scdwr (char type_to_write, int id, const char *descr, const void *values, int felem, int nval, const int *unit)
 Write a descriptor and its data. More...
 
int flames_midas_scdwri (int id, const char *descr, const int *values, int felem, int nval, const int *unit)
 Write a descriptor and its data. More...
 
int flames_midas_scdwrd (int id, const char *descr, const double *values, int felem, int nval, const int *unit)
 Write a descriptor and its data. More...
 
int flames_midas_scdwrr (int id, const char *descr, const float *values, int felem, int nval, const int *unit)
 Write a descriptor and its data. More...
 
int flames_midas_scdwrc (int id, const char *descr, int noelm, const char *values, int felem, int nval, const int *unit)
 Write a descriptor and its data. More...
 
int flames_midas_scddel (int id, const char *descr)
 Delete a descriptor. More...
 
static int scdcop (int from, int to, int mask, bool copy_naxis)
 Copy descriptors from one frame to another. More...
 
int flames_midas_scdcop (int from, int to, int mask)
 Copy descriptors. More...
 
int flames_midas_scdcop_nonaxis (int from, int to, int mask)
 Copy descriptors. More...
 
int flames_midas_sccsho (const cpl_frameset *catfile, int *noent, int *last)
 Show size and type of a catalog. More...
 
int flames_midas_sccfnd (const cpl_frameset *catfile, int frmno, char *frame)
 Find corresponding frame for given entry number. More...
 
int flames_midas_sccget (const cpl_frameset *catfile, int flag, char *name, char *ident, int *no)
 Get next sequential entry from frame catalogue. More...
 
int flames_midas_scccre (cpl_frameset **catfile, int type, int flag)
 Create a catalog. More...
 
int flames_midas_sccadd (cpl_frameset *catfile, const char *name, const char *ident)
 Add catalog entry. More...
 
static cpl_type table_dtype_to_cpltype (int dtype, int alen)
 Map MIDAS dtypes to CPL types. More...
 
static int sizeof_cpltype (cpl_type type)
 Get sizeof CPL types. More...
 
static int table_cpltype_to_dtype (cpl_type type)
 Map CPL types to MIDAS dtypes. More...
 
static const char * table_colname_from_number (int tid, int column)
 Convert table numer to name. More...
 
int flames_midas_tctopn (const char *name, int mode, int allrow, int *tid)
 Open table. More...
 
int flames_midas_tctclo (int tid)
 Closes a table. More...
 
int flames_midas_tccser (int tid, const char *colref, int *column)
 Search column by reference. More...
 
int flames_midas_tciget (int tid, int *column, int *row)
 Reads table size information. More...
 
int flames_midas_tcbget (int tid, int column, int *dtype, int *items, int *bytes)
 Reads binary storage characteristics of column. More...
 
int flames_midas_tcdget (int tid, int *store)
 Reads table storage format (F_TRANS or F_RECORD) More...
 
int flames_midas_tcfget (int tid, int column, char *form, int *dtype)
 Reads column format. More...
 
int flames_midas_tclget (int tid, int column, char *label)
 Reads column label. More...
 
int flames_midas_tcuget (int tid, int column, char *unit)
 Reads column unit. More...
 
int flames_midas_tclser (int tid, const char *label, int *column)
 Searches the sequential number of the column having the given label, case insensitive. More...
 
int flames_midas_tccini (int tid, int dtype, int alen, const char *form, const char *unit, const char *label, int *column)
 Initializes table column. More...
 
static int tcerd (cpl_type type, int tid, int row, int column, void *value, int *null)
 Reads table element. More...
 
int flames_midas_tcerdc (int tid, int row, int column, char *values, int *null)
 
int flames_midas_tcerdi (int tid, int row, int column, int *value, int *null)
 
int flames_midas_tcerdr (int tid, int row, int column, float *value, int *null)
 
int flames_midas_tcerdd (int tid, int row, int column, double *value, int *null)
 
static int tcewr (cpl_type type, int tid, int row, int column, const void *value)
 Write table element. More...
 
int flames_midas_tcewrc (int tid, int row, int column, const char *value)
 
int flames_midas_tcewrd (int tid, int row, int column, const double *value)
 
int flames_midas_tcewri (int tid, int row, int column, const int *value)
 
int flames_midas_tcewrr (int tid, int row, int column, const float *value)
 
static int tcard (cpl_type type, int tid, int row, int column, int index, int items, void *value)
 
int flames_midas_tcardc (int tid, int row, int col, int index, int items, char *value)
 Reads table elements as a character string. Arrays are edited with a comma between elements. More...
 
int flames_midas_tcardd (int tid, int row, int col, int index, int items, double *value)
 Reads table elements as a double precision value. More...
 
int flames_midas_tcardi (int tid, int row, int col, int index, int items, int *value)
 
int flames_midas_tcardr (int tid, int row, int col, int index, int items, float *value)
 
static int tcawr (cpl_type type, int tid, int row, int col, int index, int items, const void *value)
 
int flames_midas_tcawrc (int tid, int row, int col, int index, int items, const char *value)
 Writes table element, character string format. More...
 
int flames_midas_tcawrd (int tid, int row, int col, int index, int items, const double *value)
 Writes table element, double precision argument. More...
 
int flames_midas_tcawri (int tid, int row, int col, int index, int items, const int *value)
 
int flames_midas_tcawrr (int tid, int row, int col, int index, int items, const float *value)
 
int flames_midas_tcsget (int tid, int row, int *value)
 Reads row selection flag. More...
 
int flames_midas_tcsput (int tid, int row, const int *value)
 Writes row selection flag. More...
 

Variables

struct frame frames [MAX_OPEN]
 
const char * current_caller = NULL
 

Detailed Description

This is not intended to be a full implementation of the C->MIDAS interface, but only of the parts that are necessary for the FLAMES pipeline

Error handling: The functions in this module return an integer error code (expected by the FLAMES C-code) and set the cpl_error_code in case of an error

Bugs:

  1. table column formats are not handled because CPL table i/o is broken. That is not a problem for the FLAMES code which does not depend on the actual values of the format strings. (But table column units are handled (by a workaround, this also didn't work in CPL))
  2. There are no checks for NULL input (which is ok because the FLAMES code always provides non-null pointers)

Function Documentation

static bool invariant ( int  id)
static

Structure invariant.

Parameters
idframe id
Returns
true if the invariant holds

This function is used to detect bugs in this member functions. Typical usage:

assert( invariant );

in the beginning and end of every member function.

Definition at line 180 of file flames_midas_def.c.

Referenced by flames_midas_scddel(), flames_midas_scdfnd(), flames_midas_scdprs(), flames_midas_scfcre(), flames_midas_scfget(), flames_midas_scfput(), flames_midas_tccini(), flames_midas_tccser(), flames_midas_tciget(), flames_midas_tcsget(), flames_midas_tcsput(), flames_midas_tctopn(), frame_close(), get_descr_info(), load_frame(), load_frame_header(), scdcop(), scdrd(), scdwr(), and table_colname_from_number().

static bool frame_is_open ( int  id)
static
static void frame_new_image ( int  id,
const char *  filename,
uves_propertylist header,
bool  need_to_save,
cpl_image *  image,
cpl_type  type,
int  dtype 
)
static

Create new image frame.

Parameters
idframe id
Returns
0 iff okay

Definition at line 226 of file flames_midas_def.c.

Referenced by flames_midas_scfcre(), and flames_midas_scfopn().

static void frame_new_table ( int  id,
const char *  filename,
uves_propertylist header,
bool  need_to_save,
cpl_table *  table,
int  maxrow,
cpl_table *  colnames 
)
static

Create new table frame.

Parameters
idframe id
Returns
0 iff okay

Definition at line 264 of file flames_midas_def.c.

Referenced by flames_midas_tctopn().

static void frame_free ( int  id)
static

Deallocate frame.

Parameters
idframe id
Returns
0 iff okay

Definition at line 313 of file flames_midas_def.c.

References frame_is_open().

Referenced by flames_midas_scsepi(), and frame_close().

static bool is_special_midas_descr ( const char *  descr)
static

Find out if FITS descriptor has a different name from MIDAS.

Parameters
descrname
Returns
true if special

Definition at line 339 of file flames_midas_def.c.

Referenced by load_header().

static const char* convert_to_fits ( const char *  descr,
int  indx 
)
static

Map MIDAS descriptors to FITS equivalents.

Parameters
descrMIDAS descriptor name
indxcounting from 1
Returns
Newly allocated keyword name, which is a copy of the input string if not a special MIDAS descriptor.

Definition at line 364 of file flames_midas_def.c.

Referenced by create_descr(), flames_midas_sccget(), flames_midas_scddel(), and get_descr_info().

static void convert_to_history ( uves_propertylist **  header)
static

Convert header for output.

Parameters
headerto convert

Sequences of properties like (LOONGNAME, value1) (LOONGNAME, value2) (LOONGNAME, value3) (LOONGNAME, value4) with name longer than 8 characters are converted to (HISTORY, "'LOONGNAME'"); (HISTORY, "value1"); (HISTORY, "value2"); (HISTORY, "value3"); (HISTORY, "value4"); (HISTORY, "");

except "ESO [something]" descriptors which should not be converted.

Also a descriptors with comment 'MIDAS_DESC' are converted, such as COEFFI, FIBREPOS

Definition at line 442 of file flames_midas_def.c.

References check_nomsg, uves_msg_debug, uves_propertylist_duplicate(), uves_propertylist_get_size(), uves_propertylist_new(), and uves_tostring_cpl_type().

Referenced by frame_close().

static uves_propertylist* load_header ( const char *  filename,
int  extension 
)
static

Load + parse FITS header HISTORY keywords.

Parameters
filenameto load
extensionto load
Returns
FITS header

MIDAS properties like this

(HISTORY, "'KEYWORDNAME'") (HISTORY, "value1 value2 ...") : (HISTORY, "")

are converted to properties

(KEYWORDNAME, value1) (KEYWORDNAME, value2) :

Definition at line 622 of file flames_midas_def.c.

References check, is_special_midas_descr(), uves_msg_warning, uves_propertylist_append_c_double(), uves_propertylist_append_c_float(), uves_propertylist_append_c_int(), uves_propertylist_append_c_string(), uves_propertylist_get_size(), uves_propertylist_load(), uves_propertylist_new(), and uves_tostring_cpl_type().

Referenced by load_frame_header().

cpl_type flames_midas_image_dtype_to_cpltype ( int  dtype)

Map MIDAS dtypes to CPL types.

Parameters
dtypeMIDAS type to convert

Definition at line 742 of file flames_midas_def.c.

Referenced by flames_midas_scfcre(), and flames_midas_scfopn().

static void load_frame_header ( int  id)
static

Load frame FITS header if not already in memory.

Parameters
idframe id
Returns
0 iff okay

The image/table must already be open (i.e. have legal filename)

Definition at line 773 of file flames_midas_def.c.

References check, frame_is_open(), invariant(), load_header(), passure, uves_msg_debug, and uves_propertylist_get_size().

Referenced by frame_close(), get_descr_info(), and scdcop().

static void set_column_format_unit_tnull ( cpl_table *  t,
const uves_propertylist theader 
)
static

CPL workaround DFS03746.

Parameters
ttable to update
colnamename of column to update
theadertable extension header, which contains unit/format info
Returns
0 iff okay

Definition at line 809 of file flames_midas_def.c.

References check_nomsg, uves_propertylist_contains(), uves_propertylist_get_int(), and uves_propertylist_get_string().

Referenced by load_frame().

static void load_frame ( int  id)
static
static cpl_property** create_descr ( uves_propertylist header,
const char *  descr,
char  type,
int  length,
int  nexist 
)
static

Create descriptors.

Parameters
headeradd new descriptors here
descrdescriptor name
typedescriptor type
lengthnumber of descriptors to create. If type is 'C' only one property is created
nexistnumber of already existing descriptors with this name
Returns
NULL terminated array of pointers to existing descriptors

Definition at line 1060 of file flames_midas_def.c.

References check, convert_to_fits(), passure, uves_msg_debug, uves_propertylist_append_c_double(), uves_propertylist_append_c_float(), uves_propertylist_append_c_int(), and uves_propertylist_append_c_string().

Referenced by scdwr().

static cpl_property** get_descr_info ( int  id,
const char *  descr,
char *  type,
int *  length,
int *  bytelem 
)
static

Get descriptor information.

Parameters
idframe number
descrdescriptor name
type(output) descriptor type
length(output) descriptor length, if type string the string length
bytelem(output) bytes per element
Returns
NULL terminated array of pointers to existing properties, or NULL if error. The array itself must be free'd, but the properties pointed to should not be free'd.

The special MIDAS descriptor arrays are handled, e.g. STEP is mapped to to CRVAL1, not CRVAL2, CRVAL3...

If the descriptor does not exist, NULL is returned but no error is set

Definition at line 1184 of file flames_midas_def.c.

References assure_mem, check, convert_to_fits(), frame_is_open(), invariant(), load_frame_header(), passure, and uves_msg_debug.

Referenced by flames_midas_scddel(), flames_midas_scdfnd(), flames_midas_scdprs(), frame_close(), scdrd(), and scdwr().

int flames_midas_scspro ( const char *  name)

Get into the MIDAS environment.

Parameters
namename of calling program
Returns
0 iff okay

Read keywords database, Initialize file control table, Open logfile

Definition at line 1293 of file flames_midas_def.c.

References uves_msg_debug.

int flames_midas_scsepi ( void  )

Deinitialize interface.

Returns
0 iff okay

Definition at line 1323 of file flames_midas_def.c.

References frame_free(), frame_is_open(), uves_msg_debug, and uves_msg_warning.

Referenced by flames_midas_fail_macro().

int flames_midas_error_macro ( const char *  file,
const char *  function,
int  line,
int  status 
)

Print debugging info when function returns error.

Parameters
statusto be returned
Returns
status

In the original FLAMES C code, low level function failure return statements like

"return MAREMMA;"

are replaced with

"return flames_midas_error(MAREMMA)"

to allow tracking the errors

Definition at line 1371 of file flames_midas_def.c.

References uves_msg_debug.

int flames_midas_fail_macro ( const char *  file,
const char *  function,
int  line 
)

Deinitialize interface, cleanup and return failure.

Returns
0 iff okay

This function replaces the "exit(1)" calls in the original MIDAS source code

Definition at line 1390 of file flames_midas_def.c.

References flames_midas_scsepi(), uves_msg_debug, and uves_msg_error.

int flames_midas_sckwri ( int *  key,
const int *  values,
int  felem,
int  maxvals,
int *  unit 
)

Write data into integer keyword.

Parameters
keyaddress of keyword
valuesbuffer with data values
felemposition of 1st element to be written (numbered from 1)
maxvalsmax no. of elements to write
unitunit pointer
Returns
0 iff okay

Definition at line 1417 of file flames_midas_def.c.

References assure_nomsg, and uves_msg_debug.

int flames_midas_sckwrd ( double *  key,
const double *  values,
int  felem,
int  maxvals,
int *  unit 
)

Write data into double keyword.

Parameters
keyaddress of keyword
valuesbuffer with data values
felemposition of 1st element to be written (numbered from 1)
maxvalsmax no. of elements to write
unitunit pointer
Returns
0 iff okay

Definition at line 1446 of file flames_midas_def.c.

References assure_nomsg, and uves_msg_debug.

int flames_midas_sckwrc ( char *  key,
int  noelem,
const char *  values,
int  felem,
int  maxvals,
int *  unit 
)

Write data into character keyword.

Parameters
keyaddress of keyword
noelemnumber of bytes per data value
valuesbuffer with data values
felemposition of 1st element to be written (numbered from 1)
maxvalsmax no. of elements to write
unitunit pointer
Returns
0 iff okay

Definition at line 1479 of file flames_midas_def.c.

References assure_nomsg, and uves_msg_debug.

int flames_midas_sckgetc ( const char *  key,
int  felem,
int  maxvals,
int *  actvals,
char *  values 
)

Get data from character keyword.

Parameters
keykeyword name (max 8 characters)
felemposition of 1st element (numbered from 1)
maxvalsmax no. of characters to be returned (buffer size including terminating 0)
actvals(output) actual number of characters returned
values(output) buffer for data values
Returns
0 iff okay

Definition at line 1507 of file flames_midas_def.c.

References assure_nomsg.

int flames_midas_sckgetc_fs ( const cpl_frameset *  key,
int  felem,
int  maxvals,
int *  actvals,
const cpl_frameset **  values 
)

Get data from character keyword (catalogue)

Parameters
keyinput catalogue
felemposition of 1st element (must be 1)
maxvalsmax no. of characters to be returned
actvals(output) actual number of characters returned
values(output) same as input
Returns
0 iff okay

Definition at line 1541 of file flames_midas_def.c.

References assure_nomsg.

int flames_midas_sckgetc_fsp ( cpl_frameset **  key,
int  felem,
int  maxvals,
int *  actvals,
cpl_frameset ***  values 
)

Get data from character keyword (frame set pointer)

Parameters
keyinput catalogue
felemposition of 1st element (must be 1)
maxvalsmax no. of characters to be returned
actvals(output) actual number of characters returned
values(output) same as input
Returns
0 iff okay

Definition at line 1569 of file flames_midas_def.c.

References assure_nomsg.

int flames_midas_sckrdd ( const double *  key,
int  felem,
int  maxvals,
int *  actvals,
double *  values,
int *  unit,
int *  null 
)

Read data from double precision keyword.

Parameters
keykeyword array
felemfirst data item to be read
maxvalsno. of elements to get
actvals(output) actual number of elements returned
values(output) buffer for data values
unit(output) address of unit pointer
null(output) no. of null values in keyword
Returns
0 iff okay

Definition at line 1599 of file flames_midas_def.c.

References assure_nomsg.

int flames_midas_sckrdr ( const float *  key,
int  felem,
int  maxvals,
int *  actvals,
float *  values,
int *  unit,
int *  null 
)

Read data from real precision keyword.

Parameters
keykeyword array
felemfirst data item to be read
maxvalsno. of elements to get
actvals(output) actual number of elements returned
values(output) buffer for data values
unit(output) address of unit pointer
null(output) no. of null values in keyword
Returns
0 iff okay

Definition at line 1634 of file flames_midas_def.c.

References assure_nomsg.

int flames_midas_sckrdi ( const int *  key,
int  felem,
int  maxvals,
int *  actvals,
int *  values,
int *  unit,
int *  null 
)

Read data from integer keyword.

Parameters
keykeyword array
felemfirst data item to be read
maxvalsno. of elements to get
actvals(output) actual number of elements returned
values(output) buffer for data values
unit(output) address of unit pointer
null(output) no. of null values in keyword
Returns
0 iff okay

Definition at line 1669 of file flames_midas_def.c.

int flames_midas_sckrdc ( const char *  key,
int  noelm,
int  felem,
int  maxvals,
int *  actvals,
char *  values,
int *  unit,
int *  null 
)

Read data from string keyword.

Parameters
keykeyword array
noelmno. of bytes per data values
felemfirst data item to be read
maxvalsno. of elements to get
actvals(output) actual number of elements returned
values(output) buffer for data values
unit(output) address of unit pointer
null(output) no. of null values in keyword
Returns
0 iff okay

Definition at line 1703 of file flames_midas_def.c.

static int sckfnd ( const char  the_type,
const void *  key,
char *  type,
int *  noelem,
int *  bytelem 
)
static

Find keyword and provide info on it.

Parameters
keykeyword array
type(output) keyword type
noelem(output) no. of elements
bytelem(output) no. of bytes per element
Returns
0 iff okay

If keyword not found, type is ' ', and no error is set.

Definition at line 1740 of file flames_midas_def.c.

References uves_msg_debug.

Referenced by flames_midas_sckfnd_double(), flames_midas_sckfnd_float(), flames_midas_sckfnd_int(), and flames_midas_sckfnd_string().

int flames_midas_sckfnd_double ( const double *  key,
char *  type,
int *  noelem,
int *  bytelem 
)
See Also
sckfnd

Definition at line 1764 of file flames_midas_def.c.

References sckfnd().

int flames_midas_sckfnd_float ( const float *  key,
char *  type,
int *  noelem,
int *  bytelem 
)
See Also
sckfnd

Definition at line 1773 of file flames_midas_def.c.

References sckfnd().

int flames_midas_sckfnd_int ( const int *  key,
char *  type,
int *  noelem,
int *  bytelem 
)
See Also
sckfnd

Definition at line 1783 of file flames_midas_def.c.

References sckfnd().

int flames_midas_sckfnd_string ( const char *  key,
char *  type,
int *  noelem,
int *  bytelem 
)
See Also
sckfnd

Definition at line 1793 of file flames_midas_def.c.

References sckfnd().

int flames_midas_sctput ( const char *  msg,
const char *  function,
const char *  file,
int  line 
)

Display message.

Parameters
msgmessage to display
Returns
0 iff okay

Definition at line 1806 of file flames_midas_def.c.

References uves_msg_error, uves_msg_low, and uves_msg_warning.

int flames_midas_scfinf ( const char *  name,
int  fno,
int *  ibuf 
)

Open the frame and return file info in buffer up to 5 integers.

Parameters
namename of data frame
fnoflag for requested info
ibuf(output) buffer with requested info
Returns
0 iff okay

fno = 0 for getting the file id (imno) of 'name', i.e. check if the frame has been opened already

fno = 1 for getting version no., file_type, short int, int and floating format

fno = 2 for getting no_bytes_per_pixel, format, pixels_per_block, startblock and lastblock

fno = 3 for getting file_type, format, file_protect, file_compress

fno = 4 for getting no_bytes_per_pixel, format, file_type

fno = 99 to find out if file 'name' exists, no buffer is returned instead the status is set to 0 (o.k. = file exists) or not

The FLAMES code uses only fno = 3, 4, 99

Definition at line 1856 of file flames_midas_def.c.

References check, uves_msg_debug, uves_pfits_get_bitpix(), and uves_propertylist_load().

int flames_midas_scfopn ( const char *  name,
int  dattype,
int  newopn,
int  filtype,
int *  imno 
)

Open an existing image and return its internal file no.

Parameters
namename of data frame
dattypedata types as defined below
newopnnew open flag. 0: open normally. 1: open same file again
filtypefile type as defined below
imno(output) file id of frame
Returns
0 iff okay

Definition at line 1937 of file flames_midas_def.c.

References flames_midas_image_dtype_to_cpltype(), frame_is_open(), frame_new_image(), uves_msg_debug, and uves_tostring_cpl_type().

int flames_midas_scfcre ( const char *  name,
int  dattype,
int  iomode,
int  filtype,
int  size,
int *  imno 
)

Create an image frame with data of given type and return its internal file no.

Parameters
namename of data frame
dattypedata type
iomodeopening mode
filtypefile type number
sizesize of frame (number of values in file). Images: number of pixels
imno(output) file id of frame
Returns
0 iff okay
See Also
flames_midas_scfopn for details of different data and file types

Definition at line 2003 of file flames_midas_def.c.

References flames_midas_image_dtype_to_cpltype(), frame_is_open(), frame_new_image(), invariant(), passure, uves_msg_debug, and uves_propertylist_new().

static int frame_close ( int  id)
static

Close a frame, save to disk if necessary.

Parameters
idframe number
Returns
0 iff okay

Definition at line 2066 of file flames_midas_def.c.

References check, convert_to_history(), flames_midas_scdrdi(), frame_free(), frame_is_open(), get_descr_info(), invariant(), load_frame(), load_frame_header(), passure, uves_msg_debug, and uves_msg_warning.

Referenced by flames_midas_scfclo(), and flames_midas_tctclo().

int flames_midas_scfclo ( int  imno)

Close an image frame.

Parameters
imnofile id of data frame
Returns
0 iff okay

Definition at line 2232 of file flames_midas_def.c.

References frame_close().

int flames_midas_scfget ( int  imno,
int  felem,
int  size,
int *  actsize,
char *  bufadr 
)

Read data from disk frame into memory.

Parameters
imnofile id of data frame
felem1st pixel to be accessed in data space
sizenumber of data values (pixels) to be read
*actsize(output) actual number of pixels read
bufadr(output) data buffer (really a void pointer but implemented as a char pointer)
Returns
0 iff okay

Definition at line 2250 of file flames_midas_def.c.

References assure_nomsg, check, frame_is_open(), invariant(), load_frame(), passure, and uves_tostring_cpl_type().

int flames_midas_scfput ( int  imno,
int  felem,
int  size,
const char *  bufadr 
)

Write data from memory into disk frame.

Parameters
imnofile id of data frame
felem1st pixel to be accessed in data space
sizenumber of data values (pixels) to be written
bufadrdata buffer (void pointer)
Returns
0 iff okay

Definition at line 2339 of file flames_midas_def.c.

References assure_nomsg, check, frame_is_open(), invariant(), load_frame(), passure, uves_msg_debug, and uves_tostring_cpl_type().

int flames_midas_scdfnd ( int  id,
const char *  descr,
char *  type,
int *  noelem,
int *  bytelem 
)

Provide info about descriptor.

Parameters
idfile id of data frame
descrdescriptor name (max 15 chars)
type(output) type of descriptor: 'I', 'R', 'C', 'D' or ' ' (a blank)
noelem(output) number of elements
bytelem(output) number of bytes per element
Returns
0 iff okay

Search descriptor directory, if 'descr' not found, *type is set to blank

Definition at line 2445 of file flames_midas_def.c.

References assure_nomsg, check, flames_midas_scdfnd(), get_descr_info(), invariant(), passure, and uves_msg_debug.

Referenced by flames_midas_scdfnd(), and flames_midas_scdprs().

int flames_midas_scdprs ( int  id,
const char *  descr,
char *  type,
int *  noelem,
int *  bytelem 
)

Provide info about descriptor.

Parameters
idfile id of data frame
descrdescriptor name (max 15 chars)
type(output) type of descriptor: 'I', 'R', 'C', 'D' or ' ' (a blank)
noelem(output) number of elements
bytelem(output) number of bytes per element
Returns
0 iff okay

Search descriptor directory, if 'descr' not found, *type is set to blank

Definition at line 2528 of file flames_midas_def.c.

References assure_nomsg, check, flames_midas_scdfnd(), get_descr_info(), invariant(), passure, and uves_msg_debug.

static int scdrd ( char  expected_type,
int  id,
const char *  descr,
int  felem,
int  maxvals,
int *  actvals,
void *  values,
int *  unit,
int *  null 
)
static

Read contents of integer descriptor.

Parameters
idfile id of data frame
descrdescriptor name (max 15 chars)
felemposition of 1st element
maxvalsmax no. of elements to be returned
actvals(output) actual number of values returned
values(output) array for descriptor data
unit(output) address of unit pointer
null(output) no. of null values in data
Returns
0 iff okay

actvals will be the actual number of values returned

Definition at line 2613 of file flames_midas_def.c.

References check, get_descr_info(), invariant(), passure, and uves_msg_debug.

Referenced by flames_midas_scdrdc(), flames_midas_scdrdd(), flames_midas_scdrdi(), and flames_midas_scdrdr().

int flames_midas_scdrdi ( int  id,
const char *  descr,
int  felem,
int  maxvals,
int *  actvals,
int *  values,
int *  unit,
int *  null 
)

Read contents of integer descriptor.

See Also
scdrd

Definition at line 2716 of file flames_midas_def.c.

References assure_mem, check, and scdrd().

Referenced by frame_close().

int flames_midas_scdrdd ( int  id,
const char *  descr,
int  felem,
int  maxvals,
int *  actvals,
double *  values,
int *  unit,
int *  null 
)

Read contents of double descriptor.

See Also
scdrd

Definition at line 2767 of file flames_midas_def.c.

References scdrd().

Referenced by flames_midas_scdrdr().

int flames_midas_scdrdr ( int  id,
const char *  descr,
int  felem,
int  maxvals,
int *  actvals,
float *  values,
int *  unit,
int *  null 
)

Read contents of double descriptor.

See Also
scdrd

Definition at line 2782 of file flames_midas_def.c.

References flames_midas_scdrdd(), scdrd(), and uves_msg_debug.

int flames_midas_scdrdc ( int  id,
const char *  descr,
int  noelem,
int  felem,
int  maxvals,
int *  actvals,
char *  values,
int *  unit,
int *  null 
)

Read contents of string descriptor.

Parameters
noelemno. of bytes per data value

Note: maxvals in the number of characters, excluding the final terminating '\0', i.e. maxvals should usually be one less than the buffer size

See Also
scdrd

Definition at line 2842 of file flames_midas_def.c.

References scdrd().

static int scdwr ( char  type_to_write,
int  id,
const char *  descr,
const void *  values,
int  felem,
int  nval,
const int *  unit 
)
static

Write a descriptor and its data.

Parameters
type_to_writetype
idfile id of data frame
descrdescriptor name (max 15 chars)
valuesbuffer with descriptor data
felemposition of 1st descriptor value to be accessed
nvalno. of data values to write
unitunit-pointer
Returns
0 iff okay

A new descriptor is added to the descriptor area, or data of an existing descriptor is modified and extended, if necessary.

If felem = -1 descriptor values are appended to existing ones

Definition at line 2881 of file flames_midas_def.c.

References check, create_descr(), frame_is_open(), get_descr_info(), invariant(), load_frame(), passure, and uves_msg_debug.

Referenced by flames_midas_scdwrc(), flames_midas_scdwrd(), flames_midas_scdwri(), and flames_midas_scdwrr().

int flames_midas_scdwri ( int  id,
const char *  descr,
const int *  values,
int  felem,
int  nval,
const int *  unit 
)

Write a descriptor and its data.

See scdwr

Definition at line 3015 of file flames_midas_def.c.

References passure, scdwr(), uves_msg_debug, and uves_tostring_cpl_type().

Referenced by scdcop().

int flames_midas_scdwrd ( int  id,
const char *  descr,
const double *  values,
int  felem,
int  nval,
const int *  unit 
)

Write a descriptor and its data.

See flames_midas_scdwri()

Definition at line 3115 of file flames_midas_def.c.

References flames_midas_scdwrd(), and scdwr().

Referenced by flames_midas_scdwrd(), and flames_midas_scdwrr().

int flames_midas_scdwrr ( int  id,
const char *  descr,
const float *  values,
int  felem,
int  nval,
const int *  unit 
)

Write a descriptor and its data.

See flames_midas_scdwri()

Definition at line 3146 of file flames_midas_def.c.

References flames_midas_scdwrd(), scdwr(), and uves_msg_debug.

int flames_midas_scdwrc ( int  id,
const char *  descr,
int  noelm,
const char *  values,
int  felem,
int  nval,
const int *  unit 
)

Write a descriptor and its data.

Parameters
noelmno. of bytes per data value

See flames_midas_scdwri()

'noelm' larger than 1 enables you to use character arrays, where each data values is in effect a char. string of 'noelm' bytes

Definition at line 3197 of file flames_midas_def.c.

References flames_midas_scdwrc(), and scdwr().

Referenced by flames_midas_scdwrc().

int flames_midas_scddel ( int  id,
const char *  descr 
)

Delete a descriptor.

Parameters
idframe number
descrdescriptor name
Returns
0 iff okay

Definition at line 3279 of file flames_midas_def.c.

References check, convert_to_fits(), frame_is_open(), get_descr_info(), invariant(), passure, and uves_propertylist_erase_regexp().

static int scdcop ( int  from,
int  to,
int  mask,
bool  copy_naxis 
)
static

Copy descriptors from one frame to another.

Parameters
fromfile id of source frame
tofile id of destination frame
maskcopy_mask
copy_naxiswhether or not to propagate NAXIS keywords
Returns
0 iff okay

Depending on 'mask' the relevant descriptors are read from the source frame and written to the destination frame

1 - copy all descriptors 2 - copy only standard descriptors (see MIDAS env appendix E) 3 - copy all but standard descriptors 4 - copy single descriptor specified by parameter dsc 5 - copy all but extended list of standard descriptors

The FLAMES code uses only modes 1 and 3

Definition at line 3351 of file flames_midas_def.c.

References check, check_nomsg, flames_midas_scdwri(), frame_is_open(), invariant(), load_frame(), load_frame_header(), passure, uves_msg_debug, uves_propertylist_append(), uves_propertylist_copy_property_regexp(), uves_propertylist_get_int(), and uves_propertylist_get_size().

Referenced by flames_midas_scdcop(), and flames_midas_scdcop_nonaxis().

int flames_midas_scdcop ( int  from,
int  to,
int  mask 
)

Copy descriptors.

Returns
0 iff okay

See scdcop()

Definition at line 3445 of file flames_midas_def.c.

References scdcop().

int flames_midas_scdcop_nonaxis ( int  from,
int  to,
int  mask 
)

Copy descriptors.

Returns
0 iff okay

See scdcop()

Definition at line 3458 of file flames_midas_def.c.

References scdcop().

int flames_midas_sccsho ( const cpl_frameset *  catfile,
int *  noent,
int *  last 
)

Show size and type of a catalog.

Parameters
catfilecatalog file
noent(output) number of entries
last(output) last entry no.
Returns
0 iff okay

Read and count active entries of catalog

Definition at line 3475 of file flames_midas_def.c.

References assure_nomsg.

int flames_midas_sccfnd ( const cpl_frameset *  catfile,
int  frmno,
char *  frame 
)

Find corresponding frame for given entry number.

Parameters
catfilecatalog file
frmno(output) frame number counting from 1
frame(output) frame filename
Returns
0 iff okay

Definition at line 3501 of file flames_midas_def.c.

References assure_nomsg, check, and uves_msg_debug.

int flames_midas_sccget ( const cpl_frameset *  catfile,
int  flag,
char *  name,
char *  ident,
int *  no 
)

Get next sequential entry from frame catalogue.

Parameters
catfilecatalog file
flag0 for name only, 1 for name and identifier (tag)
name(output) name of frame in next entry of catalog
ident(output) identifier of that frame
no(output) current/next entry number as input/output
Returns
0 iff okay

Return name and identifier of next entry in catalog; return a blank in name[0] if end of frameset.

Parameter 'no' has to be set to 0 in the first call of the routine.

Note: The returned ident string always has length 40

Definition at line 3539 of file flames_midas_def.c.

References assure_nomsg, check, check_nomsg, convert_to_fits(), uves_msg_debug, uves_propertylist_contains(), uves_propertylist_get_string(), and uves_propertylist_load().

int flames_midas_scccre ( cpl_frameset **  catfile,
int  type,
int  flag 
)

Create a catalog.

Parameters
catfile(output) catalog. Must be deallocated by caller
typetype of files to use
flag= 1 if file dirfile.cat exists
Returns
0 iff okay

Add an entry with given name and identification field to the catalog

If flag = 1, read each filename from ASCII file 'dirfile.dat', else create an empty catalog

Definition at line 3636 of file flames_midas_def.c.

References assure_nomsg.

int flames_midas_sccadd ( cpl_frameset *  catfile,
const char *  name,
const char *  ident 
)

Add catalog entry.

Parameters
catfilecatalog file
namename of frame to be added
identIDENT info of frame to be added
Returns
0 iff okay

Add an entry with given name and identification field to the catalog

If flag = 1, read each filename from ASCII file 'dirfile.dat', else create an empty catalog

Definition at line 3668 of file flames_midas_def.c.

References assure_nomsg.

static cpl_type table_dtype_to_cpltype ( int  dtype,
int  alen 
)
static

Map MIDAS dtypes to CPL types.

Parameters
dtypeMIDAS type to convert
alennumber of array elements

Definition at line 3716 of file flames_midas_def.c.

References passure.

Referenced by flames_midas_tcbget(), and flames_midas_tccini().

static int sizeof_cpltype ( cpl_type  type)
static

Get sizeof CPL types.

Parameters
typeCPL type
Returns
size in bytes

Definition at line 3753 of file flames_midas_def.c.

References uves_tostring_cpl_type().

Referenced by flames_midas_tcbget().

static int table_cpltype_to_dtype ( cpl_type  type)
static

Map CPL types to MIDAS dtypes.

Parameters
typeCPL type to convert
Returns
dtype

Definition at line 3779 of file flames_midas_def.c.

References uves_tostring_cpl_type().

Referenced by flames_midas_tcbget(), and flames_midas_tcfget().

static const char* table_colname_from_number ( int  tid,
int  column 
)
static

Convert table numer to name.

Parameters
tidtable id
columncolumn by number (counting from 1)
Returns
column name, or NULL if not found

Definition at line 3807 of file flames_midas_def.c.

References check, frame_is_open(), invariant(), load_frame(), and passure.

Referenced by flames_midas_tcbget(), flames_midas_tcfget(), flames_midas_tclget(), flames_midas_tcuget(), tcerd(), and tcewr().

int flames_midas_tctopn ( const char *  name,
int  mode,
int  allrow,
int *  tid 
)

Open table.

Parameters
nametable name
modeopening mode
allrownumber of rows to allocate, only for F_O_MODE
tid(output) table identifier (try to keep it)
Returns
0 iff okay

Opens table file according to the desired mode. The opening mode can be F_I_MODE for input, F_D_MODE for descriptors only, F_IO_MODE for update.

Open mode can also be F_O_MODE for output.

Definition at line 3845 of file flames_midas_def.c.

References frame_is_open(), frame_new_table(), invariant(), passure, uves_msg_debug, and uves_propertylist_new().

int flames_midas_tctclo ( int  tid)

Closes a table.

Parameters
tidtable identifier
Returns
0 iff okay

Definition at line 3906 of file flames_midas_def.c.

References frame_close().

int flames_midas_tccser ( int  tid,
const char *  colref,
int *  column 
)

Search column by reference.

Parameters
tidtable id
colrefcolumn reference
column(output) column number
Returns
0 iff okay

The column may not be designated as #number or :name, only name.

Sequential search for the column label. The routine returns the column number as the last argument or -1 if the column is not found.

Definition at line 3926 of file flames_midas_def.c.

References check, frame_is_open(), invariant(), load_frame(), passure, and uves_msg_warning.

Referenced by flames_midas_tclser().

int flames_midas_tciget ( int  tid,
int *  column,
int *  row 
)

Reads table size information.

Parameters
tidtable id
column(output) number of columns
row(output) number of rows
Returns
0 iff okay

Definition at line 3978 of file flames_midas_def.c.

References check, frame_is_open(), invariant(), load_frame(), and passure.

int flames_midas_tcbget ( int  tid,
int  column,
int *  dtype,
int *  items,
int *  bytes 
)

Reads binary storage characteristics of column.

Parameters
tidtable id
columncolumn number
dtype(output) datatype
items(output) array size bytes (output) storage required
Returns
0 iff okay

The routine returns the datatype (one of the D_xx_FORMAT), the number of items (arrays), and the number of bytes required for the binary storage.

Definition at line 4014 of file flames_midas_def.c.

References check_nomsg, sizeof_cpltype(), table_colname_from_number(), table_cpltype_to_dtype(), and table_dtype_to_cpltype().

int flames_midas_tcdget ( int  tid,
int *  store 
)

Reads table storage format (F_TRANS or F_RECORD)

Parameters
tidtable id
store(output) physical format on disk
Returns
0 iff okay

Definition at line 4054 of file flames_midas_def.c.

int flames_midas_tcfget ( int  tid,
int  column,
char *  form,
int *  dtype 
)

Reads column format.

Parameters
tidtable id
columncolumn number
form(output) column format
dtype(output) data type
Returns
0 iff okay

Definition at line 4072 of file flames_midas_def.c.

References check_nomsg, table_colname_from_number(), and table_cpltype_to_dtype().

int flames_midas_tclget ( int  tid,
int  column,
char *  label 
)

Reads column label.

Parameters
tidtable id
columncolumn number
label(output) label name
Returns
0 iff okay

Definition at line 4099 of file flames_midas_def.c.

References check_nomsg, and table_colname_from_number().

int flames_midas_tcuget ( int  tid,
int  column,
char *  unit 
)

Reads column unit.

Parameters
tidtable id
columncolumn number
unit(output) unit name
Returns
0 iff okay

Definition at line 4122 of file flames_midas_def.c.

References check_nomsg, and table_colname_from_number().

int flames_midas_tclser ( int  tid,
const char *  label,
int *  column 
)

Searches the sequential number of the column having the given label, case insensitive.

Parameters
tidtable id
label(output) label name
column(output) column number (-1 if column not found)
Returns
0 iff okay

Definition at line 4148 of file flames_midas_def.c.

References flames_midas_tccser().

int flames_midas_tccini ( int  tid,
int  dtype,
int  alen,
const char *  form,
const char *  unit,
const char *  label,
int *  column 
)

Initializes table column.

Parameters
tidtable id
dtypecolumn data type (one of the D_xx_FORMAT)
alennumber of array elements
formcolumn format (is not used by FLAMES code)
unitcolumn unit
labelcolumn label
column(output) column number
Returns
0 iff okay

Elements in the column are initialized as undefined (null values).

Checks if column has been already defined, otherwise add the new column descriptors. The routine provides an overflow mechanism when the new column exceeds the allocated space

Definition at line 4179 of file flames_midas_def.c.

References check, check_nomsg, frame_is_open(), invariant(), load_frame(), passure, table_dtype_to_cpltype(), and uves_msg_debug.

static int tcerd ( cpl_type  type,
int  tid,
int  row,
int  column,
void *  value,
int *  null 
)
static

Reads table element.

Parameters
typecolumn type
tidtable id
rowrow number counting from 1
columncolumn number
value(output) actual values
null(output) if non-NULL, null flag
Returns
0 status, error and non-selected. The FLAMES C-code uses the return value only to test for error. Therefore only the error status is returned

Finds the element position and convert data type if required. Only the FIRST value is read for arrays

Definition at line 4247 of file flames_midas_def.c.

References check_nomsg, table_colname_from_number(), and uves_tostring_cpl_type().

Referenced by flames_midas_tcerdc(), flames_midas_tcerdd(), flames_midas_tcerdi(), flames_midas_tcerdr(), and tcard().

int flames_midas_tcerdc ( int  tid,
int  row,
int  column,
char *  values,
int *  null 
)
See Also
tcerd

Finds the element position and convert data type if required. Arrays are edited with a comma between elements.

Definition at line 4314 of file flames_midas_def.c.

References tcerd().

int flames_midas_tcerdi ( int  tid,
int  row,
int  column,
int *  value,
int *  null 
)
See Also
tcerd

Definition at line 4324 of file flames_midas_def.c.

References tcerd().

int flames_midas_tcerdr ( int  tid,
int  row,
int  column,
float *  value,
int *  null 
)
See Also
tcerd

Definition at line 4334 of file flames_midas_def.c.

References tcerd().

int flames_midas_tcerdd ( int  tid,
int  row,
int  column,
double *  value,
int *  null 
)
See Also
tcerd

Definition at line 4344 of file flames_midas_def.c.

References tcerd().

static int tcewr ( cpl_type  type,
int  tid,
int  row,
int  column,
const void *  value 
)
static

Write table element.

Parameters
typecolumn type
tidtable id
rowrow number
columncolumn number
valueactual value

Finds the element position and convert data type if required. Only the FIRST value is written for arrays

Definition at line 4363 of file flames_midas_def.c.

References check_nomsg, table_colname_from_number(), and uves_tostring_cpl_type().

Referenced by flames_midas_tcewrc(), flames_midas_tcewrd(), flames_midas_tcewri(), flames_midas_tcewrr(), and tcawr().

int flames_midas_tcewrc ( int  tid,
int  row,
int  column,
const char *  value 
)
See Also
tcewr

Finds the element position and convert data type if required. Element in an array must be separated by comma

Definition at line 4415 of file flames_midas_def.c.

References tcewr().

int flames_midas_tcewrd ( int  tid,
int  row,
int  column,
const double *  value 
)
See Also
tcewr

Definition at line 4426 of file flames_midas_def.c.

References tcewr().

int flames_midas_tcewri ( int  tid,
int  row,
int  column,
const int *  value 
)
See Also
tcewr

Definition at line 4436 of file flames_midas_def.c.

References tcewr().

int flames_midas_tcewrr ( int  tid,
int  row,
int  column,
const float *  value 
)
See Also
tcewr

Definition at line 4445 of file flames_midas_def.c.

References tcewr().

static int tcard ( cpl_type  type,
int  tid,
int  row,
int  column,
int  index,
int  items,
void *  value 
)
static
See Also
tcerd

Definition at line 4456 of file flames_midas_def.c.

References tcerd().

Referenced by flames_midas_tcardc(), flames_midas_tcardd(), flames_midas_tcardi(), and flames_midas_tcardr().

int flames_midas_tcardc ( int  tid,
int  row,
int  col,
int  index,
int  items,
char *  value 
)

Reads table elements as a character string. Arrays are edited with a comma between elements.

Parameters
tidtable id
rowrow number
colcolumn number
indexindex number
itemshow many
value(out) actual values
Returns
0 iff okay

Definition at line 4484 of file flames_midas_def.c.

References tcard().

int flames_midas_tcardd ( int  tid,
int  row,
int  col,
int  index,
int  items,
double *  value 
)

Reads table elements as a double precision value.

Parameters
tidtable id
rowrow number
colcolumn number
indexindex number
itemshow many
value(out) actual values
Returns
0 iff okay

Definition at line 4501 of file flames_midas_def.c.

References tcard().

int flames_midas_tcardi ( int  tid,
int  row,
int  col,
int  index,
int  items,
int *  value 
)
See Also
tcardd

Definition at line 4511 of file flames_midas_def.c.

References tcard().

int flames_midas_tcardr ( int  tid,
int  row,
int  col,
int  index,
int  items,
float *  value 
)
See Also
tcardd

Definition at line 4521 of file flames_midas_def.c.

References tcard().

static int tcawr ( cpl_type  type,
int  tid,
int  row,
int  col,
int  index,
int  items,
const void *  value 
)
static
See Also
tcewr

Definition at line 4533 of file flames_midas_def.c.

References tcewr().

Referenced by flames_midas_tcawrc(), flames_midas_tcawrd(), flames_midas_tcawri(), and flames_midas_tcawrr().

int flames_midas_tcawrc ( int  tid,
int  row,
int  col,
int  index,
int  items,
const char *  value 
)

Writes table element, character string format.

Parameters
tidtable id
rowrow number
colcolumn number
indexindex number
itemshow many
value(out) actual value
Returns
0 iff okay

Definition at line 4559 of file flames_midas_def.c.

References tcawr().

int flames_midas_tcawrd ( int  tid,
int  row,
int  col,
int  index,
int  items,
const double *  value 
)

Writes table element, double precision argument.

Parameters
tidtable id
rowrow number
colcolumn number
indexindex number
itemshow many
value(out) actual value
Returns
0 iff okay

Definition at line 4575 of file flames_midas_def.c.

References tcawr().

int flames_midas_tcawri ( int  tid,
int  row,
int  col,
int  index,
int  items,
const int *  value 
)
See Also
tcawrd

Definition at line 4584 of file flames_midas_def.c.

References tcawr().

int flames_midas_tcawrr ( int  tid,
int  row,
int  col,
int  index,
int  items,
const float *  value 
)
See Also
tcawrd

Definition at line 4594 of file flames_midas_def.c.

References tcawr().

int flames_midas_tcsget ( int  tid,
int  row,
int *  value 
)

Reads row selection flag.

Parameters
tidtable id
rowrow number
value(output) selection flag (1 if selected)
Returns
0 iff okay

Definition at line 4608 of file flames_midas_def.c.

References check, frame_is_open(), invariant(), load_frame(), and passure.

int flames_midas_tcsput ( int  tid,
int  row,
const int *  value 
)

Writes row selection flag.

Parameters
tidtable id
rowrow number
valueselection flag (1 if selected)
Returns
0 iff okay

Definition at line 4640 of file flames_midas_def.c.

References check, frame_is_open(), invariant(), load_frame(), and passure.