-
Notifications
You must be signed in to change notification settings - Fork 13
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
New Feature: ASDF Cutout Functionality #105
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, Jenny! This looks like it's in good shape for us to pick-up!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me as well.
Shall we mark this PR as ready to try and get this merged in? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making these changes. It's great to see ASDF support!
I left a few comments mainly related to using with
to help closing opened files. Please feel free to reach out with any asdf questions.
Are there plans to add asdf file support to the test suite? If so feel free to ping me on the PR and I can start looking at adding astrocut tests to the asdf downstream CI (to make sure that changes in asdf do not negatively impact astrocut).
Please feel free to reach out with any asdf questions.
Co-authored-by: Brett Graham <[email protected]>
Co-authored-by: Brett Graham <[email protected]>
Co-authored-by: Brett Graham <[email protected]>
@braingram I resolved your comments. I think we have eventual plans to add asdf support to the test suite. I'm not sure if those tests should be added now for this code, or if we should wait, since we are planning to fold these changes into the core astrocut code through some refactor and generalization. But if people want them in now, I can try to add some. |
@braingram so the minimum python that astrocut supports is 3.8. It looks like |
I think we should drop python 3.8. Newer releases of astropy also dropped support of 3.8. |
I think it would be good to add tests here, where we add the functionality. |
Should that be a separate PR? Is there more to it than bumping the version and removing 3.8 from the CI workflow? Do we need to coordinate that bump with other related software that use |
I'll try to provide some context here but I'm not sure I can recommend a solution. Both Perhaps |
I'm fine with it either way. Since it'll be required to go in before this can pass CI, it could be in this or a separate PR that goes in first. If you like I could work on it, but no promises I can get it done quickly.
Bumping the version throughout the project, making sure the pypi classifiers are correct. i think it's relatively trivial. We should start testing on 3.12 soon. that could also be done at the same time.
The only thing I can think of are tesscut. lightkurve calls tesscut over HTTP, so it's not impacted. tesscut is on 3.11 now, so it's not a big deal to drop 3.8. Github doesn't recognize any dependents here: https://github.com/spacetelescope/astrocut/network/dependents anything still on 3.8 can also just install an older version of astrocut. we'll probably not push to pypi immediately, either. or are you thinking of cutting a release soon? |
Regarding adding tests, I just want to remind everyone we do not want to release any test Roman data that can be publicly accessed, since there is no official Roman Level 2 test datasets released at MAST yet. Ideally any test would use a purely synthetic asdf file, or can retrieve the file it needs to operate on from a protected source. Or the test itself doesn't go public yet. |
I like the idea of making
Saw the 3.8 PR and approved. I don't think we are planning on releasing soon.
Yeah I would opt for creating a completely fake dataset for the test suite. We can easily update it as the datamodel changes. Then once roman data are available and maybe even public, then we add tests with real data. |
For test data I opened an issue with roman_datamodels to expose something to the public api. There are several 'maker_utils' for generating test data. Here's an example use in jdaviz: |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #105 +/- ##
==========================================
+ Coverage 94.53% 94.56% +0.02%
==========================================
Files 8 9 +1
Lines 1446 1472 +26
==========================================
+ Hits 1367 1392 +25
- Misses 79 80 +1 ☔ View full report in Codecov by Sentry. |
@falkben @braingram For now I've added some tests with fake data to make sure the basic functionality is there. Let me know if this seems reasonable to y'all. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks very much for adding the tests, they look good. just a few minor questions about how we are handling the file/file handle.
@havok2063 Thanks for making these improvements. Overall it looks good to me. Hopefully spacetelescope/roman_datamodels#299 will see some traction and there were be an easier way to make a test image (with wcs) in the future. |
@falkben I've consolidated the file IO into the main function, and added a small header keyword check. Included some extra cleanup, type annotations and docstrings, etc. |
Background
The Roman Space Telescope will have its data stored in a new file format called ASDF. In order to continue supporting our userbase and enabling productive science, the
astrocut
tool needs to be expanded to allow for the creation of cutouts of Roman mission products.Changes
astrocut
with a proof-of-concept script (asdf_cutouts.py
)asdf_cutouts.py
enough such that it can "merged" into thecutouts.py
scriptPreview