Skip to content
This repository has been archived by the owner on Feb 1, 2023. It is now read-only.

Commit

Permalink
Fix STEREO data stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
dstansby committed Jan 24, 2022
1 parent 22ea92c commit 4425725
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
3 changes: 2 additions & 1 deletion solarsynoptic/data/helpers.py
@@ -1,4 +1,5 @@
from datetime import datetime, timedelta
from pathlib import Path

from astropy.time import Time
from sunpy.net import Fido
Expand Down Expand Up @@ -37,4 +38,4 @@ def start_of_day_map(dtime, *query):
except IndexError:
raise RuntimeError(f'No maps available for whole day on {dtime}')

return download_path
return Path(download_path)
25 changes: 13 additions & 12 deletions solarsynoptic/data/stereo.py
Expand Up @@ -90,16 +90,17 @@ def stereo_start_of_day_map(dtime, wlen=195 * u.Angstrom, dl_path=None):
dl_path = Path(dl_path)

map_path = _stereo_map_path(dtime, dl_path, wlen)
if not map_path.exists():
try:
dl_path = helpers.start_of_day_map(
dtime, a.Instrument('EUVI'), a.Wavelength(195 * u.Angstrom))
except Exception:
map_path = _stereo_map_path(dtime, dl_path, wlen, beacon='_beacon')
if not map_path.exists():
dl_path = stereo_beacon_start_of_day(dtime, dl_path, wlen)
else:
dl_path = map_path

dl_path.replace(map_path)
if map_path.exists():
return Map(map_path)

try:
dl_path = helpers.start_of_day_map(
dtime, a.Instrument('EUVI'), a.Wavelength(195 * u.Angstrom))
except Exception:
map_path = _stereo_map_path(dtime, dl_path, wlen, beacon='_beacon')
if map_path.exists():
return Map(map_path)
dl_path = stereo_beacon_start_of_day(dtime, dl_path, wlen)

dl_path.replace(map_path)
return Map(map_path)

0 comments on commit 4425725

Please sign in to comment.