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/setMrelFinal.c

    r41608 r41620  
    1111  int Nsecfilt = GetPhotcodeNsecfilt ();
    1212
    13   /*** RESET photometry flags and Mcal values ***/
    14   if (RESET) {
    15     // flags used by the photometry analysis (excluding UBERCAL)
    16     unsigned int PHOTOM_FLAGS =
    17       ID_MEAS_NOCAL |          // detection ignored for this analysis (photcode, time range)
    18       ID_MEAS_POOR_PHOTOM |    // detection is photometry outlier
    19       ID_MEAS_SKIP_PHOTOM |    // detection was ignored for photometry measurement
    20       ID_MEAS_AREA |           // detetion was outside acceptable area of device
    21       ID_MEAS_SYNTH_MAG |      // magnitude is synthetic
    22       ID_MEAS_STACK_PRIMARY |  // this stack measurement is in the primary skycell
    23       ID_MEAS_STACK_PHOT_SRC;  // this measurement supplied the stack photometry
    24 
    25     // ID_MEAS_PHOTOM_UBERCAL -- externally-supplied zero point from ubercal analysis
    26     // this is set by 'setphot', do not reset here
    27 
    28     // flags used by the photometry analysis (excluding UBERCAL)
    29     // unsigned int secfiltFlags =
    30     //   ID_PHOTOM_PASS_0 | // average measured at pass 0
    31     //   ID_PHOTOM_PASS_1 | // average measured at pass 1
    32     //   ID_PHOTOM_PASS_2 | // average measured at pass 2
    33     //   ID_PHOTOM_PASS_3 | // average measured at pass 3
    34     //   ID_PHOTOM_PASS_4 | // average measured at pass 3
    35     //   ID_SECF_USE_SYNTH | // average measured at pass 3
    36     //   ID_SECF_USE_UBERCAL | // average measured at pass 3
    37     //   ID_SECF_OBJ_EXT; // average measured at pass 3
    38    
    39     // XXX I should really deprecate the concept of applying the average
    40     // calculation to a limited set of photcodes. 
    41     // for now, just do all photcodes here (
    42     // as it stands, only stacks are limited by photcode; mean exp and forced warp
    43     // are applied to all Nsecfilt
    44 
    45     for (i = 0; i < catalog[0].Naverage; i++) {
    46       int Ns;
    47       for (Ns = 0; Ns < Nsecfilt; Ns++) {
    48        
    49         off_t N = Nsecfilt*i+Ns;
    50         dvo_secfilt_init (&catalog[0].secfilt[N], SECFILT_RESET_ALL);
    51 
    52         off_t m = catalog[0].average[i].measureOffset;
    53         off_t j;
    54         for (j = 0; j < catalog[0].average[i].Nmeasure; j++, m++) {
    55        
    56           /* select measurements by time */
    57           if (TimeSelect) {
    58             if (catalog[0].measure[m].t < TSTART) continue;
    59             if (catalog[0].measure[m].t > TSTOP) continue;
    60           }
    61        
    62           // only reset Mcal for measures with a matching image
    63           // do not reset Mcal for ubercal images unless explicitly requested
    64 
    65           if (catalog[0].measure[m].dbFlags & ID_MEAS_PHOTOM_UBERCAL) {
    66             if (!KEEP_UBERCAL) {
    67               catalog[0].measure[m].McalPSF  = 0.0;
    68               catalog[0].measure[m].McalAPER = 0.0;
    69               catalog[0].measure[m].dbFlags &= ~ID_MEAS_PHOTOM_UBERCAL;
    70             }
    71           } else {
    72             if (RESET_ZEROPTS && (getImageEntry (m, 0) >= 0)) {
    73               catalog[0].measure[m].McalPSF  = 0.0;
    74               catalog[0].measure[m].McalAPER = 0.0;
    75             }
    76           }
    77           catalog[0].measure[m].dbFlags &= ~PHOTOM_FLAGS;
    78         }
    79       }
    80     }
    81   }
    82 
     13  ResetAverageAndMeasure (catalog);
     14 
    8315  // this sets flags in the measureT element, not the measure element
    8416  setExclusions (catalog, 1, VERBOSE);  /* mark by area */
Note: See TracChangeset for help on using the changeset viewer.