LSSTDESC / Spectractor

Spectractor aims at measuring the atmospheric transmission from slitless spectrophotometry images.
https://spectractor.readthedocs.io/en/latest/index.html
BSD 3-Clause "New" or "Revised" License
15 stars 8 forks source link

Auxtel fit pt #100

Closed sylvielsstfr closed 1 year ago

sylvielsstfr commented 2 years ago

I have corrected two problems

return arr.reshape(shape).sum(-1).sum(1) instead of return arr.reshape(shape).mean(-1).mean(1)

I have checked the final spectrum for CCD_REBIN = 2 was at the same flux level as for CCD_REBIN =1

When making the sub_image_subtracted little image sub_image_subtracted = sub_image - bkgd_2D(X, Y)

we must suppress negative values like this:

SDC : very important clipping negative signal, avoiding crash later sub_image_subtracted = np.where(sub_image_subtracted<0,0,sub_image_subtracted)

Because later these values are considered as weights (to find the target center).

Since that correction, I haven't anymore crashes.

Other things added, : few control plots in debug mode and make nicer plots by changing some sizes.

coveralls commented 2 years ago

Pull Request Test Coverage Report for Build 3614637224


Changes Missing Coverage Covered Lines Changed/Added Lines %
spectractor/fit/fit_spectrum.py 26 27 96.3%
spectractor/simulation/image_simulation.py 5 6 83.33%
spectractor/tools.py 12 15 80.0%
spectractor/simulation/simulator.py 42 46 91.3%
spectractor/extractor/chromaticpsf.py 39 45 86.67%
spectractor/extractor/images.py 16 24 66.67%
spectractor/fit/fit_multispectra.py 29 38 76.32%
spectractor/extractor/spectrum.py 117 127 92.13%
spectractor/fit/fitter.py 54 65 83.08%
spectractor/simulation/libradtran.py 48 60 80.0%
<!-- Total: 677 755 89.67% -->
Files with Coverage Reduction New Missed Lines %
spectractor/tools.py 1 90.06%
spectractor/fit/fit_multispectra.py 2 71.51%
spectractor/extractor/spectrum.py 3 92.48%
spectractor/extractor/extractor.py 3 89.39%
spectractor/extractor/chromaticpsf.py 7 91.45%
<!-- Total: 16 -->
Totals Coverage Status
Change from base Build 3463953628: 9.9%
Covered Lines: 7047
Relevant Lines: 7818

💛 - Coveralls
jeremyneveu commented 1 year ago

Major improvements for Spectractor new version 2.3