MUSE Pipeline Reference Manual  2.1.1
muse_processing.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  * This file is part of the MUSE Instrument Pipeline
5  * Copyright (C) 2008-2016 European Southern Observatory
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20  * 02110-1301, USA.
21  */
22 
23 #ifndef MUSE_PROCESSING_H
24 #define MUSE_PROCESSING_H
25 
26 #include <cpl.h>
27 #include "muse_image.h"
28 #include "muse_mask.h"
29 #include "muse_table.h"
30 
31 /*----------------------------------------------------------------------------*
32  * Special variable types *
33  *----------------------------------------------------------------------------*/
38 typedef struct {
39  const char *tag;
40  int ifu;
41  int counter;
43 
45 typedef struct {
46  const char *name;
47  cpl_array *intags;
48  cpl_recipe *recipe;
49  cpl_frameset *inframes;
50  cpl_frameset *usedframes;
51  cpl_frameset *outframes;
52  cpl_parameterlist *parameters;
55 
57 typedef enum {
67 
69 typedef enum {
74 
76 typedef enum {
86 
89 /*----------------------------------------------------------------------------*
90  * Defines *
91  *----------------------------------------------------------------------------*/
92 
93 /*----------------------------------------------------------------------------*
94  * Function prototypes *
95  *----------------------------------------------------------------------------*/
96 muse_processing *muse_processing_new(const char *, cpl_recipe *);
98 
99 void muse_processing_append_used(muse_processing *, cpl_frame *, cpl_frame_group, int);
100 
101 cpl_frame *muse_processing_new_frame(muse_processing *, int, cpl_propertylist *, const char *, cpl_frame_type);
102 int muse_processing_save_image(muse_processing *, int, muse_image *, const char *);
103 cpl_error_code muse_processing_save_cube(muse_processing *, int, void *, const char *, muse_cube_type);
104 int muse_processing_save_cimage(muse_processing *, int, cpl_image *, cpl_propertylist *, const char *);
105 cpl_table *muse_processing_load_ctable(muse_processing *, const char *, unsigned char);
106 muse_table *muse_processing_load_table(muse_processing *, const char *, unsigned char);
107 cpl_error_code muse_processing_save_table(muse_processing *, int, void *, cpl_propertylist *, const char *, muse_table_type);
109 int muse_processing_save_mask(muse_processing *, int, muse_mask *, const char *);
110 cpl_propertylist *muse_processing_load_header(muse_processing *, const char *);
111 cpl_error_code muse_processing_save_header(muse_processing *, int, cpl_propertylist *, const char *);
112 
113 cpl_boolean muse_processing_check_intags(muse_processing *, const char *, int);
114 cpl_error_code muse_processing_check_input(muse_processing *, unsigned char);
115 
117 
118 /* ---------------------------------------------------------------------*/
119 /* The following prototypes are defined in the recipes and provide an
120  interface to the formal description of the recipe additional to the
121  plugin interface. The typedefs are used to ensure that the doc tool used
122  the same prototypes as the recipe.
123 */
124 /* ---------------------------------------------------------------------*/
125 typedef cpl_error_code
126 muse_processing_prepare_header_func(const char *, cpl_propertylist *);
127 
128 typedef cpl_frame_level
129 muse_processing_get_frame_level_func(const char *);
130 
131 typedef muse_frame_mode
132 muse_processing_get_frame_mode_func(const char *);
133 
134 void muse_processinginfo_register(cpl_recipe *, cpl_recipeconfig *, muse_processing_prepare_header_func *, muse_processing_get_frame_level_func *, muse_processing_get_frame_mode_func *);
135 
136 cpl_error_code muse_processing_prepare_header(const cpl_recipe *, const char *, cpl_propertylist *);
137 cpl_error_code muse_processing_prepare_property(cpl_propertylist *, const char *, cpl_type, const char *);
138 
139 cpl_frame_level muse_processing_get_frame_level(const cpl_recipe *, const char *);
140 int muse_processing_get_frame_mode(const cpl_recipe *, const char *);
141 cpl_recipeconfig *muse_processing_get_recipeconfig(cpl_recipe *);
142 void muse_processinginfo_delete(cpl_recipe *);
143 
144 void muse_processing_recipeinfo(cpl_plugin *);
145 
146 #endif /* MUSE_PROCESSING_H */
int muse_processing_save_cimage(muse_processing *, int, cpl_image *, cpl_propertylist *, const char *)
Save a computed FITS image to disk.
int muse_processing_get_frame_mode(const cpl_recipe *, const char *)
Get the mode for a product frame with a certain tag.
void muse_processing_delete(muse_processing *)
Free the muse_processing structure.
int muse_processing_save_mask(muse_processing *, int, muse_mask *, const char *)
Save a computed MUSE mask to disk.
const char * name
muse_processing_framecounter * counter
muse_table_type
Structure definition of MUSE three extension FITS file.
Definition: muse_image.h:40
cpl_boolean muse_processing_check_intags(muse_processing *, const char *, int)
Check that a tag is part of the input tags of a processing structure.
cpl_frameset * usedframes
muse_processing * muse_processing_new(const char *, cpl_recipe *)
Create a new processing structure.
cpl_error_code muse_processing_prepare_header(const cpl_recipe *, const char *, cpl_propertylist *)
Prepare and check a FITS header for a certain frame tag.
cpl_error_code muse_processing_save_header(muse_processing *, int, cpl_propertylist *, const char *)
Save a FITS header to disk.
cpl_frame * muse_processing_new_frame(muse_processing *, int, cpl_propertylist *, const char *, cpl_frame_type)
Create a new frame for a result file.
muse_frame_mode
cpl_frameset * outframes
cpl_error_code muse_processing_save_cube(muse_processing *, int, void *, const char *, muse_cube_type)
Save a MUSE datacube to disk.
cpl_frame_level muse_processing_get_frame_level(const cpl_recipe *, const char *)
Get the level for a product frame with a certain tag.
cpl_recipe * recipe
muse_table * muse_processing_load_table(muse_processing *, const char *, unsigned char)
Load a MUSE table according to its tag and IFU/channel number.
muse_cube_type
void muse_processinginfo_delete(cpl_recipe *)
Clear all information from the processing info and from the recipe config.
cpl_recipeconfig * muse_processing_get_recipeconfig(cpl_recipe *)
Get the recipe (frame) configuration.
void muse_processing_append_used(muse_processing *, cpl_frame *, cpl_frame_group, int)
Add a frame to the set of used frames.
Structure to store a table together with a property list.
Definition: muse_table.h:43
muse_mask * muse_processing_load_mask(muse_processing *, const char *)
Load a mask file and its FITS header.
int muse_processing_save_image(muse_processing *, int, muse_image *, const char *)
Save a computed MUSE image to disk.
cpl_table * muse_processing_load_ctable(muse_processing *, const char *, unsigned char)
Load a CPL table according to its tag and IFU/channel number.
Handling of "mask" files.
Definition: muse_mask.h:43
cpl_array * intags
cpl_frameset * inframes
cpl_error_code muse_processing_save_table(muse_processing *, int, void *, cpl_propertylist *, const char *, muse_table_type)
Save a computed table to disk.
cpl_error_code muse_processing_check_input(muse_processing *, unsigned char)
Check the input files for completeness.
void muse_processinginfo_register(cpl_recipe *, cpl_recipeconfig *, muse_processing_prepare_header_func *, muse_processing_get_frame_level_func *, muse_processing_get_frame_mode_func *)
Register extended functionalities for MUSE recipes.
cpl_table * muse_processing_sort_exposures(muse_processing *)
Sort input frames (containing lists of pixel table filenames) into different exposures.
void muse_processing_recipeinfo(cpl_plugin *)
Output main pipeline configuration, inputs, and parameters.
cpl_propertylist * muse_processing_load_header(muse_processing *, const char *)
load a header according to its tag
cpl_parameterlist * parameters
cpl_error_code muse_processing_prepare_property(cpl_propertylist *, const char *, cpl_type, const char *)
Prepare and check the specified property.