Skip to content

Commit

Permalink
deal with reference_date additions
Browse files Browse the repository at this point in the history
  • Loading branch information
wtbarnes committed Sep 23, 2024
1 parent 6acf969 commit 0d5ba02
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion aiapy/calibrate/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def fix_observer_location(smap):
z=smap.meta["haez_obs"] * u.m,
representation_type=CartesianRepresentation,
frame=HeliocentricMeanEcliptic,
obstime=smap.date,
obstime=smap.reference_date,
).heliographic_stonyhurst
# Update header
new_meta = copy.deepcopy(smap.meta)
Expand Down
7 changes: 4 additions & 3 deletions aiapy/calibrate/tests/test_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
def test_fix_observer_location(aia_171_map):
smap_fixed = fix_observer_location(aia_171_map)
# NOTE: AIAMap already fixes the .observer_coordinate property with HAE
assert smap_fixed.meta["hgln_obs"] == smap_fixed.observer_coordinate.lon.value
assert smap_fixed.meta["hglt_obs"] == smap_fixed.observer_coordinate.lat.value
assert smap_fixed.meta["dsun_obs"] == smap_fixed.observer_coordinate.radius.value
assert u.allclose(smap_fixed.meta["hgln_obs"], smap_fixed.observer_coordinate.lon.value, atol=None, rtol=1e-6)
assert u.allclose(smap_fixed.meta["hglt_obs"], smap_fixed.observer_coordinate.lat.value, atol=None, rtol=1e-6)
assert u.allclose(smap_fixed.meta["dsun_obs"], smap_fixed.observer_coordinate.radius.value, atol=None, rtol=1e-6)


@pytest.fixture()
Expand Down Expand Up @@ -86,6 +86,7 @@ def test_update_pointing_accuracy(aia_171_map, pointing_table, t_delt_factor, ex
assert aia_map_updated.reference_pixel.y == pointing_table[expected_entry]["A_171_Y0"]


@pytest.mark.skip() # Because sunpy pulls reference_date from T_OBS, this test will always fail. Maybe remove?
@pytest.mark.remote_data()
def test_update_pointing_missing_tobs_raises_warning(aia_171_map, pointing_table):
# Tests that a warning is raised if T_OBS is not present.
Expand Down

0 comments on commit 0d5ba02

Please sign in to comment.