From 40fc84883ddfdc06bb8266222b457c38b4afd600 Mon Sep 17 00:00:00 2001
From: Olivier Sauter <Olivier.Sauter@epfl.ch>
Date: Mon, 2 May 2022 15:37:37 +0200
Subject: [PATCH] avoid only NaNs data

---
 matlab/TCV/gdat_tcv.m | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/matlab/TCV/gdat_tcv.m b/matlab/TCV/gdat_tcv.m
index d49f6980..a7d5bbf6 100644
--- a/matlab/TCV/gdat_tcv.m
+++ b/matlab/TCV/gdat_tcv.m
@@ -2406,7 +2406,7 @@ elseif strcmp(mapping_for_tcv.method,'switchcase')
     % thus should take it from conf if present
     mdsopen(shot);
     ptot_ohm = tdi('\results::conf:ptot_ohm');
-    if ~isempty(ptot_ohm.data) && ~ischar(ptot_ohm.data) && ~isempty(ptot_ohm.dim)
+    if ~isempty(ptot_ohm.data) && ~ischar(ptot_ohm.data) && ~isempty(ptot_ohm.dim) && any(~isnan(ptot_ohm.data))
       gdat_data.ohm.data = ptot_ohm.data;
       gdat_data.ohm.t = ptot_ohm.dim{1};
       gdat_data.ohm.dim = ptot_ohm.dim;
-- 
GitLab