From 2095ea7e59195f714122d1873aad5d4bd6b5a61a Mon Sep 17 00:00:00 2001 From: Noah Kasmanoff Date: Thu, 30 Nov 2023 13:11:03 -0500 Subject: [PATCH] add env example --- helio_tools/_src/data/sdo/base.py | 6 ++++-- helio_tools/_src/data/solo/base.py | 7 ++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/helio_tools/_src/data/sdo/base.py b/helio_tools/_src/data/sdo/base.py index b868ed5..fe7c9a8 100644 --- a/helio_tools/_src/data/sdo/base.py +++ b/helio_tools/_src/data/sdo/base.py @@ -182,8 +182,10 @@ def fetchDataFallback(self, date: datetime): def main(): - email = "chri.schirni@hotmail.de" - 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) diff --git a/helio_tools/_src/data/solo/base.py b/helio_tools/_src/data/solo/base.py index 3e290ba..d281a8f 100644 --- a/helio_tools/_src/data/solo/base.py +++ b/helio_tools/_src/data/solo/base.py @@ -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: @@ -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)