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";
70 for (i = 0; i < nexposures; i++) {
71 cpl_table *thisexp = cpl_table_extract(exposures, i, 1);
75 cpl_table_delete(thisexp);
77 cpl_propertylist_erase_regexp(pixtables[i]->header,
"ESO QC ", 0);
79 cpl_table_delete(exposures);
85 if (rc != CPL_ERROR_NONE) {
86 cpl_msg_error(__func__,
"weighting the pixel tables didn't work: %s",
87 cpl_error_get_message());
93 cpl_msg_error(__func__,
"combining the pixel tables didn't work: %s",
94 cpl_error_get_message());
99 if (strstr(aParams->
save,
"cube")) {
103 rp->
dx = aParams->
dx;
104 rp->dy = aParams->
dy;
105 rp->dlambda = aParams->
dlambda;
108 rp->
ld = aParams->
ld;
109 rp->
rc = aParams->
rc;
115 cpl_propertylist_delete(outwcs);
118 format, rp, aParams->
filter);
121 if (strstr(aParams->
save,
"combined")) {
123 MUSE_TAG_PIXTABLE_COMBINED,
127 return rc == CPL_ERROR_NONE ? 0 : -1;
129 for (i = 0; i < nexposures; i++) {
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)
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
muse_resampling_crstats_type crtype
double dy
Vertical step size for resampling (in arcsec or pixel). The following defaults are taken when this va...
double pixfrac
Pixel down-scaling factor for the "drizzle" resampling method.
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...
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 ...
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.
muse_pixtable * muse_xcombine_tables(muse_pixtable **aPixtables)
combine the pixel tables of several exposures into one
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.