VIRCAM Pipeline  2.3.10
vircam_standard_process.c
1 /* $Id: vircam_standard_process.c,v 1.43 2012-01-16 12:32:18 jim Exp $
2  *
3  * This file is part of the VIRCAM Pipeline
4  * Copyright (C) 2015 European Southern Observatory
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  */
20 
21 /*
22  * $Author: jim $
23  * $Date: 2012-01-16 12:32:18 $
24  * $Revision: 1.43 $
25  * $Name: not supported by cvs2svn $
26  */
27 
28 /* Includes */
29 
30 #ifdef HAVE_CONFIG_H
31 #include <config.h>
32 #endif
33 
34 #include <stdio.h>
35 #include <math.h>
36 #include <string.h>
37 #include <cpl.h>
38 
39 #include <casu_utils.h>
40 #include <casu_mods.h>
41 #include <casu_mask.h>
42 
43 #include "vircam_utils.h"
44 #include "vircam_pfits.h"
45 #include "vircam_dfs.h"
46 #include "vircam_mods.h"
47 #include "vircam_jmp_utils.h"
48 #include "vircam_paf.h"
49 
50 /* Function prototypes */
51 
52 static int vircam_standard_process_create(cpl_plugin *);
53 static int vircam_standard_process_exec(cpl_plugin *);
54 static int vircam_standard_process_destroy(cpl_plugin *);
55 static int vircam_standard_process(cpl_parameterlist *,cpl_frameset *);
56 static cpl_propertylist *vircam_standard_process_dummyqc(int type);
57 
58 
59 static char vircam_standard_process_description[] =
60 "vircam_standard_process -- VIRCAM standard field processing recipe.\n\n"
61 "Process a complete pawprint for standard fields in VIRCAM data.\n"
62 "Remove instrumental signature, interleave microstep sequences (if done),\n"
63 "combine jitters, photometrically and astrometrically calibrate the pawprint\n"
64 "image. Photometric calibration can be done with 2mass and 1 other source\n\n"
65 "The program accepts the following files in the SOF:\n\n"
66 " Tag Description\n"
67 " -----------------------------------------------------------------------\n"
68 " %-21s A list of raw science images\n"
69 " %-21s A master dark frame\n"
70 " %-21s A master twilight flat frame\n"
71 " %-21s A channel table\n"
72 " %-21s A photometric calibration table\n"
73 " %-21s A readnoise/gain file\n"
74 " %-21s A master confidence map or\n"
75 " %-21s A master bad pixel mask\n"
76 " %-21s A master 2mass catalogue index\n"
77 " %-21s A second reference catalogue index\n"
78 "All of the above are required\n"
79 "\n";
80 
224 /* Function code */
225 
226 /*---------------------------------------------------------------------------*/
234 /*---------------------------------------------------------------------------*/
235 
236 int cpl_plugin_get_info(cpl_pluginlist *list) {
237  cpl_recipe *recipe = cpl_calloc(1,sizeof(*recipe));
238  cpl_plugin *plugin = &recipe->interface;
239  char alldesc[SZ_ALLDESC];
240  (void)snprintf(alldesc,SZ_ALLDESC,vircam_standard_process_description,
241  VIRCAM_STD_OBJECT_RAW,VIRCAM_CAL_DARK,
242  VIRCAM_CAL_TWILIGHT_FLAT,VIRCAM_CAL_CHANTAB,
243  VIRCAM_CAL_PHOTTAB,VIRCAM_CAL_READGAINFILE,VIRCAM_CAL_CONF,
244  VIRCAM_CAL_BPM,VIRCAM_CAL_2MASS,VIRCAM_CAL_REFCAT);
245 
246  cpl_plugin_init(plugin,
247  CPL_PLUGIN_API,
248  VIRCAM_BINARY_VERSION,
249  CPL_PLUGIN_TYPE_RECIPE,
250  "vircam_standard_process",
251  "VIRCAM standard field processing recipe",
252  alldesc,
253  "Jim Lewis",
254  "jrl@ast.cam.ac.uk",
256  vircam_standard_process_create,
257  vircam_standard_process_exec,
258  vircam_standard_process_destroy);
259 
260  cpl_pluginlist_append(list,plugin);
261 
262  return(0);
263 }
264 
265 /*---------------------------------------------------------------------------*/
274 /*---------------------------------------------------------------------------*/
275 
276 static int vircam_standard_process_create(cpl_plugin *plugin) {
277  cpl_recipe *recipe;
278  cpl_parameter *p;
279 
280  /* Get the recipe out of the plugin */
281 
282  if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
283  recipe = (cpl_recipe *)plugin;
284  else
285  return(-1);
286 
287  /* Create the parameters list in the cpl_recipe object */
288 
289  recipe->parameters = cpl_parameterlist_new();
290 
291  /* Fill in the minimum object size */
292 
293  p = cpl_parameter_new_value("vircam.vircam_standard_process.ipix",
294  CPL_TYPE_INT,
295  "Minimum pixel area for each detected object",
296  "vircam.vircam_standard_process",5);
297  cpl_parameter_set_alias(p,CPL_PARAMETER_MODE_CLI,"ipix");
298  cpl_parameterlist_append(recipe->parameters,p);
299 
300  /* Fill in the detection threshold parameter */
301 
302  p = cpl_parameter_new_value("vircam.vircam_standard_process.thresh",
303  CPL_TYPE_DOUBLE,
304  "Detection threshold in sigma above sky",
305  "vircam.vircam_standard_process",2.0);
306  cpl_parameter_set_alias(p,CPL_PARAMETER_MODE_CLI,"thr");
307  cpl_parameterlist_append(recipe->parameters,p);
308 
309  /* Fill in flag to use deblending software or not */
310 
311  p = cpl_parameter_new_value("vircam.vircam_standard_process.icrowd",
312  CPL_TYPE_BOOL,"Use deblending?",
313  "vircam.vircam_standard_process",1);
314  cpl_parameter_set_alias(p,CPL_PARAMETER_MODE_CLI,"icrowd");
315  cpl_parameterlist_append(recipe->parameters,p);
316 
317  /* Fill in core radius */
318 
319  p = cpl_parameter_new_value("vircam.vircam_standard_process.rcore",
320  CPL_TYPE_DOUBLE,"Value of Rcore in pixels",
321  "vircam.vircam_standard_process",3.0);
322  cpl_parameter_set_alias(p,CPL_PARAMETER_MODE_CLI,"rcore");
323  cpl_parameterlist_append(recipe->parameters,p);
324 
325  /* Fill in background smoothing box size */
326 
327  p = cpl_parameter_new_value("vircam.vircam_standard_process.nbsize",
328  CPL_TYPE_INT,"Background smoothing box size",
329  "vircam.vircam_standard_process",64);
330  cpl_parameter_set_alias(p,CPL_PARAMETER_MODE_CLI,"nb");
331  cpl_parameterlist_append(recipe->parameters,p);
332 
333  /* Fill in flag to use save the output catalogue */
334 
335  p = cpl_parameter_new_value("vircam.vircam_standard_process.savecat",
336  CPL_TYPE_BOOL,"Save catalogue?",
337  "vircam.vircam_standard_process",1);
338  cpl_parameter_set_alias(p,CPL_PARAMETER_MODE_CLI,"savecat");
339  cpl_parameterlist_append(recipe->parameters,p);
340 
341 
342  /* Fill in flag to destripe the images */
343 
344  p = cpl_parameter_new_value("vircam.vircam_standard_process.destripe",
345  CPL_TYPE_BOOL,"Destripe images?",
346  "vircam.vircam_standard_process",1);
347  cpl_parameter_set_alias(p,CPL_PARAMETER_MODE_CLI,"destripe");
348  cpl_parameterlist_append(recipe->parameters,p);
349 
350  /* Fill in flag to correct sky background */
351 
352  p = cpl_parameter_new_value("vircam.vircam_standard_process.skycor",
353  CPL_TYPE_BOOL,"Do sky correction?",
354  "vircam.vircam_standard_process",1);
355  cpl_parameter_set_alias(p,CPL_PARAMETER_MODE_CLI,"skycor");
356  cpl_parameterlist_append(recipe->parameters,p);
357 
358  /* Fill in flag to save simple images */
359 
360  p = cpl_parameter_new_value("vircam.vircam_standard_process.savesimple",
361  CPL_TYPE_BOOL,"Save simple images?",
362  "vircam.vircam_standard_process",0);
363  cpl_parameter_set_alias(p,CPL_PARAMETER_MODE_CLI,"savesimple");
364  cpl_parameterlist_append(recipe->parameters,p);
365 
366  /* Extension number of input frames to use */
367 
368  p = cpl_parameter_new_range("vircam.vircam_standard_process.extenum",
369  CPL_TYPE_INT,
370  "Extension number to be done, 0 == all",
371  "vircam.vircam_standard_process",
372  0,0,16);
373  cpl_parameter_set_alias(p,CPL_PARAMETER_MODE_CLI,"ext");
374  cpl_parameterlist_append(recipe->parameters,p);
375 
376  /* Get out of here */
377 
378  return(0);
379 }
380 
381 
382 /*---------------------------------------------------------------------------*/
388 /*---------------------------------------------------------------------------*/
389 
390 static int vircam_standard_process_exec(cpl_plugin *plugin) {
391  cpl_recipe *recipe;
392 
393  /* Get the recipe out of the plugin */
394 
395  if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
396  recipe = (cpl_recipe *)plugin;
397  else
398  return(-1);
399 
400  return(vircam_standard_process(recipe->parameters,recipe->frames));
401 }
402 
403 /*---------------------------------------------------------------------------*/
409 /*---------------------------------------------------------------------------*/
410 
411 static int vircam_standard_process_destroy(cpl_plugin *plugin) {
412  cpl_recipe *recipe ;
413 
414  /* Get the recipe out of the plugin */
415 
416  if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
417  recipe = (cpl_recipe *)plugin;
418  else
419  return(-1);
420 
421  cpl_parameterlist_delete(recipe->parameters);
422  return(0);
423 }
424 
425 /*---------------------------------------------------------------------------*/
432 /*---------------------------------------------------------------------------*/
433 
434 static int vircam_standard_process(cpl_parameterlist *parlist,
435  cpl_frameset *framelist) {
436  const char *fctid="vircam_standard_process";
437  cpl_parameter *p;
438  int jst,jfn,status,j,i,retval,nusteps,isconf,live,ndit;
439  cpl_size nlab;
440  float readnoise,gain,gaincor_fac;
441  casu_fits *ff;
442  cpl_propertylist *ehu,*pp;
443  cpl_frame *catindex;
444 
445  /* Check validity of input frameset */
446 
447  if (framelist == NULL || cpl_frameset_get_size(framelist) <= 0) {
448  cpl_msg_error(fctid,"Input framelist NULL or has no input data");
449  return(-1);
450  }
451 
452  /* Initialise some things */
453  struct psStruct ps;
454  vircam_jmp_init(&ps);
455  vircam_set_recipename(fctid,RECSTD);
456  /*
457  (void)strncpy(vircam_recipename,fctid,VIRCAM_PATHSZ);
458  (void)snprintf(vircam_recipepaf,VIRCAM_PATHSZ,"VIRCAM/%s",fctid);
459  recflag = RECSTD;
460  */
461 
462  /* Get the parameters */
463 
464  p = cpl_parameterlist_find(parlist,
465  "vircam.vircam_standard_process.ipix");
466  vircam_jmp_set_config_ipix ( cpl_parameter_get_int(p) );
467  p = cpl_parameterlist_find(parlist,
468  "vircam.vircam_standard_process.thresh");
469  vircam_jmp_set_config_threshold ( (float)cpl_parameter_get_double(p) );
470  p = cpl_parameterlist_find(parlist,
471  "vircam.vircam_standard_process.icrowd");
472  vircam_jmp_set_config_icrowd ( cpl_parameter_get_bool(p) );
473  p = cpl_parameterlist_find(parlist,
474  "vircam.vircam_standard_process.rcore");
475  vircam_jmp_set_config_rcore ( (float)cpl_parameter_get_double(p) );
476  p = cpl_parameterlist_find(parlist,
477  "vircam.vircam_standard_process.nbsize");
478  vircam_jmp_set_config_nbsize ( cpl_parameter_get_int(p) );
479  p = cpl_parameterlist_find(parlist,
480  "vircam.vircam_standard_process.savecat");
481  vircam_jmp_set_config_savecat ( cpl_parameter_get_bool(p) );
482  p = cpl_parameterlist_find(parlist,
483  "vircam.vircam_standard_process.destripe");
484  vircam_jmp_set_config_destripe ( cpl_parameter_get_bool(p) );
485  p = cpl_parameterlist_find(parlist,
486  "vircam.vircam_standard_process.skycor");
487  vircam_jmp_set_config_skycor ( cpl_parameter_get_bool(p) );
488  p = cpl_parameterlist_find(parlist,
489  "vircam.vircam_standard_process.savesimple");
490  vircam_jmp_set_config_savesimple ( cpl_parameter_get_bool(p) );
491  p = cpl_parameterlist_find(parlist,
492  "vircam.vircam_standard_process.extenum");
493  vircam_jmp_set_config_extenum ( cpl_parameter_get_int(p) );
494 
495  /* Sort out raw from calib frames */
496 
497  if (vircam_dfs_set_groups(framelist) != CASU_OK) {
498  cpl_msg_error(fctid,"Cannot identify RAW and CALIB frames");
499  vircam_jmp_tidy(&ps,0);
500  return(-1);
501  }
502 
503  /* Label the input frames */
504 
505  if ((ps.labels = cpl_frameset_labelise(framelist,casu_compare_tags,
506  &nlab)) == NULL) {
507  cpl_msg_error(fctid,"Cannot labelise the input frames");
508  vircam_jmp_tidy(&ps,0);
509  return(-1);
510  }
511 
512  /* Get the input science frames */
513 
514  if ((ps.science_frames =
515  casu_frameset_subgroup(framelist,ps.labels,nlab,
516  VIRCAM_STD_OBJECT_RAW)) == NULL) {
517  cpl_msg_error(fctid,"No science images to process!");
518  vircam_jmp_tidy(&ps,0);
519  return(-1);
520  }
521 
522  /* Check to see if there is a master dark frame */
523 
524  if ((ps.master_dark =
525  casu_frameset_subgroup_1(framelist,ps.labels,nlab,
526  VIRCAM_CAL_DARK)) == NULL) {
527  cpl_msg_error(fctid,"No master dark found");
528  vircam_jmp_tidy(&ps,0);
529  return(-1);
530  }
531 
532  /* Check to see if there is a master twilight flat frame */
533 
534  if ((ps.master_twilight_flat =
535  casu_frameset_subgroup_1(framelist,ps.labels,nlab,
536  VIRCAM_CAL_TWILIGHT_FLAT)) == NULL) {
537  cpl_msg_error(fctid,"No master twilight flat found");
538  vircam_jmp_tidy(&ps,0);
539  return(-1);
540  }
541 
542  /* Get the gain corrections */
543 
544  status = CASU_OK;
545  if (casu_gaincor_calc(ps.master_twilight_flat,&i,&(ps.gaincors),
546  &status) != CASU_OK) {
547  cpl_msg_error(fctid,"Error calculating gain corrections");
548  vircam_jmp_tidy(&ps,0);
549  return(-1);
550  }
551 
552  /* Check to see if there is a readgain file */
553 
554  if ((ps.readgain_file =
555  casu_frameset_subgroup_1(framelist,ps.labels,nlab,
556  VIRCAM_CAL_READGAINFILE)) == NULL) {
557  cpl_msg_error(fctid,"No master readnoise/gain file found");
558  vircam_jmp_tidy(&ps,0);
559  return(-1);
560  }
561 
562  /* Check to see if there is a master confidence map. If there isn't
563  then look for a bad pixel mask that can be converted into a
564  confidence map (in an emergency) */
565 
566  isconf = 1;
567  if ((ps.master_conf =
568  casu_frameset_subgroup_1(framelist,ps.labels,nlab,
569  VIRCAM_CAL_CONF)) == NULL) {
570  isconf = 0;
571  if ((ps.master_conf =
572  casu_frameset_subgroup_1(framelist,ps.labels,nlab,
573  VIRCAM_CAL_BPM)) == NULL) {
574  cpl_msg_error(fctid,"No master confidence map found");
575  vircam_jmp_tidy(&ps,0);
576  return(-1);
577  }
578  }
579  ps.mask = casu_mask_define(framelist,ps.labels,nlab,VIRCAM_CAL_CONF,
580  VIRCAM_CAL_BPM);
581 
582  /* Check to see if there is a channel table */
583 
584  if ((ps.chantab = casu_frameset_subgroup_1(framelist,ps.labels,nlab,
585  VIRCAM_CAL_CHANTAB)) == NULL) {
586  cpl_msg_error(fctid,"No channel table found");
587  vircam_jmp_tidy(&ps,0);
588  return(-1);
589  }
590 
591  /* Check to see if there is a photometric table */
592 
593  if ((ps.phottab = casu_frameset_subgroup_1(framelist,ps.labels,nlab,
594  VIRCAM_CAL_PHOTTAB)) == NULL) {
595  cpl_msg_error(fctid,"No photometric table found");
596  vircam_jmp_tidy(&ps,0);
597  return(-1);
598  }
599  if ((ps.tphottab = cpl_table_load(cpl_frame_get_filename(ps.phottab),1,0)) == NULL) {
600  cpl_msg_error(fctid,"Unable to load photometric table");
601  vircam_jmp_tidy(&ps,0);
602  return(-1);
603  }
604 
605  /* Is the 2mass index file specified? */
606 
607  if ((catindex = casu_frameset_subgroup_1(framelist,ps.labels,nlab,
608  VIRCAM_CAL_2MASS)) == NULL) {
609  cpl_msg_info(fctid,"No 2MASS index found -- cannot continue");
610  vircam_jmp_tidy(&ps,0);
611  return(-1);
612  }
613 
614  /* Get catalogue parameters */
615 
616  if (casu_catpars(catindex,&(ps.catpath),&(ps.catname)) == CASU_FATAL) {
617  vircam_jmp_tidy(&ps,0);
618  cpl_frame_delete(catindex);
619  return(-1);
620  }
621  cpl_frame_delete(catindex);
622 
623  /* Is there a second photometric catalogue index file specified? */
624 
625  if ((catindex = casu_frameset_subgroup_1(framelist,ps.labels,nlab,
626  VIRCAM_CAL_REFCAT)) != NULL) {
627 
628  /* Get catalogue parameters */
629 
630  if (casu_catpars(catindex,&(ps.catpath2),&(ps.catname2)) == CASU_FATAL) {
631  vircam_jmp_tidy(&ps,0);
632  cpl_frame_delete(catindex);
633  return(-1);
634  }
635  cpl_frame_delete(catindex);
636  }
637 
638  /* Get the number of DITs */
639 
640  pp = cpl_propertylist_load(cpl_frame_get_filename(cpl_frameset_get_position(ps.science_frames,0)),0);
641  if (vircam_pfits_get_ndit(pp,&ndit) != CASU_OK) {
642  cpl_msg_error(fctid,"No value for NDIT available");
643  freepropertylist(pp);
644  vircam_jmp_tidy(&ps,0);
645  return(-1);
646  }
647  cpl_propertylist_delete(pp);
648 
649  /* Now, how many image extensions do we want to do? If the extension
650  number is zero, then we loop for all possible extensions. If it
651  isn't then we just do the extension specified */
652 
653  vircam_exten_range(vircam_jmp_get_config_extenum(),
654  (const cpl_frame *)cpl_frameset_get_position(ps.science_frames,0),
655  &jst,&jfn);
656  if (jst == -1 || jfn == -1) {
657  cpl_msg_error(fctid,"Unable to continue");
658  vircam_jmp_tidy(&ps,0);
659  return(-1);
660  }
661 
662  /* Now loop for all the extensions... */
663 
664  status = CASU_OK;
665  for (j = jst; j <= jfn; j++) {
666  vircam_jmp_set_isfirst (j == jst);
667  gaincor_fac = (ps.gaincors)[j-1];
668 
669  /* Load up the calibration frames into casu_fits/casu_tfits structures
670  It is a fatal error if any one of them can't load properly */
671 
672  ps.fdark = casu_fits_load(ps.master_dark,CPL_TYPE_FLOAT,j);
673  if (ps.fdark == NULL) {
674  cpl_msg_error(fctid,
675  "Error loading master dark %s[%" CPL_SIZE_FORMAT "]\n%s",
676  cpl_frame_get_filename(ps.master_dark),(cpl_size)j,
677  cpl_error_get_message());
678  vircam_jmp_tidy(&ps,0);
679  return(-1);
680  }
681  ps.fflat = casu_fits_load(ps.master_twilight_flat,CPL_TYPE_FLOAT,j);
682  if (ps.fflat == NULL) {
683  cpl_msg_error(fctid,
684  "Error loading master flat %s[%" CPL_SIZE_FORMAT "]\n%s",
685  cpl_frame_get_filename(ps.master_twilight_flat),
686  (cpl_size)j,cpl_error_get_message());
687  vircam_jmp_tidy(&ps,0);
688  return(-1);
689  }
690  ps.fconf = casu_fits_load(ps.master_conf,CPL_TYPE_INT,j);
691  if (ps.fconf == NULL) {
692  cpl_msg_error(fctid,
693  "Error loading master conf %s[%" CPL_SIZE_FORMAT "]\n%s",
694  cpl_frame_get_filename(ps.master_conf),(cpl_size)j,
695  cpl_error_get_message());
696  vircam_jmp_tidy(&ps,0);
697  return(-1);
698  }
699  if (! isconf)
700  vircam_jmp_bpm2conf(&ps);
701  if (casu_mask_load(ps.mask,j,
702  (int)cpl_image_get_size_x(casu_fits_get_image(ps.fconf)),
703  (int)cpl_image_get_size_y(casu_fits_get_image(ps.fconf))) != CASU_OK) {
704  cpl_msg_error(fctid,
705  "Error loading mask from master conf %s[%" CPL_SIZE_FORMAT "]\n%s",
706  cpl_frame_get_filename(ps.master_conf),(cpl_size)j,
707  cpl_error_get_message());
708  vircam_jmp_tidy(&ps,0);
709  return(-1);
710  }
711  ps.fchantab = casu_tfits_load(ps.chantab,j);
712  if (ps.fchantab == NULL) {
713  cpl_msg_error(fctid,
714  "Error loading channel table %s[%" CPL_SIZE_FORMAT "]\n%s",
715  cpl_frame_get_filename(ps.chantab),(cpl_size)j,
716  cpl_error_get_message());
717  vircam_jmp_tidy(&ps,0);
718  return(-1);
719  }
720 
721  /* Load up the casu_fits structures for the science images */
722 
723  ps.nscience = cpl_frameset_get_size(ps.science_frames);
724  ps.sci_fits = casu_fits_load_list(ps.science_frames,CPL_TYPE_FLOAT,j);
725  if (ps.sci_fits == NULL) {
726  cpl_msg_error(fctid,
727  "Error loading science frames extension %" CPL_SIZE_FORMAT ": %s",
728  (cpl_size)j,cpl_error_get_message());
729  vircam_jmp_tidy(&ps,0);
730  return(-1);
731  }
732 
733  /* Set up something for the PAFs */
734 
735  /* Make sure to delete old stuff as we are in a loop */
736  if (!ps.phupaf) freepropertylist(ps.phupaf);
737  ps.phupaf = vircam_paf_phu_items(casu_fits_get_phu(ps.sci_fits[0]));
738 
739  /* Loop through and mark the frames where the header says the detector
740  wasn't live */
741 
742  for (i = 0; i < ps.nscience; i++) {
743  ff = ps.sci_fits[i];
745  if (! live)
746  casu_fits_set_error(ff,CASU_FATAL);
748  casu_fits_get_ehu(ff)) != CASU_OK) {
749  cpl_msg_error(fctid,"Unable to correct CRVAL in %s",
751  vircam_jmp_tidy(&ps,0);
752  return(-1);
753  }
754  }
755 
756  /* Get the readnoise and gain estimate for this extension */
757 
758  vircam_jmp_get_readnoise_gain(&ps,j,&readnoise,&gain);
759 
760  /* Loop for all the science frames and do the 2d corrections */
761 
762  cpl_msg_info(fctid,"Doing stage1 corrections on %s",
763  casu_fits_get_extname(ps.sci_fits[0]));
764  for (i = 0; i < ps.nscience; i++) {
765  ff = ps.sci_fits[i];
766  cpl_propertylist_update_float(casu_fits_get_ehu(ff),"READNOIS",
767  readnoise);
768  cpl_propertylist_set_comment(casu_fits_get_ehu(ff),"READNOIS",
769  "[e-] Readnoise used in processing");
770  cpl_propertylist_update_float(casu_fits_get_ehu(ff),"GAIN",gain);
771  cpl_propertylist_set_comment(casu_fits_get_ehu(ff),"GAIN",
772  "[e-/adu] Gain used in processing");
773  if (casu_fits_get_status(ff) == CASU_FATAL) {
774  cpl_msg_info(fctid,"Detector is flagged dead in %s",
776  continue;
777  }
778  status = CASU_OK;
779  (void)casu_darkcor(ff,ps.fdark,1.0,&status);
780  (void)vircam_lincor(ff,ps.fchantab,1,ndit,&status);
781  (void)casu_nditcor(ff,ndit,"EXPTIME",&status);
782  (void)casu_flatcor(ff,ps.fflat,&status);
783  (void)casu_gaincor(ff,gaincor_fac,&status);
784  casu_fits_set_error(ff,status);
785  }
786 
787  /* Do a simple sky correction if requested */
788 
789  if (vircam_jmp_get_config_skycor()) {
790  cpl_msg_info(fctid,"Doing sky correction");
791  vircam_jmp_skycor(&ps);
792  } else {
793  for (i = 0; i < ps.nscience; i++) {
794  pp = casu_fits_get_ehu(ps.sci_fits[i]);
795  cpl_propertylist_update_string(pp,"ESO DRS SKYCOR","none");
796  cpl_propertylist_set_comment(pp,"ESO DRS SKYCOR",
797  "Sky correction method");
798  }
799  }
800 
801  /* Do destripe now */
802 
803  if (vircam_jmp_get_config_destripe()) {
804  cpl_msg_info(fctid,"Doing destripe");
805  for (i = 0; i < ps.nscience; i++) {
806  ff = ps.sci_fits[i];
807  (void)vircam_destripe(ff,ps.mask,&status);
808  casu_fits_set_error(ff,status);
809  }
810  }
811 
812  /* Calculate the illumination correction */
813 
814  cpl_msg_info(fctid,"Doing illumination correction");
815  (void)strcpy(current_cat,ps.catname);
816  (void)strcpy(current_catpath,ps.catpath);
817  vircam_jmp_illum(&ps,current_cat,current_catpath);
818 
819  /* Save the simple images */
820 
821  if (vircam_jmp_get_config_savesimple()) {
822  cpl_msg_info(fctid,"Saving simple images");
823  if (vircam_jmp_save_simple(&ps,framelist,parlist) != 0) {
824  vircam_jmp_tidy(&ps,0);
825  return(-1);
826  }
827  }
828  casu_mask_clear(ps.mask);
829 
830  /* Save the illumination correction table */
831 
832  cpl_msg_info(fctid,"Saving illumination correction table");
833  dummyqc = vircam_standard_process_dummyqc(3);
834  if (vircam_jmp_save_illum(&ps,framelist,parlist,dummyqc) != 0) {
835  vircam_jmp_tidy(&ps,0);
836  freepropertylist(dummyqc);
837  return(-1);
838  }
839  freepropertylist(dummyqc);
840 
841  /* Look at the first frame in the list and see if the number of
842  microsteps is greater than 1. If so, then we'll have to go
843  through interleaving. */
844 
845  retval = vircam_pfits_get_nusteps(casu_fits_get_phu(ps.sci_fits[0]),
846  &nusteps);
847  if (retval != CASU_OK) {
848  cpl_msg_warning(fctid,"Unable to get nusteps from header.\nAssuming no microstepping");
849  nusteps = 1;
850  }
851 
852  /* If the number of microsteps is 1 then copy over the good frames
853  into a fits list for dithering. */
854 
855  ps.ndith = 0;
856  if (nusteps < 4) {
857  if (nusteps == 1)
858  cpl_msg_info(fctid,"No interleaving will be done");
859  else
860  cpl_msg_warning(fctid,
861  "Illegal number of microsteps: %" CPL_SIZE_FORMAT "\nNo interleaving will be done",
862  (cpl_size)nusteps);
863  ps.dith_input = cpl_malloc(ps.nscience*sizeof(casu_fits *));
864  ps.dithc_input = cpl_malloc(sizeof(casu_fits *));
865  for (i = 0; i < ps.nscience; i++) {
866  if (casu_fits_get_status(ps.sci_fits[i]) == CASU_OK)
867  ps.dith_input[ps.ndith++] = ps.sci_fits[i];
868  }
869  ps.dithc_input[0] = ps.fconf;
870  ps.ndithc = 1;
871  interlv = 0;
872 
873  /* If the number of microsteps is more than 1, then we need
874  to do interleaving. The interleaving routine define
875  ps.dith_input. */
876 
877  } else {
878  cpl_msg_info(fctid,"Interleaving");
880  cpl_msg_info(fctid,"Saving superframe images");
881  if (vircam_jmp_save_super(&ps,framelist,parlist) != 0) {
882  vircam_jmp_tidy(&ps,0);
883  return(-1);
884  }
885  interlv = 1;
886  }
887 
888  /* Work out the jitter offsets and the stack the jitter frame */
889 
890  cpl_msg_info(fctid,"Working out jitter offsets");
891  vircam_jmp_dither_offsets(&ps, interlv);
892  cpl_msg_info(fctid,"Stacking jittered frame");
894 
895  /* Do a catalogue generation */
896 
897  cpl_msg_info(fctid,"Doing object extraction");
898  vircam_jmp_catalogue(&ps,interlv);
899 
900  /* Create a matched standards table */
901 
902  cpl_msg_info(fctid,"Matching objects with 2mass standards");
903  vircam_jmp_matched_stds(&ps,current_cat,current_catpath);
904 
905  /* Do a WCS fit for the dithered image */
906 
907  cpl_msg_info(fctid,"Fitting a WCS");
908  vircam_jmp_wcsfit(&ps);
909 
910  /* Finally do the photometric zeropoint fit */
911 
912  cpl_msg_info(fctid,"Doing 2mass photometric zeropoint calculation");
913  vircam_jmp_photcal(&ps);
914  if (casu_fits_get_status(ps.stack_frame) == CASU_OK) {
915  ehu = casu_fits_get_ehu(ps.stack_frame);
916  cpl_propertylist_update_float(ehu,"ESO QC ZPT_2MASS",
917  cpl_propertylist_get_float(ehu,"ESO QC MAGZPT"));
918  cpl_propertylist_set_comment(ehu,"ESO QC ZPT_2MASS",
919  cpl_propertylist_get_comment(ehu,"ESO QC MAGZPT"));
920  }
921 
922  /* Redo the photometric zeropoint with another catalogue if we
923  have one */
924 
925  if (ps.catpath2 != NULL) {
926  freetable(ps.matchstds);
927  (void)strcpy(current_cat,ps.catname2);
928  (void)strcpy(current_catpath,ps.catpath2);
929  cpl_msg_info(fctid,"Matching objects with %s standards",
930  ps.catname2);
931  vircam_jmp_matched_stds(&ps,current_cat,current_catpath);
932  cpl_msg_info(fctid,"Doing %s photometric zeropoint calculation",
933  ps.catname2);
934  vircam_jmp_photcal(&ps);
935  if (casu_fits_get_status(ps.stack_frame) == CASU_OK) {
936  ehu = casu_fits_get_ehu(ps.stack_frame);
937  cpl_propertylist_update_float(ehu,"ESO QC ZPT_STDS",
938  cpl_propertylist_get_float(ehu,"ESO QC MAGZPT"));
939  cpl_propertylist_set_comment(ehu,"ESO QC ZPT_STDS",
940  cpl_propertylist_get_comment(ehu,"ESO QC MAGZPT"));
941  cpl_propertylist_update_string(ehu,"ESO QC ZPT_STDS_CAT",
942  ps.catname2);
943  cpl_propertylist_set_comment(ehu,"ESO QC ZPT_STDS_CAT",
944  "Catalogue used in zeropoint calc");
945  }
946  } else {
947  if (casu_fits_get_status(ps.stack_frame) == CASU_OK) {
948  ehu = casu_fits_get_ehu(ps.stack_frame);
949  cpl_propertylist_update_float(ehu,"ESO QC ZPT_STDS",0.0);
950  cpl_propertylist_set_comment(ehu,"ESO QC ZPT_STDS",
951  "No secondary standard calib");
952  cpl_propertylist_update_string(ehu,"ESO QC ZPT_STDS_CAT","");
953  cpl_propertylist_set_comment(ehu,"ESO QC ZPT_STDS_CAT",
954  "No secondary standard catalogue");
955  }
956  }
957 
958  /* Save the dithered images */
959 
960  cpl_msg_info(fctid,"Saving stacked images");
961  dummyqc = vircam_standard_process_dummyqc(1);
962  if (vircam_jmp_save_stack(&ps,framelist,parlist,dummyqc) != 0) {
963  vircam_jmp_tidy(&ps,0);
964  freepropertylist(dummyqc);
965  return(-1);
966  }
967  freepropertylist(dummyqc);
968  if (vircam_jmp_get_config_savecat()) {
969  cpl_msg_info(fctid,"Saving stacked image catalogues");
970  dummyqc = vircam_standard_process_dummyqc(2);
971  if (vircam_jmp_save_catalogue(&ps,framelist,parlist,dummyqc) != 0) {
972  vircam_jmp_tidy(&ps,0);
973  freepropertylist(dummyqc);
974  return(-1);
975  }
976  freepropertylist(dummyqc);
977  }
978 
979  /* Clean up on aisle 12! */
980 
981  vircam_jmp_tidy(&ps,1);
982  }
983 
984  /* Final cleanup */
985 
986  vircam_jmp_tidy(&ps,0);
987  return(0);
988 }
989 
990 static cpl_propertylist *vircam_standard_process_dummyqc(int type) {
991  cpl_propertylist *p;
992 
993  /* Get an empty property list */
994 
995  p = cpl_propertylist_new();
996 
997  /* Now switch for the various products */
998 
999  switch (type) {
1000 
1001  /* Stack images */
1002 
1003  case 1:
1004  cpl_propertylist_update_double(p,"ESO QC WCS_DCRVAL1",0.0);
1005  cpl_propertylist_set_comment(p,"ESO QC WCS_DCRVAL1",
1006  "[deg] change in crval1");
1007  cpl_propertylist_update_double(p,"ESO QC WCS_DCRVAL2",0.0);
1008  cpl_propertylist_set_comment(p,"ESO QC WCS_DCRVAL2",
1009  "[deg] change in crval2");
1010  cpl_propertylist_update_double(p,"ESO QC WCS_DTHETA",0.0);
1011  cpl_propertylist_set_comment(p,"ESO QC WCS_DTHETA",
1012  "[deg] change in rotation");
1013  cpl_propertylist_update_double(p,"ESO QC WCS_SCALE",0.0);
1014  cpl_propertylist_set_comment(p,"ESO QC WCS_SCALE",
1015  "[arcsec] mean plate scale");
1016  cpl_propertylist_update_double(p,"ESO QC WCS_SHEAR",0.0);
1017  cpl_propertylist_set_comment(p,"ESO QC WCS_SHEAR",
1018  "[deg] abs(xrot) - abs(yrot)");
1019  cpl_propertylist_update_double(p,"ESO QC WCS_RMS",0.0);
1020  cpl_propertylist_set_comment(p,"ESO QC WCS_RMS",
1021  "[arcsec] Average error in WCS fit");
1022  cpl_propertylist_update_float(p,"ESO QC MAGZPT",0.0);
1023  cpl_propertylist_set_comment(p,"ESO QC MAGZPT",
1024  "[mag] photometric zeropoint");
1025  cpl_propertylist_update_float(p,"ESO QC MAGZERR",0.0);
1026  cpl_propertylist_set_comment(p,"ESO QC MAGZERR",
1027  "[mag] photometric zeropoint error");
1028  cpl_propertylist_update_int(p,"ESO QC MAGNZPT",0);
1029  cpl_propertylist_set_comment(p,"ESO QC MAGNZPT",
1030  "number of stars in magzpt calc");
1031  cpl_propertylist_update_int(p,"ESO QC MAGNCUT",0);
1032  cpl_propertylist_set_comment(p,"ESO QC MAGNCUT",
1033  "number of cut from magzpt calc");
1034  cpl_propertylist_update_float(p,"ESO QC LIMITING_MAG",0.0);
1035  cpl_propertylist_set_comment(p,"ESO QC LIMITING_MAG",
1036  "[mag] 5 sigma limiting mag");
1037  cpl_propertylist_update_float(p,"ESO QC ZPT_2MASS",0.0);
1038  cpl_propertylist_set_comment(p,"ESO QC ZPT_2MASS",
1039  "[mag] photometric zeropoint");
1040  cpl_propertylist_update_float(p,"ESO QC ZPT_STDS",0.0);
1041  cpl_propertylist_set_comment(p,"ESO QC ZPT_STDS",
1042  "[mag] photometric zeropoint");
1043  cpl_propertylist_update_string(p,"ESO QC ZPT_STDS_CAT","");
1044  cpl_propertylist_set_comment(p,"ESO QC ZPT_STDS_CAT",
1045  "Catalogue used in zeropoint calc");
1046  break;
1047 
1048  /* Catalogues */
1049 
1050  case 2:
1051  cpl_propertylist_update_float(p,"ESO QC SATURATION",0.0);
1052  cpl_propertylist_set_comment(p,"ESO QC SATURATION",
1053  "[adu] Saturation level");
1054  cpl_propertylist_update_float(p,"ESO QC MEAN_SKY",0.0);
1055  cpl_propertylist_set_comment(p,"ESO QC MEAN_SKY",
1056  "[adu] Median sky brightness");
1057  cpl_propertylist_update_float(p,"ESO QC SKY_NOISE",0.0);
1058  cpl_propertylist_set_comment(p,"ESO QC SKY_NOISE",
1059  "[adu] Pixel noise at sky level");
1060  cpl_propertylist_update_float(p,"ESO QC IMAGE_SIZE",0.0);
1061  cpl_propertylist_set_comment(p,"ESO QC IMAGE_SIZE",
1062  "[pixels] Average FWHM of stellar objects");
1063  cpl_propertylist_update_float(p,"ESO QC ELLIPTICITY",0.0);
1064  cpl_propertylist_set_comment(p,"ESO QC ELLIPTICITY",
1065  "Average stellar ellipticity (1-b/a)");
1066  cpl_propertylist_update_float(p,"ESO QC APERTURE_CORR",0.0);
1067  cpl_propertylist_set_comment(p,"ESO QC APERTURE_CORR",
1068  "Stellar ap-corr 1x core flux");
1069  cpl_propertylist_update_int(p,"ESO QC NOISE_OBJ",0);
1070  cpl_propertylist_set_comment(p,"ESO QC NOISE_OBJ",
1071  "Number of noise objects");
1072  break;
1073 
1074  /* Illumination tables */
1075 
1076  case 3:
1077  cpl_propertylist_update_float(p,"ESO QC ILLUMCOR_RMS",0.0);
1078  cpl_propertylist_set_comment(p,"ESO QC ILLUMCOR_RMS",
1079  "RMS of illumination correction map");
1080  break;
1081  default:
1082  break;
1083  }
1084 
1085  /* Get out of here */
1086 
1087  return(p);
1088 }
1089 
1092 /*
1093 
1094 $Log: not supported by cvs2svn $
1095 Revision 1.42 2012/01/15 17:40:09 jim
1096 Minor modifications to take into accout the changes in cpl API for v6
1097 
1098 Revision 1.41 2011/05/09 09:58:10 jim
1099 Cosmetic changes to stop compiler warnings
1100 
1101 Revision 1.40 2010/12/09 13:20:49 jim
1102 Modified some comments
1103 
1104 Revision 1.39 2010/09/13 11:43:13 jim
1105 Added flag DRS SKYCOR if background correction isn't being done
1106 
1107 Revision 1.38 2010/09/09 12:16:00 jim
1108 Added new QC parameter MAGNCUT
1109 
1110 Revision 1.37 2010/06/03 11:31:06 jim
1111 Modified so that deblending is done by default
1112 
1113 Revision 1.36 2010/03/21 06:47:42 jim
1114 Added code to trap for problems in saving products
1115 
1116 Revision 1.35 2010/03/12 10:44:07 lbilbao
1117 Added missing header inclusion.
1118 
1119 Revision 1.34 2010/02/08 16:35:26 jim
1120 Moved the definition of propertylist ps.phupaf to the recipes so that
1121 this doesn't fail when we don't save the simple images
1122 
1123 Revision 1.33 2010/01/31 18:56:35 jim
1124 Now optionally saves the simple images. Also included missing ndit correction
1125 
1126 Revision 1.32 2009/12/11 06:52:56 jim
1127 Minor mods to documentation
1128 
1129 Revision 1.31 2009/09/09 09:50:21 jim
1130 Modified to try and get headers right
1131 
1132 Revision 1.30 2009/07/03 12:30:04 jim
1133 Default value of rcore is now 3
1134 
1135 Revision 1.29 2009/02/04 09:23:29 jim
1136 Moved destriping to after sky subtraction
1137 
1138 Revision 1.28 2008/12/08 06:38:41 jim
1139 Added trap for crval==0 error. Also added a trap for illegal 2x1 microstep
1140 sequences
1141 
1142 Revision 1.27 2008/11/27 09:14:47 jim
1143 Fixed PRO CATG keyword values for interleaved confidence maps in docs
1144 
1145 Revision 1.26 2008/11/25 18:55:59 jim
1146 took out extra sky stuff
1147 
1148 Revision 1.25 2008/11/25 12:03:03 jim
1149 Now allows for masked object sky estimation
1150 
1151 Revision 1.24 2008/11/25 06:18:30 jim
1152 Changed a reference to VIRCAM_CAL_2MASS to VIRCAM_CAL_REFCAT.
1153 
1154 Revision 1.23 2008/10/01 04:59:13 jim
1155 Added call to vircam_frameset_fexists to check input frameset
1156 
1157 Revision 1.22 2008/05/06 12:15:21 jim
1158 Changed to use new version of vircam_catpars
1159 
1160 Revision 1.21 2007/11/26 09:59:06 jim
1161 Recipe now takes ndit into account when doing linearity correction
1162 
1163 Revision 1.20 2007/10/25 18:39:22 jim
1164 Altered to remove some lint messages
1165 
1166 Revision 1.19 2007/10/19 06:55:06 jim
1167 Modifications made to use new method for directing the recipes to the
1168 standard catalogues using the sof
1169 
1170 Revision 1.18 2007/07/09 13:21:56 jim
1171 Modified to use new version of vircam_exten_range
1172 
1173 Revision 1.17 2007/06/13 08:11:27 jim
1174 Modified docs to reflect changes in DFS tags
1175 
1176 Revision 1.16 2007/05/08 21:31:16 jim
1177 fixed typo
1178 
1179 Revision 1.15 2007/05/08 10:42:44 jim
1180 Added gain correction
1181 
1182 Revision 1.14 2007/05/02 12:53:11 jim
1183 typo fixes in docs
1184 
1185 Revision 1.13 2007/04/26 13:09:40 jim
1186 fixed typos
1187 
1188 Revision 1.12 2007/04/04 16:05:59 jim
1189 Modified to make paf information a bit more correct
1190 
1191 Revision 1.11 2007/04/04 10:36:18 jim
1192 Modified to use new dfs tags
1193 
1194 Revision 1.10 2007/03/29 12:19:39 jim
1195 Little changes to improve documentation
1196 
1197 Revision 1.9 2007/03/14 14:49:13 jim
1198 Fixed problem with missing paf files in jmp recipes if detlive = F. Also
1199 fixed problem where extra dummy products were being created
1200 
1201 Revision 1.8 2007/03/06 12:00:48 jim
1202 Fixed stupid typo in header
1203 
1204 Revision 1.7 2007/03/02 12:37:51 jim
1205 Fixed small memory leak
1206 
1207 Revision 1.6 2007/03/01 12:41:49 jim
1208 Modified slightly after code checking
1209 
1210 Revision 1.5 2007/02/07 10:12:40 jim
1211 Removed calls to vircam_ndit_correct as this is now no longer necessary
1212 
1213 Revision 1.4 2006/12/19 13:32:03 jim
1214 Images that are flagged as dead detectors now generate an INFO rather than
1215 an ERROR message
1216 
1217 Revision 1.3 2006/11/29 12:28:45 jim
1218 Modified so that the correct recipe names would appear in the headers of
1219 data products
1220 
1221 Revision 1.2 2006/11/28 20:57:43 jim
1222 Added illumination correction section
1223 
1224 Revision 1.1 2006/11/27 12:15:43 jim
1225 Initial entry
1226 
1227 
1228 */
char * casu_fits_get_extname(casu_fits *p)
Definition: casu_fits.c:613
int casu_fits_get_status(casu_fits *p)
Definition: casu_fits.c:711
cpl_image * casu_fits_get_image(casu_fits *p)
Definition: casu_fits.c:436
casu_fits * casu_fits_load(cpl_frame *frame, cpl_type type, int nexten)
Definition: casu_fits.c:80
casu_fits ** casu_fits_load_list(cpl_frameset *f, cpl_type type, int exten)
Definition: casu_fits.c:318
char * casu_fits_get_fullname(casu_fits *p)
Definition: casu_fits.c:680
int casu_fits_set_error(casu_fits *p, int status)
Definition: casu_fits.c:747
cpl_propertylist * casu_fits_get_phu(casu_fits *p)
Definition: casu_fits.c:531
cpl_propertylist * casu_fits_get_ehu(casu_fits *p)
Definition: casu_fits.c:576
int casu_mask_load(casu_mask *m, int nexten, int nx, int ny)
Definition: casu_mask.c:214
casu_mask * casu_mask_define(cpl_frameset *framelist, cpl_size *labels, cpl_size nlab, const char *conftag, const char *bpmtag)
Definition: casu_mask.c:89
void casu_mask_clear(casu_mask *m)
Definition: casu_mask.c:357
int casu_flatcor(casu_fits *infile, casu_fits *flatsrc, int *status)
Correct input data for flat field response.
Definition: casu_flatcor.c:79
int casu_nditcor(casu_fits *infile, int ndit, const char *expkey, int *status)
Correct input data for number of dits.
Definition: casu_nditcor.c:85
int casu_darkcor(casu_fits *infile, casu_fits *darksrc, float darkscl, int *status)
Correct input data for dark current.
Definition: casu_darkcor.c:86
int casu_gaincor(casu_fits *infile, float gainscl, int *status)
Gain correct input data frame.
Definition: casu_gaincor.c:77
casu_tfits * casu_tfits_load(cpl_frame *table, int nexten)
Definition: casu_tfits.c:78
cpl_frame * casu_frameset_subgroup_1(cpl_frameset *frameset, cpl_size *labels, cpl_size nlab, const char *tag)
Extract a frame of a given label from a frameset.
Definition: casu_utils.c:206
int casu_compare_tags(const cpl_frame *frame1, const cpl_frame *frame2)
Compare input tags.
Definition: casu_utils.c:96
int casu_catpars(cpl_frame *indx, char **catpath, char **catname)
Find the name of the standard catalogue and its location.
Definition: casu_utils.c:899
cpl_frameset * casu_frameset_subgroup(cpl_frameset *frameset, cpl_size *labels, cpl_size nlab, const char *tag)
Extract a frameset from another frameset.
Definition: casu_utils.c:149
int casu_gaincor_calc(cpl_frame *frame, int *n, float **cors, int *status)
Work out gain corrections.
Definition: casu_utils.c:757
int vircam_destripe(casu_fits *in, casu_mask *inbpm, int *status)
Remove stripes from the background of an image.
int vircam_lincor(casu_fits *infile, casu_tfits *lchantab, int kconst, int ndit, int *status)
Apply linearity curves to data.
int vircam_dfs_set_groups(cpl_frameset *set)
Definition: vircam_dfs.c:115
void vircam_jmp_dither_images(struct psStruct *ps)
void vircam_jmp_init(struct psStruct *ps)
void vircam_jmp_get_readnoise_gain(struct psStruct *ps, int jext, float *readnoise, float *gain)
void vircam_jmp_matched_stds(struct psStruct *ps, char *cata, char *catapath)
int vircam_jmp_save_super(struct psStruct *ps, cpl_frameset *framelist, cpl_parameterlist *parlist)
void vircam_jmp_bpm2conf(struct psStruct *ps)
int vircam_jmp_save_catalogue(struct psStruct *ps, cpl_frameset *framelist, cpl_parameterlist *parlist, cpl_propertylist *dummyqcprops)
void vircam_jmp_wcsfit(struct psStruct *ps)
void vircam_jmp_photcal(struct psStruct *ps)
int vircam_jmp_save_stack(struct psStruct *ps, cpl_frameset *framelist, cpl_parameterlist *parlist, cpl_propertylist *dummyqcprops)
void vircam_jmp_illum(struct psStruct *ps, char *cat, char *catpath)
void vircam_jmp_dither_offsets(struct psStruct *ps, int inter_lv)
void vircam_jmp_tidy(struct psStruct *ps, int level)
int vircam_jmp_save_illum(struct psStruct *ps, cpl_frameset *framelist, cpl_parameterlist *parlist, cpl_propertylist *dummyqcprops)
int vircam_jmp_save_simple(struct psStruct *ps, cpl_frameset *framelist, cpl_parameterlist *parlist)
void vircam_jmp_skycor(struct psStruct *ps)
void vircam_jmp_interleave(struct psStruct *ps)
void vircam_jmp_catalogue(struct psStruct *ps, int inter_lv)
int vircam_pfits_get_ndit(const cpl_propertylist *plist, int *ndit)
Get the value of NDIT.
Definition: vircam_pfits.c:583
int vircam_pfits_get_detlive(const cpl_propertylist *plist, int *detlive)
Get the value of DET_LIVE.
Definition: vircam_pfits.c:624
int vircam_pfits_get_nusteps(const cpl_propertylist *plist, int *nusteps)
Get the value of the number of microsteps in a sequence.
Definition: vircam_pfits.c:422
int vircam_check_crval(cpl_propertylist *phu, cpl_propertylist *ehu)
const char * vircam_get_license(void)
Definition: vircam_utils.c:116
void vircam_exten_range(int inexten, const cpl_frame *fr, int *out1, int *out2)
Definition: vircam_utils.c:165