GIRAFFE Pipeline Reference Manual

Fiber Positioner Utilities

Functions

cpl_table * giraffe_fiberlist_create (const cxchar *filename, cxint nspec, const cxint *spectra)
 Creates the fiber table.
GiTable * giraffe_fiberlist_load (const cxchar *filename, cxint dataset, const cxchar *tag)
 Load a fiber table from a file.
cxint giraffe_fiberlist_save (GiTable *fibers, const cxchar *filename)
 Save a fiber table to a file.
cxint giraffe_fiberlist_attach (cpl_frame *frame, GiTable *fibers)
 Attach a fiber table to a frame.
cxint giraffe_fiberlist_compare (const GiTable *fibers, const GiTable *reference)
 Compare two fiber lists.
cxint giraffe_fiberlist_associate (GiTable *fibers, const GiTable *reference)
 Associate a fiberlist with a reference list.
cxint giraffe_fiberlist_clear_index (GiTable *fibers)
 Remove the reference index column from a fiber list.
const cxchar * giraffe_fiberlist_query_index (const cpl_table *fibers)
 Query a fiber list for the name of the fiber reference index column.
cpl_array * giraffe_fiberlist_get_subslits (const cpl_table *fibers)
 Get the list of subslit identifiers from a fiber setup.
cxint * giraffe_parse_spectrum_selection (const cxchar *selection, cxint *nspec)
 Parses a spectrum selection string.

Detailed Description

TBD


Function Documentation

cxint giraffe_fiberlist_associate ( GiTable *  fibers,
const GiTable *  reference 
)

Associate a fiberlist with a reference list.

Parameters:
fibers Fiber list to associate to a reference list.
reference Reference fiber list.
Returns:
The function returns 0 on success and a non-zero value in case an error occurred. In the latter case an appropriate error code is also set.

The function associates all fibers in the source fiber list fibers which have a corresponding entry in the reference fiber list reference. To associate the source fiber list to the reference list a table column `RINDEX' is added to fibers, if it does not already exist. For each fiber having an entry in both tables the appropriate table cell of the column `RINDEX' is filled with the fiber index (column `INDEX') from the reference table.

Definition at line 986 of file gifiberutils.c.

References giraffe_table_get(), and giraffe_table_set().

Referenced by giraffe_fibers_setup().

cxint giraffe_fiberlist_attach ( cpl_frame *  frame,
GiTable *  fibers 
)

Attach a fiber table to a frame.

Parameters:
frame The frame to which the fiber table is attached.
fibers The fiber table to attach.
Returns:
The function returns 0 on success or 1 otherwise. If an error occurred an appropriate error code is also set.

The function appends the fiber table fibers to the disk file indicated by the filename property of the frame frame.

See also:
giraffe_frame_attach_table()

Definition at line 848 of file gifiberutils.c.

References giraffe_frame_attach_table(), giraffe_table_delete(), giraffe_table_duplicate(), giraffe_table_get(), giraffe_table_get_properties(), and giraffe_table_set_properties().

cxint giraffe_fiberlist_clear_index ( GiTable *  fibers  ) 

Remove the reference index column from a fiber list.

Parameters:
fibers The fiber list to update.
Returns:
The function returns 0 on success and a non-zero value otherwise.

If the fiber list fibers contains a columns RINDEX, it is removed from the table.

Definition at line 1128 of file gifiberutils.c.

References giraffe_table_get().

cxint giraffe_fiberlist_compare ( const GiTable *  fibers,
const GiTable *  reference 
)

Compare two fiber lists.

Parameters:
fibers The fiber list to compare with the reference.
reference Reference fiber list.
Returns:
The function returns 1 if the fiber lists are 'equal', or 0 if they are not 'equal'. In case an error occurs, the function returns a negative number.

The function verifies that the fiber list fibers contains the same set of fibers, or is a sub set of the fibers listed in reference. Fibers are identified using their fiber position within the slit, i.e. both tables must have a column named 'FPS'.

Definition at line 916 of file gifiberutils.c.

References giraffe_table_get().

cpl_table* giraffe_fiberlist_create ( const cxchar *  filename,
cxint  nspec,
const cxint *  spectra 
)

Creates the fiber table.

Parameters:
filename The file for which the fiber table is created.
nspec Number of spectra to process.
spectra List of spectrum indices to restrict the fiber table to.
Returns:
On success the function returns the created fiber table, or NULL otherwise

The function builds a table of fibers which have to be processed from the slit geometry file slitfile and an OzPoz table if it is present in the input file filename. If spectra is not NULL only the spectra listed in spectra are used to build the fiber table.

Warning:
The option to use a list of spectra for building the fiber table is not yet implemented.

Definition at line 92 of file gifiberutils.c.

References giraffe_get_mode(), giraffe_table_delete(), giraffe_table_get(), giraffe_table_load(), and giraffe_table_new().

Referenced by giraffe_fibers_select(), and giraffe_fibers_setup().

cpl_array* giraffe_fiberlist_get_subslits ( const cpl_table *  fibers  ) 

Get the list of subslit identifiers from a fiber setup.

Parameters:
fibers Table containing the fiber setup.
Returns:
The function returns an array with the subslit id numbers, or, in case an error occurred NULL.

The function retrieves all subslit identifiers (SSN numbers) from the fiber setup fibers, for all subslits which contain at least one fiber.

Definition at line 1211 of file gifiberutils.c.

Referenced by giraffe_fov_build().

GiTable* giraffe_fiberlist_load ( const cxchar *  filename,
cxint  dataset,
const cxchar *  tag 
)

Load a fiber table from a file.

Parameters:
filename The name of the file.
dataset The data set index of the fiber table within the file.
tag The data set name of the fiber table.
Returns:
The function returns a table containing the fiber setup if no error occurred, or NULL otherwise.

The function reads the fiber table from the data set dataset of the file filename. If the data set identifier tag is not NULL, it is used to validate the data set with the number dataset to contain a fiber setup. In this case tag must match the data set name to be considered as a valid fiber setup.

The fiber tables which can be loaded using this function have to be created with giraffe_fiberlist_create().

See also:
giraffe_fiberlist_create()

Definition at line 718 of file gifiberutils.c.

References giraffe_table_delete(), giraffe_table_load(), and giraffe_table_new().

Referenced by giraffe_fibers_setup(), and giraffe_transmission_attach().

const cxchar* giraffe_fiberlist_query_index ( const cpl_table *  fibers  ) 

Query a fiber list for the name of the fiber reference index column.

Parameters:
fibers The fiber list to query.
Returns:
The function returns the name of the reference index column, or NULL if an error occurred.

The function queries the fiber list fibers for the name of the reference index column to be used when processing fibers. This name refers to the column which contains the index of a given fiber in an associated calibration frame (typically the fiber localization).

Definition at line 1174 of file gifiberutils.c.

Referenced by giraffe_slitgeometry_create(), and giraffe_slitgeometry_load().

cxint giraffe_fiberlist_save ( GiTable *  fibers,
const cxchar *  filename 
)

Save a fiber table to a file.

Parameters:
fibers The fiber table to save
filename The name of the file.
Returns:
The function returns 0 on success or 1 otherwise. If an error occurred an appropriate error code is also set.

The function saves the fiber table fibers as an attachment to the file filename.

See also:
giraffe_fiberlist_load()

Definition at line 771 of file gifiberutils.c.

References giraffe_table_get(), giraffe_table_get_properties(), and giraffe_table_set_properties().

cxint* giraffe_parse_spectrum_selection ( const cxchar *  selection,
cxint *  nspec 
)

Parses a spectrum selection string.

Parameters:
selection The spectrum selection string to parse.
nspec The number of selected spectra.
Returns:
The function returns an array of spectrum indices of the selected spectra. The number of the selected spectra is returned in nspec.

The function parses the spectrum selection string selection and creates an array of indices from it. Each entry in the returned array is the number of the selected spectrum, i.e. the position in the slit. Counting of spectra starts at 1.

The string to be parsed is a comma separated list of individual spectrum indices (the position of the spectrum within the slit), index ranges with a following, optional step size. Spectra may be excluded explicitly by listing their indices in the same way as described for selected spectra. If spectra should be excluded the list of exclusions must follow the list of selected spectra separated by a semicolon:

    selection = "1,3,5,10-20,30-60:2;12-15,32";

The created array can be deallocated by a call to cx_free().

Definition at line 1298 of file gifiberutils.c.

References gi_warning().

Referenced by giraffe_fibers_select().


This file is part of the GIRAFFE Pipeline Reference Manual 2.8.8.
Documentation copyright © 2002-2006 European Southern Observatory.
Generated on Fri Mar 4 10:50:29 2011 by doxygen 1.6.3 written by Dimitri van Heesch, © 1997-2004