IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 27, 2021, 11:41:52 AM (5 years ago)
Author:
eugene
Message:

consolidate reset operations for clarity

File:
1 edited

Legend:

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

    r41606 r41620  
    1010int relphot_objects (SkyList *skylist, int hostID, char *hostpath) {
    1111
    12   off_t i, j, k;
    13   int Nsecfilt;
     12  off_t i;
    1413  struct stat filestat;
    1514
     
    8584
    8685    // reset the calculated average magnitudes (does not affect ubercal-tied measurements or images)
    87     if (RESET) {
    88       Nsecfilt = catalog.Nsecfilt;
    89 
    90       DVOAverageFlags photomBits =
    91         ID_OBJ_EXT             | // extended in our data (eg, PS)
    92         ID_OBJ_EXT_ALT         | // extended in external data (eg, 2MASS)
    93         ID_OBJ_GOOD            | // good-quality measurement in our data (eg,PS)
    94         ID_OBJ_GOOD_ALT        | // good-quality measurement in  external data (eg, 2MASS)
    95         ID_OBJ_GOOD_STACK      | // good-quality object in the stack (> 1 good stack)
    96         ID_OBJ_BEST_STACK      | // the primary stack measurement are the best measurements
    97         ID_OBJ_SUSPECT_STACK   | // suspect object in the stack (> 1 good or suspect stack, < 2 good)
    98         ID_OBJ_BAD_STACK;        // good-quality object in the stack (> 1 good stack)
    99      
    100       for (j = 0; j < catalog.Naverage; j++) {
    101         catalog.average[j].flags    &= ~photomBits; // reset all except astrometry bits
    102         catalog.average[j].psfQF     = NAN;     // reset (will be re-calculated here)
    103         catalog.average[j].psfQFperf = NAN;     // reset (will be re-calculated here)
    104         catalog.average[j].stargal   = NAN;     // reset (will be re-calculated here)
    105         catalog.average[j].photFlagsUpper = 0;  // reset (will be re-calculated here)
    106         catalog.average[j].photFlagsLower = 0;  // reset (will be re-calculated here)
    107         catalog.average[j].NwarpOK        = 0;  // reset (will be re-calculated here)
    108         for (k = 0; k < Nsecfilt; k++) {
    109           dvo_secfilt_init (&catalog.secfilt[j*Nsecfilt + k], SECFILT_RESET_ALL);
    110         }
    111       }
    112     }
     86    ResetAverageObjects(&catalog);
    11387
    11488    populate_tiny_values(&catalog, DVO_TV_MEASURE | DVO_TV_AVERAGE);
     
    11993    // XXX reload_catalogs.c calls initTGroupBins here
    12094
    121     initGridBins   (&catalog, 1);
     95    initGridBins   ();
    12296
    12397    findImages (&catalog, 1, FALSE);
     
    235209    if (RESET)             { strextend (&command, "-reset"); }
    236210    if (RESET_ZEROPTS)     { strextend (&command, "-reset-zpts"); }
     211    if (RESET_FLATCORR)    { strextend (&command, "-reset-flat"); }
     212    if (!KEEP_UBERCAL)     { strextend (&command, "-reset-ubercal"); }
    237213    if (PRESERVE_PS1)      { strextend (&command, "-preserve-ps1"); }
    238214    if (IS_DIFF_DB)        { strextend (&command, "-is-diff-db"); }
    239215    if (UPDATE)            { strextend (&command, "-update"); }
    240     if (!KEEP_UBERCAL)     { strextend (&command, "-reset-ubercal"); }
    241216    if (UPDATE_CATFORMAT)  { strextend (&command, "-update-catformat %s", UPDATE_CATFORMAT); }
    242217    if (BOUNDARY_TREE)     { strextend (&command, "-boundary-tree %s", BOUNDARY_TREE); }
    243218    if (SYNTH_ZERO_POINTS) { strextend (&command, "-synthphot-zpts %s", SYNTH_ZERO_POINTS); }
     219    // if (GRID_ZEROPT)       { strextend (&command, "-grid %s", GRID_MEANFILE); }
    244220    if (USE_BASIC_CHECK)   { strextend (&command, "-basic-image-search"); }
    245221    if (USE_ALL_IMAGES)    { strextend (&command, "-use-all-images"); }
     
    251227
    252228    // if (SET_MREL_VERSION != 1) { strextend (&command, "-set-mrel-version %d", SET_MREL_VERSION); }
     229
     230    // missing AreaSelect & TimeSelect
    253231
    254232    fprintf (stderr, "command: %s\n", command);
Note: See TracChangeset for help on using the changeset viewer.