32 #include "muse_astrometry_z.h"
61 prop->
darcheck = MUSE_POSTPROC_DARCHECK_NONE;
62 if (aParams->
darcheck == MUSE_ASTROMETRY_PARAM_DARCHECK_CHECK) {
63 prop->
darcheck = MUSE_POSTPROC_DARCHECK_CHECK;
64 }
else if (aParams->
darcheck == MUSE_ASTROMETRY_PARAM_DARCHECK_CORRECT) {
65 prop->
darcheck = MUSE_POSTPROC_DARCHECK_CORRECT;
74 if (aParams->
centroid == MUSE_ASTROMETRY_PARAM_CENTROID_MOFFAT) {
76 }
else if (aParams->
centroid == MUSE_ASTROMETRY_PARAM_CENTROID_BOX) {
78 }
else if (aParams->
centroid != MUSE_ASTROMETRY_PARAM_CENTROID_GAUSSIAN) {
79 cpl_msg_error(__func__,
"unknown centroiding method \"%s\"", aParams->
centroid_s);
85 if (rotcenter && cpl_array_get_size(rotcenter) >= 2) {
86 prop->crpix1 = atof(cpl_array_get_string(rotcenter, 0));
87 prop->
crpix2 = atof(cpl_array_get_string(rotcenter, 1));
89 cpl_array_delete(rotcenter);
97 MUSE_TAG_ASTROMETRY_REFERENCE, 0);
99 cpl_msg_error(__func__,
"Required input %s not found in input files",
100 MUSE_TAG_ASTROMETRY_REFERENCE);
101 cpl_error_set_message(__func__, CPL_ERROR_NULL_INPUT,
102 MUSE_TAG_ASTROMETRY_REFERENCE
" missing");
110 cpl_msg_error(__func__,
"no astrometric exposures found in input");
114 int nexposures = cpl_table_get_nrow(prop->
exposures);
119 for (i = 0; i < nexposures; i++) {
123 for (i2 = 0; i2 <= i; i2++) {
135 cpl_error_code rc = CPL_ERROR_NONE;
137 for (i = 0; i < nexposures; i++) {
141 wcsobjs[i]->cube->
recnames = cpl_array_new(1, CPL_TYPE_STRING);
143 cpl_array_set_string(wcsobjs[i]->cube->recnames, 0,
"white");
150 char *
object = cpl_sprintf(
"Astrometric calibration (%s)",
151 cpl_propertylist_get_string(wcsobjs[i]->cube->header,
153 cpl_propertylist_update_string(wcsobjs[i]->wcs,
"OBJECT",
object);
155 MUSE_TAG_ASTROMETRY_WCS);
157 if (rc != CPL_ERROR_NONE) {
158 for ( ; i < nexposures; i++) {
168 cpl_table_delete(fwhite);
171 return rc == CPL_ERROR_NONE ? 0 : -1;
muse_postproc_properties * muse_postproc_properties_new(muse_postproc_type aType)
Create a post-processing properties object.
muse_wcs_centroid_type centroid
double rejsigma
Rejection sigma level of the astrometric fit.
double lambdaref
Reference wavelength used for correction of differential atmospheric refraction. The R-band (peak wav...
muse_image * muse_datacube_collapse(muse_datacube *aCube, cpl_table *aFilter)
Integrate a FITS NAXIS=3 datacube along the wavelength direction.
cpl_error_code muse_postproc_qc_fwhm(muse_processing *aProcessing, muse_datacube *aCube)
Compute QC1 parameters for datacubes and save them in the FITS header.
void * muse_postproc_process_exposure(muse_postproc_properties *aProp, unsigned int aIndex, muse_postproc_sky_outputs *aSkyOut)
Merge and process pixel tables from one exposure.
WCS object to store data needed while computing the astrometric solution.
Structure definition of MUSE three extension FITS file.
cpl_array * recnames
the reconstructed image filter names
cpl_table * muse_table_load_filter(muse_processing *aProcessing, const char *aFilterName)
Load a table for a given filter name.
cpl_array * muse_cplarray_new_from_delimited_string(const char *aString, const char *aDelim)
Convert a delimited string into an array of strings.
cpl_error_code muse_processing_save_header(muse_processing *aProcessing, int aIFU, cpl_propertylist *aHeader, const char *aTag)
Save a FITS header to disk.
double radius
Initial radius in pixels for pattern matching identification in the astrometric field.
cpl_error_code muse_datacube_convert_dq(muse_datacube *aCube)
Convert the DQ extension of a datacube to NANs in DATA and STAT.
double lambdamin
Cut off the data below this wavelength after loading the pixel table(s).
cpl_error_code muse_processing_save_cube(muse_processing *aProcessing, int aIFU, void *aCube, const char *aTag, muse_cube_type aType)
Save a MUSE datacube to disk.
int centroid
Centroiding method to use for objects in the field of view. "gaussian" and "moffat" use 2D fits to de...
Structure definition of the post-processing properties.
void muse_postproc_properties_delete(muse_postproc_properties *aProp)
Free memory taken by a post-processing properties object and all its components.
const char * centroid_s
Centroiding method to use for objects in the field of view. "gaussian" and "moffat" use 2D fits to de...
int niter
Number of iterations of the astrometric fit.
double detsigma
Source detection sigma level to use.
const char * rotcenter
Center of rotation of the instrument, given as two comma-separated floating point values in pixels...
muse_imagelist * muse_imagelist_new(void)
Create a new (empty) MUSE image list.
Structure to hold the parameters of the muse_astrometry recipe.
cpl_table * muse_table_load(muse_processing *aProcessing, const char *aTag, unsigned char aIFU)
load a table according to its tag and IFU/channel number
double lambdamax
Cut off the data above this wavelength after loading the pixel table(s).
void muse_wcs_object_delete(muse_wcs_object *aWCSObj)
Deallocate memory associated to a muse_wcs_object.
cpl_table * muse_processing_sort_exposures(muse_processing *aProcessing)
Sort input frames (containing lists of pixel table filenames) into different exposures.
muse_postproc_darcheck darcheck
cpl_error_code muse_imagelist_set(muse_imagelist *aList, muse_image *aImage, unsigned int aIdx)
Set the muse_image of given list index.
cpl_frame * muse_frameset_find_master(const cpl_frameset *aFrames, const char *aTag, unsigned char aIFU)
find the master frame according to its CCD number and tag
muse_imagelist * recimages
the reconstructed image data
double faccuracy
Factor of initial accuracy relative to mean positional accuracy of the measured positions to use for ...
int darcheck
Carry out a check of the theoretical DAR correction using source centroiding. If "correct" it will al...