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

    r41603 r41620  
    3535  ALLOCATE (Nvalid, int, Nsecfilt);
    3636
    37   // flags used by the photometry analysis (excluding UBERCAL)
    38   unsigned int PHOTOM_FLAGS =
    39     ID_MEAS_NOCAL          | // detection ignored for this analysis (photcode, time range)
    40     ID_MEAS_POOR_PHOTOM    | // detection is photometry outlier
    41     ID_MEAS_SKIP_PHOTOM    | // detection was ignored for photometry measurement
    42     ID_MEAS_AREA           | // detetion was outside acceptable area of device
    43     ID_MEAS_SYNTH_MAG      | // magnitude is synthetic
    44     ID_MEAS_STACK_PRIMARY  | // this stack measurement is in the primary skycell
    45     ID_MEAS_STACK_PHOT_SRC | // this measurement supplied the stack photometry
    46     ID_MEAS_PHOTOM_PSF     | // this measurement is used for the mean psf mag
    47     ID_MEAS_PHOTOM_APER    | // this measurement is used for the mean ap mag
    48     ID_MEAS_PHOTOM_KRON    ; // this measurement is used for the mean kron mag
    49    
    5037  /* exclude stars not in range or with too few measurements */
    5138  for (i = 0; i < catalog[0].Naverage; i++) {
     
    6148    }
    6249
    63     // reset the calculated average magnitudes (does not affect ubercal-tied measurements or images)
    64     if (RESET) {
    65       int Ns;
    66 
    67       for (Ns = 0; Ns < Nphotcodes; Ns++) {
    68 
    69         int thisCode = photcodes[Ns][0].code;
    70         int Nsec = GetPhotcodeNsec(thisCode);
    71 
    72         dvo_secfilt_init (&subcatalog[0].secfilt[Nsecfilt*Naverage+Nsec], SECFILT_RESET_ALL);
    73       }
    74     }
     50    // reset the calculated average magnitudes for active photcode only
     51    ResetAverageActivePhotcodes (&subcatalog[0].secfilt[Nsecfilt*Naverage]);
    7552
    7653    Nm = 0;
     
    11188      if (isnan(catalog[0].measure[offset].Mkron)) { Nnan ++; continue; }
    11289
    113       // require 0x01 in photFlags (fitted with a PSF)
     90      // require 0x01 in photFlags (fitted with a PSF) -- add to the test data
    11491// XXX EAM : test is inconsistent -- fix      if ((catalog[0].measure[offset].photFlags & 0x01) == 0) { Nbad ++; continue; }
    11592
     
    156133      subcatalog[0].measureT[Nmeasure].dbFlags &= ~ID_MEAS_SKIP_PHOTOM;
    157134      subcatalog[0].measureT[Nmeasure].averef = Naverage;
    158       if (RESET) {
    159         // only reset Mcal for measures with a matching image
    160         // do not reset Mcal for ubercal images unless explicitly requested
    161         if (subcatalog[0].measureT[Nmeasure].dbFlags & ID_MEAS_PHOTOM_UBERCAL) {
    162           if (!KEEP_UBERCAL) {
    163             subcatalog[0].measureT[Nmeasure].McalPSF  = 0.0;
    164             subcatalog[0].measureT[Nmeasure].McalAPER = 0.0;
    165             subcatalog[0].measureT[Nmeasure].dbFlags &= ~ID_MEAS_PHOTOM_UBERCAL;
    166           }
    167         } else {
    168           if (getImageEntry (Nmeasure, Ncat) >= 0) {
    169             subcatalog[0].measureT[Nmeasure].McalPSF  = 0.0;
    170             subcatalog[0].measureT[Nmeasure].McalAPER = 0.0;
    171           }
    172         }
    173         subcatalog[0].measureT[Nmeasure].dbFlags &= ~PHOTOM_FLAGS;
    174       }
     135      ResetMeasureZeroPoints (&subcatalog[0].measureT[Nmeasure], Nmeasure, Ncat);
     136
    175137      Nmeasure ++;
    176138      Nm ++;
Note: See TracChangeset for help on using the changeset viewer.