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
How to set observer coordinate in a Map? #4189
Comments
One could imagine creating a convenience function or method (e.g., called something like |
Obviously whoever actually writes such a function would need to "learn FITS". =) |
Why a convenience function/method instead of a setter? |
Some reasons to avoid a setter:
|
Why not?
This seems easily fixed by clear documentation ("This is a list of the properties that can be set").
What's the normal machinery that needs to be triggered? Wouldn't it be possible to trigger it from a setter (which is essentially just a method)? I don't think there are implementation reasons to choose a setter or a method, but it seems like there are API reasons, the difference being m.observer_coordinate = my_skycoord or new_m = m.set_observer_coord(my_skycoord) And it sounds like the second method option is the best one, as it preserves the original map. |
There is a lot to unpack here. I am going to focus on the short term things, given the current design we have for map etc. I think the bigger picture issues (setters, mutability etc) can be considered as and when we refactor the metadata handling. Firstly, I started hacking on addressing #3643 which should be a part of this, although our current design of on-the-fly generated WCSes makes it not really an API solution. I think having a The main issue I see with implementing something which sets the observer coordinate is maintaining coherence (or at least finding and removing) observer coordinates in different systems in the header. I.e. if you load an AIA map and then set the observer coordinate, ideally all the |
See #4194 for a concept that's been brewing in my brain |
I've put code to take a coordinate and return appropriate observer metadata in |
#3110 is related, but not a duplicate |
I currently have a lot of maps with missing observer coordinate information, and I would like to set this information to the location of the earth at the time the map was observed.
One way of doing this is to manually calculate what the values of the
'hgln_obs', 'hglt_obs', 'dsun_obs'
FITS keywords should be, manually add them to the existing header, and create a new map. But I think a user should not have to worry about or know anything about FITS to do this.Another way of doing this would be giving the☹️ (#3911)
observer_coordinate
property a setter, and I could then set the observer coordinate to aSkyCoord
(and internally sunpy would handle with the FITS stuff). But it has been decided not to support property setters onMap
So my questions are
Map
?The text was updated successfully, but these errors were encountered: