-
Notifications
You must be signed in to change notification settings - Fork 14
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
Fix various issues related to ImageCollection and Standardizers. #674
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DinoBektesevic
force-pushed
the
standardizers/pack_unpack_ic
branch
from
July 30, 2024 03:46
cce94e6
to
836cb7f
Compare
the metadata stuff looks good to me! |
I've punted adding of the metadata header unit into a different PR so this one doesn't get too long. I've un-done the example addition of the metadata in work-unit here for now. |
Standardizers: - sync KBMODV1 and ButlerStandardizer; they're not exact, but better. - rename mjd to mjd_mid, fix tests - extract obs lon, lat and elevation in Butler std - make Multi and Single Ext standardizers not directly instantiable. ImageCollection - implement packing and unpacking of shared columns, sadly it's not as big of a space-saving as one would really want. - implement to and from BinTableHDU cast for ImageCollection - add it to workunit as a metadata header unit Flesh out a lot more tests for ImageCollection and Standardizers: - more explicit teting of more expected values - more explicit testing of lazy loading and indexing mechanism in IC
…Error in Python 3.10
DinoBektesevic
force-pushed
the
standardizers/pack_unpack_ic
branch
from
July 31, 2024 20:01
9aa2d4f
to
faa6eea
Compare
DinoBektesevic
force-pushed
the
standardizers/pack_unpack_ic
branch
from
July 31, 2024 20:23
faa6eea
to
5504ea3
Compare
DinoBektesevic
force-pushed
the
standardizers/pack_unpack_ic
branch
from
August 1, 2024 20:46
be246aa
to
c952ad5
Compare
jeremykubica
approved these changes
Aug 5, 2024
Spelling fix. Co-authored-by: Jeremy Kubica <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #665
Resolves #673
Resolves #672
I would also like to close #303.
I tried resolving #410 and resolving #589 but I couldn't really make my way around the work unit code tbh. There's a lot of nesting and some of the duplicated code makes it kind of fuzzy to understand what is the currently used codepath.
The
WorkUnit
also seems to be broken. It doesn't require a configuration to be given, but it throws an unclear error (None does not have keys
) when writing and reading to/from fits without providing one. Not sure if config is intended to be optional (then we need a better error) or we should just make it a required parameter to a work unit?I added an example of how we can package a flattened image collection into a header unit in the
to/from_fits
methods, but I'd love some direction from @maxwest-uw or @jeremykubica as to what you would like to see happen here? I think the metadata is serializable into a YAML or dict. WorkUnits have a lot of serialization for that, but is this used?There's a metadata but the docs aren't clear as to rules of what goes to primary as metadata vs "metadata" HDU? Values are stored in headers for both of them, even when the underlying HDU is BinTable or Table - but I don't think I can do that with image collection tbh. So I don't think that fits with your convention.
More broadly, I don't think this is safe to do. The
HIERARCH
andCONTINUE
keywords are supported by astropy, but I don't think this is part of official standard. Astropy doesn't say much about limitations, but CFITSIO seems to agree and says it will throw an error if the key-value pair is more than 40 chars long and if it's a string it will just forcefully truncate it without error-ing out.The changes:
Standardizers:
- sync
KBMODV1
andButlerStandardizer
; they're not exact, but better.- rename
mjd
tomjd_mid
, fix tests- extract obs
lon
,lat
andelevation
inButlerStandardizer
- make
MultiExt
andSingleExt
standardizers not directly instantiabl (this was a complain from Max a while ago but I can't find an issue if there was one)ImageCollection
:- implement packing and unpacking of shared columns
- implement to and from
BinTableHDU
cast forImageCollection
- add it to workunit as a metadata header unit as an example
- add
vstack
method (have to test in wild) for image collection- adds a
copy
method- add a way to manually reset lazy loading indices after subsetting form a larger collection (useful only for really really large collections)
Flesh out a lot more tests for
ImageCollection
andStandardizers
:- more explicit testing of more expected values
- more explicit testing of lazy loading and indexing mechanism in IC