fjebaker / SpectralFitting.jl

✨🛰 Fast and flexible spectral fitting in Julia.
https://fjebaker.github.io/SpectralFitting.jl
GNU General Public License v3.0
9 stars 5 forks source link

Plot unfolded data and model #111

Closed phajy closed 5 months ago

phajy commented 5 months ago

This is a draft PR for plotting unfolded data and model (see #82). This draft will use the XSPEC method of calculation. It is a WIP and not ready to be merged. There are a couple of things I don't know how to do, and perhaps a bug I need to chase down.

phajy commented 5 months ago

This now produces unfolded E F_E plots that match those in XSPEC (produced using XSPEC's plot eeufs command). The key change that was required in the last commit was to divide by $\Delta x$ to get the fluxes in "per keV" units.

Here are two example plots. The first from XSPEC the second from SpectralFitting showing good agreement.

Screenshot 2024-06-15 at 21 26 44 Screenshot 2024-06-15 at 21 27 19
codecov-commenter commented 5 months ago

Codecov Report

Attention: Patch coverage is 0% with 45 lines in your changes missing coverage. Please review.

Project coverage is 63.22%. Comparing base (6ab9ac7) to head (7a19436). Report is 21 commits behind head on main.

Files Patch % Lines
src/plots-recipes.jl 0.00% 45 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #111 +/- ## ========================================== - Coverage 66.24% 63.22% -3.03% ========================================== Files 41 41 Lines 2216 2344 +128 ========================================== + Hits 1468 1482 +14 - Misses 748 862 +114 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

fjebaker commented 5 months ago

@phajy I've added two commits and marked ready for review, if that's okay?

fjebaker commented 5 months ago

See also #113

phajy commented 5 months ago

Thanks @fjebaker. This looks great and I am happy for you to merge is with the main branch.