IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 21, 2021, 10:03:06 AM (5 years ago)
Author:
eugene
Message:

major revision of the photometric flat-field correction / grid analysis; strip out code which uses astrometric information to define the grid

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/relphot.20210521/src/relphot_images.c

    r41556 r41603  
    5454  FlatCorrectionTable *flatcorr = NULL;
    5555
     56  initGridBins (); // allocates the empty array of corrections (elements are build below)
     57
    5658  if (CALIBRATE_STACKS_AND_WARPS || (NLOOP > 0)) {
    5759    /* load catalog data from region files (hostID is 0 since we are not a client */
     
    6870    initTGroupBins (catalog, Ncatalog);
    6971
    70     initGridBins   (catalog, Ncatalog);
    7172    initMrel (catalog, Ncatalog);
    7273
     
    7475    MARKTIME("-- set up image indexes: %f sec\n", dtime);
    7576
    76     findMosaics (catalog, Ncatalog, TRUE);  /* also sets Grid values */
     77    findMosaics (catalog, Ncatalog, TRUE);
    7778    MARKTIME("-- set up mosaic indexes: %f sec\n", dtime);
    7879
    7980    findTGroups (catalog, Ncatalog);
    8081    MARKTIME("-- set up mosaic indexes: %f sec\n", dtime);
     82
     83    initGrid (); // allocate grid correction entries for existing photcodes
    8184
    8285    SAVEPLOT = FALSE;
     
    9194    }
    9295
    93     // if we are measuring the flat-field correction grid, we need to perform a number of iterations first:
    94     if (USE_GRID) {
    95       int star_toofew;
    96 
    97       // until we finish the grid analysis, do not reject stars out-of-hand based on ID_OBJ_FEW
    98       // XXX this is kind of poor: need to have a better distinctions about STAR_BAD in setMrel vs getMrel
    99       star_toofew = STAR_TOOFEW;
    100       STAR_TOOFEW = 0;
    101       for (i = 0; i < NGRID; i++) {
    102         STAR_BAD = ID_OBJ_POOR;
    103         setMrel  (catalog, Ncatalog, flatcorr);
    104         STAR_BAD  = ID_OBJ_POOR | ID_OBJ_FEW;
    105         setMgrid (catalog, flatcorr);
    106       }
    107       STAR_BAD  = ID_OBJ_POOR | ID_OBJ_FEW;
    108       STAR_TOOFEW = star_toofew;
    109     }
    110 
    11196    /* determine fit values */
    11297    for (i = 0; i < NLOOP; i++) {
     
    119104      setMgrp  (catalog, flatcorr);
    120105
    121       setMgrid (catalog, flatcorr);
     106      setMgrid (catalog, Ncatalog);
    122107      MARKTIME("-- set Mrel, Mcal, Mmos, Mgrid : %f sec\n", dtime);
    123108   
    124109      if (PLOTSTUFF) {
    125110        plot_scatter (catalog, Ncatalog, flatcorr);
    126         plot_grid (catalog, flatcorr);
    127111        plot_mosaics ();
    128112        plot_images ();
     
    140124    if (PLOTSTUFF) {
    141125      plot_scatter (catalog, Ncatalog, flatcorr);
    142       plot_grid (catalog, flatcorr);
    143126      plot_mosaics ();
    144127      plot_images ();
     
    147130    }
    148131 
    149     if (USE_GRID) dump_grid ();
     132    // if (GRID_ZEROPT) dump_grid ();
    150133
    151134    MARKTIME("-- finalize Mcal values: %f sec\n", dtime);
     
    169152    freeMosaicBins (Ncatalog, TRUE);
    170153    freeTGroupBins (Ncatalog);
    171     freeGridBins (Ncatalog);
    172 
    173154    // end of if (NLOOP > 0) block : this loop determines the offsets per chip
    174155  } else {
     
    205186  freeImages (db.ftable.buffer);
    206187  freeMosaics ();
     188  freeGridBins ();
     189
    207190  gfits_db_free (&db);
    208191
Note: See TracChangeset for help on using the changeset viewer.