forked from cfe316/atomic
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathfetch_adas_data
More file actions
executable file
·39 lines (32 loc) · 1.18 KB
/
fetch_adas_data
File metadata and controls
executable file
·39 lines (32 loc) · 1.18 KB
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
#!/opt/anaconda3/bin/python
import atomic_neu.adas as adas
atomic_data = './adas_data'
# elements_years = [('hydrogen', 96), ('argon', 89), ('boron', 89), ('carbon', 96),
# ('neon', 96), ('silicon', 96), ('tungsten', 50),
# ('nitrogen', 96), ('lithium', 96), ('beryllium', 96),
# ('helium', 96), ('iron', 89)]
# elements_years = [('oxygen', 96)]
elements_years = [('tungsten', 89)]
db = adas.OpenAdas()
for element, year in elements_years:
res = db.search_adf11(element, year)
for r in res:
print(r[1])
db.fetch(r, atomic_data)
for element, year in elements_years:
res = db.search_adf15(element)
for r in res:
print(r[1])
db.fetch(r, atomic_data)
destination = './src'
for routine in (11,15):
fname = 'xxdata_' + str(routine) + '.tar.gz'
print("Downloading " + fname)
db.fetch(('/code/' + fname, fname), destination)
tar = tarfile.open(destination + '/' + fname)
"""
# here we specifically go against the prohibition in
# https://docs.python.org/2/library/tarfile.html#tarfile.TarFile.extractall
"""
print("Extracting " + fname)
tar.extractall(path=destination)