MUSE Pipeline Reference Manual  1.0.2
muse_astrometry_z.c
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  * This file is part of the MUSE Instrument Pipeline
5  * Copyright (C) 2005-2014 European Southern Observatory
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  */
21 
22 /* This file was automatically generated */
23 
24 #ifdef HAVE_CONFIG_H
25 #include <config.h>
26 #endif
27 
28 /*----------------------------------------------------------------------------*
29  * Includes *
30  *----------------------------------------------------------------------------*/
31 #include <string.h> /* strcmp(), strstr() */
32 #include <strings.h> /* strcasecmp() */
33 #include <cpl.h>
34 
35 #include "muse_astrometry_z.h" /* in turn includes muse.h */
36 
37 /*----------------------------------------------------------------------------*/
50 /*----------------------------------------------------------------------------*/
53 /*----------------------------------------------------------------------------*
54  * Static variables *
55  *----------------------------------------------------------------------------*/
56 static const char *muse_astrometry_help =
57  "Merge pixel tables from all IFUs, apply correction for differential atmospheric refraction, optionally apply flux calibration and telluric correction (if the necessary input data was given), and resample the data from all exposures into a datacube. Use the cube to detect objects which are then matched to their reference positions from which a two-dimensional WCS solution is computed.";
58 
59 static const char *muse_astrometry_help_esorex =
60  "\n\nInput frames for raw frame tag \"PIXTABLE_ASTROMETRY\":\n"
61  "\n Frame tag Type Req #Fr Description"
62  "\n -------------------- ---- --- --- ------------"
63  "\n PIXTABLE_ASTROMETRY raw Y Pixel table of an astrometric field"
64  "\n ASTROMETRY_REFERENCE calib Y 1 Reference table of known objects for astrometry"
65  "\n EXTINCT_TABLE calib . 1 Atmospheric extinction table"
66  "\n STD_RESPONSE calib . 1 Response curve as derived from standard star(s)"
67  "\n STD_TELLURIC calib . 1 Telluric absorption as derived from standard star(s)"
68  "\n\nProduct frames for raw frame tag \"PIXTABLE_ASTROMETRY\":\n"
69  "\n Frame tag Level Description"
70  "\n -------------------- -------- ------------"
71  "\n DATACUBE_ASTROMETRY final Reduced astrometry field exposure"
72  "\n ASTROMETRY_WCS final Astrometric solution";
73 
74 /*----------------------------------------------------------------------------*/
82 /*----------------------------------------------------------------------------*/
83 static cpl_recipeconfig *
84 muse_astrometry_new_recipeconfig(void)
85 {
86  cpl_recipeconfig *recipeconfig = cpl_recipeconfig_new();
87  const char *tag;
88 
89  tag = "PIXTABLE_ASTROMETRY";
90  cpl_recipeconfig_set_tag(recipeconfig, tag, 1, -1);
91  cpl_recipeconfig_set_input(recipeconfig, tag, "ASTROMETRY_REFERENCE", 1, 1);
92  cpl_recipeconfig_set_input(recipeconfig, tag, "EXTINCT_TABLE", -1, 1);
93  cpl_recipeconfig_set_input(recipeconfig, tag, "STD_RESPONSE", -1, 1);
94  cpl_recipeconfig_set_input(recipeconfig, tag, "STD_TELLURIC", -1, 1);
95  cpl_recipeconfig_set_output(recipeconfig, tag, "DATACUBE_ASTROMETRY");
96  cpl_recipeconfig_set_output(recipeconfig, tag, "ASTROMETRY_WCS");
97 
98  return recipeconfig;
99 } /* muse_astrometry_new_recipeconfig() */
100 
101 /*----------------------------------------------------------------------------*/
111 /*----------------------------------------------------------------------------*/
112 static cpl_error_code
113 muse_astrometry_prepare_header(const char *aFrametag, cpl_propertylist *aHeader)
114 {
115  cpl_ensure_code(aFrametag, CPL_ERROR_NULL_INPUT);
116  cpl_ensure_code(aHeader, CPL_ERROR_NULL_INPUT);
117  if (!strcmp(aFrametag, "DATACUBE_ASTROMETRY")) {
118  muse_processing_prepare_property(aHeader, "ESO QC ASTRO POS[0-9]+ X",
119  CPL_TYPE_FLOAT,
120  "[pix] Position of source k in x-direction in combined frame");
121  muse_processing_prepare_property(aHeader, "ESO QC ASTRO POS[0-9]+ Y",
122  CPL_TYPE_FLOAT,
123  "[pix] Position of source k in y-direction in combined frame");
124  muse_processing_prepare_property(aHeader, "ESO QC ASTRO FWHM[0-9]+ X",
125  CPL_TYPE_FLOAT,
126  "[arcsec] FWHM of source k in x-direction in combined frame");
127  muse_processing_prepare_property(aHeader, "ESO QC ASTRO FWHM[0-9]+ Y",
128  CPL_TYPE_FLOAT,
129  "[arcsec] FWHM of source k in y-direction in combined frame");
130  } else if (!strcmp(aFrametag, "ASTROMETRY_WCS")) {
131  muse_processing_prepare_property(aHeader, "ESO QC ASTRO NSTARS",
132  CPL_TYPE_INT,
133  "Number of stars identified for the astrometric solution");
134  muse_processing_prepare_property(aHeader, "ESO QC ASTRO SCALE X",
135  CPL_TYPE_FLOAT,
136  "[arcsec] Computed scale in x-direction");
137  muse_processing_prepare_property(aHeader, "ESO QC ASTRO SCALE Y",
138  CPL_TYPE_FLOAT,
139  "[arcsec] Computed scale in y-direction");
140  muse_processing_prepare_property(aHeader, "ESO QC ASTRO ANGLE X",
141  CPL_TYPE_FLOAT,
142  "[deg] Computed angle in x-direction");
143  muse_processing_prepare_property(aHeader, "ESO QC ASTRO ANGLE Y",
144  CPL_TYPE_FLOAT,
145  "[deg] Computed angle in y-direction");
146  muse_processing_prepare_property(aHeader, "ESO QC ASTRO MEDRES X",
147  CPL_TYPE_FLOAT,
148  "[arcsec] Median residuals of astrometric fit in x-direction");
149  muse_processing_prepare_property(aHeader, "ESO QC ASTRO MEDRES Y",
150  CPL_TYPE_FLOAT,
151  "[arcsec] Median residuals of astrometric fit in y-direction");
152  } else {
153  cpl_msg_warning(__func__, "Frame tag %s is not defined", aFrametag);
154  return CPL_ERROR_ILLEGAL_INPUT;
155  }
156  return CPL_ERROR_NONE;
157 } /* muse_astrometry_prepare_header() */
158 
159 /*----------------------------------------------------------------------------*/
168 /*----------------------------------------------------------------------------*/
169 static cpl_frame_level
170 muse_astrometry_get_frame_level(const char *aFrametag)
171 {
172  if (!aFrametag) {
173  return CPL_FRAME_LEVEL_NONE;
174  }
175  if (!strcmp(aFrametag, "DATACUBE_ASTROMETRY")) {
176  return CPL_FRAME_LEVEL_FINAL;
177  }
178  if (!strcmp(aFrametag, "ASTROMETRY_WCS")) {
179  return CPL_FRAME_LEVEL_FINAL;
180  }
181  return CPL_FRAME_LEVEL_NONE;
182 } /* muse_astrometry_get_frame_level() */
183 
184 /*----------------------------------------------------------------------------*/
193 /*----------------------------------------------------------------------------*/
194 static muse_frame_mode
195 muse_astrometry_get_frame_mode(const char *aFrametag)
196 {
197  if (!aFrametag) {
198  return MUSE_FRAME_MODE_ALL;
199  }
200  if (!strcmp(aFrametag, "DATACUBE_ASTROMETRY")) {
202  }
203  if (!strcmp(aFrametag, "ASTROMETRY_WCS")) {
205  }
206  return MUSE_FRAME_MODE_ALL;
207 } /* muse_astrometry_get_frame_mode() */
208 
209 /*----------------------------------------------------------------------------*/
219 /*----------------------------------------------------------------------------*/
220 static int
221 muse_astrometry_create(cpl_plugin *aPlugin)
222 {
223  /* Check that the plugin is part of a valid recipe */
224  cpl_recipe *recipe;
225  if (cpl_plugin_get_type(aPlugin) == CPL_PLUGIN_TYPE_RECIPE) {
226  recipe = (cpl_recipe *)aPlugin;
227  } else {
228  return -1;
229  }
230 
231  /* register the extended processing information (new FITS header creation, *
232  * getting of the frame level for a certain tag) */
234  muse_astrometry_new_recipeconfig(),
235  muse_astrometry_prepare_header,
236  muse_astrometry_get_frame_level,
237  muse_astrometry_get_frame_mode);
238 
239  /* XXX initialize timing in messages *
240  * since at least esorex is too stupid to turn it on, we have to do it */
242  cpl_msg_set_time_on();
243  }
244 
245  /* Create the parameter list in the cpl_recipe object */
246  recipe->parameters = cpl_parameterlist_new();
247  /* Fill the parameters list */
248  cpl_parameter *p;
249 
250  /* --centroid: Centroiding method to use for objects in the field of view. "gaussian" and "moffat" use 2D fits to derive the centroid, "box" is a simple centroid in a square box. */
251  p = cpl_parameter_new_enum("muse.muse_astrometry.centroid",
252  CPL_TYPE_STRING,
253  "Centroiding method to use for objects in the field of view. \"gaussian\" and \"moffat\" use 2D fits to derive the centroid, \"box\" is a simple centroid in a square box.",
254  "muse.muse_astrometry",
255  (const char *)"moffat",
256  3,
257  (const char *)"gaussian",
258  (const char *)"moffat",
259  (const char *)"box");
260  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG, "centroid");
261  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "centroid");
262 
263  cpl_parameterlist_append(recipe->parameters, p);
264 
265  /* --detsigma: Source detection sigma level to use. */
266  p = cpl_parameter_new_value("muse.muse_astrometry.detsigma",
267  CPL_TYPE_DOUBLE,
268  "Source detection sigma level to use.",
269  "muse.muse_astrometry",
270  (double)3.);
271  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG, "detsigma");
272  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "detsigma");
273 
274  cpl_parameterlist_append(recipe->parameters, p);
275 
276  /* --radius: Initial radius in pixels for pattern matching identification in the astrometric field. */
277  p = cpl_parameter_new_value("muse.muse_astrometry.radius",
278  CPL_TYPE_DOUBLE,
279  "Initial radius in pixels for pattern matching identification in the astrometric field.",
280  "muse.muse_astrometry",
281  (double)5.);
282  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG, "radius");
283  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "radius");
284 
285  cpl_parameterlist_append(recipe->parameters, p);
286 
287  /* --faccuracy: Factor of initial accuracy relative to mean positional accuracy of the measured positions to use for pattern matching. */
288  p = cpl_parameter_new_value("muse.muse_astrometry.faccuracy",
289  CPL_TYPE_DOUBLE,
290  "Factor of initial accuracy relative to mean positional accuracy of the measured positions to use for pattern matching.",
291  "muse.muse_astrometry",
292  (double)5.);
293  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG, "faccuracy");
294  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "faccuracy");
295 
296  cpl_parameterlist_append(recipe->parameters, p);
297 
298  /* --niter: Number of iterations of the astrometric fit. */
299  p = cpl_parameter_new_value("muse.muse_astrometry.niter",
300  CPL_TYPE_INT,
301  "Number of iterations of the astrometric fit.",
302  "muse.muse_astrometry",
303  (int)2);
304  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG, "niter");
305  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "niter");
306 
307  cpl_parameterlist_append(recipe->parameters, p);
308 
309  /* --rejsigma: Rejection sigma level of the astrometric fit. */
310  p = cpl_parameter_new_value("muse.muse_astrometry.rejsigma",
311  CPL_TYPE_DOUBLE,
312  "Rejection sigma level of the astrometric fit.",
313  "muse.muse_astrometry",
314  (double)3.);
315  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG, "rejsigma");
316  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "rejsigma");
317 
318  cpl_parameterlist_append(recipe->parameters, p);
319 
320  /* --rotcenter: Center of rotation of the instrument, given as two comma-separated floating point values in pixels. */
321  p = cpl_parameter_new_value("muse.muse_astrometry.rotcenter",
322  CPL_TYPE_STRING,
323  "Center of rotation of the instrument, given as two comma-separated floating point values in pixels.",
324  "muse.muse_astrometry",
325  (const char *)"-0.01,-1.20");
326  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG, "rotcenter");
327  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "rotcenter");
328 
329  cpl_parameterlist_append(recipe->parameters, p);
330 
331  /* --lambdamin: Cut off the data below this wavelength after loading the pixel table(s). */
332  p = cpl_parameter_new_value("muse.muse_astrometry.lambdamin",
333  CPL_TYPE_DOUBLE,
334  "Cut off the data below this wavelength after loading the pixel table(s).",
335  "muse.muse_astrometry",
336  (double)4000.);
337  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG, "lambdamin");
338  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "lambdamin");
339 
340  cpl_parameterlist_append(recipe->parameters, p);
341 
342  /* --lambdamax: Cut off the data above this wavelength after loading the pixel table(s). */
343  p = cpl_parameter_new_value("muse.muse_astrometry.lambdamax",
344  CPL_TYPE_DOUBLE,
345  "Cut off the data above this wavelength after loading the pixel table(s).",
346  "muse.muse_astrometry",
347  (double)10000.);
348  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG, "lambdamax");
349  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "lambdamax");
350 
351  cpl_parameterlist_append(recipe->parameters, p);
352 
353  /* --lambdaref: Reference wavelength used for correction of differential atmospheric refraction. The R-band (peak wavelength ~7000 Angstrom) that is usually used for guiding, is close to the central wavelength of MUSE, so a value of 7000.0 Angstrom should be used if nothing else is known. A value less than zero switches DAR correction off. */
354  p = cpl_parameter_new_value("muse.muse_astrometry.lambdaref",
355  CPL_TYPE_DOUBLE,
356  "Reference wavelength used for correction of differential atmospheric refraction. The R-band (peak wavelength ~7000 Angstrom) that is usually used for guiding, is close to the central wavelength of MUSE, so a value of 7000.0 Angstrom should be used if nothing else is known. A value less than zero switches DAR correction off.",
357  "muse.muse_astrometry",
358  (double)7000.);
359  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG, "lambdaref");
360  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "lambdaref");
361 
362  cpl_parameterlist_append(recipe->parameters, p);
363 
364  /* --darcheck: Carry out a check of the theoretical DAR correction using source centroiding. If "correct" it will also apply an empirical correction. */
365  p = cpl_parameter_new_enum("muse.muse_astrometry.darcheck",
366  CPL_TYPE_STRING,
367  "Carry out a check of the theoretical DAR correction using source centroiding. If \"correct\" it will also apply an empirical correction.",
368  "muse.muse_astrometry",
369  (const char *)"none",
370  3,
371  (const char *)"none",
372  (const char *)"check",
373  (const char *)"correct");
374  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG, "darcheck");
375  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "darcheck");
376 
377  cpl_parameterlist_append(recipe->parameters, p);
378 
379  return 0;
380 } /* muse_astrometry_create() */
381 
382 /*----------------------------------------------------------------------------*/
393 /*----------------------------------------------------------------------------*/
394 static int
395 muse_astrometry_params_fill(muse_astrometry_params_t *aParams, cpl_parameterlist *aParameters)
396 {
397  cpl_ensure_code(aParams, CPL_ERROR_NULL_INPUT);
398  cpl_ensure_code(aParameters, CPL_ERROR_NULL_INPUT);
399  cpl_parameter *p;
400 
401  p = cpl_parameterlist_find(aParameters, "muse.muse_astrometry.centroid");
402  cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
403  aParams->centroid_s = cpl_parameter_get_string(p);
404  aParams->centroid =
405  (!strcasecmp(aParams->centroid_s, "gaussian")) ? MUSE_ASTROMETRY_PARAM_CENTROID_GAUSSIAN :
406  (!strcasecmp(aParams->centroid_s, "moffat")) ? MUSE_ASTROMETRY_PARAM_CENTROID_MOFFAT :
407  (!strcasecmp(aParams->centroid_s, "box")) ? MUSE_ASTROMETRY_PARAM_CENTROID_BOX :
408  MUSE_ASTROMETRY_PARAM_CENTROID_INVALID_VALUE;
409  cpl_ensure_code(aParams->centroid != MUSE_ASTROMETRY_PARAM_CENTROID_INVALID_VALUE,
410  CPL_ERROR_ILLEGAL_INPUT);
411 
412  p = cpl_parameterlist_find(aParameters, "muse.muse_astrometry.detsigma");
413  cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
414  aParams->detsigma = cpl_parameter_get_double(p);
415 
416  p = cpl_parameterlist_find(aParameters, "muse.muse_astrometry.radius");
417  cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
418  aParams->radius = cpl_parameter_get_double(p);
419 
420  p = cpl_parameterlist_find(aParameters, "muse.muse_astrometry.faccuracy");
421  cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
422  aParams->faccuracy = cpl_parameter_get_double(p);
423 
424  p = cpl_parameterlist_find(aParameters, "muse.muse_astrometry.niter");
425  cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
426  aParams->niter = cpl_parameter_get_int(p);
427 
428  p = cpl_parameterlist_find(aParameters, "muse.muse_astrometry.rejsigma");
429  cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
430  aParams->rejsigma = cpl_parameter_get_double(p);
431 
432  p = cpl_parameterlist_find(aParameters, "muse.muse_astrometry.rotcenter");
433  cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
434  aParams->rotcenter = cpl_parameter_get_string(p);
435 
436  p = cpl_parameterlist_find(aParameters, "muse.muse_astrometry.lambdamin");
437  cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
438  aParams->lambdamin = cpl_parameter_get_double(p);
439 
440  p = cpl_parameterlist_find(aParameters, "muse.muse_astrometry.lambdamax");
441  cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
442  aParams->lambdamax = cpl_parameter_get_double(p);
443 
444  p = cpl_parameterlist_find(aParameters, "muse.muse_astrometry.lambdaref");
445  cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
446  aParams->lambdaref = cpl_parameter_get_double(p);
447 
448  p = cpl_parameterlist_find(aParameters, "muse.muse_astrometry.darcheck");
449  cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
450  aParams->darcheck_s = cpl_parameter_get_string(p);
451  aParams->darcheck =
452  (!strcasecmp(aParams->darcheck_s, "none")) ? MUSE_ASTROMETRY_PARAM_DARCHECK_NONE :
453  (!strcasecmp(aParams->darcheck_s, "check")) ? MUSE_ASTROMETRY_PARAM_DARCHECK_CHECK :
454  (!strcasecmp(aParams->darcheck_s, "correct")) ? MUSE_ASTROMETRY_PARAM_DARCHECK_CORRECT :
455  MUSE_ASTROMETRY_PARAM_DARCHECK_INVALID_VALUE;
456  cpl_ensure_code(aParams->darcheck != MUSE_ASTROMETRY_PARAM_DARCHECK_INVALID_VALUE,
457  CPL_ERROR_ILLEGAL_INPUT);
458 
459  return 0;
460 } /* muse_astrometry_params_fill() */
461 
462 /*----------------------------------------------------------------------------*/
469 /*----------------------------------------------------------------------------*/
470 static int
471 muse_astrometry_exec(cpl_plugin *aPlugin)
472 {
473  if (cpl_plugin_get_type(aPlugin) != CPL_PLUGIN_TYPE_RECIPE) {
474  return -1;
475  }
476  cpl_recipe *recipe = (cpl_recipe *)aPlugin;
477  cpl_msg_set_threadid_on();
478 
479  cpl_frameset *usedframes = cpl_frameset_new(),
480  *outframes = cpl_frameset_new();
482  muse_astrometry_params_fill(&params, recipe->parameters);
483 
484  cpl_errorstate prestate = cpl_errorstate_get();
485 
486  muse_processing *proc = muse_processing_new("muse_astrometry",
487  recipe);
488  int rc = muse_astrometry_compute(proc, &params);
489  cpl_frameset_join(usedframes, proc->usedframes);
490  cpl_frameset_join(outframes, proc->outframes);
492 
493  if (!cpl_errorstate_is_equal(prestate)) {
494  /* dump all errors from this recipe in chronological order */
495  cpl_errorstate_dump(prestate, CPL_FALSE, muse_cplerrorstate_dump_some);
496  /* reset message level to not get the same errors displayed again by esorex */
497  cpl_msg_set_level(CPL_MSG_INFO);
498  }
499  /* clean up duplicates in framesets of used and output frames */
502 
503  /* to get esorex to see our classification (frame groups etc.), *
504  * replace the original frameset with the list of used frames *
505  * before appending product output frames */
506  /* keep the same pointer, so just erase all frames, not delete the frameset */
507  muse_cplframeset_erase_all(recipe->frames);
508  cpl_frameset_join(recipe->frames, usedframes);
509  cpl_frameset_join(recipe->frames, outframes);
510  cpl_frameset_delete(usedframes);
511  cpl_frameset_delete(outframes);
512  return rc;
513 } /* muse_astrometry_exec() */
514 
515 /*----------------------------------------------------------------------------*/
522 /*----------------------------------------------------------------------------*/
523 static int
524 muse_astrometry_destroy(cpl_plugin *aPlugin)
525 {
526  /* Get the recipe from the plugin */
527  cpl_recipe *recipe;
528  if (cpl_plugin_get_type(aPlugin) == CPL_PLUGIN_TYPE_RECIPE) {
529  recipe = (cpl_recipe *)aPlugin;
530  } else {
531  return -1;
532  }
533 
534  /* Clean up */
535  cpl_parameterlist_delete(recipe->parameters);
537  return 0;
538 } /* muse_astrometry_destroy() */
539 
540 /*----------------------------------------------------------------------------*/
550 /*----------------------------------------------------------------------------*/
551 int
552 cpl_plugin_get_info(cpl_pluginlist *aList)
553 {
554  cpl_recipe *recipe = cpl_calloc(1, sizeof *recipe);
555  cpl_plugin *plugin = &recipe->interface;
556 
557  char *helptext;
559  helptext = cpl_sprintf("%s%s", muse_astrometry_help,
560  muse_astrometry_help_esorex);
561  } else {
562  helptext = cpl_sprintf("%s", muse_astrometry_help);
563  }
564 
565  /* Initialize the CPL plugin stuff for this module */
566  cpl_plugin_init(plugin, CPL_PLUGIN_API, MUSE_BINARY_VERSION,
567  CPL_PLUGIN_TYPE_RECIPE,
568  "muse_astrometry",
569  "Compute an astrometric solution.",
570  helptext,
571  "Peter Weilbacher",
572  "usd-help@eso.org",
574  muse_astrometry_create,
575  muse_astrometry_exec,
576  muse_astrometry_destroy);
577  cpl_pluginlist_append(aList, plugin);
578  cpl_free(helptext);
579 
580  return 0;
581 } /* cpl_plugin_get_info() */
582 
void muse_processing_delete(muse_processing *aProcessing)
Free the muse_processing structure.
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_cplframework_type muse_cplframework(void)
Return the CPL framework the recipe is run under.
cpl_frameset * usedframes
muse_processing * muse_processing_new(const char *aName, cpl_recipe *aRecipe)
Create a new processing structure.
const char * muse_get_license(void)
Get the pipeline copyright and license.
Definition: muse_utils.c:84
double radius
Initial radius in pixels for pattern matching identification in the astrometric field.
muse_frame_mode
double lambdamin
Cut off the data below this wavelength after loading the pixel table(s).
cpl_frameset * outframes
int centroid
Centroiding method to use for objects in the field of view. "gaussian" and "moffat" use 2D fits to de...
void muse_cplerrorstate_dump_some(unsigned aCurrent, unsigned aFirst, unsigned aLast)
Dump some CPL errors.
void muse_processinginfo_delete(cpl_recipe *)
Clear all information from the processing info and from the recipe config.
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.
const char * darcheck_s
Carry out a check of the theoretical DAR correction using source centroiding. If "correct" it will al...
double detsigma
Source detection sigma level to use.
cpl_error_code muse_cplframeset_erase_duplicate(cpl_frameset *aFrames)
Erase all duplicate frames from a frameset.
cpl_error_code muse_cplframeset_erase_all(cpl_frameset *aFrames)
Erase all frames in a frameset.
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.
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.
double lambdamax
Cut off the data above this wavelength after loading the pixel table(s).
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...
cpl_error_code muse_processing_prepare_property(cpl_propertylist *, const char *, cpl_type, const char *)
Prepare and check the specified property.