MUSE Pipeline Reference Manual  0.18.1
muse_quality.h
1 /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim:set sw=2 sts=2 et cin: */
3 /*
4  *
5  * This file is part of the MUSE Instrument Pipeline
6  * Copyright (C) 2005-2011 European Southern Observatory
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  */
22 #ifndef MUSE_QUALITY_H
23 #define MUSE_QUALITY_H
24 
25 /*---------------------------------------------------------------------------*
26  * Includes *
27  *---------------------------------------------------------------------------*/
28 #include <cpl.h>
29 #include "muse_image.h"
30 
31 #include "muse_cplwrappers.h"
32 
33 /*---------------------------------------------------------------------------*
34  * Defines *
35  *---------------------------------------------------------------------------*/
36 
40 /* Euro3D bad pixel states (be sure to use unsigned numbers) */
41 #define EURO3D_GOODPIXEL 0
42 #define EURO3D_TELLURIC (1ul << 0) /* uncorrected */
43 #define EURO3D_TELLCOR (1ul << 1) /* corrected */
44 #define EURO3D_COSMICRAY (1ul << 5) /* uncorrected */
45 #define EURO3D_LOWQEPIXEL (1ul << 6)
46 #define EURO3D_HOTPIXEL (1ul << 8)
47 #define EURO3D_DARKPIXEL (1ul << 9)
48 #define EURO3D_SATURATED (1ul << 12)
49 #define EURO3D_DEADPIXEL (1ul << 13)
50 #define EURO3D_BADOTHER (1ul << 14) /* other kind of bad pixel */
51  /* used for non-positive pixels in flat-fields */
52 #define EURO3D_OBJECT (1ul << 25) /* for object masks, see *
53  * muse_sky_subtract_simple() */
54 #define EURO3D_MUSE_TRAP (1ul << 29)
55 #define EURO3D_MISSDATA (1ul << 30)
56 #define EURO3D_OUTSDRANGE (1ul << 31)
57 #define EURO3D_ALLBITS 0xFFFFul
58 
60 
63 /*---------------------------------------------------------------------------*
64  * Function prototypes *
65  *---------------------------------------------------------------------------*/
66 int muse_quality_dark_badpix(muse_image *, double, double);
67 int muse_quality_bad_columns(muse_image *, double, double);
68 int muse_quality_flat_badpix(muse_image *, cpl_table *, double, double);
70 cpl_table *muse_quality_convert_dq(cpl_image *);
71 cpl_error_code muse_quality_merge_badpix(cpl_table *, const cpl_table *);
72 int muse_quality_image_reject_using_dq(cpl_image *, cpl_image *, cpl_image *);
73 
74 cpl_table *muse_quality_merge_badpix_from_file(const cpl_table *, const char *, const char *, int *);
75 cpl_error_code muse_quality_copy_badpix_table(const char *, const char *, int, const cpl_table *);
76 
77 #endif /* MUSE_QUALITY_H */
int muse_quality_flat_badpix(muse_image *, cpl_table *, double, double)
Find bad (especially dark) pixels (in a master flat).
Definition: muse_quality.c:315
cpl_table * muse_quality_convert_dq(cpl_image *)
Convert a data quality (DQ) image extension to a bad pixel table.
Definition: muse_quality.c:506
int muse_quality_bad_columns(muse_image *, double, double)
Find bad columns (in a master bias).
Definition: muse_quality.c:193
cpl_error_code muse_quality_copy_badpix_table(const char *, const char *, int, const cpl_table *)
Copy bad pixel table on disk, replacing the table in one extension.
Definition: muse_quality.c:759
cpl_table * muse_quality_merge_badpix_from_file(const cpl_table *, const char *, const char *, int *)
Merge bad pixel table in memory with table from file on disk.
Definition: muse_quality.c:693
Structure definition of MUSE three extension FITS file.
Definition: muse_image.h:41
int muse_quality_set_saturated(muse_image *)
Set all pixels above the saturation limit in the bad pixel image.
Definition: muse_quality.c:469
const muse_cpltable_def muse_badpix_table_def[]
cpl_error_code muse_quality_merge_badpix(cpl_table *, const cpl_table *)
Merge two bad pixel tables.
Definition: muse_quality.c:562
int muse_quality_dark_badpix(muse_image *, double, double)
Find bad (especially hot) pixels (in a master dark).
Definition: muse_quality.c:80
Definition of a cpl table structure.
int muse_quality_image_reject_using_dq(cpl_image *, cpl_image *, cpl_image *)
Reject pixels of one or two images on a DQ image.
Definition: muse_quality.c:623