MOONS Pipeline Reference Manual 0.13.1
moo_det.c
1/*
2 * This file is part of the MOONS Pipeline
3 * Copyright (C) 2002-2016 European Southern Observatory
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19
20#ifdef HAVE_CONFIG_H
21#include <config.h>
22#endif
23
24/*-----------------------------------------------------------------------------
25 Includes
26 -----------------------------------------------------------------------------*/
27#include <math.h>
28#include <cpl.h>
29#include <hdrl.h>
30#include "moo_pfits.h"
31#include "moo_single.h"
32#include "moo_badpix.h"
33#include "moo_det.h"
34#include "moo_fibres_table.h"
35/*----------------------------------------------------------------------------*/
53/*----------------------------------------------------------------------------*/
54
57/*-----------------------------------------------------------------------------
58 Function codes
59 -----------------------------------------------------------------------------*/
60
61/*----------------------------------------------------------------------------*/
69/*----------------------------------------------------------------------------*/
70moo_det *
72{
73 moo_det *res = cpl_calloc(1, sizeof(moo_det));
74 return res;
75}
76
77/*----------------------------------------------------------------------------*/
89/*----------------------------------------------------------------------------*/
90moo_det *
91moo_det_create(const cpl_frame *frame)
92{
93 cpl_ensure(frame != NULL, CPL_ERROR_NULL_INPUT, NULL);
94 const char *filename = cpl_frame_get_filename(frame);
95
96 cpl_ensure(filename != NULL, CPL_ERROR_NULL_INPUT, NULL);
97
98 moo_det *res = moo_det_new();
99
100 res->primary_header = cpl_propertylist_load(filename, 0);
101 res->filename = cpl_strdup(filename);
102
103 cpl_errorstate prev_state = cpl_errorstate_get();
104
105 res->ri[0] = moo_single_create(filename, MOO_TYPE_RI, 1);
106 res->yj[0] = moo_single_create(filename, MOO_TYPE_YJ, 1);
107 res->h[0] = moo_single_create(filename, MOO_TYPE_H, 1);
108 res->ri[1] = moo_single_create(filename, MOO_TYPE_RI, 2);
109 res->yj[1] = moo_single_create(filename, MOO_TYPE_YJ, 2);
110 res->h[1] = moo_single_create(filename, MOO_TYPE_H, 2);
112
113 if (!cpl_errorstate_is_equal(prev_state)) {
114 cpl_msg_info("MOO_PREPARE", "DET: can't load %s : code %d", filename,
115 cpl_error_get_code());
116 cpl_errorstate_set(prev_state);
117 }
118 return res;
119}
120
121/*----------------------------------------------------------------------------*/
133/*----------------------------------------------------------------------------*/
134cpl_error_code
135moo_det_load(moo_det *self, unsigned int level)
136{
137 cpl_ensure_code(self != NULL, CPL_ERROR_NULL_INPUT);
138
139 int i;
140 for (i = 0; i < 2; i++) {
141 moo_det_load_ri(self, i, level);
142 moo_det_load_yj(self, i, level);
143 moo_det_load_h(self, i, level);
144 }
145 return CPL_ERROR_NONE;
146}
147/*----------------------------------------------------------------------------*/
164/*----------------------------------------------------------------------------*/
165cpl_error_code
166moo_det_load_ri(moo_det *self, int num, int level)
167{
168 cpl_ensure_code(self != NULL, CPL_ERROR_NULL_INPUT);
169 cpl_ensure_code(num >= 0, CPL_ERROR_ILLEGAL_INPUT);
170 cpl_ensure_code(num <= 1, CPL_ERROR_ACCESS_OUT_OF_RANGE);
171 cpl_ensure_code(level >= 0, CPL_ERROR_ILLEGAL_INPUT);
172
173 if (self->ri[num] != NULL) {
174 moo_single_load(self->ri[num], level);
175 }
176 return CPL_ERROR_NONE;
177}
178
179/*----------------------------------------------------------------------------*/
195/*----------------------------------------------------------------------------*/
196moo_single *
197moo_det_load_single(moo_det *self, moo_detector_type type, int num, int level)
198{
199 moo_single *res = NULL;
200
201 cpl_ensure(self != NULL, CPL_ERROR_NULL_INPUT, NULL);
202 cpl_ensure(num >= 1 && num <= 2, CPL_ERROR_ILLEGAL_INPUT, NULL);
203
204 res = moo_det_get_single(self, type, num);
205 if (res != NULL) {
206 moo_single_load(res, level);
207 }
208
209 return res;
210}
211
212/*----------------------------------------------------------------------------*/
229/*----------------------------------------------------------------------------*/
230cpl_error_code
231moo_det_free_single(moo_det *self, moo_detector_type type, int num)
232{
233 cpl_ensure_code(self != NULL, CPL_ERROR_NULL_INPUT);
234 cpl_ensure_code(num >= 1, CPL_ERROR_ILLEGAL_INPUT);
235 cpl_ensure_code(num <= 2, CPL_ERROR_ACCESS_OUT_OF_RANGE);
236
237 cpl_error_code status = CPL_ERROR_NONE;
238
239 moo_single *single = moo_det_get_single(self, type, num);
240 if (single != NULL) {
241 status = moo_single_free(single);
242 }
243 return status;
244}
245
246/*----------------------------------------------------------------------------*/
263/*----------------------------------------------------------------------------*/
264cpl_error_code
265moo_det_load_yj(moo_det *self, int num, int level)
266{
267 cpl_ensure_code(self != NULL, CPL_ERROR_NULL_INPUT);
268 cpl_ensure_code(num >= 0, CPL_ERROR_ILLEGAL_INPUT);
269 cpl_ensure_code(num <= 1, CPL_ERROR_ACCESS_OUT_OF_RANGE);
270 cpl_ensure_code(level >= 0, CPL_ERROR_ILLEGAL_INPUT);
271
272 if (self->yj[num] != NULL) {
273 moo_single_load(self->yj[num], level);
274 }
275 return CPL_ERROR_NONE;
276}
277
278/*----------------------------------------------------------------------------*/
296/*----------------------------------------------------------------------------*/
297cpl_error_code
298moo_det_load_h(moo_det *self, int num, int level)
299{
300 cpl_ensure_code(self != NULL, CPL_ERROR_NULL_INPUT);
301 cpl_ensure_code(num >= 0, CPL_ERROR_ILLEGAL_INPUT);
302 cpl_ensure_code(num <= 1, CPL_ERROR_ACCESS_OUT_OF_RANGE);
303 cpl_ensure_code(level >= 0, CPL_ERROR_ILLEGAL_INPUT);
304
305 if (self->h[num] != NULL) {
306 moo_single_load(self->h[num], level);
307 }
308 return CPL_ERROR_NONE;
309}
310
311cpl_error_code
312moo_det_set_single(moo_det *self,
314 int num,
315 moo_single *single)
316{
317 cpl_ensure_code(self != NULL, CPL_ERROR_NULL_INPUT);
318 cpl_ensure_code(num >= 1 && num <= 2, CPL_ERROR_ILLEGAL_INPUT);
319
320 cpl_error_code status = CPL_ERROR_NONE;
321
322 switch (type) {
323 case MOO_TYPE_RI:
324 moo_single_delete(self->ri[num - 1]);
325 self->ri[num - 1] = single;
326 break;
327 case MOO_TYPE_YJ:
328 moo_single_delete(self->yj[num - 1]);
329 self->yj[num - 1] = single;
330 break;
331 case MOO_TYPE_H:
332 moo_single_delete(self->h[num - 1]);
333 self->h[num - 1] = single;
334 break;
335 default:
336 status = CPL_ERROR_ILLEGAL_INPUT;
337 cpl_error_set(__func__, status);
338 break;
339 }
340 return status;
341}
342/*----------------------------------------------------------------------------*/
357/*----------------------------------------------------------------------------*/
358moo_single *
359moo_det_get_single(moo_det *self, moo_detector_type type, int num)
360{
361 moo_single *result = NULL;
362
363 cpl_ensure(self != NULL, CPL_ERROR_NULL_INPUT, NULL);
364 cpl_ensure(num >= 1 && num <= 2, CPL_ERROR_ILLEGAL_INPUT, NULL);
365
366 switch (type) {
367 case MOO_TYPE_RI:
368 result = self->ri[num - 1];
369 break;
370 case MOO_TYPE_YJ:
371 result = self->yj[num - 1];
372 break;
373 case MOO_TYPE_H:
374 result = self->h[num - 1];
375 break;
376 default:
377 result = NULL;
378 break;
379 }
380 return result;
381}
382/*----------------------------------------------------------------------------*/
398/*----------------------------------------------------------------------------*/
399moo_single *
400moo_det_get_ri(moo_det *self, int num)
401{
402 cpl_ensure(self != NULL, CPL_ERROR_NULL_INPUT, NULL);
403 cpl_ensure(num >= 0, CPL_ERROR_ILLEGAL_INPUT, NULL);
404 cpl_ensure(num <= 1, CPL_ERROR_ACCESS_OUT_OF_RANGE, NULL);
405
406 return self->ri[num];
407}
408
409/*----------------------------------------------------------------------------*/
422/*----------------------------------------------------------------------------*/
423cpl_table *
425{
426 cpl_ensure(self != NULL, CPL_ERROR_NULL_INPUT, NULL);
427
428 if (self->fibre_table == NULL && self->filename != NULL) {
429 cpl_size qnum =
430 cpl_fits_find_extension(self->filename, MOO_FIBRES_TABLE_EXTNAME);
431 if (qnum > 0) {
432 self->fibre_table = cpl_table_load(self->filename, qnum, 0);
433 }
434 }
435 return self->fibre_table;
436}
437
438/*----------------------------------------------------------------------------*/
451/*----------------------------------------------------------------------------*/
452cpl_propertylist *
454{
455 if (self->primary_header == NULL && self->filename != NULL) {
456 self->primary_header = cpl_propertylist_load(self->filename, 0);
457 }
458 return self->primary_header;
459}
460/*----------------------------------------------------------------------------*/
469/*----------------------------------------------------------------------------*/
470
471void
472moo_det_delete(moo_det *self)
473{
474 if (self != NULL) {
475 int i;
476 if (self->filename != NULL) {
477 cpl_free(self->filename);
478 }
479
480 for (i = 0; i < 2; i++) {
481 moo_single_delete(self->ri[i]);
482 moo_single_delete(self->yj[i]);
483 moo_single_delete(self->h[i]);
484 }
485 if (self->primary_header != NULL) {
486 cpl_propertylist_delete(self->primary_header);
487 }
488 if (self->fibre_table != NULL) {
489 cpl_table_delete(self->fibre_table);
490 }
491 cpl_free(self);
492 }
493}
494/*----------------------------------------------------------------------------*/
505/*----------------------------------------------------------------------------*/
506void
507moo_det_save(moo_det *self, const char *filename)
508{
509 if (self != NULL) {
510 if (self->primary_header != NULL) {
511 cpl_propertylist_save(self->primary_header, filename,
512 CPL_IO_CREATE);
513 }
514 else {
515 cpl_propertylist *h = cpl_propertylist_new();
516 cpl_propertylist_save(h, filename, CPL_IO_CREATE);
517 cpl_propertylist_delete(h);
518 }
519 int i;
520 for (i = 1; i <= 2; i++) {
521 moo_single_save(self->ri[i - 1], filename, MOO_TYPE_RI, i);
522 moo_single_save(self->yj[i - 1], filename, MOO_TYPE_YJ, i);
523 moo_single_save(self->h[i - 1], filename, MOO_TYPE_H, i);
524 }
525
526 if (self->fibre_table != NULL) {
527 cpl_propertylist *h = cpl_propertylist_new();
528 cpl_propertylist_append_string(h, MOO_PFITS_EXTNAME,
529 MOO_FIBRES_TABLE_EXTNAME);
530 cpl_table_save(self->fibre_table, h, h, filename, CPL_IO_EXTEND);
531 cpl_propertylist_delete(h);
532 }
533 }
534}
535
536/*----------------------------------------------------------------------------*/
548/*----------------------------------------------------------------------------*/
549cpl_error_code
550moo_det_dump(const moo_det *self, FILE *stream)
551{
552 cpl_ensure_code(self != NULL, CPL_ERROR_NULL_INPUT);
553 cpl_ensure_code(stream != NULL, CPL_ERROR_NULL_INPUT);
554
555 fprintf(stream, "---MOO_DET\n");
556 fprintf(stream, "filename %s\n", self->filename);
557 int i;
558 for (i = 0; i < 2; i++) {
559 if (self->ri[i] != NULL) {
560 fprintf(stream, "---RI_%d %p\n", i, self->ri[i]);
561 moo_single_dump(self->ri[i], stream);
562 }
563
564 if (self->yj[i] != NULL) {
565 fprintf(stream, "---YJ_%d %p\n", i, self->yj[i]);
566 moo_single_dump(self->yj[i], stream);
567 }
568
569 if (self->h[i] != NULL) {
570 fprintf(stream, "---H_%d %p\n", i, self->h[i]);
571 moo_single_dump(self->h[i], stream);
572 }
573 }
574
575 return CPL_ERROR_NONE;
576}
577
578cpl_propertylist *
579moo_det_get_single_header(moo_det *self, moo_detector_type type, int num)
580{
581 cpl_ensure(self != NULL, CPL_ERROR_ILLEGAL_INPUT, NULL);
582 cpl_ensure(num >= 1, CPL_ERROR_ILLEGAL_INPUT, NULL);
583 cpl_ensure(num <= 2, CPL_ERROR_ACCESS_OUT_OF_RANGE, NULL);
584
585 moo_single *single = moo_det_get_single(self, type, num);
586
587 return moo_single_get_header(single);
588}
589
590
591/*----------------------------------------------------------------------------*/
602/*----------------------------------------------------------------------------*/
603cpl_error_code
604moo_det_sum(moo_det *self, moo_det *det)
605{
606 cpl_ensure_code(self != NULL, CPL_ERROR_ILLEGAL_INPUT);
607 cpl_ensure_code(det != NULL, CPL_ERROR_ILLEGAL_INPUT);
608
609 int i;
610 for (i = 0; i < 2; i++) {
611 moo_single *ri = self->ri[i];
612 moo_single *detri = det->ri[i];
613 if (ri != NULL) {
614 moo_single_sum(ri, detri);
615 }
616 moo_single *yj = self->yj[i];
617 if (yj != NULL) {
618 moo_single *detyj = det->yj[i];
619 moo_single_sum(yj, detyj);
620 }
621 moo_single *h = self->h[i];
622 if (h != NULL) {
623 moo_single *deth = det->h[i];
624 moo_single_sum(h, deth);
625 }
626 }
627 return CPL_ERROR_NONE;
628}
629
630/*----------------------------------------------------------------------------*/
641/*----------------------------------------------------------------------------*/
642cpl_error_code
643moo_det_subtract(moo_det *self, moo_det *det)
644{
645 cpl_ensure_code(self != NULL, CPL_ERROR_ILLEGAL_INPUT);
646 cpl_ensure_code(det != NULL, CPL_ERROR_ILLEGAL_INPUT);
647
648 int i;
649 for (i = 0; i < 2; i++) {
650 moo_single *ri = self->ri[i];
651 moo_single *detri = det->ri[i];
652 if (ri != NULL) {
653 moo_single_sub(ri, detri);
654 }
655 moo_single *yj = self->yj[i];
656 if (yj != NULL) {
657 moo_single *detyj = det->yj[i];
658 moo_single_sub(yj, detyj);
659 }
660 moo_single *h = self->h[i];
661 if (h != NULL) {
662 moo_single *deth = det->h[i];
663 moo_single_sub(h, deth);
664 }
665 }
666 return CPL_ERROR_NONE;
667}
668
669/*----------------------------------------------------------------------------*/
680/*----------------------------------------------------------------------------*/
681cpl_error_code
682moo_det_divide(moo_det *self, moo_det *det)
683{
684 cpl_ensure_code(self != NULL, CPL_ERROR_ILLEGAL_INPUT);
685 cpl_ensure_code(det != NULL, CPL_ERROR_ILLEGAL_INPUT);
686
687 int i;
688 for (i = 0; i < 2; i++) {
689 moo_single *ri = self->ri[i];
690 moo_single *detri = det->ri[i];
691 if (ri != NULL) {
692 moo_single_divide(ri, detri);
693 }
694 moo_single *yj = self->yj[i];
695 if (yj != NULL) {
696 moo_single *detyj = det->yj[i];
697 moo_single_divide(yj, detyj);
698 }
699 moo_single *h = self->h[i];
700 if (h != NULL) {
701 moo_single *deth = det->h[i];
702 moo_single_divide(h, deth);
703 }
704 }
705 return CPL_ERROR_NONE;
706}
707
708/*----------------------------------------------------------------------------*/
719/*----------------------------------------------------------------------------*/
720cpl_error_code
721moo_det_rescale_using_exptime(moo_det *self, moo_det *det)
722{
723 cpl_ensure_code(self != NULL, CPL_ERROR_ILLEGAL_INPUT);
724 cpl_ensure_code(det != NULL, CPL_ERROR_ILLEGAL_INPUT);
725
726 int i;
727 for (i = 0; i < 2; i++) {
728 moo_single *ri = self->ri[i];
729 if (ri != NULL) {
730 double exptimea = moo_pfits_get_exptime(self->primary_header);
731 double exptimeb = moo_pfits_get_exptime(det->primary_header);
732 moo_single_multiply_scalar(ri, exptimeb / exptimea);
733 }
734 moo_single *yj = self->yj[i];
735 if (yj != NULL) {
736 moo_single *detyj = det->yj[i];
737 double exptimea =
738 moo_pfits_get_dit(yj->header) * moo_pfits_get_ndit(yj->header);
739 double exptimeb = moo_pfits_get_dit(detyj->header) *
740 moo_pfits_get_ndit(detyj->header);
741 moo_single_multiply_scalar(yj, exptimeb / exptimea);
742 }
743 moo_single *h = self->h[i];
744 if (h != NULL) {
745 moo_single *deth = det->h[i];
746 double exptimea =
747 moo_pfits_get_dit(h->header) * moo_pfits_get_ndit(h->header);
748 double exptimeb = moo_pfits_get_dit(deth->header) *
749 moo_pfits_get_ndit(deth->header);
750 moo_single_multiply_scalar(h, exptimeb / exptimea);
751 }
752 }
753 return CPL_ERROR_NONE;
754}
755
756/*----------------------------------------------------------------------------*/
767/*----------------------------------------------------------------------------*/
768cpl_error_code
769moo_det_mean(moo_det *self, moo_det *det)
770{
771 cpl_ensure_code(self != NULL, CPL_ERROR_ILLEGAL_INPUT);
772 cpl_ensure_code(det != NULL, CPL_ERROR_ILLEGAL_INPUT);
773
774 int i;
775 for (i = 0; i < 2; i++) {
776 moo_single *ri = self->ri[i];
777 moo_single *detri = det->ri[i];
778 if (ri != NULL) {
779 moo_single_mean(ri, detri);
780 }
781 moo_single *yj = self->yj[i];
782 if (yj != NULL) {
783 moo_single *detyj = det->yj[i];
784 moo_single_mean(yj, detyj);
785 }
786 moo_single *h = self->h[i];
787 if (h != NULL) {
788 moo_single *deth = det->h[i];
789 moo_single_mean(h, deth);
790 }
791 }
792 return CPL_ERROR_NONE;
793}
794
795/*----------------------------------------------------------------------------*/
806/*----------------------------------------------------------------------------*/
807cpl_error_code
808moo_det_filter_snr(moo_det *self, double *min_snr_tab)
809{
810 cpl_ensure_code(self != NULL, CPL_ERROR_ILLEGAL_INPUT);
811
812 for (int i = 0; i < 2; i++) {
813 moo_single *ri = self->ri[i];
814 if (ri != NULL) {
815 double min_snr = min_snr_tab[i * 3];
817 moo_single_filter_snr(ri, min_snr);
818 }
819 moo_single *yj = self->yj[i];
820 if (yj != NULL) {
821 double min_snr = min_snr_tab[i * 3 + 1];
823 moo_single_filter_snr(yj, min_snr);
824 }
825 moo_single *h = self->h[i];
826 if (h != NULL) {
827 double min_snr = min_snr_tab[i * 3 + 2];
829 moo_single_filter_snr(h, min_snr);
830 }
831 }
832 return CPL_ERROR_NONE;
833}
#define MOO_BADPIX_GOOD
Definition: moo_badpix.h:36
cpl_error_code moo_det_load_h(moo_det *self, int num, int level)
Load the H part in DET.
Definition: moo_det.c:298
moo_single * moo_det_load_single(moo_det *self, moo_detector_type type, int num, int level)
Load the type part in DET and return it.
Definition: moo_det.c:197
cpl_error_code moo_det_rescale_using_exptime(moo_det *self, moo_det *det)
Rescale using exptime factor.
Definition: moo_det.c:721
cpl_error_code moo_det_filter_snr(moo_det *self, double *min_snr_tab)
Flag low snr pixels from DET structure.
Definition: moo_det.c:808
cpl_error_code moo_det_load_ri(moo_det *self, int num, int level)
Load the RI part in DET.
Definition: moo_det.c:166
cpl_error_code moo_det_load_yj(moo_det *self, int num, int level)
Load the YJ part in DET.
Definition: moo_det.c:265
cpl_error_code moo_det_free_single(moo_det *self, moo_detector_type type, int num)
Free the given type part in DET.
Definition: moo_det.c:231
moo_single * moo_det_get_ri(moo_det *self, int num)
Get the RI part in DET.
Definition: moo_det.c:400
cpl_error_code moo_det_sum(moo_det *self, moo_det *det)
Sum DET structure.
Definition: moo_det.c:604
cpl_propertylist * moo_det_get_primary_header(moo_det *self)
Get the PRIMARY HEADER in DET.
Definition: moo_det.c:453
moo_det * moo_det_create(const cpl_frame *frame)
Create a new moo_det from the given DET frame.
Definition: moo_det.c:91
moo_det * moo_det_new(void)
Create a new moo_det.
Definition: moo_det.c:71
void moo_det_save(moo_det *self, const char *filename)
Save a moo_det to a FITS file.
Definition: moo_det.c:507
cpl_error_code moo_det_dump(const moo_det *self, FILE *stream)
Dump structural information of DET.
Definition: moo_det.c:550
cpl_table * moo_det_get_fibre_table(moo_det *self)
Get the FIBRE TABLE in DET.
Definition: moo_det.c:424
cpl_error_code moo_det_load(moo_det *self, unsigned int level)
Load all parts in DET.
Definition: moo_det.c:135
cpl_error_code moo_det_subtract(moo_det *self, moo_det *det)
Subtract DET structure.
Definition: moo_det.c:643
void moo_det_delete(moo_det *self)
Delete a moo_det.
Definition: moo_det.c:472
cpl_error_code moo_det_mean(moo_det *self, moo_det *det)
Sum DET structure.
Definition: moo_det.c:769
moo_single * moo_det_get_single(moo_det *self, moo_detector_type type, int num)
Get the type part in DET and return it.
Definition: moo_det.c:359
cpl_error_code moo_det_divide(moo_det *self, moo_det *det)
Divide DET structure.
Definition: moo_det.c:682
enum _moo_detector_type_ moo_detector_type
The type code type.
Definition: moo_detector.h:64
@ MOO_TYPE_YJ
Definition: moo_detector.h:50
@ MOO_TYPE_H
Definition: moo_detector.h:54
@ MOO_TYPE_RI
Definition: moo_detector.h:46
cpl_error_code moo_single_load(moo_single *self, unsigned int level)
Load data in a single structure.
Definition: moo_single.c:152
cpl_error_code moo_single_mean(moo_single *a, moo_single *b)
Mean of two single DET.
Definition: moo_single.c:618
cpl_error_code moo_single_sub(moo_single *a, moo_single *b)
Subtract two single DET.
Definition: moo_single.c:502
void moo_single_delete(moo_single *self)
Delete a moo_single.
Definition: moo_single.c:211
moo_single * moo_single_create(const char *filename, moo_detector_type type, int ntas)
Create a new moo_single from the given filename.
Definition: moo_single.c:105
cpl_error_code moo_single_dump(const moo_single *self, FILE *stream)
Dump structural information of a Single DET.
Definition: moo_single.c:460
cpl_error_code moo_single_free(moo_single *self)
Free memory associate to this single DET.
Definition: moo_single.c:349
cpl_error_code moo_single_sum(moo_single *a, moo_single *b)
Add two single DET.
Definition: moo_single.c:588
cpl_error_code moo_single_divide(moo_single *a, moo_single *b)
Divide two single DET.
Definition: moo_single.c:532
cpl_error_code moo_single_multiply_scalar(moo_single *a, double scalar)
Elementwise multiplication of a single with a scalar.
Definition: moo_single.c:562
void moo_single_save(moo_single *self, const char *filename, moo_detector_type type, int ntas)
Save a moo_single to a FITS file.
Definition: moo_single.c:384
cpl_error_code moo_single_filter_snr(moo_single *self, double min_snr)
Flag low snr pixels from single DET structure.
Definition: moo_single.c:652
int moo_pfits_get_ndit(const cpl_propertylist *plist)
find out the ESO DET NDIT value
Definition: moo_pfits.c:382
double moo_pfits_get_dit(const cpl_propertylist *plist)
find out the DIT value
Definition: moo_pfits.c:362
double moo_pfits_get_exptime(const cpl_propertylist *plist)
find out the EXPTIME value
Definition: moo_pfits.c:1039