17#include "moo_params.h"
19#include "moo_badpix.h"
20#include "moo_products.h"
21#include "moo_region.h"
23#include "moo_telluric.h"
24#include "moo_target_table.h"
25#include "irplib_ksigma_clip.h"
52 const cpl_parameterlist *parlist,
54 const char *pipeline_id)
56 cpl_ensure(framelist != NULL, CPL_ERROR_NULL_INPUT, NULL);
57 cpl_ensure(parlist != NULL, CPL_ERROR_NULL_INPUT, NULL);
58 cpl_ensure(recid != NULL, CPL_ERROR_NULL_INPUT, NULL);
59 cpl_ensure(pipeline_id != NULL, CPL_ERROR_NULL_INPUT, NULL);
61 moo_products *res = cpl_calloc(1,
sizeof(moo_products));
62 res->framelist = framelist;
63 res->temporarylist = cpl_frameset_new();
64 res->parlist = parlist;
66 res->pipeline_id = pipeline_id;
87 cpl_ensure(self != NULL, CPL_ERROR_NULL_INPUT, NULL);
104_moo_products_create_frame(
const moo_products *self,
105 cpl_propertylist *header,
106 cpl_frame_level level,
108 const char *filename,
109 const cpl_frame *inherit_frame)
111 cpl_frame *product_frame = cpl_frame_new();
113 cpl_frame_set_type(product_frame, CPL_FRAME_TYPE_ANY);
114 cpl_frame_set_group(product_frame, CPL_FRAME_GROUP_PRODUCT);
115 cpl_frame_set_level(product_frame, level);
116 cpl_frame_set_tag(product_frame, tag);
118 if (filename != NULL) {
119 cpl_frame_set_filename(product_frame, filename);
122 char *name = cpl_sprintf(
"%s.fits", tag);
123 cpl_frame_set_filename(product_frame, name);
126 cpl_error_code status =
127 cpl_dfs_setup_product_header(header, product_frame, self->framelist,
128 self->parlist, self->recid,
129 self->pipeline_id, DICTIONARY_ID,
132 if (status != CPL_ERROR_NONE) {
133 cpl_frame_delete(product_frame);
134 product_frame = NULL;
136 return product_frame;
154 cpl_error_code status = CPL_ERROR_NONE;
155 cpl_ensure_code(self != NULL, CPL_ERROR_ILLEGAL_INPUT);
156 cpl_ensure_code(frame != NULL, CPL_ERROR_ILLEGAL_INPUT);
158 cpl_frame_level level = cpl_frame_get_level(frame);
160 if (level == CPL_FRAME_LEVEL_TEMPORARY) {
161 status = cpl_frameset_insert(self->temporarylist, frame);
163 else if (level == CPL_FRAME_LEVEL_INTERMEDIATE && self->keep_temp == 0) {
164 status = cpl_frameset_insert(self->temporarylist, frame);
167 status = cpl_frameset_insert(self->framelist, frame);
190 cpl_frame_level level,
192 const char *filename,
193 const cpl_frame *inherit_frame)
195 cpl_ensure(self != NULL, CPL_ERROR_NULL_INPUT, NULL);
196 cpl_ensure(det != NULL, CPL_ERROR_NULL_INPUT, NULL);
197 cpl_ensure(det->primary_header != NULL, CPL_ERROR_NULL_INPUT, NULL);
199 cpl_errorstate prestate = cpl_errorstate_get();
200 cpl_frame *product_frame = NULL;
201 const char *pname = NULL;
203 moo_try_check(product_frame =
204 _moo_products_create_frame(self, det->primary_header,
205 level, tag, filename,
208 moo_try_check(pname = cpl_frame_get_filename(product_frame),
" ");
213 if (!cpl_errorstate_is_equal(prestate)) {
214 cpl_frame_delete(product_frame);
216 return product_frame;
232 cpl_frame_level level,
234 const char *filename,
235 const cpl_frame *inherit_frame)
237 cpl_ensure(self != NULL, CPL_ERROR_NULL_INPUT, NULL);
238 cpl_ensure(loc != NULL, CPL_ERROR_NULL_INPUT, NULL);
239 cpl_ensure(loc->primary_header != NULL, CPL_ERROR_NULL_INPUT, NULL);
241 cpl_frame *product_frame = cpl_frame_new();
243 cpl_frame_set_type(product_frame, CPL_FRAME_TYPE_ANY);
244 cpl_frame_set_group(product_frame, CPL_FRAME_GROUP_PRODUCT);
245 cpl_frame_set_level(product_frame, level);
246 cpl_frame_set_tag(product_frame, tag);
247 cpl_frame_set_filename(product_frame, filename);
249 cpl_dfs_setup_product_header(loc->primary_header, product_frame,
250 self->framelist, self->parlist, self->recid,
251 self->pipeline_id, DICTIONARY_ID,
256 if (level == CPL_FRAME_LEVEL_TEMPORARY) {
257 cpl_frameset_insert(self->temporarylist, product_frame);
259 else if (level == CPL_FRAME_LEVEL_INTERMEDIATE && self->keep_temp == 0) {
260 cpl_frameset_insert(self->temporarylist, product_frame);
263 cpl_frameset_insert(self->framelist, product_frame);
266 return product_frame;
287 cpl_frame_level level,
289 const char *filename,
290 const cpl_frame *inherit_frame)
292 cpl_ensure(self != NULL, CPL_ERROR_NULL_INPUT, NULL);
293 cpl_ensure(ext != NULL, CPL_ERROR_NULL_INPUT, NULL);
294 cpl_ensure(ext->primary_header != NULL, CPL_ERROR_NULL_INPUT, NULL);
296 cpl_frame *product_frame = NULL;
297 const char *pname = NULL;
299 moo_try_check(product_frame =
300 _moo_products_create_frame(self, ext->primary_header,
301 level, tag, filename,
304 moo_try_check(pname = cpl_frame_get_filename(product_frame),
" ");
308 return product_frame;
330 cpl_frame_level level,
332 const char *filename,
333 const cpl_frame *inherit_frame)
335 cpl_ensure(self != NULL, CPL_ERROR_NULL_INPUT, NULL);
336 cpl_ensure(rbn != NULL, CPL_ERROR_NULL_INPUT, NULL);
337 cpl_ensure(rbn->primary_header != NULL, CPL_ERROR_NULL_INPUT, NULL);
339 cpl_frame *product_frame = NULL;
340 const char *pname = NULL;
342 moo_try_check(product_frame =
343 _moo_products_create_frame(self, rbn->primary_header,
344 level, tag, filename,
347 moo_try_check(pname = cpl_frame_get_filename(product_frame),
" ");
352 return product_frame;
374 cpl_frame_level level,
376 const char *filename,
377 const cpl_frame *inherit_frame)
379 cpl_ensure(self != NULL, CPL_ERROR_NULL_INPUT, NULL);
380 cpl_ensure(sci != NULL, CPL_ERROR_NULL_INPUT, NULL);
381 cpl_ensure(sci->primary_header != NULL, CPL_ERROR_NULL_INPUT, NULL);
383 cpl_frame *product_frame = NULL;
384 const char *pname = NULL;
386 moo_try_check(product_frame =
387 _moo_products_create_frame(self, sci->primary_header,
388 level, tag, filename,
391 moo_try_check(pname = cpl_frame_get_filename(product_frame),
" ");
396 return product_frame;
418 cpl_frame_level level,
420 const char *filename,
421 const cpl_frame *inherit_frame)
423 cpl_ensure(self != NULL, CPL_ERROR_NULL_INPUT, NULL);
424 cpl_ensure(resp != NULL, CPL_ERROR_NULL_INPUT, NULL);
425 cpl_ensure(resp->primary_header != NULL, CPL_ERROR_NULL_INPUT, NULL);
427 cpl_frame *product_frame = NULL;
428 const char *pname = NULL;
430 moo_try_check(product_frame =
431 _moo_products_create_frame(self, resp->primary_header,
432 level, tag, filename,
435 moo_try_check(pname = cpl_frame_get_filename(product_frame),
" ");
440 return product_frame;
462 cpl_frame_level level,
464 const char *filename,
465 const cpl_frame *inherit_frame)
467 cpl_frame *product_frame = NULL;
468 cpl_ensure(self != NULL, CPL_ERROR_NULL_INPUT, NULL);
469 cpl_ensure(tell != NULL, CPL_ERROR_NULL_INPUT, NULL);
470 cpl_ensure(tell->primary_header != NULL, CPL_ERROR_NULL_INPUT, NULL);
472 const char *pname = NULL;
474 moo_try_check(product_frame =
475 _moo_products_create_frame(self, tell->primary_header,
476 level, tag, filename,
480 moo_try_check(pname = cpl_frame_get_filename(product_frame),
" ");
485 return product_frame;
508 cpl_frame_level level,
510 const char *filename,
511 const cpl_frame *inherit_frame,
514 cpl_ensure(self != NULL, CPL_ERROR_NULL_INPUT, NULL);
515 cpl_ensure(map != NULL, CPL_ERROR_NULL_INPUT, NULL);
516 cpl_ensure(map->primary_header != NULL, CPL_ERROR_NULL_INPUT, NULL);
518 cpl_frame *product_frame = NULL;
519 const char *pname = NULL;
521 moo_try_check(product_frame =
522 _moo_products_create_frame(self, map->primary_header,
523 level, tag, filename,
526 moo_try_check(pname = cpl_frame_get_filename(product_frame),
" ");
527 moo_map_update_linetable(map, rbn);
532 return product_frame;
553 moo_molectable *mtable,
554 cpl_frame_level level,
556 const char *filename,
557 const cpl_frame *inherit_frame)
559 cpl_ensure(self != NULL, CPL_ERROR_NULL_INPUT, NULL);
560 cpl_ensure(mtable != NULL, CPL_ERROR_NULL_INPUT, NULL);
561 cpl_ensure(mtable->primary_header != NULL, CPL_ERROR_NULL_INPUT, NULL);
563 cpl_frame *product_frame = NULL;
564 const char *pname = NULL;
566 moo_try_check(product_frame =
567 _moo_products_create_frame(self, mtable->primary_header,
568 level, tag, filename,
571 moo_try_check(pname = cpl_frame_get_filename(product_frame),
" ");
576 return product_frame;
597 cpl_frame_level level,
599 const char *filename,
600 const cpl_frame *inherit_frame)
602 cpl_ensure(self != NULL, CPL_ERROR_NULL_INPUT, NULL);
603 cpl_ensure(bpm != NULL, CPL_ERROR_NULL_INPUT, NULL);
604 cpl_ensure(bpm->primary_header != NULL, CPL_ERROR_NULL_INPUT, NULL);
606 cpl_frame *product_frame = NULL;
607 const char *pname = NULL;
609 moo_try_check(product_frame =
610 _moo_products_create_frame(self, bpm->primary_header,
611 level, tag, filename,
614 moo_try_check(pname = cpl_frame_get_filename(product_frame),
" ");
619 return product_frame;
640 moo_saturate_map *saturate,
641 cpl_frame_level level,
643 const char *filename,
644 const cpl_frame *inherit_frame)
646 cpl_ensure(self != NULL, CPL_ERROR_NULL_INPUT, NULL);
647 cpl_ensure(saturate != NULL, CPL_ERROR_NULL_INPUT, NULL);
648 cpl_ensure(saturate->primary_header != NULL, CPL_ERROR_NULL_INPUT, NULL);
650 cpl_frame *product_frame = NULL;
651 const char *pname = NULL;
653 moo_try_check(product_frame =
654 _moo_products_create_frame(self, saturate->primary_header,
655 level, tag, filename,
658 moo_try_check(pname = cpl_frame_get_filename(product_frame),
" ");
663 return product_frame;
685 cpl_frame_level level,
687 const char *filename,
688 const cpl_frame *inherit_frame)
690 cpl_ensure(self != NULL, CPL_ERROR_NULL_INPUT, NULL);
691 cpl_ensure(cube != NULL, CPL_ERROR_NULL_INPUT, NULL);
692 cpl_ensure(cube->primary_header != NULL, CPL_ERROR_NULL_INPUT, NULL);
694 cpl_frame *product_frame = NULL;
695 const char *pname = NULL;
697 moo_try_check(product_frame =
698 _moo_products_create_frame(self, cube->primary_header,
699 level, tag, filename,
702 moo_try_check(pname = cpl_frame_get_filename(product_frame),
" ");
707 return product_frame;
728 cpl_frame_level level,
730 const char *filename,
731 const cpl_frame *inherit_frame)
733 cpl_ensure(self != NULL, CPL_ERROR_NULL_INPUT, NULL);
734 cpl_ensure(ttable != NULL, CPL_ERROR_NULL_INPUT, NULL);
735 cpl_ensure(ttable->primary_header != NULL, CPL_ERROR_NULL_INPUT, NULL);
737 cpl_frame *product_frame = NULL;
738 const char *pname = NULL;
740 moo_try_check(product_frame =
741 _moo_products_create_frame(self, ttable->primary_header,
742 level, tag, filename,
745 moo_try_check(pname = cpl_frame_get_filename(product_frame),
" ");
747 moo_try_check(moo_target_table_save(ttable, pname),
" ");
752 return product_frame;
756moo_products_add_f2f(moo_products *self,
758 cpl_frame_level level,
760 const char *filename,
761 const cpl_frame *inherit_frame)
763 cpl_ensure(self != NULL, CPL_ERROR_NULL_INPUT, NULL);
764 cpl_ensure(f2f != NULL, CPL_ERROR_NULL_INPUT, NULL);
765 cpl_ensure(f2f->primary_header != NULL, CPL_ERROR_NULL_INPUT, NULL);
767 cpl_frame *product_frame = cpl_frame_new();
769 cpl_frame_set_type(product_frame, CPL_FRAME_TYPE_ANY);
770 cpl_frame_set_group(product_frame, CPL_FRAME_GROUP_PRODUCT);
771 cpl_frame_set_level(product_frame, level);
772 cpl_frame_set_tag(product_frame, tag);
773 cpl_frame_set_filename(product_frame, filename);
775 cpl_dfs_setup_product_header(f2f->primary_header, product_frame,
776 self->framelist, self->parlist, self->recid,
777 self->pipeline_id, DICTIONARY_ID,
780 moo_f2f_save(f2f, filename);
782 if (level == CPL_FRAME_LEVEL_TEMPORARY) {
783 cpl_frameset_insert(self->temporarylist, product_frame);
785 else if (level == CPL_FRAME_LEVEL_INTERMEDIATE && self->keep_temp == 0) {
786 cpl_frameset_insert(self->temporarylist, product_frame);
789 cpl_frameset_insert(self->framelist, product_frame);
792 return product_frame;
796moo_products_add_psf(moo_products *self,
798 cpl_frame_level level,
800 const char *filename,
801 const cpl_frame *inherit_frame)
803 cpl_ensure(self != NULL, CPL_ERROR_NULL_INPUT, NULL);
804 cpl_ensure(psf != NULL, CPL_ERROR_NULL_INPUT, NULL);
805 cpl_ensure(psf->primary_header != NULL, CPL_ERROR_NULL_INPUT, NULL);
807 cpl_frame *product_frame = cpl_frame_new();
809 cpl_frame_set_type(product_frame, CPL_FRAME_TYPE_ANY);
810 cpl_frame_set_group(product_frame, CPL_FRAME_GROUP_PRODUCT);
811 cpl_frame_set_level(product_frame, level);
812 cpl_frame_set_tag(product_frame, tag);
813 cpl_frame_set_filename(product_frame, filename);
815 cpl_dfs_setup_product_header(psf->primary_header, product_frame,
816 self->framelist, self->parlist, self->recid,
817 self->pipeline_id, DICTIONARY_ID,
822 if (level == CPL_FRAME_LEVEL_TEMPORARY) {
823 cpl_frameset_insert(self->temporarylist, product_frame);
825 else if (level == CPL_FRAME_LEVEL_INTERMEDIATE && self->keep_temp == 0) {
826 cpl_frameset_insert(self->temporarylist, product_frame);
829 cpl_frameset_insert(self->framelist, product_frame);
832 return product_frame;
836moo_products_add_raw(moo_products *self,
838 cpl_frame_level level,
840 const char *filename,
841 const cpl_frame *inherit_frame)
843 cpl_ensure(self != NULL, CPL_ERROR_NULL_INPUT, NULL);
844 cpl_ensure(raw != NULL, CPL_ERROR_NULL_INPUT, NULL);
845 cpl_ensure(raw->primary_header != NULL, CPL_ERROR_NULL_INPUT, NULL);
847 cpl_frame *product_frame = cpl_frame_new();
849 cpl_frame_set_type(product_frame, CPL_FRAME_TYPE_ANY);
850 cpl_frame_set_group(product_frame, CPL_FRAME_GROUP_PRODUCT);
851 cpl_frame_set_level(product_frame, level);
852 cpl_frame_set_tag(product_frame, tag);
853 cpl_frame_set_filename(product_frame, filename);
855 cpl_dfs_setup_product_header(raw->primary_header, product_frame,
856 self->framelist, self->parlist, self->recid,
857 self->pipeline_id, DICTIONARY_ID,
860 if (level == CPL_FRAME_LEVEL_TEMPORARY) {
861 cpl_frameset_insert(self->temporarylist, product_frame);
863 else if (level == CPL_FRAME_LEVEL_INTERMEDIATE && self->keep_temp == 0) {
864 cpl_frameset_insert(self->temporarylist, product_frame);
867 cpl_frameset_insert(self->framelist, product_frame);
869 return product_frame;
873moo_products_delete(moo_products *self)
877 int size = cpl_frameset_get_size(self->temporarylist);
879 for (i = 0; i < size; i++) {
881 cpl_frameset_get_position_const(self->temporarylist, i);
882 const char *name = cpl_frame_get_filename(f);
885 cpl_frameset_delete(self->temporarylist);
892moo_region_ron(hdrl_imagelist *biaslist,
899 double ron = 0.0, mean = 0.0, stdev = 0.0;
901 double sks_iter = 10;
902 int nbias = hdrl_imagelist_get_size(biaslist);
903 cpl_vector *region_ron = cpl_vector_new(nbias - 1);
905 for (
int i = 0; i < nbias - 1; i++) {
906 const hdrl_image *h1 = hdrl_imagelist_get_const(biaslist, i);
907 const hdrl_image *h2 = hdrl_imagelist_get_const(biaslist, i + 1);
908 const cpl_image *i1 = hdrl_image_get_image_const(h1);
909 const cpl_image *i2 = hdrl_image_get_image_const(h2);
910 cpl_image *diff = cpl_image_subtract_create(i1, i2);
911 if (strcmp(method, MOO_RON_ESTIMATION_METHOD_LOCAL) == 0) {
915 cpl_error_code error;
917 error = irplib_ksigma_clip(diff, llx, lly, urx, ury, sks_low,
918 sks_iter, 1e-5, &mean, &stdev);
920 cpl_ensure_code(!error, error);
922 ron = stdev / sqrt(2);
923 cpl_vector_set(region_ron, i, ron);
924 cpl_image_delete(diff);
926 ron = cpl_vector_get_mean(region_ron);
927 cpl_vector_delete(region_ron);
948 moo_detlist *bias_list,
949 moo_bias_params *bias_params,
950 moo_products *products)
952 cpl_ensure_code(det != NULL, CPL_ERROR_NULL_INPUT);
953 cpl_ensure_code(det->primary_header != NULL, CPL_ERROR_NULL_INPUT);
954 cpl_ensure_code(bias_list != NULL, CPL_ERROR_NULL_INPUT);
955 cpl_ensure_code(bias_params != NULL, CPL_ERROR_NULL_INPUT);
960 cpl_msg_indent_more();
962 cpl_msg_info(__func__,
"Use method %s for estimate RON",
963 bias_params->ron_estimation_method);
965 for (i = 0; i < 2; i++) {
966 moo_single *s = det->ri[i];
970 hdrl_imagelist *ilist =
973 cpl_propertylist *header = moo_single_get_header(s);
975 moo_outputs *outputs = moo_outputs_load(header,
MOO_TYPE_RI);
978 for (
int ri = 0; ri < outputs->nb; ri++) {
979 int llx = outputs->outputs[ri].x;
980 int lly = outputs->outputs[ri].y;
981 int urx = outputs->outputs[ri].x + outputs->outputs[ri].nx - 1;
982 int ury = outputs->outputs[ri].y + outputs->outputs[ri].ny - 1;
985 hdrl_image_extract(s->image, llx, lly, urx, ury);
986 hdrl_value mean = hdrl_image_get_mean(image);
987 double stdev = hdrl_image_get_stdev(image);
990 median = cpl_image_get_mad(hdrl_image_get_image(image), &mad);
991 hdrl_image_delete(image);
998 moo_region_ron(ilist, llx, lly, urx, ury,
999 bias_params->ron_estimation_method);
1001 cpl_msg_info(__func__,
"RI_%d OUT%d RON RAW : %f e-(%f ADU)",
1002 i + 1, ri + 1, ron_raw,
1003 ron_raw * outputs->outputs[ri].gain);
1004 double ron_master = mad * CPL_MATH_STD_MAD;
1006 cpl_msg_info(__func__,
1007 "RI_%d OUT%d RON MASTER : %f e- (%f ADU)", i + 1,
1009 ron_master * outputs->outputs[ri].gain);
1011 moo_outputs_delete(outputs);
1012 hdrl_imagelist_unwrap(ilist);
1016 cpl_msg_indent_less();
1018 MOONS_TAG_MASTER_BIAS, NULL, NULL);
1019 return CPL_ERROR_NONE;
1040 cpl_ensure_code(det != NULL, CPL_ERROR_NULL_INPUT);
1041 cpl_ensure_code(det->primary_header != NULL, CPL_ERROR_NULL_INPUT);
1048 for (i = 0; i < 2; i++) {
1049 moo_single *s = det->ri[i];
1052 cpl_msg_info(__func__,
"Normalizing RI_%d by exptime %f", i + 1,
1056 cpl_image *image = hdrl_image_get_image(s->image);
1057 cpl_mask *mask = cpl_image_set_bpm(image, NULL);
1058 hdrl_image_div_scalar(s->image, (hdrl_value){ exptime, 0. });
1059 cpl_image_set_bpm(image, mask);
1064 hdrl_value mean = hdrl_image_get_mean(s->image);
1065 hdrl_value median = hdrl_image_get_median(s->image);
1066 double stdev = hdrl_image_get_stdev(s->image);
1071 double mdark_current = MOO_TO_ADU(mean.data, gain) * 3600.0;
1073 cpl_msg_info(__func__,
"RI%d MDARK CURRENT %f", i + 1,
1081 hdrl_value mean = hdrl_image_get_mean(s->image);
1082 hdrl_value median = hdrl_image_get_median(s->image);
1083 double stdev = hdrl_image_get_stdev(s->image);
1089 (dit * ndit) * 3600.0);
1096 hdrl_value mean = hdrl_image_get_mean(s->image);
1097 hdrl_value median = hdrl_image_get_median(s->image);
1098 double stdev = hdrl_image_get_stdev(s->image);
1104 (dit * ndit) * 3600.0);
1110 MOONS_TAG_MASTER_DARK_VIS, NULL, NULL);
1114 MOONS_TAG_MASTER_DARK_NIR, NULL, NULL);
1116 return CPL_ERROR_NONE;
1137 const cpl_frame *inherit_frame)
1139 cpl_ensure(self != NULL, CPL_ERROR_NULL_INPUT, NULL);
1140 cpl_ensure(s1d != NULL, CPL_ERROR_NULL_INPUT, NULL);
1141 cpl_ensure(s1d->primary_header != NULL, CPL_ERROR_NULL_INPUT, NULL);
1143 cpl_frame *product_frame = NULL;
1145 moo_try_check(product_frame =
1146 _moo_products_create_frame(self, s1d->primary_header,
1147 CPL_FRAME_LEVEL_FINAL, tag,
1148 s1d->filename, inherit_frame),
1154 return product_frame;
#define MOO_BADPIX_NON_LINEAR
#define MOO_BADPIX_OUTSIDE_DATA_RANGE
#define MOO_BADPIX_COSMETIC
void moo_bpm_save(moo_bpm *self, const char *filename)
Save a moo_bpm to a FITS file.
void moo_cube_save(moo_cube *self, const char *filename)
Save a moo_cube to a FITS file.
void moo_det_save(moo_det *self, const char *filename)
Save a moo_det to a FITS file.
hdrl_imagelist * moo_detlist_get_image(const moo_detlist *self, moo_detector_type type, int num)
Get the all the images of the type part in the detlist.
cpl_error_code moo_detlist_free_single(const moo_detlist *self, moo_detector_type type, int num)
Free the type part for all DET in the detlist.
cpl_error_code moo_detlist_load_single(const moo_detlist *self, moo_detector_type type, int num, int level)
Load the type part for all DET in the detlist.
void moo_ext_save(moo_ext *self, const char *filename)
Save a moo_ext to a FITS file.
void moo_loc_save(moo_loc *self, const char *filename, int keep_points)
Save a moo_loc to a FITS file.
void moo_map_save(moo_map *self, const char *filename)
Save a moo_map to a FITS file.
void moo_molectable_save(moo_molectable *self, const char *filename)
Save a moo_molectable to a FITS file.
int moo_params_get_keep_temp(const moo_params *self, const cpl_parameterlist *list)
Get keep-temp parameter from moons parameters list.
void moo_params_delete(moo_params *self)
Delete a moo_params.
moo_params * moo_params_new(const char *pid, const char *recipe_id)
Create a new moo_params.
void moo_psf_save(moo_psf *self, const char *filename)
Save a moo_psf to a FITS file.
void moo_rbn_save(moo_rbn *self, const char *filename)
Save a moo_rbn to a FITS file.
void moo_resp_save(moo_resp *self, const char *filename)
Save a moo_resp to a FITS file.
void moo_s1d_save(moo_s1d *self)
Save a moo_s1d to a FITS file.
void moo_saturate_map_save(moo_saturate_map *self, const char *filename)
Save a moo_saturate_map to a FITS file.
void moo_sci_save(moo_sci *self, const char *filename)
Save a moo_sci to a FITS file.
cpl_error_code moo_single_load(moo_single *self, unsigned int level)
Load data in a single structure.
void moo_telluric_save(moo_telluric *self, const char *filename)
Save a moo_telluric to a FITS file.
int moo_pfits_get_ndit(const cpl_propertylist *plist)
find out the ESO DET NDIT value
cpl_error_code moo_pfits_update_exptime(cpl_propertylist *plist, double value)
Set the EXPTIME value.
double moo_pfits_get_dit(const cpl_propertylist *plist)
find out the DIT value
float moo_pfits_get_det_chip_outi_gain(const cpl_propertylist *plist, int i)
find out the ESO DET OUTI CHIP GAIN value
float moo_pfits_get_det_outi_gain(const cpl_propertylist *plist, int i)
find out the ESO DET OUTI GAIN value
double moo_pfits_get_exptime(const cpl_propertylist *plist)
find out the EXPTIME value
moo_products * moo_products_new(cpl_frameset *framelist, const cpl_parameterlist *parlist, const char *recid, const char *pipeline_id)
create a moo_product object for a recipe
cpl_frame * moo_products_add_s1d(moo_products *self, moo_s1d *s1d, const char *tag, const cpl_frame *inherit_frame)
create a product from a MOLECTABLE object
cpl_frame * moo_products_add_loc(moo_products *self, moo_loc *loc, int keep_points, cpl_frame_level level, const char *tag, const char *filename, const cpl_frame *inherit_frame)
This function creates a product from a LOC structure.
cpl_frame * moo_products_add_sci(moo_products *self, moo_sci *sci, cpl_frame_level level, const char *tag, const char *filename, const cpl_frame *inherit_frame)
create a product from a SCI object
cpl_frame * moo_products_add_rbn(moo_products *self, moo_rbn *rbn, cpl_frame_level level, const char *tag, const char *filename, const cpl_frame *inherit_frame)
create a product from a RBN object
cpl_frame * moo_products_add_ext(moo_products *self, moo_ext *ext, cpl_frame_level level, const char *tag, const char *filename, const cpl_frame *inherit_frame)
create a product from a EXT object
cpl_frame * moo_products_add_molectable(moo_products *self, moo_molectable *mtable, cpl_frame_level level, const char *tag, const char *filename, const cpl_frame *inherit_frame)
create a product from a MOLECTABLE object
cpl_error_code moo_products_add_frame(const moo_products *self, cpl_frame *frame)
add a frame to the recipe products
cpl_frame * moo_products_add_target_table(moo_products *self, moo_target_table *ttable, cpl_frame_level level, const char *tag, const char *filename, const cpl_frame *inherit_frame)
create a product from a TARGET_TABLE object
cpl_frame * moo_products_add_saturate_map(moo_products *self, moo_saturate_map *saturate, cpl_frame_level level, const char *tag, const char *filename, const cpl_frame *inherit_frame)
create a product from a SATURATE MAP object
cpl_frame * moo_products_add_resp(moo_products *self, moo_resp *resp, cpl_frame_level level, const char *tag, const char *filename, const cpl_frame *inherit_frame)
create a product from a RESP object
cpl_frame * moo_products_add_map(moo_products *self, moo_map *map, cpl_frame_level level, const char *tag, const char *filename, const cpl_frame *inherit_frame, moo_rbn *rbn)
create a product from a EXT object
cpl_frame * moo_products_add_cube(moo_products *self, moo_cube *cube, cpl_frame_level level, const char *tag, const char *filename, const cpl_frame *inherit_frame)
create a product from a CUBE object
cpl_frame * moo_products_add_bpm(moo_products *self, moo_bpm *bpm, cpl_frame_level level, const char *tag, const char *filename, const cpl_frame *inherit_frame)
create a product from a BPM object
cpl_error_code moo_masterdark(moo_det *det, moo_products *products, int mode)
This function creates the master dark frame as a product and essentially produces a standard output a...
cpl_frame * moo_products_add(moo_products *self, moo_det *det, cpl_frame_level level, const char *tag, const char *filename, const cpl_frame *inherit_frame)
create a product from a DET object
cpl_error_code moo_masterbias(moo_det *det, moo_detlist *bias_list, moo_bias_params *bias_params, moo_products *products)
This function creates the master bias frame as a product and essentially produces a standard output a...
const moo_params * moo_products_get_params(const moo_products *self)
get the moo_params object
cpl_frame * moo_products_add_telluric(moo_products *self, moo_telluric *tell, cpl_frame_level level, const char *tag, const char *filename, const cpl_frame *inherit_frame)
create a product from a TELLURIC object
cpl_error_code moo_qc_set_mdark_normalise_factor(cpl_propertylist *plist, double val)
Set the QC.MDARK.NORMALISE.FACTOR value.
cpl_error_code moo_qc_set_ron_raw(cpl_propertylist *plist, int i, double val)
Set the QC.RON.RAW value.
cpl_error_code moo_qc_set_mbias_mad(cpl_propertylist *plist, int i, double val)
Set the QC.MBIAS.MAD value.
cpl_error_code moo_qc_set_mdark_rms(cpl_propertylist *plist, double val)
Set the QC.MDARK.RMS value.
cpl_error_code moo_qc_set_mdark_avg(cpl_propertylist *plist, double val)
Set the QC.MDARK.AVG value.
cpl_error_code moo_qc_set_mbias_med(cpl_propertylist *plist, int i, double val)
Set the QC.MBIAS.MED value.
cpl_error_code moo_qc_set_mdark_current(cpl_propertylist *plist, double val)
Set the QC.MEAN.DARK.CURRENT value.
cpl_error_code moo_qc_set_ron_master(cpl_propertylist *plist, int i, double val)
Set the QC.RON.MASTER value.
cpl_error_code moo_qc_set_mbias_avg(cpl_propertylist *plist, int i, double val)
Set the QC.MBIAS.AVG value.
cpl_error_code moo_qc_set_mdark_med(cpl_propertylist *plist, double val)
Set the QC.MDARK.MED value.
cpl_error_code moo_qc_set_mbias_rms(cpl_propertylist *plist, int i, double val)
Set the QC.MBIAS.AVG value.
cpl_error_code moo_raw_save(moo_raw *self, const char *filename)
Save a moo_raw to a FITS file.
double moo_image_get_ron(cpl_image *diff, int llx, int lly, int urx, int ury, int nb_boxes, int box_hsize, double max_error_frac, int max_niter)
compute ron in a diff image using boxes
the different type of detectors