Skip to content

Commit

Permalink
Download metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
starfleetjames committed Sep 15, 2023
1 parent 9b3722f commit 708713c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion setup_minimum_required_folders_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"https://www.dropbox.com/s/z86h2h7l8pgbhnl/filter_entrance_transmission.csv?dl=1",
"https://www.dropbox.com/s/muclu9kncl7xyff/filter_focal_plane_transmission.csv?dl=1",
"https://www.dropbox.com/s/tvqt8ybipa1bm8z/aia_V9_fullemiss.nc?dl=1",
"https://www.dropbox.com/s/k1qv0lujqmpvszn/si_qe_henke.csv?dl=1"] # dl=1 is important
"https://www.dropbox.com/s/k1qv0lujqmpvszn/si_qe_henke.csv?dl=1",
"https://www.dropbox.com/scl/fi/rbe7vm3sha9mbloek1iio/suncet_metadata_definition_v1.0.0.csv?rlkey=mswa2lvdrvbb9o1rer1z60p2x&dl=1"] # dl=1 is important

def run():
if os.getenv('suncet_data') == None:
Expand All @@ -34,6 +35,8 @@ def run():
synthetic_path.mkdir(parents=True, exist_ok=True)
synthetic_path = Path(os.getenv('suncet_data') + '/synthetic/level0_raw/binary')
synthetic_path.mkdir(parents=True, exist_ok=True)
metadata_path = Path(os.getenv('suncet_data') + '/metadata')
metadata_path.mkdir(parents=True, exist_ok=True)

ssl._create_default_https_context = ssl._create_unverified_context

Expand All @@ -54,6 +57,8 @@ def run():
filename = filter_path / filename
elif filename.startswith('si_qe_'):
filename = qe_path / filename
elif filename.startswith('suncet_metadata_'):
filename = metadata_path / filename
with open(filename, "wb") as f:
print('downloading file: {}'.format(filename))
f.write(data)
Expand Down

0 comments on commit 708713c

Please sign in to comment.