Skip to content
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 EUI observer coordinate date #5462

Merged
merged 1 commit into from
Jul 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions changelog/5462.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
The date returned by `~sunpy.map.GenericMap.date` for Solar Orbiter/EUI maps
has been adjusted to be taken from the DATE-AVG keyword
(the middle of the image acquisition period), instead of the DATE-OBS
keyword (the beginning of the image acquisition period). This means the observer
coordinate now has the correct date.
7 changes: 7 additions & 0 deletions sunpy/map/sources/solo.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from sunpy.coordinates import HeliocentricInertial
from sunpy.map import GenericMap
from sunpy.map.sources.source_type import source_stretch
from sunpy.time import parse_time

__all__ = ['EUIMap']

Expand Down Expand Up @@ -47,6 +48,12 @@ def processing_level(self):
def exposure_time(self):
return self.meta.get('xposure', 0.0) * self.timeunit

@property
def date(self):
t = self.meta.get('date-avg')
timesys = self.meta.get('timesys')
return parse_time(t, scale=timesys.lower())

@property
def _supported_observer_coordinates(self):
return [(('hcix_obs', 'hciy_obs', 'hciz_obs'),
Expand Down
4 changes: 3 additions & 1 deletion sunpy/map/sources/tests/test_eui_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,9 @@ def test_is_datasource_for(eui_fsi_map):


def test_observer_coordinate(eui_fsi_map):
assert isinstance(eui_fsi_map.observer_coordinate, SkyCoord)
obs_coord = eui_fsi_map.observer_coordinate
assert isinstance(obs_coord, SkyCoord)
assert obs_coord.obstime.isot == eui_fsi_map.meta['date-avg']


def test_observatory(eui_fsi_map):
Expand Down