-
-
Notifications
You must be signed in to change notification settings - Fork 591
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
Add GONG H-Alpha map source #7451
Conversation
3427043
to
e709fc4
Compare
e709fc4
to
ea6e52a
Compare
Because of the asdf issue with the |
We need to fix that bug, and milestone it for 6.0 |
ea6e52a
to
c9bbc8c
Compare
sunpy/map/sources/gong.py
Outdated
|
||
@property | ||
def observer_coordinate(self): | ||
return SkyCoord(self.earth_location.itrs).heliographic_stonyhurst |
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.
Do we have a test for this?
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.
No but I can add one but there is a test for self.earth_location
and if this were to break it would be in SkyCoord
or EarthLocation
ec2f4a8
to
361ed29
Compare
I think the test fail is related to this issue astropy/astropy/issues/16128 |
361ed29
to
66c6455
Compare
Yea so if I extract the test command and run in a terminal it works I guess it could be something to do with import astropy.units as u
from numpy.testing import assert_equal
from sunpy.data.test import get_dummy_map_from_header, get_test_filepath
gm = get_dummy_map_from_header(get_test_filepath('gong_halpha.header'))
assert_equal(gm.observer_coordinate.data.xyz,
[146712246479.363, -5563586.169750214, -17605285536.73928] * u.m) |
66c6455
to
493707d
Compare
I'm able to reproduce this test fail locally. The reason is because the last date in the IERS table that astropy is grabbing is 1/12/2024 and the date of this observation is 2/16/2024. Thus, its throwing a warning that you're beyond the last date in the IERS table and your accuracy may be degraded. |
Yea but is that specific to test runs e.g. strict remote data runner as if I run it from local shell it works?
|
Ok I think that should fix the test. Let me know what you think about that. I changed the |
Either you're silencing the warning or using a different IERS table (that has a more recent date). Can you check which table you're using? |
Hum I cleared the downloaded cache in the process of trying to reproduce the errors so maybe that's related.
I could use an older H-alpha file for the tests before 2024/02/12? |
Maybe? Whatever I did also I did not fix the issue on the CI though did fix the fail for me locally. The most annoying combination. Yeah, maybe just using an older file is the easiest solution. People will of course run into this if they use the newer files, but it's probably not a big deal in terms of accuracy or they'll have a more up-to-date IERS table. |
def test_scale(gong_halpha): | ||
"""Tests the scale property of the GONGHalphaMap map.""" | ||
assert_equal(gong_halpha.scale.axis1, 1.0794939681708389 * (u.arcsec / u.pix)) | ||
assert_equal(gong_halpha.scale.axis1, 1.0794939681708389 * (u.arcsec / u.pix)) |
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.
Should this be axis2
?
Just to cross-reference, the actual underlying in astropy is now being discussed here: astropy/astropy#13227 (comment) The tl;dr is that astropy will ignore a just-downloaded IERS table if you have I would suggest that if we don't want this PR held up by this bugfix, then we just choose a GONG header at an earlier date. |
8cd494a
to
03764b4
Compare
with pytest.warns(AstropyWarning, match='Tried to get polar motions for times after IERS data is valid.'): | ||
with pytest.warns(AstropyWarning, match='times are outside of range covered by IERS table'): |
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.
Had to add an extra warning?
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.
I broke oldest build do this.
> with pytest.warns(AstropyWarning, match='Tried to get polar motions for times after IERS data is valid.'):
E Failed: DID NOT WARN. No warnings of type (<class 'astropy.utils.exceptions.AstropyWarning'>,) were emitted. The list of emitted warnings is: [].
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.
Again I think we should just choose an older test header to avoid having to deal with this IERS behavior since an upstream fix is needed.
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.
Even though the upstream fix (astropy/astropy#16187) will likely be merged imminently, it probably won't be backported, so it will be a long while before it is in all versions of astropy
we support. The alternative to picking an older test header is to simply filter away warnings within the unit test.
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.
That is, the unit test don't actually care if there's a warning or not, so catching/matching with pytest.warns()
is unnecessary.
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.
(And yes, there are two warnings, from two different parts of the astropy
codebase.)
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.
Done.
d4e591b
to
2343d1b
Compare
* Add tests and test data * Add observer_coord and update docs.
Co-authored-by: Will Barnes <[email protected]>
2343d1b
to
30d1d4b
Compare
PR Description
Closes #6656 by adding a GONG H-alpha map source.
TODO:
Image from GONG site
From sunpy with this PR