28 #include <cxstrutils.h>
29 #include <cxmessages.h>
31 #include <cpl_propertylist.h>
33 #include <cpl_error.h>
39 #include "gimessages.h"
41 #include "gifiberutils.h"
53 _giraffe_compare_int(cxcptr first, cxcptr second)
56 cxint *_first = (cxint *)first;
57 cxint *_second = (cxint *)second;
59 return *_first - *_second;
89 const cxchar *
const fctid =
"giraffe_fiberlist_create";
100 cx_string *slit_name = NULL;
102 cpl_table *fibers = NULL;
106 cpl_propertylist *properties = NULL;
107 cpl_propertylist *sorting_order = NULL;
109 GiTable *slits = NULL;
110 GiTable *ozpoz = NULL;
112 GiInstrumentMode mode;
126 properties = cpl_propertylist_load(filename, 0);
128 if (properties == NULL) {
129 cpl_msg_error(fctid,
"Cannot load properties of data set 0 "
130 "from `%s'!", filename);
131 cpl_propertylist_delete(properties);
136 if (!cpl_propertylist_has(properties, GIALIAS_STSCFF) &&
137 !cpl_propertylist_has(properties, GIALIAS_STSCTAL)) {
138 cpl_msg_warning(fctid,
"%s: Properties (%s, %s) not found! "
139 "Simultaneous calibration lamps assumed to "
140 "be off!", filename, GIALIAS_STSCFF,
146 cxint scff = cpl_propertylist_get_bool(properties,
148 cxint sctal= cpl_propertylist_get_bool(properties,
153 cpl_msg_info(fctid,
"Simultaneous calibration lamps "
158 cpl_msg_info(fctid,
"Simultaneous calibration lamps "
167 cx_string_create(cpl_propertylist_get_string(properties,
170 cpl_msg_error(fctid,
"%s: Property (%s) not found!", filename,
172 cpl_propertylist_delete(properties);
176 cx_string_strip(slit_name);
181 if (mode == GIMODE_NONE) {
182 cpl_msg_error(fctid,
"Invalid instrument mode!");
184 cx_string_delete(slit_name);
185 cpl_propertylist_delete(properties);
190 cpl_propertylist_delete(properties);
199 cx_assert(ozpoz != NULL);
201 giraffe_error_push();
207 if (cpl_error_get_code() == CPL_ERROR_BAD_FILE_FORMAT) {
208 cpl_msg_error(fctid,
"Data set %d in `%s' is not an "
209 "OzPoz table!", GIOZPOZ_EXTENSION, filename);
211 cpl_table_delete(fibers);
217 cpl_msg_error(fctid,
"No OzPoz table found in `%s'!",
223 cpl_msg_warning(fctid,
"Empty OzPoz table found in `%s'.",
239 cx_assert(slits != NULL);
241 giraffe_error_push();
245 if (cpl_error_get_code() == CPL_ERROR_BAD_FILE_FORMAT) {
246 cpl_msg_error(fctid,
"Data set %d in `%s' is not a fiber table!",
247 GIFIBER_EXTENSION, filename);
252 cpl_msg_error(fctid,
"Cannot load data set %d (fiber table) "
253 "from `%s'!", GIFIBER_EXTENSION, filename);
268 cpl_table_select_all(_slits);
269 cpl_table_and_selected_string(_slits,
"Slit", CPL_NOT_EQUAL_TO,
270 cx_string_get(slit_name));
272 giraffe_error_push();
274 cpl_table_erase_selected(_slits);
276 if (cpl_error_get_code() != CPL_ERROR_NONE) {
277 cpl_msg_error(fctid,
"Invalid slit `%s' selected. No fibers found.",
278 cx_string_get(slit_name));
280 cx_string_delete(slit_name);
291 cx_string_delete(slit_name);
300 nfibers = cpl_table_get_nrow(_slits);
301 fibers = cpl_table_new(nfibers);
303 giraffe_error_push();
305 cpl_table_new_column(fibers,
"INDEX", CPL_TYPE_INT);
306 cpl_table_new_column(fibers,
"FPS", CPL_TYPE_INT);
307 cpl_table_new_column(fibers,
"SSN", CPL_TYPE_INT);
308 cpl_table_new_column(fibers,
"PSSN", CPL_TYPE_INT);
309 cpl_table_new_column(fibers,
"RP", CPL_TYPE_INT);
311 for (i = 0; i < nfibers; i++) {
315 cxint fps = strtol(cpl_table_get_string(_slits,
"FPS", i), NULL, 10);
316 cxint ssn = strtol(cpl_table_get_string(_slits,
"SSN", i), NULL, 10);
317 cxint pssn = strtol(cpl_table_get_string(_slits,
"PSSN", i),
322 s = (cxchar*) cpl_table_get_string(_slits,
"RP", i);
325 rp = strtol(s, NULL, 10);
328 if (mode == GIMODE_ARGUS) {
330 const cxchar *rpid = cpl_table_get_string(_slits,
333 if (cx_strncasecmp(rpid,
"Cal", 3) != 0) {
340 cpl_table_set_int(fibers,
"FPS", i, fps);
341 cpl_table_set_int(fibers,
"SSN", i, ssn);
342 cpl_table_set_int(fibers,
"PSSN", i, pssn);
343 cpl_table_set_int(fibers,
"RP", i, rp);
347 if (mode == GIMODE_IFU || mode == GIMODE_ARGUS) {
349 if (cpl_table_has_column(_slits,
"X") &&
350 cpl_table_has_column(_slits,
"Y")) {
352 cpl_table_new_column(fibers,
"X", CPL_TYPE_INT);
353 cpl_table_new_column(fibers,
"Y", CPL_TYPE_INT);
355 for (i = 0; i < nfibers; i++) {
362 s = cpl_table_get_string(_slits,
"X", i);
365 x = strtol(s, NULL, 10);
368 s = cpl_table_get_string(_slits,
"Y", i);
371 y = strtol(s, NULL, 10);
374 cpl_table_set_int(fibers,
"X", i, x);
375 cpl_table_set_int(fibers,
"Y", i, y);
382 cpl_table_move_column(fibers,
"Retractor", _slits);
384 if (cpl_error_get_code() != CPL_ERROR_NONE) {
385 cpl_msg_error(fctid,
"Data set %d in `%s' is not a valid "
386 "fiber table!", GIFIBER_EXTENSION, filename);
388 cpl_table_delete(fibers);
403 if (mode == GIMODE_ARGUS) {
405 sorting_order = cpl_propertylist_new();
407 cpl_propertylist_append_bool(sorting_order,
"FPS", 1);
408 cpl_table_sort(fibers, sorting_order);
410 cpl_propertylist_delete(sorting_order);
411 sorting_order = NULL;
420 for (i = 0; i < nfibers; i++) {
422 const cxchar *s = cpl_table_get_string(fibers,
"Retractor", i);
425 if (strstr(s,
"Calibration")) {
426 cpl_table_set_int(fibers,
"RP", i, -1);
429 cpl_table_set_int(fibers,
"INDEX", i, i + 1);
433 if (!cpl_table_has_column(fibers,
"FPD")) {
434 cpl_table_duplicate_column(fibers,
"FPD", fibers,
"INDEX");
437 cpl_table_new_column(fibers,
"OBJECT", CPL_TYPE_STRING);
438 cpl_table_new_column(fibers,
"R", CPL_TYPE_DOUBLE);
439 cpl_table_new_column(fibers,
"THETA", CPL_TYPE_DOUBLE);
440 cpl_table_new_column(fibers,
"ORIENT", CPL_TYPE_DOUBLE);
441 cpl_table_new_column(fibers,
"TYPE", CPL_TYPE_STRING);
443 cpl_table_fill_column_window_double(fibers,
"R", 0, nfibers, 0.);
444 cpl_table_fill_column_window_double(fibers,
"THETA", 0, nfibers, 0.);
445 cpl_table_fill_column_window_double(fibers,
"ORIENT", 0, nfibers, 0.);
447 if (_ozpoz != NULL) {
448 if (cpl_table_has_column(_ozpoz,
"RA")) {
449 cpl_table_new_column(fibers,
"RA", CPL_TYPE_DOUBLE);
450 cpl_table_fill_column_window_double(fibers,
"RA", 0,
454 if (cpl_table_has_column(_ozpoz,
"DEC")) {
455 cpl_table_new_column(fibers,
"DEC", CPL_TYPE_DOUBLE);
456 cpl_table_fill_column_window_double(fibers,
"DEC", 0,
460 if (cpl_table_has_column(_ozpoz,
"MAGNITUDE")) {
461 cpl_table_new_column(fibers,
"MAGNITUDE", CPL_TYPE_DOUBLE);
462 cpl_table_fill_column_window_double(fibers,
"MAGNITUDE", 0,
466 if (cpl_table_has_column(_ozpoz,
"B_V")) {
467 cpl_table_new_column(fibers,
"B_V", CPL_TYPE_DOUBLE);
468 cpl_table_fill_column_window_double(fibers,
"B_V", 0,
482 nbuttons = _ozpoz == NULL ? 0 : cpl_table_get_nrow(_ozpoz);
484 cpl_table_select_all(fibers);
486 for (i = 0; i < nfibers; i++) {
488 cxbool missing = TRUE;
490 cxint fiber = cpl_table_get_int(fibers,
"RP", i, NULL);
499 if (fiber == -1 && calsim == TRUE) {
500 cpl_table_set_string(fibers,
"OBJECT", i,
"CALSIM");
501 cpl_table_unselect_row(fibers, i);
504 else if (fiber == 0 && mode == GIMODE_ARGUS) {
505 cpl_table_unselect_row(fibers, i);
513 for (j = 0; j < nbuttons; j++) {
515 cxint button = cpl_table_get_int(_ozpoz,
"BUTTON", j, NULL);
518 if (fiber == button) {
519 const cxchar *object;
522 cxdouble r, theta, orient;
530 object = cpl_table_get_string(_ozpoz,
"OBJECT", j);
531 otype = cpl_table_get_string(_ozpoz,
"TYPE", j);
533 r = cpl_table_get_double(_ozpoz,
"R", j, NULL);
534 theta = cpl_table_get_double(_ozpoz,
"THETA", j, NULL);
535 orient = cpl_table_get_double(_ozpoz,
"ORIENT", j, NULL);
537 if (cpl_table_has_column(_ozpoz,
"RA")) {
538 ra = cpl_table_get_double(_ozpoz,
"RA", j, NULL);
541 if (cpl_table_has_column(_ozpoz,
"DEC")) {
542 dec = cpl_table_get_double(_ozpoz,
"DEC", j, NULL);
545 if (cpl_table_has_column(_ozpoz,
"MAGNITUDE")) {
546 mag = cpl_table_get_float(_ozpoz,
"MAGNITUDE", j,
550 if (cpl_table_has_column(_ozpoz,
"B_V")) {
551 b_v = cpl_table_get_double(_ozpoz,
"B_V", j, NULL);
552 b_v = CX_CLAMP(b_v, -5., 5.);
555 cpl_table_set_string(fibers,
"OBJECT", i,
object);
556 cpl_table_set_string(fibers,
"TYPE", i, otype);
558 cpl_table_set_double(fibers,
"R", i, r);
559 cpl_table_set_double(fibers,
"THETA", i, theta);
560 cpl_table_set_double(fibers,
"ORIENT", i, orient);
562 if (cpl_table_has_column(fibers,
"RA")) {
563 cpl_table_set_double(fibers,
"RA", i, ra);
566 if (cpl_table_has_column(fibers,
"DEC")) {
567 cpl_table_set_double(fibers,
"DEC", i, dec);
570 if (cpl_table_has_column(fibers,
"MAGNITUDE")) {
571 cpl_table_set_double(fibers,
"MAGNITUDE", i, mag);
574 if (cpl_table_has_column(fibers,
"B_V")) {
575 cpl_table_set_double(fibers,
"B_V", i, b_v);
578 cpl_table_unselect_row(fibers, i);
585 if (missing == TRUE) {
587 cxint _fps = cpl_table_get_int(fibers,
"FPS", i, NULL);
588 cpl_msg_debug(fctid,
"Fiber at FPS = %d is not used", _fps);
595 giraffe_error_push();
597 cpl_table_erase_selected(fibers);
599 if (cpl_error_get_code() != CPL_ERROR_NONE) {
600 cpl_table_delete(fibers);
616 if (spectra && nspec > 0) {
618 register cxint rows = cpl_table_get_nrow(fibers);
621 cx_assert(cpl_table_get_column_type(fibers,
"FPD") == CPL_TYPE_INT);
623 cpl_table_select_all(fibers);
625 for (i = 0; i < rows; i++) {
628 register cxint selected = 0;
629 register cxint idx = cpl_table_get_int(fibers,
"FPD", i, NULL);
632 for (j = 0; j < nspec; j++) {
633 if (idx == spectra[j]) {
640 cpl_table_unselect_row(fibers, i);
643 cpl_table_select_row(fibers, i);
648 giraffe_error_push();
650 cpl_table_erase_selected(fibers);
652 if (cpl_error_get_code() != CPL_ERROR_NONE) {
653 cpl_table_delete(fibers);
666 for (i = 0; i < cpl_table_get_nrow(fibers); i++) {
667 cpl_table_set_int(fibers,
"INDEX", i, i + 1);
675 cx_assert(sorting_order == NULL);
677 sorting_order = cpl_propertylist_new();
678 cpl_propertylist_append_bool(sorting_order,
"INDEX", 0);
680 cpl_table_sort(fibers, sorting_order);
682 cpl_propertylist_delete(sorting_order);
683 sorting_order = NULL;
719 const cxchar *fctid =
"giraffe_fiberlist_load";
725 cx_assert(fibers != NULL);
727 giraffe_error_push();
730 if (cpl_error_get_code() == CPL_ERROR_BAD_FILE_FORMAT) {
731 cpl_msg_error(fctid,
"Data set %d in `%s' is not a fiber table!",
737 cpl_msg_error(fctid,
"Cannot load data set %d (fiber table) "
738 "from `%s'!", dataset, filename);
771 const cxchar *fctid =
"giraffe_fiberlist_save";
773 cxbool created = FALSE;
777 cpl_propertylist *properties = NULL;
778 cpl_table *table = NULL;
781 if (fibers == NULL || filename == NULL) {
782 cpl_error_set(fctid, CPL_ERROR_NULL_INPUT);
789 cpl_error_set(fctid, CPL_ERROR_DATA_NOT_FOUND);
795 if (properties == NULL) {
796 properties = cpl_propertylist_new();
798 cpl_propertylist_append_string(properties, GIALIAS_EXTNAME,
799 GIFRAME_FIBER_SETUP);
805 if (cpl_propertylist_has(properties, GIALIAS_EXTNAME)) {
806 cpl_propertylist_set_string(properties, GIALIAS_EXTNAME,
807 GIFRAME_FIBER_SETUP);
810 cpl_propertylist_append_string(properties, GIALIAS_EXTNAME,
811 GIFRAME_FIBER_SETUP);
814 cpl_propertylist_set_comment(properties, GIALIAS_EXTNAME,
815 "FITS Extension name");
817 code = cpl_table_save(table, NULL, properties, filename, CPL_IO_EXTEND);
819 if (created == TRUE) {
820 cpl_propertylist_delete(properties);
823 return code == CPL_ERROR_NONE ? 0 : 1;
848 const cxchar *fctid =
"giraffe_fiberlist_attach";
851 cxbool created = FALSE;
855 cpl_propertylist *properties = NULL;
857 GiTable *_fibers = NULL;
860 if (frame == NULL || fibers == NULL) {
861 cpl_error_set(fctid, CPL_ERROR_NULL_INPUT);
869 if (properties == NULL) {
870 properties = cpl_propertylist_new();
882 if (created == TRUE) {
883 cpl_propertylist_delete(properties);
914 const GiTable *reference)
924 if (_fibers == NULL || _reference == NULL) {
928 if (!cpl_table_has_column(_fibers,
"FPS") ||
929 !cpl_table_has_column(_reference,
"FPS")) {
934 for (i = 0; i < cpl_table_get_nrow(_reference); i++) {
936 cxbool found = FALSE;
939 cxint fps = cpl_table_get_int(_reference,
"FPS", i, NULL);
941 for (j = 0; j < cpl_table_get_nrow(_fibers); j++) {
942 cxint _fps = cpl_table_get_int(_fibers,
"FPS", j, NULL);
950 if (found == FALSE) {
986 const cxchar *fctid =
"giraffe_fiberlist_associate";
993 cpl_table *_fibers = NULL;
994 cpl_table *_reference = NULL;
997 if (fibers == NULL) {
998 cpl_error_set(fctid, CPL_ERROR_NULL_INPUT);
1002 if (reference == NULL) {
1003 cpl_error_set(fctid, CPL_ERROR_NULL_INPUT);
1010 if (!cpl_table_has_column(_fibers,
"FPS")) {
1011 cpl_error_set(fctid, CPL_ERROR_ILLEGAL_INPUT);
1015 if (!cpl_table_has_column(_reference,
"FPS")) {
1016 cpl_error_set(fctid, CPL_ERROR_ILLEGAL_INPUT);
1027 if (!cpl_table_has_column(_fibers,
"RINDEX")) {
1029 cxint size = cpl_table_get_nrow(_fibers);
1031 cxint status = cpl_table_duplicate_column(_fibers,
"RINDEX",
1034 if (status != CPL_ERROR_NONE) {
1038 status = cpl_table_fill_column_window_int(_fibers,
"RINDEX", 0,
1041 if (status != CPL_ERROR_NONE) {
1054 nf = cpl_table_get_nrow(_fibers);
1055 nr = cpl_table_get_nrow(_reference);
1057 cpl_table_unselect_all(_fibers);
1059 for (i = 0; i < nf; i++) {
1063 cxint fps = cpl_table_get_int(_fibers,
"FPS", i, NULL);
1066 for (j = 0; j < nr; j++) {
1068 cxint _fps = cpl_table_get_int(_reference,
"FPS", j, NULL);
1073 cxint ridx = cpl_table_get_int(_reference,
"INDEX", j, NULL);
1075 cpl_table_set_int(_fibers,
"RINDEX", i, ridx);
1076 cpl_table_select_row(_fibers, i);
1090 _fibers = cpl_table_extract_selected(_fibers);
1097 for (i = 0; i < cpl_table_get_nrow(_fibers); i++) {
1098 cpl_table_set_int(_fibers,
"INDEX", i, i + 1);
1104 cpl_table_delete(_fibers);
1128 cpl_table* _fibers = NULL;
1130 if (fibers == NULL) {
1136 if (_fibers == NULL) {
1140 giraffe_error_push();
1142 if (cpl_table_has_column(_fibers,
"RINDEX") == TRUE) {
1143 cpl_table_erase_column(_fibers,
"RINDEX");
1146 if (cpl_error_get_code() != CPL_ERROR_NONE) {
1150 giraffe_error_pop();
1174 const cxchar *names[] = {
"RINDEX",
"INDEX", NULL};
1175 const cxchar **idx = names;
1178 while (*idx != NULL) {
1180 if (cpl_table_has_column((cpl_table *)fibers, *idx) != 0) {
1213 cpl_array* subslits = NULL;
1216 cx_assert(fibers != NULL);
1218 nfibers = cpl_table_get_nrow(fibers);
1228 subslits = cpl_array_new(nfibers, CPL_TYPE_INT);
1229 cpl_array_fill_window(subslits, 0, nfibers, 0);
1231 ssn = cpl_array_get_data_int(subslits);
1238 for (i = 0; i < nfibers; ++i) {
1239 ssn[i] = cpl_table_get_int(fibers,
"SSN", i, NULL);
1242 qsort(ssn, nfibers,
sizeof(cxint), _giraffe_compare_int);
1249 for (i = 1; i < nfibers; ++i) {
1250 if (ssn[i] != ssn[nss]) {
1251 ssn[++nss] = ssn[i];
1256 cpl_array_set_size(subslits, nss);
1298 cxchar **lists = NULL;
1299 cxchar **ranges = NULL;
1304 cxint *fibers = NULL;
1305 cxint *_fibers = NULL;
1307 cx_slist *fl = NULL;
1309 cx_slist_iterator pos;
1314 lists = cx_strsplit(selection,
";", 2);
1316 if (lists == NULL) {
1320 if (lists[1] != NULL) {
1321 gi_warning(
"Usage of fiber exclusion lists is not supported! "
1322 "The given exclusion list is ignored!");
1325 ranges = cx_strsplit(lists[0],
",", -1);
1327 if (ranges == NULL) {
1333 while (ranges[i] != NULL) {
1335 cxchar **bounds = cx_strsplit(ranges[i],
"-", 2);
1340 if (bounds == NULL) {
1341 cx_strfreev(ranges);
1358 lower = strtol(bounds[0], &last, 10);
1360 if (*last !=
'\0') {
1361 cx_strfreev(bounds);
1362 cx_strfreev(ranges);
1372 if (bounds[1] != NULL) {
1374 upper = strtol(bounds[1], &last, 10);
1376 if (*last !=
'\0') {
1377 cx_strfreev(bounds);
1378 cx_strfreev(ranges);
1389 upper = upper > 0 ? upper : lower;
1391 if (lower <= 0 || upper <= 0 || upper < lower) {
1392 cx_strfreev(bounds);
1393 cx_strfreev(ranges);
1405 if (upper > lower) {
1406 nfibers += upper - lower;
1409 fibers = cx_realloc(fibers, nfibers *
sizeof(cxint));
1411 for (j = first; j < nfibers; j++) {
1412 fibers[j] = lower + j - first;
1419 cx_strfreev(bounds);
1426 cx_strfreev(ranges);
1429 qsort(fibers, nfibers,
sizeof(cxint), _giraffe_compare_int);
1436 fl = cx_slist_new();
1438 for (i = 0; i < nfibers; i++) {
1439 cx_slist_push_back(fl, fibers + i);
1442 cx_slist_unique(fl, _giraffe_compare_int);
1444 nfibers = cx_slist_size(fl);
1445 _fibers = cx_malloc(nfibers *
sizeof(cxint));
1449 pos = cx_slist_begin(fl);
1450 while (pos != cx_slist_end(fl)) {
1452 cxint *fn = cx_slist_get(fl, pos);
1454 cx_assert(fn != NULL);
1457 pos = cx_slist_next(fl, pos);
1460 cx_slist_delete(fl);
1482 const GiTable *reference, cxint *nspec)
1490 cxint nfibers = cpl_table_get_nrow(fibers);
1491 cxint nactive = cpl_table_get_nrow(_reference);
1492 cxint *spectra = NULL;
1495 if (fibers == NULL) {
1499 if (!cpl_table_has_column(fibers,
"FPS") ||
1500 !cpl_table_has_column(fibers,
"FPD")) {
1501 cpl_table_delete(fibers);
1505 if (!cpl_table_has_column(_reference,
"FPS")) {
1506 cpl_table_delete(fibers);
1510 if (nactive > nfibers) {
1511 cpl_table_delete(fibers);
1516 spectra = cx_malloc(nactive *
sizeof(cxint));
1518 for (i = 0; i < nactive; ++i) {
1521 cxint fps = cpl_table_get_int(_reference,
"FPS", i, NULL);
1523 for (j = 0; j < nfibers; ++j) {
1525 cxint _fps = cpl_table_get_int(fibers,
"FPS", j, NULL);
1526 cxint _fpd = cpl_table_get_int(fibers,
"FPD", j, NULL);
1529 spectra[nspectra] = _fpd;
1538 cpl_table_delete(fibers);
1540 if (nspectra < nactive) {
1541 spectra = cx_realloc(spectra, nspectra *
sizeof(cxint));
1544 qsort(spectra, nspectra,
sizeof(cxint), _giraffe_compare_int);
cxint * giraffe_create_spectrum_selection(const cxchar *filename, const GiTable *reference, cxint *nspec)
Create a spectrum selection from a reference table.
cxint * giraffe_parse_spectrum_selection(const cxchar *selection, cxint *nspec)
Parses a spectrum selection string.
cpl_table * giraffe_fiberlist_create(const cxchar *filename, cxint nspec, const cxint *spectra)
Creates the fiber table.
cxint giraffe_fiberlist_save(GiTable *fibers, const cxchar *filename)
Save a fiber table to a file.
cxint giraffe_fiberlist_compare(const GiTable *fibers, const GiTable *reference)
Compare two fiber lists.
cxint giraffe_fiberlist_attach(cpl_frame *frame, GiTable *fibers)
Attach a fiber table to a frame.
GiTable * giraffe_fiberlist_load(const cxchar *filename, cxint dataset, const cxchar *tag)
Load a fiber table from a file.
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_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.
cxint giraffe_frame_attach_table(cpl_frame *frame, GiTable *table, const cxchar *tag, cxbool update)
Attach a table to a product frame.
void gi_warning(const cxchar *format,...)
Log a warning.
cxint giraffe_table_set(GiTable *self, cpl_table *table)
Sets the table data.
cxint giraffe_table_load(GiTable *self, const cxchar *filename, cxint position, const cxchar *id)
Reads a data set from a file into a Giraffe table.
cpl_propertylist * giraffe_table_get_properties(const GiTable *self)
Gets the table properties.
GiTable * giraffe_table_new(void)
Creates a new, empty Giraffe table.
void giraffe_table_delete(GiTable *self)
Destroys a Giraffe table.
cpl_table * giraffe_table_get(const GiTable *self)
Get the table data from a Giraffe table.
GiTable * giraffe_table_duplicate(const GiTable *src)
Duplicate a Giraffe table.
cxint giraffe_table_set_properties(GiTable *self, cpl_propertylist *properties)
Attaches a property list to an table.
GiInstrumentMode giraffe_get_mode(cpl_propertylist *properties)
Determines the instrument mode from a property list.