Skip to content

Commit

Permalink
add env example
Browse files Browse the repository at this point in the history
  • Loading branch information
nkasmanoff committed Nov 30, 2023
1 parent ac6d1e2 commit 2095ea7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 4 additions & 2 deletions helio_tools/_src/data/sdo/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,10 @@ def fetchDataFallback(self, date: datetime):


def main():
email = "[email protected]"
base_path = "/home/juanjohn/data/helio/sdo"
import os
email = os.getenv('SDO_EMAIL')
base_path = os.path.join(os.path.expanduser('~'), 'sdo-data')

downloader_sdo = SDODownloader(
base_path=base_path, email=email, n_workers=8)

Expand Down
7 changes: 4 additions & 3 deletions helio_tools/_src/data/solo/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@ def downloadFSI(self, query_date, wl):
query_date.isoformat("T", timespec='seconds'))
if os.path.exists(file_path):
return file_path
#

search = Fido.search(a.Time(query_date - timedelta(minutes=15), query_date + timedelta(minutes=15)),
a.Instrument('EUI'), a.soar.Product(wl), a.Level(2))
assert search.file_num > 0, "No data found for %s (%s)" % (
query_date.isoformat(), wl)
search = sorted(search['soar'], key=lambda x: abs(
pd.to_datetime(x['Start time']) - query_date).total_seconds())
#

for entry in search:
files = Fido.fetch(entry, path=self.base_path, progress=False)
if len(files) != 1:
Expand Down Expand Up @@ -145,7 +145,8 @@ def downloadHRI(self, query_date, wl):


if __name__ == '__main__':
base_path = "/home/juanjohn/data/helio/solo"
import os
base_path = os.path.join(os.path.expanduser('~'), 'solo-data')

downloader_solo = SOLODownloader(base_path=base_path)
start_date = datetime(2021, 2, 22, 0, 0)
Expand Down

0 comments on commit 2095ea7

Please sign in to comment.