31#include "moo_subtract_nod.h"
34#include "moo_badpix.h"
36#include "moo_fibres_table.h"
72 cpl_frame *nod_det_frame = NULL;
73 moo_det *nod_det = NULL;
74 cpl_propertylist *sky_header = NULL;
75 cpl_ensure(
object != NULL, CPL_ERROR_NULL_INPUT, NULL);
76 cpl_ensure(sky != NULL, CPL_ERROR_NULL_INPUT, NULL);
78 cpl_errorstate prestate = cpl_errorstate_get();
83 nod_det_frame = cpl_frame_new();
84 cpl_frame_set_filename(nod_det_frame, filename);
93 if (cpl_propertylist_has(sky_header, MOONS_QC_FRAME_RAW1)) {
94 const char *sky_filename =
95 cpl_propertylist_get_string(sky_header, MOONS_QC_FRAME_RAW1);
102 int sky_nrow = cpl_table_get_nrow(sky_fibre_table);
103 int nrow = cpl_table_get_nrow(fibre_table);
106 sky_nrow == nrow, CPL_ERROR_ILLEGAL_INPUT,
107 "OBJECT fibre table rows and sky fibre table rows doesnt match");
108 for (
int i = 0; i < nrow; i++) {
110 cpl_table_get_string(sky_fibre_table, MOO_FIBRES_TABLE_TYPE, i);
111 cpl_table_set_string(fibre_table, MOO_FIBRES_TABLE_TYPE_NOD, i, t);
114 cpl_frame_delete(nod_det_frame);
115 if (!cpl_errorstate_is_equal(prestate)) {
cpl_error_code moo_det_rescale_using_exptime(moo_det *self, moo_det *det)
Rescale using exptime factor.
cpl_propertylist * moo_det_get_primary_header(moo_det *self)
Get the PRIMARY HEADER in DET.
moo_det * moo_det_create(const cpl_frame *frame)
Create a new moo_det from the given DET frame.
void moo_det_save(moo_det *self, const char *filename)
Save a moo_det to a FITS file.
cpl_table * moo_det_get_fibre_table(moo_det *self)
Get the FIBRE TABLE in DET.
cpl_error_code moo_det_load(moo_det *self, unsigned int level)
Load all parts in DET.
cpl_error_code moo_det_subtract(moo_det *self, moo_det *det)
Subtract DET structure.
void moo_det_delete(moo_det *self)
Delete a moo_det.
cpl_error_code moo_fibres_table_add_nod_cols(cpl_table *table)
add nod additional columns
moo_det * moo_subtract_nod(moo_det *object, moo_det *sky, const char *filename)
Sky from object subtraction.
cpl_error_code moo_qc_set_frame_raw2(cpl_propertylist *plist, const char *val)
Set the QC.FRAME.RAW2 value.