StingraySoftware / stingray

Anything can happen in the next half hour (including spectral timing made easy)!
https://stingray.science/stingray
MIT License
175 stars 144 forks source link

Fits event lists #834

Closed matteobachetti closed 1 month ago

matteobachetti commented 3 months ago

Introduces a new FITS reader class, that lazy loads the data until a slice is required (in which case, the wanted StingrayTimeseries object is created).

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 92.62821% with 23 lines in your changes missing coverage. Please review.

Project coverage is 79.52%. Comparing base (aee67bb) to head (0f4a16b). Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
stingray/io.py 91.24% 19 Missing :warning:
stingray/events.py 55.55% 4 Missing :warning:

:exclamation: There is a different number of reports uploaded between BASE (aee67bb) and HEAD (0f4a16b). Click for more details.

HEAD has 13 uploads less than BASE | Flag | BASE (aee67bb) | HEAD (0f4a16b) | |------|------|------| ||16|3|
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #834 +/- ## =========================================== - Coverage 96.11% 79.52% -16.59% =========================================== Files 48 48 Lines 9371 9667 +296 =========================================== - Hits 9007 7688 -1319 - Misses 364 1979 +1615 ```

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

matteobachetti commented 1 month ago

@matteolucchini1 thanks for the review! I will work on the API docs, I do realize now that I could have done much better 😅 . I'm just not sure about notebooks or user-facing documentation: this is a function that is more for internal use in the library, something to speed up the loading of small parts of big files. This will be used by user facing classes (something like LazyLoadedEventLists, gotta find a better name but that's what they will be), but probably not directly from users.

matteolucchini1 commented 1 month ago

@matteobachetti Ah fair enough. I do still think it would be nice to show different ways of loading event files (e.g. here's what happens when you load an heasoft-compatible file, or a generic fits file like in this PR, or whatever other source is supported), but maybe a bunch of that is beyond the scope of the PR. I'll try to dig into the code between today and early next week!

matteobachetti commented 1 month ago

@matteolucchini1 I wrote a small motivation tutorial here: https://github.com/StingraySoftware/notebooks/pull/107

matteolucchini1 commented 1 month ago

I really like that tutorial! I left a couple more minor comments otherwise it's getting close :)