Skip to content

Commit

Permalink
Update transform code and fix change log
Browse files Browse the repository at this point in the history
  • Loading branch information
samaloney committed Dec 13, 2024
1 parent 735e6c7 commit ec8a24d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
File renamed without changes.
10 changes: 5 additions & 5 deletions stixpy/coordinates/tests/test_transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from sunpy.coordinates import HeliographicStonyhurst, Helioprojective

from stixpy.coordinates.frames import STIXImaging
from stixpy.coordinates.transforms import _get_aux_data, get_hpc_info
from stixpy.coordinates.transforms import _get_ephemeris_data, get_hpc_info


@pytest.mark.skip(reason="Test data maybe incorrect")
Expand Down Expand Up @@ -70,15 +70,15 @@ def test_stx_to_hpc_obstime_end():
@pytest.mark.remote_data
def test_get_aux_data():
with pytest.raises(ValueError, match="No STIX pointing data found for time range"):
_get_aux_data(Time("2015-06-06")) # Before the mission started
_get_ephemeris_data(Time("2015-06-06")) # Before the mission started

aux_data = _get_aux_data(Time("2022-08-28T16:02:00"))
aux_data = _get_ephemeris_data(Time("2022-08-28T16:02:00"))
assert len(aux_data) == 1341

aux_data = _get_aux_data(Time("2022-08-28T16:02:00"), end_time=Time("2022-08-28T16:04:00"))
aux_data = _get_ephemeris_data(Time("2022-08-28T16:02:00"), end_time=Time("2022-08-28T16:04:00"))
assert len(aux_data) == 1341

aux_data = _get_aux_data(Time("2022-08-28T23:58:00"), end_time=Time("2022-08-29T00:02:00"))
aux_data = _get_ephemeris_data(Time("2022-08-28T23:58:00"), end_time=Time("2022-08-29T00:02:00"))
assert len(aux_data) == 2691


Expand Down
10 changes: 5 additions & 5 deletions stixpy/coordinates/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def get_hpc_info(times, end_time=None):
-------
"""
aux = _get_aux_data(times.min(), times.max())
aux = _get_ephemeris_data(times.min(), times.max())

indices = np.argwhere((aux["time"] >= times.min()) & (aux["time"] <= times.max()))
if end_time is not None:
Expand Down Expand Up @@ -153,7 +153,7 @@ def get_hpc_info(times, end_time=None):


@lru_cache
def _get_aux_data(start_time, end_time=None):
def _get_ephemeris_data(start_time, end_time=None):
r"""
Search, download and read L2 pointing data.
Expand All @@ -173,9 +173,9 @@ def _get_aux_data(start_time, end_time=None):
query = Fido.search(
a.Time(start_time, end_time),
a.Instrument.stix,
a.Level.l2,
a.stix.DataType.aux,
a.stix.DataProduct.aux_ephemeris,
a.Level.anc,
a.stix.DataType.asp,
a.stix.DataProduct.asp_ephemeris,
)
if len(query["stix"]) == 0:
raise ValueError(f"No STIX pointing data found for time range {start_time} to {end_time}.")
Expand Down

0 comments on commit ec8a24d

Please sign in to comment.