sunkit-spex icon indicating copy to clipboard operation
sunkit-spex copied to clipboard

STIX spectrogram loader

Open natsat0919 opened this issue 1 year ago • 4 comments

Code for STIX spectrogram data loading (addressing issue https://github.com/sunpy/sunkit-spex/issues/104 .). Currently this loader only supports processed STIX spectrogram files outputted by the stx_convert_spectrogram IDL function. A lot of the loader functions in StixLoader inherit from the old RhessiLoader class that was previously in the instruments.py file. I have added this loader to the legacy fitting folder instead of the extern folder as there will likely be changes to the instrument loaders in general. Once we decide on the format of the loader, we can move it to extern.

Changes implemented: Updated the STIX file loading functions Added StixLoader (supports spectrogram data loading, choosing event and background times for spectral fitting, lightcurve and spectrogram plotting)

natsat0919 avatar Jul 18 '24 22:07 natsat0919

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Please upload report for BASE (main@c340a00). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #160   +/-   ##
=======================================
  Coverage        ?   61.90%           
=======================================
  Files           ?       32           
  Lines           ?     3520           
  Branches        ?        0           
=======================================
  Hits            ?     2179           
  Misses          ?     1341           
  Partials        ?        0           

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

codecov-commenter avatar Jul 18 '24 22:07 codecov-commenter

I think this looks good! Would it be worth while to move the code to the extern module, like where the RHESSI code is now?

KriSun95 avatar Aug 08 '24 04:08 KriSun95

I think this looks good! Would it be worth while to move the code to the extern module, like where the RHESSI code is now?

Yeah sure, I will move it there. I just thought that if we plan on doing some refactoring, then it would be better to have it in the legacy folder.

natsat0919 avatar Aug 08 '24 15:08 natsat0919

@KriSun95 The STIX loader is now moved to extern!

natsat0919 avatar Aug 10 '24 01:08 natsat0919

@samaloney thanks for the code review. I updated the code based on your comments. It should be ready to bed merged

natsat0919 avatar Oct 05 '24 16:10 natsat0919

I had to update the srm placeholder for the STIX loader, as custom placeholder names don't allow loading in of multiple files at the same time (since only pha_file, arf_file ... srm_file in the LoadSpec are actually allowed to be lists). Therefore, it was not possible to simultaneously load 2 STIX spectra at the same time for fitting

natsat0919 avatar Oct 08 '24 14:10 natsat0919