32 #include "muse_astrometry_z.h" 56 cpl_errorstate state = cpl_errorstate_get();
63 prop->
darcheck = MUSE_POSTPROC_DARCHECK_NONE;
64 if (aParams->
darcheck == MUSE_ASTROMETRY_PARAM_DARCHECK_CHECK) {
65 prop->
darcheck = MUSE_POSTPROC_DARCHECK_CHECK;
66 }
else if (aParams->
darcheck == MUSE_ASTROMETRY_PARAM_DARCHECK_CORRECT) {
67 prop->
darcheck = MUSE_POSTPROC_DARCHECK_CORRECT;
76 if (aParams->
centroid == MUSE_ASTROMETRY_PARAM_CENTROID_MOFFAT) {
78 }
else if (aParams->
centroid == MUSE_ASTROMETRY_PARAM_CENTROID_BOX) {
80 }
else if (aParams->
centroid != MUSE_ASTROMETRY_PARAM_CENTROID_GAUSSIAN) {
81 cpl_msg_error(__func__,
"unknown centroiding method \"%s\"", aParams->
centroid_s);
87 if (rotcenter && cpl_array_get_size(rotcenter) >= 2) {
88 prop->crpix1 = atof(cpl_array_get_string(rotcenter, 0));
89 prop->
crpix2 = atof(cpl_array_get_string(rotcenter, 1));
91 cpl_array_delete(rotcenter);
95 MUSE_TAG_STD_RESPONSE, 0);
97 MUSE_TAG_STD_TELLURIC, 0);
99 MUSE_TAG_EXTINCT_TABLE, 0);
102 MUSE_TAG_ASTROMETRY_REFERENCE, 0);
104 cpl_msg_error(__func__,
"Required input %s not found in input files",
105 MUSE_TAG_ASTROMETRY_REFERENCE);
106 cpl_error_set_message(__func__, CPL_ERROR_NULL_INPUT,
107 MUSE_TAG_ASTROMETRY_REFERENCE
" missing");
112 CPL_FRAME_GROUP_CALIB, 1);
117 cpl_msg_error(__func__,
"no astrometric exposures found in input");
121 int nexposures = cpl_table_get_nrow(prop->
exposures);
126 for (i = 0; i < nexposures; i++) {
130 for (i2 = 0; i2 <= i; i2++) {
142 for (i = 0; i < nexposures; i++) {
151 char *
object = cpl_sprintf(
"Astrometric calibration (%s)",
152 cpl_propertylist_get_string(wcsobjs[i]->cube->header,
154 cpl_propertylist_update_string(wcsobjs[i]->wcs,
"OBJECT",
object);
157 MUSE_TAG_ASTROMETRY_WCS);
159 if (rc != CPL_ERROR_NONE) {
160 for ( ; i < nexposures; i++) {
172 return cpl_errorstate_is_equal(state) ? 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...
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.
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...
muse_table * muse_processing_load_table(muse_processing *aProcessing, const char *aTag, unsigned char aIFU)
Load a MUSE table according to its tag and IFU/channel number.
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...
void muse_processing_append_used(muse_processing *aProcessing, cpl_frame *aFrame, cpl_frame_group aGroup, int aDuplicate)
Add a frame to the set of used frames.
int niter
Number of iterations of the astrometric fit.
double detsigma
Source detection sigma level to use. If this is negative, values between its absolute and 1...
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.
const char * rotcenter
Center of rotation of the instrument, given as two comma-separated floating point values in pixels...
Structure to hold the parameters of the muse_astrometry recipe.
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_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
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...