-
Notifications
You must be signed in to change notification settings - Fork 3
/
prepare_tutorial.py
61 lines (53 loc) · 2.03 KB
/
prepare_tutorial.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# import sys
# sys.path.insert(0, "./") # add path for import
import tigress_read # scripts for reading data
# Master directory where the data is stored
dir_master = "./data/"
# Snapshot number
num = 300
# A snapshot can be downloaded using `download` method.
# dataset can be one of
# ["MHD", "MHD_PI", "chem", "CO_lines", "history", "input", "all"]
## R8_4pc MHD
while True:
download_ok = input("Download 4pc MHD data [750MB]? (y/n):")
if download_ok.lower() in ["y", "n"]:
break
if download_ok.lower() == "y":
# read the model information
model_4pc = tigress_read.Model("R8_4pc", dir_master=dir_master)
# download data
model_4pc.download(num, dataset="history")
model_4pc.download(num, dataset="input")
model_4pc.download(num, dataset="MHD")
## R8_4pc MHD_PI
while True:
download_ok = input("Download 4pc MHD_PI data [3.9GB]? (y/n):")
if download_ok.lower() in ["y", "n"]:
break
if download_ok.lower() == "y":
# read the model information
model_4pc = tigress_read.Model("R8_4pc", dir_master=dir_master)
# download data
model_4pc.download(num, dataset="history")
model_4pc.download(num, dataset="input")
model_4pc.download(num, dataset="MHD_PI")
while True:
download_ok = input("Download 2pc MHD/CO data [6GB]? (y/n):")
if download_ok.lower() in ["y", "n"]:
break
if download_ok.lower() == "y":
model_id_2pc = "R8_2pc" # name of the simulation model
model_2pc = tigress_read.Model(model_id_2pc, dir_master=dir_master)
# reading the model information
model_2pc.download(num, dataset="history")
model_2pc.download(num, dataset="input")
model_2pc.download(num, dataset="MHD")
model_2pc.download(num, dataset="CO_lines", iline=1) # CO(J=1-0)
model_2pc.download(num, dataset="CO_lines", iline=2) # CO(J=2-1)
while True:
download_ok = input("Download 2pc full chemistry data [15GB]? (y/n):")
if download_ok.lower() in ["y", "n"]:
break
if download_ok.lower() == "y":
model_2pc.download(num, dataset="chem") # large file 15GB