Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fitting #68

Merged
merged 12 commits into from
Apr 28, 2022
Merged

Fitting #68

merged 12 commits into from
Apr 28, 2022

Conversation

samaloney
Copy link
Collaborator

PR Description

Not sure what happened #56 but this is the same code but rebased and dropping some commit which are now in dedicated PR

@codecov-commenter
Copy link

codecov-commenter commented Apr 27, 2022

Codecov Report

Merging #68 (995084c) into master (c357470) will decrease coverage by 62.08%.
The diff coverage is 19.49%.

@@             Coverage Diff             @@
##           master      #68       +/-   ##
===========================================
- Coverage   93.48%   31.39%   -62.09%     
===========================================
  Files           5       17       +12     
  Lines         629     3086     +2457     
===========================================
+ Hits          588      969      +381     
- Misses         41     2117     +2076     
Impacted Files Coverage Δ
sunxspex/constants.py 88.88% <ø> (ø)
sunxspex/sunxspex_fitting/fitter.py 13.26% <ø> (ø)
sunxspex/sunxspex_fitting/rainbow_text.py 11.76% <11.76%> (ø)
sunxspex/sunxspex_fitting/data_loader.py 12.73% <12.73%> (ø)
sunxspex/sunxspex_fitting/rhes_spec_code.py 14.54% <14.54%> (ø)
sunxspex/sunxspex_fitting/instruments.py 18.24% <18.24%> (ø)
sunxspex/sunxspex_fitting/parameter_handler.py 19.29% <19.29%> (ø)
sunxspex/sunxspex_fitting/nu_spec_code.py 21.87% <21.87%> (ø)
sunxspex/sunxspex_fitting/stix_spec_code.py 23.80% <23.80%> (ø)
...spex/sunxspex_fitting/photon_models_for_fitting.py 24.32% <24.32%> (ø)
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c357470...995084c. Read the comment docs.

@DanRyanIrish
Copy link
Member

Let's get this merged and then start opening issues and PRs to further develop the code.

KriSun95 and others added 11 commits April 28, 2022 10:37
Added examples of spectral fitting in the top level directory
…just their source code. Made check for this and writing user help info

Found that user models and sub-models mostly need to be self contained. Added warnings and info for user to make them aware.

removed needless distinction between user submodels and models. Now all user defined models are to be of the form f(...,energies=None)

Added del_photon_model so that user added models can be removed and added patch for corner plot titles. Setting confidence_range after mcmc run now updates the param and mcmc table too.

Separated nustar specific code into own class. Now (I think) very easy to include different instruments with their own class or provide users own data if they just have the relevant arrays. Code still needs tidying and more docs but this is a big step.

tidied up files slightly and can now append mcmc runs instead of overwriting

minor changes
…el functions protect globals now, renew_model method has been added to fitting code to allow complicated models to be re-added once loaded back in to a different session without overwriting the parameter table etc.

Added docstrings

More tidying up and correcting docstrings

More, corrected docs
…ues an error would occur. Updated documentation and reduced some methods complexity

Added docs and tidied

fixed typo

finished docs for now. plotting code needs some more work but at least docstrings will make it clearer to use and change in the future

fixed bug

added priority input to calc_hess method if fractional input doesnt work
… fitting

Updated bugs, rhessi loader class now in and working somewhat, still need to test properly and improve

rhessi loader up and running in the code. options to fit like ospex etc so quite a lot done

sorted out docs and locations of some methods

Fixed bugs, can rebin rhessi data now all seems peaceful

Added rhessi example and custom data example. fixed bugs
…t have that yet though

plot method works now without a defined model, allows user to see spectrum or spectra before fitting. Minor rebinning weirdness with left over bins

fixed rebinning bug when plotting one spectrum, and now the errors on the bins that dont get combined are not plotted which is the same as the actual values

added docs for the spectrogram
…ill now be plotted, fixed some docs, got STIX data loading in well

fixed mcmc plotting bug

pass bin widths through to counts_model instead of waorking them out everytime

fixed energy y-axis in spectrogram
…import errors for some reason, I think it is fixed now
Co-authored-by: DanRyanIrish <ryand5@tcd.ie>
Co-authored-by: DanRyanIrish <ryand5@tcd.ie>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants