IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 27, 2019, 8:42:23 AM (7 years ago)
Author:
eugene
Message:

coding trace analysis to handle bad edge cases; add red & blu sides for trace spline; adding variance to flat-field

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ohana.20190329/src/opihi/mana/deimos_fitprofile.c

    r40754 r40755  
    7878 
    7979  float Sky_V = 0.0, BckL_V = 0.0, BckR_V = 0.0;
    80   int Sky_N = 0, BckL_N = 0, BckR_N = 0;
     80  float Sky_N = 0.0, BckL_N = 0.0, BckR_N = 0.0;
    8181  for (int i = 0; i < xprofile->Nelements; i++) {
     82    if (!isfinite(wprofile->elements.Flt[i])) continue;
     83    if (!isfinite(fprofile->elements.Flt[i])) continue;
     84    float wt = 1 / SQ(wprofile->elements.Flt[i]);
    8285    if (xprofile->elements.Flt[i] < Xs) {
    83       BckL_V += fprofile->elements.Flt[i];
    84       BckL_N ++;
     86      BckL_V += fprofile->elements.Flt[i]*wt;
     87      BckL_N += wt;
    8588      continue;
    8689    }
    8790    if (xprofile->elements.Flt[i] > Xe) {
    88       BckR_V += fprofile->elements.Flt[i];
    89       BckR_N ++;
     91      BckR_V += fprofile->elements.Flt[i]*wt;
     92      BckR_N += wt;
    9093      continue;
    9194    }
    92     Sky_V += fprofile->elements.Flt[i];
    93     Sky_N ++;
     95    Sky_V += fprofile->elements.Flt[i]*wt;
     96    Sky_N += wt;
    9497  }
    9598  float Sky = Sky_V / Sky_N;
     
    211214  int Npts = 0;
    212215  for (int i = 0; i < NptsAll; i++) {
     216    if (!isfinite(wprofile[i])) continue;
     217    if (!isfinite(fprofile[i])) continue;
    213218    int keep = (mode == MODE_UPPER) ^ (xprofile[i] < limit);
    214219    if (keep) {
Note: See TracChangeset for help on using the changeset viewer.