Skip to content

Commit

Permalink
fix low prob. failure issue in rmschi2 computation
Browse files Browse the repository at this point in the history
  • Loading branch information
julienguy committed Mar 12, 2016
1 parent ece7f74 commit 34895b7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/library/specex_psf_fitter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1381,10 +1381,12 @@ bool specex::PSF_Fitter::FitSeveralSpots(vector<specex::Spot_p>& spots, double *
}
}
}
if(As.size1()>1) {
/*
if(As.size1()>1) {
specex::write_new_fits_image("A.fits",As);
SPECEX_WARNING("wrote A.fits");
}
*/
if(fatal) {
SPECEX_ERROR("cholesky_solve failed with status " << status);
} else {
Expand Down Expand Up @@ -2011,7 +2013,9 @@ void specex::PSF_Fitter::compare_spots_chi2_and_mask(std::vector<specex::Spot_p>
}
if(s<2) continue;
double mchi2=sc/s;
double rmschi2=sqrt(sc2/s-mchi2*mchi2);
double var=sc2/s-mchi2*mchi2;
if(var<=0) continue;
double rmschi2=sqrt(var);
if(spot->chi2 > (mchi2 + nsig*rmschi2)) {
SPECEX_WARNING("masking spot " << i << " at x=" << spot->xc << " y=" << spot->yc << " with large chi2 = " << spot->chi2 << ">" << mchi2 << "+" << nsig << "*" << rmschi2 << "=" << (mchi2 + nsig*rmschi2));
spot->flux=0;
Expand Down

0 comments on commit 34895b7

Please sign in to comment.