IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 24, 2016, 5:07:24 PM (10 years ago)
Author:
eugene
Message:

modify irls fitting to apply the multiply the modified weight by the error-based weight

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/cmd.astro/fitplx.c

    r39234 r39610  
    597597  dsort (values, Npts);
    598598
    599   if (Npts % 2) {
    600     int Ncenter = Npts / 2;
    601     *median = values[Ncenter];
    602   } else {
    603     int Ncenter = Npts / 2 - 1;
    604     *median = 0.5*(values[Ncenter] + values[Ncenter + 1]);
    605   }
    606 
    607   double Slo = VectorFractionInterpolate (values, 0.158655, Npts);
    608   double Shi = VectorFractionInterpolate (values, 0.841345, Npts);
    609 
    610   *sigma = (Shi - Slo) / 2.0;
    611 
     599  if (median) {
     600    if (Npts % 2) {
     601      int Ncenter = Npts / 2;
     602      *median = values[Ncenter];
     603    } else {
     604      int Ncenter = Npts / 2 - 1;
     605      *median = 0.5*(values[Ncenter] + values[Ncenter + 1]);
     606    }
     607  }
     608   
     609  if (sigma) {
     610    double Slo = VectorFractionInterpolate (values, 0.158655, Npts);
     611    double Shi = VectorFractionInterpolate (values, 0.841345, Npts);
     612    *sigma = (Shi - Slo) / 2.0;
     613  }
     614 
    612615  return TRUE;
    613616}
Note: See TracChangeset for help on using the changeset viewer.