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
TBDFunction 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.
Definition at line 990 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.
- See also:
- giraffe_frame_attach_table()
Definition at line 852 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.
RINDEX
, it is removed from the table.
Definition at line 1132 of file gifiberutils.c.
References giraffe_error_pop(), giraffe_error_push(), and 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.
Definition at line 920 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
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_error_pop(), giraffe_error_push(), 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
.
Definition at line 1215 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.
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 722 of file gifiberutils.c.
References giraffe_error_pop(), giraffe_error_push(), 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.
Definition at line 1178 of file gifiberutils.c.
Referenced by giraffe_slitgeometry_create(), giraffe_slitgeometry_load(), and giraffe_transmission_compute().
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.
- See also:
- giraffe_fiberlist_load()
Definition at line 775 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 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 1302 of file gifiberutils.c.
References gi_warning().
Referenced by giraffe_fibers_select().