-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.py
137 lines (131 loc) · 5.19 KB
/
run.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
from server import app
from db import ImageDB
import argparse
import json
import socket
test_data = {
'd70a8ff17f100c65' : {
'filename' : '/data/magnetic.raw',
'dimensions' : [512, 512, 512],
'isosurfaceValues' : [0.2],
'colorMap' : 'coolToWarm',
'cameraPosition' : [128, 256, 512]
},
'4090332927509071' : {
'filename' : '/data/magnetic.raw',
'dimensions' : [512, 512, 512],
'isosurfaceValues' : [0.2],
'colorMap' : 'coolToWarm',
'cameraPosition' : [32, 64, 128]
},
'319c29c3691cdcb7' : {
'filename' : '/data/E_1350.dat',
'dimensions' : [432, 432, 432],
'isosurfaceValues' : [0.0565],
'colorMap' : 'viridis',
'cameraPosition' : [0, 0, -324]
},
'0b17640461d44454' : {
'filename' : '/data/E_1350.dat',
'dimensions' : [432, 432, 432],
'isosurfaceValues' : [0.0565],
'colorMap' : 'viridis',
'cameraPosition' : [-432, 0, 0]
},
'949f2252b142104c' : {
'filename' : '/data/interp8502.nc',
'dimensions' : [280, 490, 490],
'dataVariable' : 'wind_velocity_magnitude',
'colorMap' : 'magma',
'opacityMap' : 'exponential',
'isosurfaceValues' : [0.12, 27.59, 55.06, 82.53, 110.0],
'cameraPosition' : [-280, 200, 175]
},
# the following are for the paper
# heptane surface - used in resubmission
'ba30f594754a4b95' : {
'author' : 'Alok Hota',
'organization' : 'University of Tennessee',
'email' : '[email protected]',
'machine' : socket.getfqdn(),
'filename' : '/data/heptane.raw',
'dimensions' : [302, 302, 302],
'dataVariable' : 'csafe_heptane_gas',
'colorMap' : 'viridis',
'isosurfaceValues' : [64],
'cameraPosition' : [75, -200, 200]
},
# magnetic surface - used in resubmission
'a4e2e960e51d81dd' : {
'author' : 'Alok Hota',
'organization' : 'University of Tennessee',
'email' : '[email protected]',
'machine' : socket.getfqdn(),
'filename' : '/data/magnetic.raw',
'dimensions' : [512, 512, 512],
'dataVariable' : 'magnetic_reconnection',
'colorMap' : 'coolToWarm',
'isosurfaceValues' : [0.2],
'cameraPosition' : [128, -256, 512]
},
# tornado streamlines - used in resubmission
'6cf01069b23cda94' : {
'author' : 'Alok Hota',
'organization' : 'University of Tennessee',
'email' : '[email protected]',
'machine' : socket.getfqdn(),
'filename' : '/data/interp9000.raw',
'dimensions' : [280, 490, 490],
'dataVariable' : 'wind_velocity',
'seedBoxExtents' : [150, 250, 150, 250, 0, 10],
'seedSubsample' : 10,
'cameraPosition' : [-280, 200, 175]
},
# girus molecule - used in resubmission
'446f4adb901b54d5' : {
'author' : 'Alok Hota',
'organization' : 'University of Tennessee',
'email' : '[email protected]',
'machine' : socket.getfqdn(),
'filename' : '/data/crov_virus.xyz',
'info' : 'Pseudoatomic model of Cafeteria roenbergensis virus. Closeup view of the virus capsid. Data from River Xiao, [email protected]',
'cameraPosition' : [0, 0, 1385]
},
# superstorm surface - not used in resubmission
'dcfe34b862c777a5' : {
'author' : 'Alok Hota',
'organization' : 'University of Tennessee',
'email' : '[email protected]',
'machine' : socket.getfqdn(),
'filename' : '/data/run1/wrfprs_1993-03-13_22:00:00.nc',
'dimensions' : [254, 254, 37],
'dataVariable' : 'R_H_GDS3_ISBL',
'colorMap' : 'spectral reverse',
'isosurfaceValues' : [0.1, 25, 50, 75, 100],
"cameraPosition" : [-198.449, -221.429, 147.687]
},
# supernova surface - used in resubmission
'87683740eaba1ad4' : {
'author' : 'Alok Hota',
'organization' : 'University of Tennessee',
'email' : '[email protected]',
'machine' : socket.getfqdn(),
'filename' : '/data/E_1354.dat',
'dimensions' : [432, 432, 432],
'dataVariable' : 'angular_velocity',
'colorMap' : 'viridis',
'isosurfaceValues' : [0.0565],
'cameraPosition' : [0, 0, -324]
}
}
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('-g', '--debug', action='store_true')
parser.add_argument('-p', '--port', type=int, default=5000)
args = parser.parse_args()
idb = ImageDB(debug=args.debug)
print 'adding keys to the db for testing'
for dbkey, data in test_data.iteritems():
idb.add(dbkey, json.dumps(data))
app.config['IMAGE_DB'] = idb
app.run(debug=args.debug, host='0.0.0.0', port=args.port)