MUSE Pipeline Reference Manual  0.18.5
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  *
5  * This file is part of the MUSE Instrument Pipeline
6  * Copyright (C) 2008-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_PROCESSING_H
24 #define MUSE_PROCESSING_H
25 
26 #include <cpl.h>
27 #include "muse_image.h"
28 #include "muse_mask.h"
29 
30 /*----------------------------------------------------------------------------*
31  * Special variable types *
32  *----------------------------------------------------------------------------*/
33 
34 typedef struct {
35  const char *tag;
36  int ifu;
37  int counter;
38 } muse_framecounter_s;
39 
44 typedef struct {
45  const char *recipeName;
46  const char *inputTag;
47  cpl_recipe *recipe;
48  cpl_frameset *inputFrames;
49  cpl_frameset *usedFrames;
50  cpl_frameset *outputFrames;
51  cpl_parameterlist *parameters;
52  muse_framecounter_s * framecounter;
54 
56 typedef enum {
66 
68 typedef enum {
72 
74 typedef enum {
82 
85 /*----------------------------------------------------------------------------*
86  * Defines *
87  *----------------------------------------------------------------------------*/
88 
89 /*----------------------------------------------------------------------------*
90  * Function prototypes *
91  *----------------------------------------------------------------------------*/
92 muse_processing *muse_processing_new(const char *recipeName, cpl_recipe *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_error_code muse_processing_check_input(muse_processing *, unsigned char);
106 
108 
110 
111 /* ---------------------------------------------------------------------*/
112 /* The following prototypes are defined in the recipes and provide an
113  interface to the formal description of the recipe additional to the
114  plugin interface. The typedefs are used to ensure that the doc tool used
115  the same prototypes as the recipe.
116 */
117 /* ---------------------------------------------------------------------*/
118 typedef cpl_error_code
119 muse_processing_prepare_header_func(const char *, cpl_propertylist *);
120 
121 typedef cpl_frame_level
122 muse_processing_get_frame_level_func(const char *);
123 
124 typedef muse_frame_mode
125 muse_processing_get_frame_mode_func(const char *);
126 
127 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 *);
128 
129 cpl_error_code muse_processing_prepare_header(const cpl_recipe *, const char *, cpl_propertylist *);
130 cpl_error_code muse_processing_prepare_property(cpl_propertylist *, const char *, cpl_type, const char *);
131 
132 cpl_frame_level muse_processing_get_frame_level(const cpl_recipe *, const char *);
133 int muse_processing_get_frame_mode(const cpl_recipe *, const char *);
134 cpl_recipeconfig *muse_processing_get_recipeconfig(cpl_recipe *);
135 void muse_processinginfo_delete(cpl_recipe *);
136 
137 #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.
const char * inputTag
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.
muse_framecounter_s * framecounter
int muse_processing_save_mask(muse_processing *, int, muse_mask *, const char *)
Save a computed MUSE mask to disk.
muse_table_type
const char * recipeName
Structure definition of MUSE three extension FITS file.
Definition: muse_image.h:41
muse_mask * muse_processing_mask_load(muse_processing *, const char *)
Load a mask file and its FITS header.
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.
muse_processing * muse_processing_new(const char *recipeName, cpl_recipe *recipe)
Create a new processing structure.
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_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
cpl_frameset * outputFrames
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:43
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_frameset * inputFrames
cpl_frameset * usedFrames
cpl_parameterlist * parameters
cpl_error_code muse_processing_prepare_property(cpl_propertylist *, const char *, cpl_type, const char *)
Prepare and check the specified property.