Skip to content

Commit d5009a1

Browse files
committed
for d3d data mapping needs to be rotated
1 parent 3b37932 commit d5009a1

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

data/signals.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -213,12 +213,12 @@ def fetch_nstx_data(signal_path,shot_num,c):
213213
'energydt':energydt,'ipdirect':ipdirect,'iptarget':iptarget,'iperr':iperr,
214214
#'tmamp1':tmamp1,'tmamp2':tmamp2,'tmfreq1':tmfreq1,'tmfreq2':tmfreq2,'pechin':pechin,
215215
# 'rho_profile_spatial':rho_profile_spatial,'etemp_profile_spatial':etemp_profile_spatial,'edens_profile_spatial':edens_profile_spatial,'etemp':etemp
216-
'etemp_profile':etemp_profile,'edens_profile':edens_profile}
217-
#'itemp_profile':itemp_profile,'zdens_profile':zdens_profile}
218-
#'trot_profile':trot_profile,'pthm_profile':pthm_profile,
219-
#'neut_profile':neut_profile,'q_profile':q_profile,
220-
#'bootstrap_current_profile':bootstrap_current_profile,
221-
#'q_psi_profile':q_psi_profile}
216+
'etemp_profile':etemp_profile,'edens_profile':edens_profile,
217+
'itemp_profile':itemp_profile,'zdens_profile':zdens_profile,
218+
'trot_profile':trot_profile,'pthm_profile':pthm_profile,
219+
'neut_profile':neut_profile,'q_profile':q_profile,
220+
'bootstrap_current_profile':bootstrap_current_profile,
221+
'q_psi_profile':q_psi_profile}
222222
#}
223223

224224
#new signals are not downloaded yet

plasma/primitives/data.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,14 +220,17 @@ def fetch_data(self,signal,shot_num,c):
220220
time,data,mapping,success = self.fetch_data_fn(path,shot_num,c)
221221
if mapping is not None and np.ndim(mapping) == 1:#make sure there is a mapping for every timestep
222222
T = len(time)
223-
mapping = np.tile(mapping,(T,1))
223+
mapping = np.tile(mapping,(T,1)).transpose()
224+
assert(mapping.shape == data.shape), "shape of mapping and data is different"
224225
if mapping_path is not None:#fetch the mapping separately
225226
time_map,data_map,mapping_map,success_map = self.fetch_data_fn(mapping_path,shot_num,c)
226-
assert(time == time_map), "time for signal {} and mapping {} don't align: \n{}\n\n{}\n".format(path,mapping_path,time,time_map)
227227
success = (success and success_map)
228228
if not success:
229229
print("No success for signal {} and mapping {}".format(path,mapping_path))
230-
mapping = data_map
230+
mapping = data
231+
else:
232+
assert(np.all(time == time_map)), "time for signal {} and mapping {} don't align: \n{}\n\n{}\n".format(path,mapping_path,time,time_map)
233+
mapping = data_map
231234

232235
except Exception as e:
233236
time,data = create_missing_value_filler()

0 commit comments

Comments
 (0)