MUSE Pipeline Reference Manual  1.0.2
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-2014 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 02110-1301, USA.
20  */
21 
22 #ifndef MUSE_PROCESSING_H
23 #define MUSE_PROCESSING_H
24 
25 #include <cpl.h>
26 #include "muse_image.h"
27 #include "muse_mask.h"
28 
29 /*----------------------------------------------------------------------------*
30  * Special variable types *
31  *----------------------------------------------------------------------------*/
36 typedef struct {
37  const char *tag;
38  int ifu;
39  int counter;
41 
43 typedef struct {
44  const char *name;
45  cpl_array *intags;
46  cpl_recipe *recipe;
47  cpl_frameset *inframes;
48  cpl_frameset *usedframes;
49  cpl_frameset *outframes;
50  cpl_parameterlist *parameters;
53 
55 typedef enum {
65 
67 typedef enum {
71 
73 typedef enum {
82 
85 /*----------------------------------------------------------------------------*
86  * Defines *
87  *----------------------------------------------------------------------------*/
88 
89 /*----------------------------------------------------------------------------*
90  * Function prototypes *
91  *----------------------------------------------------------------------------*/
92 muse_processing *muse_processing_new(const char *, cpl_recipe *);
94 
95 void muse_processing_append_used(muse_processing *, cpl_frame *, cpl_frame_group, int);
96 
97 cpl_frame *muse_processing_new_frame(muse_processing *, int, cpl_propertylist *, const char *, cpl_frame_type);
98 int muse_processing_save_image(muse_processing *, int, muse_image *, const char *);
99 cpl_error_code muse_processing_save_cube(muse_processing *, int, void *, const char *, muse_cube_type);
100 int muse_processing_save_cimage(muse_processing *, int, cpl_image *, cpl_propertylist *, const char *);
101 cpl_error_code muse_processing_save_table(muse_processing *, int, void *, cpl_propertylist *, const char *, muse_table_type);
102 int muse_processing_save_mask(muse_processing *, int, muse_mask *, const char *);
103 cpl_error_code muse_processing_save_header(muse_processing *, int, cpl_propertylist *, const char *);
104 
105 cpl_boolean muse_processing_check_intags(muse_processing *, const char *, int);
106 cpl_error_code muse_processing_check_input(muse_processing *, unsigned char);
107 
109 
111 
112 /* ---------------------------------------------------------------------*/
113 /* The following prototypes are defined in the recipes and provide an
114  interface to the formal description of the recipe additional to the
115  plugin interface. The typedefs are used to ensure that the doc tool used
116  the same prototypes as the recipe.
117 */
118 /* ---------------------------------------------------------------------*/
119 typedef cpl_error_code
120 muse_processing_prepare_header_func(const char *, cpl_propertylist *);
121 
122 typedef cpl_frame_level
123 muse_processing_get_frame_level_func(const char *);
124 
125 typedef muse_frame_mode
126 muse_processing_get_frame_mode_func(const char *);
127 
128 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 *);
129 
130 cpl_error_code muse_processing_prepare_header(const cpl_recipe *, const char *, cpl_propertylist *);
131 cpl_error_code muse_processing_prepare_property(cpl_propertylist *, const char *, cpl_type, const char *);
132 
133 cpl_frame_level muse_processing_get_frame_level(const cpl_recipe *, const char *);
134 int muse_processing_get_frame_mode(const cpl_recipe *, const char *);
135 cpl_recipeconfig *muse_processing_get_recipeconfig(cpl_recipe *);
136 void muse_processinginfo_delete(cpl_recipe *);
137 
138 #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
muse_mask * muse_processing_mask_load(muse_processing *, const char *)
Load a mask file and its FITS header.
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_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.
int muse_processing_save_image(muse_processing *, int, muse_image *, const char *)
Save a computed MUSE image to disk.
Handling of "mask" files.
Definition: muse_mask.h:42
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.
cpl_parameterlist * parameters
cpl_error_code muse_processing_prepare_property(cpl_propertylist *, const char *, cpl_type, const char *)
Prepare and check the specified property.