Skip to content

Commit 91cbab0

Browse files
committed
added new way to store missing signals as text files. removed spatial profiles as they would be saved under the same name as the jet profiles mapped to rho
1 parent 5f09a5c commit 91cbab0

File tree

3 files changed

+8
-16
lines changed

3 files changed

+8
-16
lines changed

data/signals.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ def fetch_nstx_data(signal_path,shot_num,c):
211211
'pradedge':pradedge,'pradtot':pradtot,'pin':pin,
212212
'torquein':torquein,
213213
'energydt':energydt,'ipdirect':ipdirect,'iptarget':iptarget,'iperr':iperr,
214-
#'tmamp1':tmamp1,'tmamp2':tmamp2,'tmfreq1':tmfreq1,'tmfreq2':tmfreq2,'pechin':pechin,
215-
# 'rho_profile_spatial':rho_profile_spatial,'etemp_profile_spatial':etemp_profile_spatial,'edens_profile_spatial':edens_profile_spatial,'etemp':etemp
214+
'tmamp1':tmamp1,'tmamp2':tmamp2,'tmfreq1':tmfreq1,'tmfreq2':tmfreq2,'pechin':pechin,
215+
'rho_profile_spatial':rho_profile_spatial,'etemp':etemp,
216216
'etemp_profile':etemp_profile,'edens_profile':edens_profile,
217217
'itemp_profile':itemp_profile,'zdens_profile':zdens_profile,
218218
'trot_profile':trot_profile,'pthm_profile':pthm_profile,

plasma/primitives/data.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from scipy.interpolate import UnivariateSpline
66

77
from plasma.utils.processing import get_individual_shot_file
8-
from plasma.utils.downloading import format_save_path
8+
from plasma.utils.downloading import format_save_path,get_missing_value_array
99

1010
# class SignalCollection:
1111
# """GA Data Obj"""
@@ -265,10 +265,4 @@ def __str__(self):
265265
def __repr__(self):
266266
return self.__str__()
267267

268-
def create_missing_value_filler():
269-
time = np.linspace(0,100,100)
270-
vals = np.zeros_like(time)
271-
return time,vals
272268

273-
def get_missing_value_array():
274-
return np.array([-1.0])

plasma/utils/downloading.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
from multiprocessing import Queue
2626
import os
2727
import errno
28-
from plasma.primitives.data import get_missing_value_array
2928

3029
# import gadata
3130

@@ -35,10 +34,9 @@
3534

3635
#print("Importing numpy version"+np.__version__)
3736

38-
def create_missing_value_filler():
39-
time = np.linspace(0,100,100)
40-
vals = np.zeros_like(time)
41-
return time,vals
37+
38+
def get_missing_value_array():
39+
return np.array([-1.0])
4240

4341
def makedirs_process_safe(dirpath):
4442
try: #can lead to race condition
@@ -108,8 +106,8 @@ def save_shot(shot_num_queue,c,signals,save_prepath,machine,sentinel=-1):
108106
makedirdepth_process_safe(save_path_full)
109107
if success:
110108
np.savetxt(save_path_full,data_two_column,fmt = '%.5e')#fmt = '%f %f')
111-
else
112-
np.savetxt(save_path_full,get_missing_value_array())
109+
else:
110+
np.savetxt(save_path_full,get_missing_value_array(),fmt = '%.5e')
113111
print('.',end='')
114112
except:
115113
print('Could not save shot {}, signal {}'.format(shot_num,signal_path))

0 commit comments

Comments
 (0)