MUSE Pipeline Reference Manual  0.18.1
muse_image.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 
23 #ifndef MUSE_IMAGE_H
24 #define MUSE_IMAGE_H
25 
26 /*----------------------------------------------------------------------------*
27  * Special variable types *
28  *----------------------------------------------------------------------------*/
29 
33 /*----------------------------------------------------------------------------*/
40 /*----------------------------------------------------------------------------*/
41 typedef struct {
47  cpl_image *data;
48 
57  cpl_image *dq;
58 
65  cpl_image *stat;
66 
73  cpl_propertylist *header;
74 } muse_image;
75 
78 /*----------------------------------------------------------------------------*
79  * Defines *
80  *----------------------------------------------------------------------------*/
81 /* extension names for the three images */
82 #define EXTNAME_DATA "DATA"
83 #define EXTNAME_DQ "DQ"
84 #define EXTNAME_STAT "STAT"
85 #define EXTNAME_DATA_COMMENT "This extension contains data values"
86 #define EXTNAME_DQ_COMMENT "This extension contains bad pixel status values"
87 #define EXTNAME_STAT_COMMENT "This extension contains data variance"
88 
89 /*----------------------------------------------------------------------------*
90  * Function prototypes *
91  *----------------------------------------------------------------------------*/
94 muse_image *muse_image_load(const char *);
95 muse_image *muse_image_load_from_extensions(const char *, unsigned char);
96 muse_image *muse_image_load_from_raw(const char *, int);
97 cpl_error_code muse_image_save(muse_image *, const char *);
101 int muse_image_scale(muse_image *, double);
102 
104 cpl_error_code muse_image_adu_to_count(muse_image *);
105 
106 cpl_error_code muse_image_reject_from_dq(muse_image *);
107 
108 #endif /* MUSE_IMAGE_H */
void muse_image_delete(muse_image *)
Deallocate memory associated to a muse_image object.
Definition: muse_image.c:84
int muse_image_divide(muse_image *, muse_image *)
Divide a muse_image by another with correct treatment of bad pixels and variance. ...
Definition: muse_image.c:623
int muse_image_scale(muse_image *, double)
Scale a muse_image with correct treatment of variance.
Definition: muse_image.c:687
cpl_image * data
the data extension
Definition: muse_image.h:47
muse_image * muse_image_load_from_raw(const char *, int)
Load raw image into the data extension of a MUSE image.
Definition: muse_image.c:286
muse_image * muse_image_duplicate(const muse_image *)
Duplicate the three image extensions and the FITS headers of a MUSE image.
Definition: muse_image.c:494
cpl_image * stat
the statistics extension
Definition: muse_image.h:65
int muse_image_subtract(muse_image *, muse_image *)
Subtract a muse_image from another with correct treatment of bad pixels and variance.
Definition: muse_image.c:577
Structure definition of MUSE three extension FITS file.
Definition: muse_image.h:41
cpl_propertylist * header
the FITS header
Definition: muse_image.h:73
int muse_image_variance_create(muse_image *, muse_image *)
Create the photon noise-based variance in the stat extension.
Definition: muse_image.c:731
cpl_image * dq
the data quality extension
Definition: muse_image.h:57
cpl_error_code muse_image_save(muse_image *, const char *)
Save the three image extensions and the FITS headers of a MUSE image to a file.
Definition: muse_image.c:396
muse_image * muse_image_load(const char *)
Load the three extensions and the FITS headers of a MUSE image from a file.
Definition: muse_image.c:222
cpl_error_code muse_image_reject_from_dq(muse_image *)
Reject pixels of a muse_image depending on its DQ data.
Definition: muse_image.c:848
muse_image * muse_image_new(void)
Allocate memory for a new muse_image object.
Definition: muse_image.c:65
cpl_error_code muse_image_adu_to_count(muse_image *)
Convert the data units from raw adu to count (= electron) units.
Definition: muse_image.c:795
muse_image * muse_image_load_from_extensions(const char *, unsigned char)
Load the three extensions and the FITS headers of a MUSE image from extensions of a merged file...
Definition: muse_image.c:256