-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdatasets.py
52 lines (34 loc) · 1.06 KB
/
datasets.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
import numpy as np
import h5py
import pickle
def NOAA():
f = h5py.File('Data/NOAA/sst_weekly.mat','r')
sst = np.nan_to_num( np.array(f['sst']) )
num_frames = 1914
sea = np.zeros((num_frames,180,360,1))
for t in range(num_frames):
sea[t,:,:,0] = sst[t,:].reshape(180,360,order='F')
sea /= sea.max()
return sea
def pipe():
with open("Data/Turbulent/ch_2Dxysec.pickle", 'rb') as f:
pipe = pickle.load(f)
pipe /= np.abs(pipe).max()
return pipe
def cylinder():
with open('Data/Cylinder/Cy_Taira.pickle', 'rb') as f:
cyl = pickle.load(f)/11.0960
return cyl
def plume():
with h5py.File('Data/Plume/concentration.h5', "r") as f:
plume_3D = f['cs']
plume_3D = np.array(plume_3D)
plume_3D /= plume_3D.max()
return plume_3D
def porous():
with h5py.File('Data/Pore/rho_1.h5', "r") as f:
pore = f['rho'][:]
return pore
def isotropic3D():
with h5py.File('Isotropic/scalarHIT_fields100.h5', "r") as f:
return np.array(f['fields'])