-
-
Notifications
You must be signed in to change notification settings - Fork 68
Add a new keyword argument negative_lon_cdelt
to find_optimal_celestial_wcs
#528
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
base: main
Are you sure you want to change the base?
Conversation
…stial_wcs' whcih controls the sign of cdelt[0]. For solar observations for instance this value should be positive.
negative_lon_cdelt
to `find_optimal_celestial_wcs
negative_lon_cdelt
to find_optimal_celestial_wcs
Seems sane, though I don't know how complete the list of negative frames is? |
Well I tried to base is on the list of valid celestial frames from WCS paper II, I need to investigate whether there are others that could be possible. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #528 +/- ##
==========================================
+ Coverage 88.86% 88.89% +0.03%
==========================================
Files 28 28
Lines 1374 1378 +4
==========================================
+ Hits 1221 1225 +4
Misses 153 153 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Well as far as I can tell I think that's it, I don't think there are other standardized ones. I've decided to update the docstring to spell out the automation rule, so it's not some secret implementation detail. |
@@ -322,6 +322,8 @@ def test_solar_wcs(): | |||
|
|||
pytest.importorskip("sunpy", minversion="6.0.1") | |||
|
|||
# The following registers the WCS <-> frame for solar coordinates | |||
|
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.
Is there supposed to be an import here. Did pre-commit steal it?
negative_lon_cdelt : bool, optional | ||
Whether the CDELT value for the longitude coordinate should be negative | ||
(`True`) or positive (`False`). For astronomical observations of the | ||
sky this is usually the case, while for coordinate systems used in | ||
solar physics this is usually positive. If this is not specified, the | ||
value will be `True` if the first four characters for CTYPE for the | ||
longitude is ``RA--``, ``GLON``, ``ELON``, ``HLON``, or ``SLON``, and | ||
`False` otherwise. |
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.
negative_lon_cdelt : bool, optional | |
Whether the CDELT value for the longitude coordinate should be negative | |
(`True`) or positive (`False`). For astronomical observations of the | |
sky this is usually the case, while for coordinate systems used in | |
solar physics this is usually positive. If this is not specified, the | |
value will be `True` if the first four characters for CTYPE for the | |
longitude is ``RA--``, ``GLON``, ``ELON``, ``HLON``, or ``SLON``, and | |
`False` otherwise. | |
negative_lon_cdelt : bool, optional | |
Whether the CDELT value for the longitude coordinate should be negative | |
(`True`) or positive (`False`). For astronomical observations of the | |
sky it is usually negative, while for coordinate systems used in | |
solar physics this is usually positive. If this is not specified, the | |
value will be `True` if the first four characters for CTYPE for the | |
longitude is ``RA--``, ``GLON``, ``ELON``, ``HLON``, or ``SLON``, and | |
`False` otherwise. |
I think this reads more clearly
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.
The only way I can think of to have a deprecation period is to trigger the 'auto' behavior when negative_lon_cdelt='auto'
, and set the default to None
for a release, which is the auto behavior + a warning.
One other thought is that this PR does negative CDELT for only a whitelist of frames, which, since having it be negative feels like the "weird case" in general, it seems right to only do it when we know it's right to do so. But if instead there were a list of known "positive CDELT" frames and otherwise negative CDELT were the default, then we'd only be changing the function's behavior when we know that's right to do so. As-is feels better long-term, but flipping the sense of the whitelist feels less disruptive short-term. Thoughts?
Well to put it on the table we could also just keep the default as True and make False or auto opt in. |
This defaults to
None
which means auto. This is a break in API compared to before since for solar WCS for example, cdelt will now be positive. I'm not sure how to change the default via a deprecation phase though, so maybe we have to just bite the bullet?Fixes #431
@svank @Cadair - any opinions?