IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 33373


Ignore:
Timestamp:
Feb 26, 2012, 12:32:46 PM (14 years ago)
Author:
eugene
Message:

working on clipping and flagging bad detectinos (making things more consistent, clear)

Location:
branches/eam_branches/ipp-20111122/Ohana/src/relphot/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/StarOps.c

    r33372 r33373  
    6868        int Nsec = GetPhotcodeNsec(thisCode);
    6969
    70         /* calculate the average value for a single star */
     70        /* calculate the average mag in this SEC photcode for a single star */
    7171
    7272        // skip bad stars
    7373        if (catalog[i].secfilt[Nsecfilt*j+Nsec].flags & STAR_BAD) continue;
     74
     75        N = 0;
    7476        m = catalog[i].averageT[j].measureOffset;
    75 
    76         N = 0;
    7777        for (k = 0; k < catalog[i].averageT[j].Nmeasure; k++, m++) {
    7878
     
    8282          if (code->equiv != thisCode) { continue; }
    8383
    84           // int ecode = GetPhotcodeEquivCodebyCode (catalog[i].measureT[m].photcode);
    85           // if (ecode != thisCode) { continue; }
    86 
    87           if (catalog[i].measureT[m].dbFlags & MEAS_BAD) {
    88             Nbad ++;
    89             continue;
    90           }
    91 
    92           // XXX allow REF stars (no Image Entry) to be included in the calculation this
    93           // should be optionally set, and should allow for REF stars to be downweighted by
    94           // more than their reported errors.  how such info is carried is unclear...
     84          if (catalog[i].measureT[m].dbFlags & MEAS_BAD) { Nbad ++; continue; }
     85
    9586          if (getImageEntry (m, i) < 0) {
    9687            Mcal = Mmos = Mgrid = 0;
    9788          } else {
    9889            Mcal  = getMcal  (m, i, flatcorr, catalog);
    99             if (isnan(Mcal)) {
    100               Ncal ++;
    101               continue;
    102             }
     90            if (isnan(Mcal)) { Ncal ++; continue; }
    10391            Mmos  = getMmos  (m, i);
    104             if (isnan(Mmos)) {
    105               Nmos ++;
    106               continue;
    107             }
     92            if (isnan(Mmos)) { Nmos ++; continue; }
    10893            Mgrid = getMgrid (m, i);
    109             if (isnan(Mgrid)) {
    110               Ngrid++;
    111               continue;
    112             }
     94            if (isnan(Mgrid)) { Ngrid++; continue; }
    11395          }
    11496
     
    184166  double *list, *dlist;
    185167  StatType stats;
    186   int Nsec, ecode;
     168  int Nsec;
    187169
    188170  int Nsecfilt = GetPhotcodeNsecfilt ();
     
    201183    for (j = 0; j < catalog[i].Naverage; j++) {
    202184
    203       /* skip stars already calibrated */
    204       if (catalog[i].found[j]) continue; 
    205 
    206185      int Ns;
    207186      for (Ns = 0; Ns < Nphotcodes; Ns++) {
     
    209188        int thisCode = photcodes[Ns][0].code;
    210189        Nsec = GetPhotcodeNsec(thisCode);
     190
     191        /* star/photcodes already calibrated */
     192        if (catalog[i].found[Nsecfilt*j+Nsec]) continue; 
    211193
    212194        N = 0;
     
    218200          if (!code) continue;
    219201          if (code->equiv != thisCode) { continue; }
    220 
    221           // ecode = GetPhotcodeEquivCodebyCode (catalog[i].measureT[m].photcode);
    222           // if (ecode != thisCode) { continue; }
    223202
    224203          if (catalog[i].measureT[m].dbFlags & MEAS_BAD) continue;
     
    249228          dlist[N] = MAX (hypot(catalog[i].measureT[m].dM, code->photomErrSys), MIN_ERROR);
    250229
    251           // up-weight the ubercal values (or convergence can take a long time...)
     230          // up-weight the ubercal values (or convergence can take a long time...) (XXX make this optional?)
    252231          if (catalog[i].measureT[m].dbFlags & ID_MEAS_PHOTOM_UBERCAL) {
    253232            dlist[N] = MAX (0.1*catalog[i].measureT[m].dM, MIN_ERROR);
     
    269248
    270249        liststats (list, dlist, N, &stats);
    271         if (mark) catalog[i].found[j] = TRUE;
     250        if (mark) catalog[i].found[Nsecfilt*j+Nsec] = TRUE;
    272251
    273252        /* use sigma or error in dM for output? */
     
    578557          if (ecode != thisCode) { continue; }
    579558
     559          // why am I skipping this??
    580560          /* if (catalog[i].measureT[m].dbFlags & MEAS_BAD) continue; */
    581561          Mcal  = getMcal  (m, i, flatcorr, catalog);
  • branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/setMrelFinal.c

    r33364 r33373  
    1010  int ecode;
    1111
     12  int Nsecfilt = GetPhotcodeNsecfilt ();
     13
    1214  /* if we reset the catalog, reset all the current measurements */
    1315  if (RESET) {
    14 
    15     int Nsecfilt = GetPhotcodeNsecfilt ();
    16 
     16    // flags used by the photometry analysis (excluding UBERCAL)
     17    unsigned int PHOTOM_FLAGS =
     18      ID_MEAS_NOCAL |       // detection ignored for this analysis (photcode, time range)
     19      ID_MEAS_POOR_PHOTOM | // detection is photometry outlier
     20      ID_MEAS_SKIP_PHOTOM | // detection was ignored for photometry measurement
     21      ID_MEAS_AREA;       // detetion was outside acceptable area of device
     22   
    1723    int Ns;
    1824    for (Ns = 0; Ns < Nphotcodes; Ns++) {
     
    3945          }
    4046       
    41           catalog[0].measure[m].Mcal = 0;
    42           catalog[0].measure[m].dbFlags &= 0xff00;
    43           catalog[0].measure[m].dbFlags &= ~ID_MEAS_POOR_PHOTOM;
    44           catalog[0].measure[m].dbFlags &= ~ID_MEAS_SKIP_PHOTOM;
    45           catalog[0].measure[m].dbFlags &= ~ID_MEAS_AREA;
    46           catalog[0].measure[m].dbFlags &= ~ID_MEAS_NOCAL;
     47          if (!KEEP_UBERCAL) {
     48            catalog[0].measure[m].Mcal = 0;
     49            catalog[0].measure[m].dbFlags &= ~ID_MEAS_PHOTOM_UBERCAL;
     50          }
     51          catalog[0].measure[m].dbFlags &= ~PHOTOM_FLAGS;
    4752        }
    4853      }
     
    5459
    5560  /* set catalog[0].found[i] = FALSE */
    56   ALLOCATE (catalog[0].found, off_t, MAX (1, catalog[0].Naverage));
    57   for (i = 0; i < catalog[0].Naverage; i++) {
     61  ALLOCATE (catalog[0].found, off_t, MAX (1, Nsecfilt*catalog[0].Naverage));
     62  for (i = 0; i < Nsecfilt*catalog[0].Naverage; i++) {
    5863    catalog[0].found[i] = FALSE;
    5964  }
     
    8691
    8792/* ID_MEAS_SKIP marks measurements which were not used to calculate Mrel */
     93// For each star & photcode, we are selecting the measurements to use in the average
     94// photometry value.  This function is called several times, lowering the bar to
     95// acceptance on each pass. The rejections at the different passes are:
     96
     97// 0 : only use measurements thought to be not extended and dM < SIGMA_LIM (REMOVED)
     98// 1 : use extended and low-sig detections (REMOVED)
     99// 3 : accept the measurements marked as outliers; accept images marked as outliers
     100// 4 : accept the measurements outside of the instrumental magnitude limits (eg, SAT)
     101
     102// XXX if I'm reading this correctly, passes 0, 1, 2 are identical & accept all
     103// non-outliers with Imag range
     104
    88105void skip_measurements (Catalog *catalog, int pass, FlatCorrectionTable *flatcorr) {
    89106
     
    104121  for (i = 0; i < catalog[0].Naverage; i++) {
    105122    Ntot += catalog[0].average[i].Nmeasure;
     123
     124    // this function does not check secfilt entries separately, but there is no harm in
     125    // twiddling the so skip a star here only we can only
     126    // have we gotten
     127
    106128    if (catalog[0].found[i]) continue;
     129  XXX : this should be done by secfilt.  think about this...
    107130
    108131    m = catalog[0].average[i].measureOffset;
Note: See TracChangeset for help on using the changeset viewer.