-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path07.savedata.py
More file actions
executable file
·31 lines (26 loc) · 983 Bytes
/
Copy path07.savedata.py
File metadata and controls
executable file
·31 lines (26 loc) · 983 Bytes
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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 30 11:38:36 2023
@author: chingchen
"""
import stagpy
import os,sys
import numpy as np
from stagpy import stagyydata
from stagpy import field
model = 'w0210'
model = sys.argv[1]
path = '/lfs/jiching/'
savepath = '/lfs/jiching/data/'
data = stagyydata.StagyyData(path+model)
for shot in range(1,53):
print(shot)
kk1,kk2,kk3,kk4 = field.get_meshes_fld(data.snaps[shot],'T')
eta1,eta2,eta3,eta4 = field.get_meshes_fld(data.snaps[shot],'eta')
rho1,rho2,rho3,rho4 = field.get_meshes_fld(data.snaps[shot],'rho')
np.savetxt(savepath+'/'+model+'_get_meshes_x_of_'+str(shot)+'.txt',kk1)
np.savetxt(savepath+'/'+model+'_get_meshes_z_of_'+str(shot)+'.txt',kk2)
np.savetxt(savepath+'/'+model+'_get_meshes_T_of_'+str(shot)+'.txt',kk3)
np.savetxt(savepath+'/'+model+'_get_meshes_eta_of_'+str(shot)+'.txt',eta3)
np.savetxt(savepath+'/'+model+'_get_meshes_rho_of_'+str(shot)+'.txt',rho3)