From 643de23f1149dbfcda45a323e92128ef794879bf Mon Sep 17 00:00:00 2001 From: Olivier Sauter <olivier.sauter@epfl.ch> Date: Tue, 5 Jul 2011 14:41:31 +0000 Subject: [PATCH] debug when Thomson edge does not exist git-svn-id: https://spcsvn.epfl.ch/repos/TCV/gdat/trunk@2875 d63d8f72-b253-0410-a779-e742ad2e26cf --- crpptbx/TCV/loadTCVdata.m | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/crpptbx/TCV/loadTCVdata.m b/crpptbx/TCV/loadTCVdata.m index b87b6c90..192d4d92 100644 --- a/crpptbx/TCV/loadTCVdata.m +++ b/crpptbx/TCV/loadTCVdata.m @@ -678,16 +678,24 @@ switch TCVkeywrdcase{index} endstr psi_max=tdi(['\results::thomson.edge:psi_max' endstr]); psiscatvol=tdi(['\results::thomson.edge:psiscatvol' endstr]); - for ir=1:length(psiscatvol.dim{2}) - rho(ir,:)= sqrt(1.-psiscatvol.data(:,ir)./psi_max.data(:))'; - end - trace.dim=[{rho};{time}]; - trace.dimunits=[{'sqrt(psi)'} ; {'time [s]'}]; - trace.x=rho; - trace.t=time; - % isfield does not work since tracetdi is not a 'struct' but a tdi object, thus isfield using isa does not work - if any(strcmp(fieldnames(tracetdi),'units')) - trace.units=tracetdi.units; + if ~isempty(psiscatvol.data) && ~ischar(psiscatvol.data) + for ir=1:length(psiscatvol.dim{2}) + rho(ir,:)= sqrt(1.-psiscatvol.data(:,ir)./psi_max.data(:))'; + end + trace.dim=[{rho};{time}]; + trace.dimunits=[{'sqrt(psi)'} ; {'time [s]'}]; + trace.x=rho; + trace.t=time; + % isfield does not work since tracetdi is not a 'struct' but a tdi object, thus isfield using isa does not work + if any(strcmp(fieldnames(tracetdi),'units')) + trace.units=tracetdi.units; + end + else + trace.dim={}; + trace.dimunits={}; + trace.x=[]; + trace.t=[]; + trace.units={}; end mdsclose; -- GitLab