32 #include "muse_exp_combine_z.h" 54 int nexposures = cpl_table_get_nrow(exposures);
56 cpl_msg_error(__func__,
"This recipe only makes sense with multiple " 58 cpl_table_delete(exposures);
61 const char *savevalid =
"cube,combined";
68 cpl_msg_warning(__func__,
"Input %s has unexpected format, proceeding " 69 "without offset and flux scales!", MUSE_TAG_OFFSET_LIST);
70 cpl_table_delete(offsets);
78 for (i = 0; i < nexposures; i++) {
79 cpl_table *thisexp = cpl_table_extract(exposures, i, 1);
83 cpl_table_delete(thisexp);
86 cpl_propertylist_erase_regexp(pixtables[i]->header,
"ESO QC ", 0);
89 cpl_table_delete(exposures);
95 if (rc != CPL_ERROR_NONE) {
96 cpl_msg_error(__func__,
"weighting the pixel tables didn't work: %s",
97 cpl_error_get_message());
103 cpl_msg_error(__func__,
"combining the pixel tables didn't work: %s",
104 cpl_error_get_message());
109 if (strstr(aParams->
save,
"cube")) {
113 rp->
dx = aParams->
dx;
114 rp->dy = aParams->
dy;
115 rp->dlambda = aParams->
dlambda;
118 rp->
ld = aParams->
ld;
119 rp->
rc = aParams->
rc;
123 cpl_propertylist_delete(outwcs);
126 format, rp, aParams->
filter);
129 if (strstr(aParams->
save,
"combined")) {
131 MUSE_TAG_PIXTABLE_COMBINED,
135 cpl_table_delete(offsets);
136 return rc == CPL_ERROR_NONE ? 0 : -1;
138 for (i = 0; i < nexposures; i++) {
142 cpl_table_delete(offsets);
cpl_propertylist * muse_postproc_cube_load_output_wcs(muse_processing *aProcessing)
Find a file with a usable output WCS in the input frameset.
int ld
Number of adjacent pixels to take into account during resampling in all three directions (loop distan...
const char * crtype_s
Type of statistics used for detection of cosmic rays during final resampling. "iraf" uses the varianc...
cpl_error_code muse_resampling_params_set_wcs(muse_resampling_params *aParams, const cpl_propertylist *aWCS)
Set an output WCS (and wavelength scale) in the resampling parameters.
muse_xcombine_types muse_postproc_get_weight_type(const char *aWeightString)
Select correct weighting type for weight string.
const char * resample_s
The resampling technique to use for the final output cube. (as string)
const char * pixfrac
Pixel down-scaling factor for the "drizzle" resampling method. Up to three, comma-separated, floating-point values can be given. If only one value is given, it applies to all dimensions, two values are interpreted as spatial and spectral direction, respectively, while three are taken as horizontal, vertical, and spectral.
muse_resampling_crstats_type muse_postproc_get_cr_type(const char *aCRTypeString)
Select correct cosmic ray rejection type for crtype string.
double crsigma
Sigma rejection factor to use for cosmic ray rejection during final resampling. A zero or negative va...
const char * format_s
Type of output file format, "Cube" is a standard FITS cube with NAXIS=3 and multiple extensions (for ...
cpl_error_code muse_postproc_cube_resample_and_collapse(muse_processing *aProcessing, muse_pixtable *aPixtable, muse_cube_type aFormat, muse_resampling_params *aParams, const char *aFilter)
High level function to resample to a datacube and collapse that to an image of the field of view and ...
cpl_error_code muse_xcombine_weights(muse_pixtable **aPixtables, muse_xcombine_types aWeighting)
compute the weights for combination of two or more exposures
cpl_error_code muse_cpltable_check(const cpl_table *aTable, const muse_cpltable_def *aDef)
Check whether the table contains the fields of the definition.
muse_resampling_crstats_type crtype
double dy
Vertical step size for resampling (in arcsec or pixel). The following defaults are taken when this va...
Structure definition of MUSE pixel table.
Structure to hold the parameters of the muse_exp_combine recipe.
muse_cube_type muse_postproc_get_cube_format(const char *aFormatString)
Select correct cube format for format string.
cpl_boolean muse_postproc_check_save_param(const char *aSave, const char *aValid)
Check the –save parameter contents against allowed options.
const char * weight_s
Type of weighting scheme to use when combining multiple exposures. "exptime" just uses the exposure t...
muse_resampling_params * muse_resampling_params_new(muse_resampling_type aMethod)
Create the resampling parameters structure.
double lambdamax
Cut off the data above this wavelength after loading the pixel table(s).
const char * filter
The filter name(s) to be used for the output field-of-view image. Each name has to correspond to an E...
muse_pixtable * muse_xcombine_tables(muse_pixtable **aPixtables, const cpl_table *aOffsets)
combine the pixel tables of several exposures into one
double lambdamin
Cut off the data below this wavelength after loading the pixel table(s).
const char * save
Select output product(s) to save. Can contain one or more of "cube" (output cube and associated image...
double dlambda
Wavelength step size (in Angstrom). Natural instrument sampling is used, if this is 0...
double dx
Horizontal step size for resampling (in arcsec or pixel). The following defaults are taken when this ...
cpl_error_code muse_resampling_params_set_pixfrac(muse_resampling_params *aParams, const char *aString)
Set resampling pixfrac given a string that can contain up to three floating-point values...
cpl_table * muse_processing_load_ctable(muse_processing *aProcessing, const char *aTag, unsigned char aIFU)
Load a CPL table according to its tag and IFU/channel number.
muse_pixtable * muse_pixtable_load_merge_channels(cpl_table *aExposureList, double aLambdaMin, double aLambdaMax)
Load and merge the pixel tables of the 24 MUSE sub-fields.
muse_resampling_type muse_postproc_get_resampling_type(const char *aResampleString)
Select correct resampling type for resample string.
double rc
Critical radius for the "renka" resampling method.
cpl_error_code muse_processing_save_table(muse_processing *aProcessing, int aIFU, void *aTable, cpl_propertylist *aHeader, const char *aTag, muse_table_type aType)
Save a computed table to disk.
muse_resampling_type
Resampling types.
void muse_resampling_params_delete(muse_resampling_params *aParams)
Delete a resampling parameters structure.
cpl_table * muse_processing_sort_exposures(muse_processing *aProcessing)
Sort input frames (containing lists of pixel table filenames) into different exposures.
void muse_pixtable_delete(muse_pixtable *aPixtable)
Deallocate memory associated to a pixel table object.
muse_xcombine_types
Xposure combination types.