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

Detailed Description

TBD

Function Documentation

cxint* giraffe_create_spectrum_selection ( const cxchar *  filename,
const GiTable *  reference,
cxint *  nspec 
)

Create a spectrum selection from a reference table.

Parameters
filename
reference
nspec
Returns

Definition at line 1489 of file gifiberutils.c.

References giraffe_fiberlist_create(), and giraffe_table_get().

Referenced by giraffe_fibers_select().

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

Associate a fiberlist with a reference list.

Parameters
fibersFiber list to associate to a reference list.
referenceReference 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 991 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
frameThe frame to which the fiber table is attached.
fibersThe 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 853 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
fibersThe 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 1133 of file gifiberutils.c.

References giraffe_table_get().

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

Compare two fiber lists.

Parameters
fibersThe fiber list to compare with the reference.
referenceReference 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 921 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
filenameThe file for which the fiber table is created.
nspecNumber of spectra to process.
spectraList of spectrum indices to be used for the fiber table.
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 93 of file gifiberutils.c.

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

Referenced by giraffe_create_spectrum_selection(), 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
fibersTable 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 1216 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
filenameThe name of the file.
datasetThe data set index of the fiber table within the file.
tagThe 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 723 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
fibersThe 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 1179 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
fibersThe fiber table to save
filenameThe 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 776 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
selectionThe spectrum selection string to parse.
nspecThe 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:

1 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 1303 of file gifiberutils.c.

References gi_warning().

Referenced by giraffe_fibers_select().


This file is part of the GIRAFFE Pipeline Reference Manual 2.14.
Documentation copyright © 2002-2006 European Southern Observatory.
Generated on Wed Mar 11 2015 13:19:42 by doxygen 1.8.9.1 written by Dimitri van Heesch, © 1997-2004