-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRead_p3.py
69 lines (33 loc) · 995 Bytes
/
Read_p3.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
#!/usr/bin/env python
# coding: utf-8
# In[1]:
#if working on lx-moissard
Cluster = 'Occ/'
run_name = '20_08_18_new_big_one_0'
filepath = '/data/Lathys/Visualisation/' + Cluster + run_name + '/ncfiles/p3_files/'
p3_file = filepath + "p3_0000_18_08_20_t00230.nc"
# In[2]:
import netCDF4 as nc
import numpy as np
import matplotlib
from matplotlib import pyplot as plt
from matplotlib import rcParams
rcParams["figure.figsize"] = [20, 15]
# In[3]:
p3_data = nc.Dataset(p3_file,'r')
print(p3_data.__dict__)
# In[ ]:
# for variable in p3_data.variables:
# print(variable)
# In[ ]:
posx = p3_data.variables['particule_x']
posy = p3_data.variables['particule_y']
posz = p3_data.variables['particule_z']
velx = p3_data.variables['particule_vx']
vely = p3_data.variables['particule_vy']
velz = p3_data.variables['particule_vz']
# In[ ]:
plt.scatter(np.array(posx), np.array(velx), s = 0.01)
# In[ ]:
plt.scatter(np.array(posx), np.array(posy), s = 0.01)
# In[ ]: