vircam_jitter_microstep_process.c

00001 /* $Id: vircam_jitter_microstep_process.c,v 1.67 2010/12/09 13:19:44 jim Exp $
00002  *
00003  * This file is part of the VIRCAM Pipeline
00004  * Copyright (C) 2005 Cambridge Astronomy Survey Unit
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  */
00020 
00021 /*
00022  * $Author: jim $
00023  * $Date: 2010/12/09 13:19:44 $
00024  * $Revision: 1.67 $
00025  * $Name: v1-1-0 $
00026  */
00027 
00028 /* Includes */
00029 
00030 #ifdef HAVE_CONFIG_H
00031 #include <config.h>
00032 #endif
00033 
00034 #include <stdio.h>
00035 #include <string.h>
00036 #include <cpl.h>
00037 #include <math.h>
00038 
00039 #include "vircam_utils.h"
00040 #include "vircam_mask.h"
00041 #include "vircam_pfits.h"
00042 #include "vircam_dfs.h"
00043 #include "vircam_mods.h"
00044 #include "vircam_fits.h"
00045 #include "vircam_tfits.h"
00046 #include "vircam_jmp_utils.h"
00047 #include "vircam_paf.h"
00048 
00049 /* Function prototypes */
00050 
00051 static int vircam_jitter_microstep_process_create(cpl_plugin *);
00052 static int vircam_jitter_microstep_process_exec(cpl_plugin *);
00053 static int vircam_jitter_microstep_process_destroy(cpl_plugin *);
00054 static int vircam_jitter_microstep_process(cpl_parameterlist *, 
00055                                            cpl_frameset *);
00056 static cpl_propertylist *vircam_jitter_microstep_process_dummyqc(int type);
00057 
00058 
00059 static char vircam_jitter_microstep_process_description[] =
00060 "vircam_jitter_microstep_process -- VIRCAM science product recipe.\n\n"
00061 "Process a complete pawprint for VIRCAM data. Remove instrumental\n"
00062 "signature, interleave microstep sequences (if done), combine jitters\n"
00063 "photometrically and astrometrically calibrate the pawprint image\n\n"
00064 "The program accepts the following files in the SOF:\n\n"
00065 "    Tag                   Description\n"
00066 "    -----------------------------------------------------------------------\n"
00067 "    %-21s A list of raw science images or\n"
00068 "    %-21s A list of raw science images (extended)\n"
00069 "    %-21s A list of offset sky exposures (optional)\n"
00070 "    %-21s A master dark frame\n"
00071 "    %-21s A master twilight flat frame\n"
00072 "    %-21s A master sky frame (optional)\n"
00073 "    %-21s A channel table\n"
00074 "    %-21s A photometric calibration table\n"
00075 "    %-21s A readnoise/gain file\n"
00076 "    %-21s A master confidence map or\n"
00077 "    %-21s A master bad pixel mask\n"
00078 "    %-21s A master standard star index\n"
00079 "All of the above are required\n"
00080 "\n";
00081 
00219 /* Function code */
00220 
00221 /*---------------------------------------------------------------------------*/
00229 /*---------------------------------------------------------------------------*/
00230 
00231 int cpl_plugin_get_info(cpl_pluginlist *list) {
00232     cpl_recipe  *recipe = cpl_calloc(1,sizeof(*recipe));
00233     cpl_plugin  *plugin = &recipe->interface;
00234     char alldesc[SZ_ALLDESC];
00235     (void)snprintf(alldesc,SZ_ALLDESC,
00236                    vircam_jitter_microstep_process_description,
00237                    VIRCAM_SCI_OBJECT_RAW,VIRCAM_SCI_OBJECT_EXT_RAW,
00238                    VIRCAM_OFFSET_SKY_RAW,VIRCAM_CAL_DARK,
00239                    VIRCAM_CAL_TWILIGHT_FLAT,VIRCAM_CAL_SKY,VIRCAM_CAL_CHANTAB,
00240                    VIRCAM_CAL_PHOTTAB,VIRCAM_CAL_READGAINFILE,VIRCAM_CAL_CONF,
00241                    VIRCAM_CAL_BPM,VIRCAM_CAL_2MASS);
00242 
00243     cpl_plugin_init(plugin,
00244                     CPL_PLUGIN_API,
00245                     VIRCAM_BINARY_VERSION,
00246                     CPL_PLUGIN_TYPE_RECIPE,
00247                     "vircam_jitter_microstep_process",
00248                     "VIRCAM jitter microstep recipe",
00249                     alldesc,
00250                     "Jim Lewis",
00251                     "jrl@ast.cam.ac.uk",
00252                     vircam_get_license(),
00253                     vircam_jitter_microstep_process_create,
00254                     vircam_jitter_microstep_process_exec,
00255                     vircam_jitter_microstep_process_destroy);
00256 
00257     cpl_pluginlist_append(list,plugin);
00258 
00259     return(0);
00260 }
00261 
00262 /*---------------------------------------------------------------------------*/
00271 /*---------------------------------------------------------------------------*/
00272 
00273 static int vircam_jitter_microstep_process_create(cpl_plugin *plugin) {
00274     cpl_recipe      *recipe;
00275     cpl_parameter   *p;
00276 
00277     /* Get the recipe out of the plugin */
00278 
00279     if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
00280         recipe = (cpl_recipe *)plugin;
00281     else 
00282         return(-1);
00283 
00284     /* Create the parameters list in the cpl_recipe object */
00285 
00286     recipe->parameters = cpl_parameterlist_new();
00287 
00288     /* Fill in the minimum object size */
00289 
00290     p = cpl_parameter_new_value("vircam.vircam_jitter_microstep_process.ipix",
00291                                 CPL_TYPE_INT,
00292                                 "Minimum pixel area for each detected object",
00293                                 "vircam.vircam_jitter_microstep_process",5);
00294     cpl_parameter_set_alias(p,CPL_PARAMETER_MODE_CLI,"ipix");
00295     cpl_parameterlist_append(recipe->parameters,p);
00296 
00297     /* Fill in the detection threshold parameter */
00298 
00299     p = cpl_parameter_new_value("vircam.vircam_jitter_microstep_process.thresh",
00300                                 CPL_TYPE_DOUBLE,
00301                                 "Detection threshold in sigma above sky",
00302                                 "vircam.vircam_jitter_microstep_process",2.0);
00303     cpl_parameter_set_alias(p,CPL_PARAMETER_MODE_CLI,"thr");
00304     cpl_parameterlist_append(recipe->parameters,p);
00305 
00306     /* Fill in flag to use deblending software or not */
00307 
00308     p = cpl_parameter_new_value("vircam.vircam_jitter_microstep_process.icrowd",
00309                                 CPL_TYPE_BOOL,"Use deblending?",
00310                                 "vircam.vircam_jitter_microstep_process",1);
00311     cpl_parameter_set_alias(p,CPL_PARAMETER_MODE_CLI,"icrowd");
00312     cpl_parameterlist_append(recipe->parameters,p);
00313 
00314     /* Fill in core radius */
00315 
00316     p = cpl_parameter_new_value("vircam.vircam_jitter_microstep_process.rcore",
00317                                 CPL_TYPE_DOUBLE,"Value of Rcore in pixels",
00318                                 "vircam.vircam_jitter_microstep_process",3.0);
00319     cpl_parameter_set_alias(p,CPL_PARAMETER_MODE_CLI,"rcore");
00320     cpl_parameterlist_append(recipe->parameters,p);
00321 
00322     /* Fill in background smoothing box size */
00323 
00324     p = cpl_parameter_new_value("vircam.vircam_jitter_microstep_process.nbsize",
00325                                 CPL_TYPE_INT,"Background smoothing box size",
00326                                 "vircam.vircam_jitter_microstep_process",64);
00327     cpl_parameter_set_alias(p,CPL_PARAMETER_MODE_CLI,"nb");
00328     cpl_parameterlist_append(recipe->parameters,p);
00329 
00330     /* Fill in flag to use save the output catalogue */
00331 
00332     p = cpl_parameter_new_value("vircam.vircam_jitter_microstep_process.savecat",
00333                                 CPL_TYPE_BOOL,"Save catalogue?",
00334                                 "vircam.vircam_jitter_microstep_process",1);
00335     cpl_parameter_set_alias(p,CPL_PARAMETER_MODE_CLI,"savecat");
00336     cpl_parameterlist_append(recipe->parameters,p);
00337 
00338 
00339     /* Fill in flag to destripe the images */
00340 
00341     p = cpl_parameter_new_value("vircam.vircam_jitter_microstep_process.destripe",
00342                                 CPL_TYPE_BOOL,"Destripe images?",
00343                                 "vircam.vircam_jitter_microstep_process",1);
00344     cpl_parameter_set_alias(p,CPL_PARAMETER_MODE_CLI,"destripe");
00345     cpl_parameterlist_append(recipe->parameters,p);
00346 
00347     /* Fill in flag to correct sky background */
00348 
00349     p = cpl_parameter_new_value("vircam.vircam_jitter_microstep_process.skycor",
00350                                 CPL_TYPE_BOOL,"Do a sky subtraction?",
00351                                 "vircam.vircam_jitter_microstep_process",1);
00352     cpl_parameter_set_alias(p,CPL_PARAMETER_MODE_CLI,"skycor");
00353     cpl_parameterlist_append(recipe->parameters,p);
00354 
00355     /* Fill in flag to save simple images */
00356 
00357     p = cpl_parameter_new_value("vircam.vircam_jitter_microstep_process.savesimple",
00358                                 CPL_TYPE_BOOL,"Save simple images?",
00359                                 "vircam.vircam_jitter_microstep_process",0);
00360     cpl_parameter_set_alias(p,CPL_PARAMETER_MODE_CLI,"savesimple");
00361     cpl_parameterlist_append(recipe->parameters,p);
00362 
00363     /* Extension number of input frames to use */
00364 
00365     p = cpl_parameter_new_range("vircam.vircam_jitter_microstep_process.extenum",
00366                                 CPL_TYPE_INT,
00367                                 "Extension number to be done, 0 == all",
00368                                 "vircam.vircam_jitter_microstep_process",
00369                                 1,0,16);
00370     cpl_parameter_set_alias(p,CPL_PARAMETER_MODE_CLI,"ext");
00371     cpl_parameterlist_append(recipe->parameters,p);
00372         
00373     /* Get out of here */
00374 
00375     return(0);
00376 }
00377     
00378     
00379 /*---------------------------------------------------------------------------*/
00385 /*---------------------------------------------------------------------------*/
00386 
00387 static int vircam_jitter_microstep_process_exec(cpl_plugin *plugin) {
00388     cpl_recipe  *recipe;
00389 
00390     /* Get the recipe out of the plugin */
00391 
00392     if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
00393         recipe = (cpl_recipe *)plugin;
00394     else 
00395         return(-1);
00396 
00397     return(vircam_jitter_microstep_process(recipe->parameters,recipe->frames));
00398 }
00399                                 
00400 /*---------------------------------------------------------------------------*/
00406 /*---------------------------------------------------------------------------*/
00407 
00408 static int vircam_jitter_microstep_process_destroy(cpl_plugin *plugin) {
00409     cpl_recipe *recipe ;
00410 
00411     /* Get the recipe out of the plugin */
00412 
00413     if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
00414         recipe = (cpl_recipe *)plugin;
00415     else 
00416         return(-1);
00417 
00418     cpl_parameterlist_delete(recipe->parameters);
00419     return(0);
00420 }
00421 
00422 /*---------------------------------------------------------------------------*/
00429 /*---------------------------------------------------------------------------*/
00430 
00431 static int vircam_jitter_microstep_process(cpl_parameterlist *parlist, 
00432                                            cpl_frameset *framelist) {
00433     const char *fctid="vircam_jitter_microstep_process";
00434     cpl_parameter *p;
00435     int nlab,jst,jfn,status,j,i,retval,nusteps,isconf,live,ndit;
00436     float readnoise,gain,gaincor_fac;
00437     vir_fits *ff;
00438     cpl_frame *catindex;
00439     cpl_propertylist *pp;
00440 
00441     /* Check validity of input frameset */
00442 
00443     if (framelist == NULL || cpl_frameset_get_size(framelist) <= 0) {
00444         cpl_msg_error(fctid,"Input framelist NULL or has no input data\n");
00445         return(-1);
00446     }
00447 
00448     /* Check the files in the frameset */
00449 
00450     if (vircam_frameset_fexists(framelist) != VIR_OK) {
00451         cpl_msg_error(fctid,"Input frameset is missing files. Check SOF");
00452         return(-1);
00453     }
00454 
00455     /* Initialise some things */
00456 
00457     vircam_jmp_init();
00458     (void)strncpy(vircam_recipename,fctid,VIRCAM_PATHSZ);
00459     (void)snprintf(vircam_recipepaf,VIRCAM_PATHSZ,"VIRCAM/%s",fctid);
00460     recflag = RECSCI;
00461 
00462     /* Get the parameters */
00463 
00464     p = cpl_parameterlist_find(parlist,
00465                                "vircam.vircam_jitter_microstep_process.ipix");
00466     vircam_jmp_config.ipix = cpl_parameter_get_int(p);
00467     p = cpl_parameterlist_find(parlist,
00468                                "vircam.vircam_jitter_microstep_process.thresh");
00469     vircam_jmp_config.threshold = (float)cpl_parameter_get_double(p);
00470     p = cpl_parameterlist_find(parlist,
00471                                "vircam.vircam_jitter_microstep_process.icrowd");
00472     vircam_jmp_config.icrowd = cpl_parameter_get_bool(p);
00473     p = cpl_parameterlist_find(parlist,
00474                                "vircam.vircam_jitter_microstep_process.rcore");
00475     vircam_jmp_config.rcore = (float)cpl_parameter_get_double(p);
00476     p = cpl_parameterlist_find(parlist,
00477                                "vircam.vircam_jitter_microstep_process.nbsize");
00478     vircam_jmp_config.nbsize = cpl_parameter_get_int(p);
00479     p = cpl_parameterlist_find(parlist,
00480                                "vircam.vircam_jitter_microstep_process.savecat");
00481     vircam_jmp_config.savecat = cpl_parameter_get_bool(p);
00482     p = cpl_parameterlist_find(parlist,
00483                                "vircam.vircam_jitter_microstep_process.destripe");
00484     vircam_jmp_config.destripe = cpl_parameter_get_bool(p);
00485     p = cpl_parameterlist_find(parlist,
00486                                "vircam.vircam_jitter_microstep_process.skycor");
00487     vircam_jmp_config.skycor = cpl_parameter_get_bool(p);
00488     p = cpl_parameterlist_find(parlist,
00489                                "vircam.vircam_jitter_microstep_process.savesimple");
00490     vircam_jmp_config.savesimple = cpl_parameter_get_bool(p);
00491     p = cpl_parameterlist_find(parlist,
00492                                "vircam.vircam_jitter_microstep_process.extenum");
00493     vircam_jmp_config.extenum = cpl_parameter_get_int(p);
00494 
00495     /* Sort out raw from calib frames */
00496 
00497     if (vircam_dfs_set_groups(framelist) != VIR_OK) {
00498         cpl_msg_error(fctid,"Cannot identify RAW and CALIB frames");
00499         vircam_jmp_tidy(0);
00500         return(-1);
00501     }
00502 
00503     /* Label the input frames */
00504 
00505     if ((ps.labels = cpl_frameset_labelise(framelist,vircam_compare_tags,
00506                                            &nlab)) == NULL) {
00507         cpl_msg_error(fctid,"Cannot labelise the input frames");
00508         vircam_jmp_tidy(0);
00509         return(-1);
00510     }
00511 
00512     /* Get the input science frames */
00513 
00514     if ((ps.science_frames = 
00515          vircam_frameset_subgroup(framelist,ps.labels,nlab,
00516                                   VIRCAM_SCI_OBJECT_RAW)) == NULL) {
00517         if ((ps.science_frames =
00518              vircam_frameset_subgroup(framelist,ps.labels,nlab,
00519                                       VIRCAM_SCI_OBJECT_EXT_RAW)) == NULL) {
00520             cpl_msg_error(fctid,"No science images to process!");
00521             vircam_jmp_tidy(0);
00522             return(-1);
00523         }
00524     }
00525 
00526     /* Get the offset sky frames */
00527 
00528     
00529     if ((ps.master_sky = vircam_frameset_subgroup_1(framelist,ps.labels,nlab,
00530                                                     VIRCAM_CAL_SKY)) == NULL) { 
00531         if ((ps.offset_skies = 
00532              vircam_frameset_subgroup(framelist,ps.labels,nlab,
00533                                       VIRCAM_OFFSET_SKY_RAW)) == NULL)
00534             offsky = 0;
00535         else 
00536             offsky = 1;
00537     } else {
00538         offsky = -1;
00539     }
00540 
00541     /* Check to see if there is a master dark frame */
00542 
00543     if ((ps.master_dark = 
00544          vircam_frameset_subgroup_1(framelist,ps.labels,nlab,
00545                                     VIRCAM_CAL_DARK)) == NULL) {
00546         cpl_msg_error(fctid,"No master dark found");
00547         vircam_jmp_tidy(0);
00548         return(-1);
00549     }
00550         
00551     /* Check to see if there is a master twilight flat frame */
00552 
00553     if ((ps.master_twilight_flat = 
00554          vircam_frameset_subgroup_1(framelist,ps.labels,nlab,
00555                                     VIRCAM_CAL_TWILIGHT_FLAT)) == NULL) {
00556         cpl_msg_error(fctid,"No master twilight flat found");
00557         vircam_jmp_tidy(0);
00558         return(-1);
00559     }
00560 
00561     /* Get the gain corrections */
00562 
00563     status = VIR_OK;
00564     if (vircam_gaincor_calc(ps.master_twilight_flat,&i,&(ps.gaincors),
00565                             &status) != VIR_OK) {
00566         cpl_msg_error(fctid,"Error calculating gain corrections");
00567         vircam_jmp_tidy(0);
00568         return(-1);
00569     }
00570         
00571     /* Check to see if there is a readgain file */
00572 
00573     if ((ps.readgain_file = 
00574          vircam_frameset_subgroup_1(framelist,ps.labels,nlab,
00575                                     VIRCAM_CAL_READGAINFILE)) == NULL) {
00576         cpl_msg_error(fctid,"No master readnoise/gain file found");
00577         vircam_jmp_tidy(0);
00578         return(-1);
00579     }
00580         
00581     /* Check to see if there is a master confidence map. If there isn't
00582        then look for a bad pixel mask that can be converted into a 
00583        confidence map (in an emergency) */
00584 
00585     isconf = 1;
00586     if ((ps.master_conf = 
00587          vircam_frameset_subgroup_1(framelist,ps.labels,nlab,
00588                                     VIRCAM_CAL_CONF)) == NULL) {
00589         isconf = 0;
00590         if ((ps.master_conf = 
00591              vircam_frameset_subgroup_1(framelist,ps.labels,nlab,
00592                                         VIRCAM_CAL_BPM)) == NULL) {
00593             cpl_msg_error(fctid,"No master confidence map found");
00594             vircam_jmp_tidy(0);
00595             return(-1);
00596         }
00597     }
00598     ps.mask = vircam_mask_define(framelist,ps.labels,nlab);
00599         
00600     /* Check to see if there is a channel table */
00601 
00602     if ((ps.chantab = vircam_frameset_subgroup_1(framelist,ps.labels,nlab,
00603                                                  VIRCAM_CAL_CHANTAB)) == NULL) {
00604         cpl_msg_error(fctid,"No channel table found");
00605         vircam_jmp_tidy(0);
00606         return(-1);
00607     }
00608 
00609     /* Check to see if there is a photometric table */
00610 
00611     if ((ps.phottab = vircam_frameset_subgroup_1(framelist,ps.labels,nlab,
00612                                                  VIRCAM_CAL_PHOTTAB)) == NULL) {
00613         cpl_msg_error(fctid,"No photometric table found");
00614         vircam_jmp_tidy(0);
00615         return(-1);
00616     }
00617     if ((ps.tphottab = cpl_table_load(cpl_frame_get_filename(ps.phottab),1,0)) == NULL) {
00618         cpl_msg_error(fctid,"Unable to load photometric table");
00619         vircam_jmp_tidy(0);
00620         return(-1);
00621     }
00622 
00623     /* Is the 2mass index file specified? */
00624 
00625     if ((catindex = vircam_frameset_subgroup_1(framelist,ps.labels,nlab,
00626                                                VIRCAM_CAL_2MASS)) == NULL) {
00627         cpl_msg_info(fctid,"No 2MASS index found -- cannot continue");
00628         vircam_jmp_tidy(0);
00629         return(-1);
00630     }
00631     
00632     /* Get catalogue parameters */
00633 
00634     if (vircam_catpars(catindex,&(ps.catpath),&(ps.catname)) == VIR_FATAL) {
00635         vircam_jmp_tidy(0);
00636         cpl_frame_delete(catindex);
00637         return(-1);
00638     }
00639     cpl_frame_delete(catindex);
00640 
00641     /* Set up the photometric calibration catalogue data */
00642 
00643     (void)strcpy(current_catpath,ps.catpath);
00644     (void)strcpy(current_cat,ps.catname);
00645 
00646     /* Get the number of DITs */
00647 
00648     pp = cpl_propertylist_load(cpl_frame_get_filename(cpl_frameset_get_frame(ps.science_frames,0)),0);
00649     if (vircam_pfits_get_ndit(pp,&ndit) != VIR_OK) {
00650         cpl_msg_error(fctid,"No value for NDIT available");
00651         freepropertylist(pp);
00652         vircam_jmp_tidy(0);
00653         return(-1);
00654     }
00655     cpl_propertylist_delete(pp);
00656 
00657     /* Now, how many image extensions do we want to do? If the extension
00658        number is zero, then we loop for all possible extensions. If it
00659        isn't then we just do the extension specified */
00660 
00661     vircam_exten_range(vircam_jmp_config.extenum,
00662                        (const cpl_frame *)cpl_frameset_get_frame(ps.science_frames,0),
00663                        &jst,&jfn);
00664     if (jst == -1 || jfn == -1) {
00665         cpl_msg_error(fctid,"Unable to continue");
00666         vircam_jmp_tidy(0);
00667         return(-1);
00668     }
00669 
00670     /* Now loop for all the extensions... */
00671 
00672     status = VIR_OK;
00673     for (j = jst; j <= jfn; j++) {
00674         isfirst = (j == jst);
00675         gaincor_fac = (ps.gaincors)[j-1];
00676         cpl_msg_info(fctid,"Beginning extension [%d]",j);
00677 
00678         /* Load up the calibration frames into vir_fits/vir_tfits structures 
00679            It is a fatal error if any one of them can't load properly */
00680         
00681         ps.fdark = vircam_fits_load(ps.master_dark,CPL_TYPE_FLOAT,j);
00682         if (ps.fdark == NULL) {
00683             cpl_msg_error(fctid,"Error loading master dark %s[%d]\n%s",
00684                           cpl_frame_get_filename(ps.master_dark),j,
00685                           cpl_error_get_message());
00686             vircam_jmp_tidy(0);
00687             return(-1);
00688         }
00689         ps.fflat = vircam_fits_load(ps.master_twilight_flat,CPL_TYPE_FLOAT,j);
00690         if (ps.fflat == NULL) {
00691             cpl_msg_error(fctid,"Error loading master flat %s[%d]\n%s",
00692                           cpl_frame_get_filename(ps.master_twilight_flat),j,
00693                           cpl_error_get_message());
00694             vircam_jmp_tidy(0);
00695             return(-1);
00696         }
00697         ps.fconf = vircam_fits_load(ps.master_conf,CPL_TYPE_INT,j);
00698         if (ps.fconf == NULL) {
00699             cpl_msg_error(fctid,"Error loading master conf %s[%d]\n%s",
00700                           cpl_frame_get_filename(ps.master_conf),j,
00701                           cpl_error_get_message());
00702             vircam_jmp_tidy(0);
00703             return(-1);
00704         }
00705         if (! isconf) 
00706             vircam_jmp_bpm2conf();
00707         if (vircam_mask_load(ps.mask,j,
00708                              cpl_image_get_size_x(vircam_fits_get_image(ps.fconf)),
00709                              cpl_image_get_size_y(vircam_fits_get_image(ps.fconf))) != VIR_OK) {
00710             cpl_msg_error(fctid,"Error loading mask from master conf %s[%d]\n%s",
00711                           cpl_frame_get_filename(ps.master_conf),j,
00712                           cpl_error_get_message());
00713             vircam_jmp_tidy(0);
00714             return(-1);
00715         }
00716         if (offsky == -1) {
00717             ps.fsky = vircam_fits_load(ps.master_sky,CPL_TYPE_FLOAT,j);
00718             if (ps.fsky == NULL) {
00719                 cpl_msg_error(fctid,"Error loading master sky %s[%d]\n%s",
00720                               cpl_frame_get_filename(ps.master_sky),j,
00721                               cpl_error_get_message());
00722                 vircam_jmp_tidy(0);
00723                 return(-1);
00724             }
00725         }
00726         ps.fchantab = vircam_tfits_load(ps.chantab,j);
00727         if (ps.fchantab == NULL) {
00728             cpl_msg_error(fctid,"Error loading channel table %s[%d]\n%s",
00729                           cpl_frame_get_filename(ps.chantab),j,
00730                           cpl_error_get_message());
00731             vircam_jmp_tidy(0);
00732             return(-1);
00733         }
00734 
00735         /* Load up the vir_fits structures for the science images */
00736 
00737         ps.nscience = cpl_frameset_get_size(ps.science_frames);
00738         ps.sci_fits = vircam_fits_load_list(ps.science_frames,CPL_TYPE_FLOAT,j);
00739         if (ps.sci_fits == NULL) {
00740             cpl_msg_error(fctid,"Error loading science frames extension %d: %s",
00741                           j,cpl_error_get_message());
00742             vircam_jmp_tidy(0);
00743             return(-1);
00744         }
00745 
00746         /* Set up something for the PAFs */
00747 
00748         ps.phupaf = vircam_paf_phu_items(vircam_fits_get_phu(ps.sci_fits[0]));
00749 
00750         /* Load up the vir_fits structures for the offset skies (if needed) */
00751 
00752         if (offsky == 1) {
00753             ps.noffsets = cpl_frameset_get_size(ps.offset_skies);
00754             ps.offsky_fits = vircam_fits_load_list(ps.offset_skies,
00755                                                    CPL_TYPE_FLOAT,j);
00756             if (ps.offsky_fits == NULL) {
00757                 cpl_msg_error(fctid,
00758                               "Error loading offset skies extension %d: %s",
00759                               j,cpl_error_get_message());
00760                 vircam_jmp_tidy(0);
00761                 return(-1);
00762             }
00763         } else {
00764             ps.noffsets = 0;
00765             ps.offsky_fits = NULL;
00766         }
00767 
00768         /* Loop through and mark the frames where the header says the detector
00769            wasn't live. Also check to see if the CRVAL == 0 problem is 
00770            present. Check for live detectors in the offset skies too */
00771 
00772         for (i = 0; i < ps.nscience; i++) {
00773             ff = ps.sci_fits[i];
00774             vircam_pfits_get_detlive(vircam_fits_get_ehu(ff),&live);
00775             if (! live) 
00776                 vircam_fits_set_error(ff,VIR_FATAL);
00777             if (vircam_check_crval(vircam_fits_get_phu(ff),
00778                                    vircam_fits_get_ehu(ff)) != VIR_OK) {
00779                 cpl_msg_error(fctid,"Unable to correct CRVAL in %s",
00780                               vircam_fits_get_fullname(ff));
00781                 vircam_jmp_tidy(0);
00782                 return(-1);
00783             }
00784         }
00785         for (i = 0; i < ps.noffsets; i++) {
00786             ff = ps.offsky_fits[i];
00787             vircam_pfits_get_detlive(vircam_fits_get_ehu(ff),&live);
00788             if (! live) 
00789                 vircam_fits_set_error(ff,VIR_FATAL);
00790         }
00791 
00792         /* Get the readnoise and gain estimate for this extension */
00793 
00794         vircam_jmp_get_readnoise_gain(j,&readnoise,&gain);
00795 
00796         /* Loop for all the science frames and do the 2d corrections. Then
00797            do it for the offset skies */
00798 
00799         cpl_msg_info(fctid,"Doing stage1 corrections");
00800         for (i = 0; i < ps.nscience; i++) {
00801             ff = ps.sci_fits[i];
00802             cpl_propertylist_update_float(vircam_fits_get_ehu(ff),"READNOIS",
00803                                           readnoise);
00804             cpl_propertylist_set_comment(vircam_fits_get_ehu(ff),"READNOIS",
00805                                          "[e-] Readnoise used in processing");
00806             cpl_propertylist_update_float(vircam_fits_get_ehu(ff),"GAIN",gain);
00807             cpl_propertylist_set_comment(vircam_fits_get_ehu(ff),"GAIN",
00808                                          "[e-/adu] Gain used in processing");
00809             if (vircam_fits_get_status(ff) == VIR_FATAL) {
00810                 cpl_msg_info(fctid,"Detector is flagged dead in %s",
00811                              vircam_fits_get_fullname(ff));
00812                 continue;
00813             }
00814             status = VIR_OK;
00815             (void)vircam_darkcor(ff,ps.fdark,1.0,&status);
00816             (void)vircam_lincor(ff,ps.fchantab,1,ndit,&status);
00817             (void)vircam_nditcor(ff,ndit,&status);
00818             (void)vircam_flatcor(ff,ps.fflat,&status);
00819             (void)vircam_gaincor(ff,gaincor_fac,&status);
00820             vircam_fits_set_error(ff,status);
00821         }
00822         for (i = 0; i < ps.noffsets; i++) {
00823             ff = ps.offsky_fits[i];
00824             if (vircam_fits_get_status(ff) == VIR_FATAL) {
00825                 cpl_msg_info(fctid,"Detector is flagged dead in %s",
00826                              vircam_fits_get_fullname(ff));
00827                 continue;
00828             }
00829             status = VIR_OK;
00830             (void)vircam_darkcor(ff,ps.fdark,1.0,&status);
00831             (void)vircam_lincor(ff,ps.fchantab,1,ndit,&status);
00832             (void)vircam_nditcor(ff,ndit,&status);
00833             (void)vircam_flatcor(ff,ps.fflat,&status);
00834             (void)vircam_gaincor(ff,gaincor_fac,&status);
00835             vircam_fits_set_error(ff,status);
00836         }
00837 
00838         /* Do a simple sky correction if requested */
00839 
00840         if (vircam_jmp_config.skycor) {
00841             cpl_msg_info(fctid,"Doing sky correction");
00842             vircam_jmp_skycor();
00843         } else {
00844             for (i = 0; i < ps.nscience; i++) {
00845                 pp = vircam_fits_get_ehu(ps.sci_fits[i]);
00846                 cpl_propertylist_update_string(pp,"ESO DRS SKYCOR","none");
00847                 cpl_propertylist_update_comment(pp,"ESO DRS SKYCOR",
00848                                                 "Sky correction method");
00849             }
00850         }
00851 
00852         /* Do destripe if requested */
00853 
00854         if (vircam_jmp_config.destripe) {
00855             for (i = 0; i < ps.nscience; i++) {
00856                 ff = ps.sci_fits[i];
00857                 (void)vircam_destripe(ff,ps.mask,&status);
00858                 vircam_fits_set_error(ff,status);
00859             }
00860             for (i = 0; i < ps.noffsets; i++) {
00861                 ff = ps.offsky_fits[i];
00862                 (void)vircam_destripe(ff,ps.mask,&status);
00863                 vircam_fits_set_error(ff,status);
00864             }
00865         }
00866 
00867         /* Look at the first frame in the list and see if the number of
00868            microsteps is greater than 1. If so, then we'll have to go
00869            through interleaving. */
00870 
00871         retval = vircam_pfits_get_nusteps(vircam_fits_get_phu(ps.sci_fits[0]),
00872                                           &nusteps);
00873         if (retval != VIR_OK) {
00874             cpl_msg_warning(fctid,"Unable to get nusteps from header.\nAssuming no microstepping");
00875             nusteps = 1;
00876         }
00877         
00878         /* If the number of microsteps is 1 then copy over the good frames
00879            into a fits list for dithering. */
00880 
00881         ps.ndith = 0;
00882         if (nusteps < 4) {
00883             if (nusteps == 1) 
00884                 cpl_msg_info(fctid,"No interleaving will be done");
00885             else
00886                 cpl_msg_warning(fctid,"Illegal number of microsteps: %d\nNo interleaving will be done",nusteps);
00887             ps.dith_input = cpl_malloc(ps.nscience*sizeof(vir_fits *));
00888             ps.dithc_input = cpl_malloc(sizeof(vir_fits *));
00889             for (i = 0; i < ps.nscience; i++) {
00890                 if (vircam_fits_get_status(ps.sci_fits[i]) == VIR_OK) 
00891                     ps.dith_input[ps.ndith++] = ps.sci_fits[i];
00892             }
00893             ps.dithc_input[0] = ps.fconf;
00894             ps.ndithc = 1;
00895             interlv = 0;
00896 
00897         /* If the number of microsteps is more than 1, then we need
00898            to do interleaving. The interleaving routine define
00899            ps.dith_input. */
00900 
00901         } else {
00902             cpl_msg_info(fctid,"Interleaving");
00903             vircam_jmp_interleave();
00904             interlv = 1;
00905         }
00906 
00907         /* Work out the jitter offsets and the stack the jitter frame */
00908 
00909         cpl_msg_info(fctid,"Working out jitter offsets");
00910         vircam_jmp_dither_offsets();
00911         cpl_msg_info(fctid,"Stacking jittered frame");
00912         vircam_jmp_dither_images();
00913 
00914         /* Do a catalogue generation */
00915 
00916         cpl_msg_info(fctid,"Doing object extraction");
00917         vircam_jmp_catalogue();
00918 
00919         /* Create a matched standards table */
00920 
00921         cpl_msg_info(fctid,"Matching objects with 2mass standards");
00922         vircam_jmp_matched_stds();
00923 
00924         /* Do a WCS fit for the dithered image */
00925 
00926         cpl_msg_info(fctid,"Fitting a WCS");
00927         vircam_jmp_wcsfit();
00928 
00929         /* Finally do the photometric zeropoint fit */
00930 
00931         cpl_msg_info(fctid,"Doing photometric zeropoint calculation");
00932         vircam_jmp_photcal();
00933 
00934         /* Save the simple images */ 
00935 
00936         if (vircam_jmp_config.savesimple) {
00937             cpl_msg_info(fctid,"Saving simple images");
00938             if (vircam_jmp_save_simple(framelist,parlist) != 0) {
00939                 vircam_jmp_tidy(0);
00940                 return(-1);
00941             }
00942         }
00943         if (offsky == 1) {
00944             if (vircam_jmp_config.savesimple) {
00945                 cpl_msg_info(fctid,"Saving offset sky simple images");
00946                 if (vircam_jmp_save_simple_offsets(framelist,parlist) != 0) {
00947                     vircam_jmp_tidy(0);
00948                     return(-1);
00949                 }
00950             }
00951             cpl_msg_info(fctid,"Saving mean offset sky image");
00952             if (vircam_jmp_save_offsky(framelist,parlist) != 0) {
00953                 vircam_jmp_tidy(0);
00954                 return(-1);
00955             }
00956         }
00957         vircam_mask_clear(ps.mask);
00958 
00959         /* Save super frames */
00960 
00961         if (interlv) {
00962             cpl_msg_info(fctid,"Saving superframe images");
00963             if (vircam_jmp_save_super(framelist,parlist) != 0) {
00964                 vircam_jmp_tidy(0);
00965                 return(-1);
00966             }
00967         }
00968 
00969         /* Save the dithered images */
00970 
00971         cpl_msg_info(fctid,"Saving stacked image");     
00972         dummyqc = vircam_jitter_microstep_process_dummyqc(1);
00973         if (vircam_jmp_save_stack(framelist,parlist) != 0) {
00974             vircam_jmp_tidy(0);
00975             freepropertylist(dummyqc);
00976             return(-1);
00977         }
00978         freepropertylist(dummyqc);
00979         if (vircam_jmp_config.savecat) {
00980             cpl_msg_info(fctid,"Saving stacked image catalogue");
00981             dummyqc = vircam_jitter_microstep_process_dummyqc(2);
00982             if (vircam_jmp_save_catalogue(framelist,parlist) != 0) {
00983                 vircam_jmp_tidy(0);
00984                 freepropertylist(dummyqc);
00985                 return(-1);
00986             }
00987             freepropertylist(dummyqc);
00988         }
00989 
00990         /* Clean up on aisle 12! */
00991 
00992         vircam_jmp_tidy(1);
00993     }
00994 
00995     /* Final cleanup */
00996 
00997     vircam_jmp_tidy(0);
00998     return(0);
00999 }
01000 
01001 static cpl_propertylist *vircam_jitter_microstep_process_dummyqc(int type) {
01002     cpl_propertylist *p;
01003 
01004     /* Get an empty property list */
01005 
01006     p = cpl_propertylist_new();
01007 
01008     /* Now switch for the various products */
01009 
01010     switch (type) {
01011 
01012     /* Stack images */
01013 
01014     case 1:
01015         cpl_propertylist_update_double(p,"ESO QC WCS_DCRVAL1",0.0);
01016         cpl_propertylist_set_comment(p,"ESO QC WCS_DCRVAL1",
01017                                      "[deg] change in crval1");
01018         cpl_propertylist_update_double(p,"ESO QC WCS_DCRVAL2",0.0);
01019         cpl_propertylist_set_comment(p,"ESO QC WCS_DCRVAL2",
01020                                      "[deg] change in crval2");
01021         cpl_propertylist_update_double(p,"ESO QC WCS_DTHETA",0.0);
01022         cpl_propertylist_set_comment(p,"ESO QC WCS_DTHETA",
01023                                      "[deg] change in rotation");
01024         cpl_propertylist_update_double(p,"ESO QC WCS_SCALE",0.0);
01025         cpl_propertylist_set_comment(p,"ESO QC WCS_SCALE",
01026                                      "[arcsec] mean plate scale");
01027         cpl_propertylist_update_double(p,"ESO QC WCS_SHEAR",0.0);
01028         cpl_propertylist_set_comment(p,"ESO QC WCS_SHEAR",
01029                                      "[deg] abs(xrot) - abs(yrot)");
01030         cpl_propertylist_update_double(p,"ESO QC WCS_RMS",0.0);
01031         cpl_propertylist_set_comment(p,"ESO QC WCS_RMS",
01032                                      "[arcsec] Average error in WCS fit");
01033         cpl_propertylist_update_float(p,"ESO QC MAGZPT",0.0);
01034         cpl_propertylist_set_comment(p,"ESO QC MAGZPT",
01035                                      "[mag] photometric zeropoint");
01036         cpl_propertylist_update_float(p,"ESO QC MAGZERR",0.0);
01037         cpl_propertylist_set_comment(p,"ESO QC MAGZERR",
01038                                      "[mag] photometric zeropoint error");
01039         cpl_propertylist_update_int(p,"ESO QC MAGNZPT",0);
01040         cpl_propertylist_set_comment(p,"ESO QC MAGNZPT",
01041                                      "number of stars in magzpt calc");
01042         cpl_propertylist_update_int(p,"ESO QC MAGNCUT",0);
01043         cpl_propertylist_set_comment(p,"ESO QC MAGNCUT",
01044                                      "number of stars cut from magzpt calc");
01045         cpl_propertylist_update_float(p,"ESO QC LIMITING_MAG",0.0);
01046         cpl_propertylist_set_comment(p,"ESO QC LIMITING_MAG",
01047                                      "[mag] 5 sigma limiting mag");
01048         break;
01049 
01050     /* Catalogues */
01051 
01052     case 2:
01053         cpl_propertylist_update_float(p,"ESO QC SATURATION",0.0);
01054         cpl_propertylist_set_comment(p,"ESO QC SATURATION",
01055                                      "[adu] Saturation level");
01056         cpl_propertylist_update_float(p,"ESO QC MEAN_SKY",0.0);
01057         cpl_propertylist_set_comment(p,"ESO QC MEAN_SKY",
01058                                      "[adu] Median sky brightness");
01059         cpl_propertylist_update_float(p,"ESO QC SKY_NOISE",0.0);
01060         cpl_propertylist_set_comment(p,"ESO QC SKY_NOISE",
01061                                      "[adu] Pixel noise at sky level");
01062         cpl_propertylist_update_float(p,"ESO QC IMAGE_SIZE",0.0);
01063         cpl_propertylist_set_comment(p,"ESO QC IMAGE_SIZE",
01064                                      "[pixels] Average FWHM of stellar objects")
01065 ;
01066         cpl_propertylist_update_float(p,"ESO QC ELLIPTICITY",0.0);
01067         cpl_propertylist_set_comment(p,"ESO QC ELLIPTICITY",
01068                                      "Average stellar ellipticity (1-b/a)");
01069         cpl_propertylist_update_float(p,"ESO QC APERTURE_CORR",0.0);
01070         cpl_propertylist_set_comment(p,"ESO QC APERTURE_CORR",
01071                                      "Stellar ap-corr 1x core flux");
01072         cpl_propertylist_update_int(p,"ESO QC NOISE_OBJ",0);
01073         cpl_propertylist_set_comment(p,"ESO QC NOISE_OBJ",
01074                                      "Number of noise objects");
01075         break;
01076     default:
01077         break;
01078     }
01079 
01080     /* Get out of here */
01081 
01082     return(p);
01083 }
01084 
01087 /*
01088 
01089 $Log: vircam_jitter_microstep_process.c,v $
01090 Revision 1.67  2010/12/09 13:19:44  jim
01091 Modified comments
01092 
01093 Revision 1.66  2010/09/13 11:43:13  jim
01094 Added flag DRS SKYCOR if background correction isn't being done
01095 
01096 Revision 1.65  2010/09/10 11:25:19  jim
01097 Modified so that a master sky can now be used.
01098 
01099 Revision 1.64  2010/09/09 12:15:35  jim
01100 Added new QC parameter MAGNCUT
01101 
01102 Revision 1.63  2010/06/03 11:30:40  jim
01103 Modified so that object deblending is done by default. Also fixed bug where
01104 offset sky images were saved when --savesimple was switched off
01105 
01106 Revision 1.62  2010/03/21 06:47:42  jim
01107 Added code to trap for problems in saving products
01108 
01109 Revision 1.61  2010/03/12 10:44:07  lbilbao
01110 Added missing header inclusion.
01111 
01112 Revision 1.60  2010/02/08 16:35:26  jim
01113 Moved the definition of propertylist ps.phupaf to the recipes so that
01114 this doesn't fail when we don't save the simple images
01115 
01116 Revision 1.59  2010/01/31 18:57:15  jim
01117 Now simple images are only saved when you really want them
01118 
01119 Revision 1.58  2009/12/11 06:52:56  jim
01120 Minor mods to documentation
01121 
01122 Revision 1.57  2009/09/22 12:29:37  jim
01123 Modified to do offset sky exposures
01124 
01125 Revision 1.56  2009/07/03 12:30:04  jim
01126 Default value of rcore is now 3
01127 
01128 Revision 1.55  2009/02/04 09:23:29  jim
01129 Moved destriping to after sky subtraction
01130 
01131 Revision 1.54  2009/01/19 14:36:02  jim
01132 Added vircam_nditcor
01133 
01134 Revision 1.53  2008/12/08 06:38:41  jim
01135 Added trap for crval==0 error. Also added a trap for illegal 2x1 microstep
01136 sequences
01137 
01138 Revision 1.52  2008/11/27 09:14:47  jim
01139 Fixed PRO CATG keyword values for interleaved confidence maps in docs
01140 
01141 Revision 1.51  2008/11/25 18:55:59  jim
01142 took out extra sky stuff
01143 
01144 Revision 1.50  2008/11/25 12:03:21  jim
01145 Fixed doc
01146 
01147 Revision 1.49  2008/11/25 11:53:50  jim
01148 Changed type for 'skycor' parameter to an enum. Recipe now allows for standard
01149 or object masked sky estimate
01150 
01151 Revision 1.48  2008/10/01 04:59:13  jim
01152 Added call to vircam_frameset_fexists to check input frameset
01153 
01154 Revision 1.47  2008/05/06 12:15:20  jim
01155 Changed to use new version of vircam_catpars
01156 
01157 Revision 1.46  2007/11/26 09:59:06  jim
01158 Recipe now takes ndit into account when doing linearity correction
01159 
01160 Revision 1.45  2007/10/25 18:39:22  jim
01161 Altered to remove some lint messages
01162 
01163 Revision 1.44  2007/10/19 06:55:06  jim
01164 Modifications made to use new method for directing the recipes to the
01165 standard catalogues using the sof
01166 
01167 Revision 1.43  2007/07/09 13:21:55  jim
01168 Modified to use new version of vircam_exten_range
01169 
01170 Revision 1.42  2007/06/13 08:11:27  jim
01171 Modified docs to reflect changes in DFS tags
01172 
01173 Revision 1.41  2007/05/15 08:55:19  jim
01174 Moved the saving of the products to later in the loop so that the jitter
01175 and microstep offsets will be written to the product headers
01176 
01177 Revision 1.40  2007/05/08 21:31:15  jim
01178 fixed typo
01179 
01180 Revision 1.39  2007/05/08 10:42:44  jim
01181 Added gain correction
01182 
01183 Revision 1.38  2007/04/04 16:05:59  jim
01184 Modified to make paf information a bit more correct
01185 
01186 Revision 1.37  2007/04/04 10:36:18  jim
01187 Modified to use new dfs tags
01188 
01189 Revision 1.36  2007/03/29 12:19:38  jim
01190 Little changes to improve documentation
01191 
01192 Revision 1.35  2007/03/14 14:49:13  jim
01193 Fixed problem with missing paf files in jmp recipes if detlive = F. Also
01194 fixed problem where extra dummy products were being created
01195 
01196 Revision 1.34  2007/03/06 12:00:48  jim
01197 Fixed stupid typo in header
01198 
01199 Revision 1.33  2007/03/01 12:41:49  jim
01200 Modified slightly after code checking
01201 
01202 Revision 1.32  2007/02/07 10:12:39  jim
01203 Removed calls to vircam_ndit_correct as this is now no longer necessary
01204 
01205 Revision 1.31  2006/12/19 13:31:27  jim
01206 Fixed path2mass alias name. Also detectors flagged as dead now only generate
01207 an INFO message
01208 
01209 Revision 1.30  2006/11/29 12:28:45  jim
01210 Modified so that the correct recipe names would appear in the headers of
01211 data products
01212 
01213 Revision 1.29  2006/11/27 12:17:25  jim
01214 Almost all support routines are now in vircam/vircam_jmp_utils.c
01215 
01216 Revision 1.28  2006/11/22 21:57:06  jim
01217 Modified how readnoise and gain are read
01218 
01219 Revision 1.27  2006/11/10 09:23:06  jim
01220 Added sky correction and destriping along with the relevant command line
01221 parameters. Also fixed save routines so that dummy products will get the
01222 IMADUMMY flag.
01223 
01224 Revision 1.26  2006/09/09 16:49:40  jim
01225 Header comment update
01226 
01227 Revision 1.25  2006/08/07 14:21:03  jim
01228 Made a few more changes to make sure that if things fail then it doesn't try
01229 and run further processing steps
01230 
01231 Revision 1.24  2006/08/07 12:59:52  jim
01232 Fixed DET LIVE problem (I think)
01233 
01234 Revision 1.23  2006/08/01 11:28:14  jim
01235 Modified to use new smoothing kernel width parameter in imcore
01236 
01237 Revision 1.22  2006/07/19 10:42:50  jim
01238 Fixed a bug where the product frame lists were being deleted too early
01239 
01240 Revision 1.21  2006/07/17 12:51:48  jim
01241 Plugged a great number of memory leaks (mainly to do with propertylists)
01242 
01243 Revision 1.20  2006/07/17 09:31:24  jim
01244 Fixed a small memory leak and a bug in vircam_jmp_dither_offsets
01245 
01246 Revision 1.19  2006/07/11 14:56:17  jim
01247 Changes in the interleaving and jitter routines so that missing data
01248 and frames that are flagged as bad are dealt with properly
01249 
01250 Revision 1.18  2006/07/07 09:34:21  jim
01251 Fixed a few bugs relating to interleaving
01252 
01253 Revision 1.17  2006/07/04 09:19:03  jim
01254 replaced all sprintf statements with snprintf
01255 
01256 Revision 1.16  2006/06/20 19:07:01  jim
01257 Corrects for ndit != 1
01258 
01259 Revision 1.15  2006/06/19 20:50:35  jim
01260 Put a better algorithm for working out an output file name into
01261 vircam_jmp_save_smple
01262 
01263 Revision 1.14  2006/06/15 09:58:58  jim
01264 Minor changes to docs
01265 
01266 Revision 1.13  2006/06/14 14:17:13  jim
01267 minor documentation fix
01268 
01269 Revision 1.12  2006/06/13 21:28:39  jim
01270 Uses new VIRCAM_CALIB_READGAIN_FILE as an input now.
01271 
01272 Revision 1.11  2006/06/13 14:10:59  jim
01273 Fixed routine that saves catalogues to remove WCS stuff from extension header.
01274 
01275 Revision 1.10  2006/06/09 22:25:06  jim
01276 tidied up a few bugs
01277 
01278 Revision 1.9  2006/06/09 11:26:25  jim
01279 Small changes to keep lint happy
01280 
01281 Revision 1.8  2006/06/08 14:52:52  jim
01282 Fixed a few little bugs
01283 
01284 Revision 1.7  2006/06/06 13:03:30  jim
01285 Added QC parameters to docs
01286 
01287 Revision 1.6  2006/06/01 14:34:06  jim
01288 Now accepts a bad pixel mask in place of a confidence map for emergency use
01289 
01290 Revision 1.5  2006/05/30 14:27:54  jim
01291 Added illcor parameter to call for photcal
01292 
01293 Revision 1.4  2006/05/30 12:15:42  jim
01294 Cosmetic changes
01295 
01296 Revision 1.3  2006/05/27 21:25:49  jim
01297 Added some more docs
01298 
01299 Revision 1.2  2006/05/26 15:06:06  jim
01300 Fixed lots of little bugs
01301 
01302 Revision 1.1  2006/05/24 13:39:29  jim
01303 First cut
01304 
01305 
01306 */

Generated on 7 Feb 2011 for VIRCAM Pipeline by  doxygen 1.6.1