-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
increase min sunpy #63
base: main
Are you sure you want to change the base?
Conversation
3b12579
to
d4d8d35
Compare
1ba30c9
to
d28706f
Compare
hmi_map.meta.update(_earth_obs_coord_meta(hmi_map.meta['date-obs'])) | ||
|
||
|
||
def load_adapt(adapt_path): |
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.
We dont have the same loader in sunpy but we can now load them directly. But only the first one.
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 don't know enough about the data to know if the other ones are useful, but if there isn't a drop in replacement then maybe we shouldn't yank it?
Also deprecations please 👼
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.
Added.
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 @nabobalis
I think we need to be deprecating stuff, I made the first version 1.0.0 for a reason, I think stability is important here.
I will let @jgieseler and @STBadman chime in on things like load_adapt
and fix_hmi_meta
specifically, but I would like a review from at least one of them before we merge.
hmi_map.meta.update(_earth_obs_coord_meta(hmi_map.meta['date-obs'])) | ||
|
||
|
||
def load_adapt(adapt_path): |
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 don't know enough about the data to know if the other ones are useful, but if there isn't a drop in replacement then maybe we shouldn't yank it?
Also deprecations please 👼
6af00f1
to
bfacbe8
Compare
2d7c5db
to
1f03469
Compare
@@ -42,7 +42,6 @@ def __init__(self, br, nr, rss): | |||
sunkit_magex.pfss.utils.is_full_sun_synoptic_map(br, error=True) | |||
|
|||
self._map_in = copy.deepcopy(br) | |||
self.dtime = self.map.date |
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.
Not sure if we need this but it should be reference_date
if we do.
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'd probably not remove this property from the Input
class, so 👍 making it reference_date.
I need to patch sunpy 6.0.0 first and then this should pass. |
Oh in that case, I was very wrong and we should fix that in the map source. The reason I said that was it was in the notes:
But clearly I didn't check. |
Yes, I saw that comment as well and was confused. That's why I was wondering if I do the loading in a wrong way. |
Oh I am confused, sunpy doesn't change the meta anymore. If you access the attributes of the map, those should be correct now. I think .units? |
Hm, I don't know. But I just checked and run some old code that uses Missing metadata for solar radius: assuming the standard radius of the photosphere. [sunpy.map.mapbase]
2024-09-17 18:19:50 - sunpy - INFO: Missing metadata for solar radius: assuming the standard radius of the photosphere.
WARNING: SunpyMetadataWarning: Missing metadata for observer: assuming Earth-based observer.
For frame 'heliographic_stonyhurst' the following metadata is missing: hgln_obs,hglt_obs,dsun_obs
For frame 'heliographic_carrington' the following metadata is missing: crlt_obs,dsun_obs,crln_obs
[sunpy.map.mapbase]
2024-09-17 18:19:50 - sunpy - WARNING: SunpyMetadataWarning: Missing metadata for observer: assuming Earth-based observer.
For frame 'heliographic_stonyhurst' the following metadata is missing: hgln_obs,hglt_obs,dsun_obs
For frame 'heliographic_carrington' the following metadata is missing: crlt_obs,dsun_obs,crln_obs |
Ah I see, yeah but we should not be fixing these metadata ourselves but letting sunpy emit them. These are legit issues with the FITS files and having some special helper function for it is not something we should be doing in sunkit-magex. |
de8000d
to
d57aef3
Compare
Dob build is failing due to JSOC. I can skip the examples. |
@@ -36,6 +37,7 @@ def _earth_obs_coord_meta(obstime): | |||
return _observer_coord_meta(sunpy.coordinates.get_earth(obstime)) | |||
|
|||
|
|||
@deprecated('1.0', message="This is now fixed within sunpy when you load a HMI file.") | |||
def fix_hmi_meta(hmi_map): |
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.
So the only fix not in sunpy core is:
# Fix observer coordinate
if 'hglt_obs' not in hmi_map.meta:
hmi_map.meta.update(_earth_obs_coord_meta(hmi_map.meta['date-obs']))
We can talk about adding it but that becomes an open question for the other SDO or earth based observatories.
changelog/63.breaking.2.rst
Outdated
- pfss.utils.fix_hmi_meta | ||
- pfss.utils.load_adapt | ||
|
||
These functions are no longer needed and will be removed. |
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.
Are there alternatives we can direct people to?
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.
There is an example on how to load the adapt maps. FOr the fix meta, we have the how to.
I can link to both.
sunkit_magex/pfss/utils.py
Outdated
@@ -79,6 +81,7 @@ def fix_hmi_meta(hmi_map): | |||
hmi_map.meta.update(_earth_obs_coord_meta(hmi_map.meta['date-obs'])) | |||
|
|||
|
|||
@deprecated('1.0', message="This is not required anymore. An example of how to load an ADAPT file is available in the documentation.") |
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'd either link to it or say use sunpy.map.Map
or similar.
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
I'm generally happy with this and we should ship a release, so if we can get the CI fixed and one of @jgieseler or @STBadman are ok with this we should merge it. |
Sorry, this has been on my to-do list to review for ages - just reading the
conversation I think I agree with the changes but I'd like to try out a
workflow with ADAPT and HMI and make sure I understand it all. I'm at a
workshop first half of this week but I will have time on Thursday if you're
ok to wait till then.
…On Tue, Feb 4, 2025, 09:27 Stuart Mumford ***@***.***> wrote:
I'm generally happy with this and we should ship a release, so if we can
get the CI fixed and one of @jgieseler <https://github.com/jgieseler> or
@STBadman <https://github.com/STBadman> are ok with this we should merge
it.
—
Reply to this email directly, view it on GitHub
<#63 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANC6CA4U3A5ARJCLXRLS7A32ODE63AVCNFSM6AAAAABLLLNBVKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMZUGEZDQNJZGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
yep, that's fine no rush! |
b6256f4
to
5eb8e40
Compare
5eb8e40
to
9552abf
Compare
"scipy>=1.10.1", | ||
"streamtracer>=2.2.0", | ||
"sunpy[map]>=6.0.1,!=6.0.0", | ||
"matplotlib>=3.5.0", # Needed to solve the correct env for oldestdeps |
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 didn't know how else to handle it
if hasattr(scipy.special, "sph_harm_y"): | ||
return -scipy.special.sph_harm_y(l, m, phi, theta) | ||
if hasattr(scipy.special, "sph_harm"): | ||
return -scipy.special.sph_harm(m, l, phi, theta) |
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.
It works.
m = 0 | ||
c = zss**(-l-2) * ((2*l + 1) / (l + 1 + l * zss**(-2*l - 1))) | ||
f = analytic.Br(l, m, zss) | ||
phi = 0 * u.deg | ||
theta = 0 * u.deg | ||
assert f(zss, theta, phi) == -0.5 * np.sqrt(3 / np.pi) * c | ||
np.testing.assert_allclose(f(zss, theta, phi), -0.5 * np.sqrt(3 / np.pi) * c) |
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.
There is a floating point difference now at the 8th decime.
This supersedes #48
This turned into a large PR. I could split it out but i'm lazy.