From f86e2016a0b5ae11cdd2c740d54a3e1fea5741fd Mon Sep 17 00:00:00 2001
From: Francesco Carpanese <francesco.carpanese@epfl.ch>
Date: Mon, 3 Feb 2020 15:37:11 +0100
Subject: [PATCH] Small correction to bring back the function to the original
 state.

---
 matlab/IMAS/G_ITER_generator.m     | 2 +-
 matlab/IMAS/complete_IDS_CORSICA.m | 8 ++++----
 matlab/IMAS/data_coils.m           | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/matlab/IMAS/G_ITER_generator.m b/matlab/IMAS/G_ITER_generator.m
index bc4a0f91..9cc4a407 100644
--- a/matlab/IMAS/G_ITER_generator.m
+++ b/matlab/IMAS/G_ITER_generator.m
@@ -47,7 +47,7 @@ sort_list = [3,4,2,5,1,6,7,8,9,10,11,12, 13, 14];
 for ii=1:numel(sort_list)
     vv(:,ii) = vvtmp(:,sort_list(ii));
 end
-N = N(sort_list);
+N = abs(N(sort_list));
 % Compute the windings and connection matrix
 [rw,zw,Twa] = gen_filament(vv,N,2);
 G.dima = dima(sort_list);
diff --git a/matlab/IMAS/complete_IDS_CORSICA.m b/matlab/IMAS/complete_IDS_CORSICA.m
index de1cb3c5..34b38b69 100644
--- a/matlab/IMAS/complete_IDS_CORSICA.m
+++ b/matlab/IMAS/complete_IDS_CORSICA.m
@@ -1,10 +1,10 @@
-%function IDS_out = complete_IDS_CORSICA(IDS_in,varargin)
+function IDS_out = complete_IDS_CORSICA(IDS_in,varargin)
 %
 %
 
 %
-doread = 1;
-dosave = 1;
+doread = 0;
+dosave = 0;
 
 
 if doread
@@ -117,7 +117,7 @@ fields_to_add = setdiff(mag_fluxloop_def_fields,mag_fluxloop_fields);
 
 %% Ff
 tmp = data_Ff();
-for ii=1:numel(tmp.r)
+for ii=1:numel(tmp.r) 
   if ~isempty(fields_to_add)
     for idef=1:length(fields_to_add)
       % add first defaults and fill in after
diff --git a/matlab/IMAS/data_coils.m b/matlab/IMAS/data_coils.m
index e29c3e11..e5f69a57 100644
--- a/matlab/IMAS/data_coils.m
+++ b/matlab/IMAS/data_coils.m
@@ -1,6 +1,6 @@
 function [data_struct] = data_coils()
 % Data BASED on ITER_D_24JQWZ V1.0
-% VSU and VSL are not correctly described at the moment
+% VSU and VSL are not correctly described at the moment since they are taken as rectangular but they are rounded
 
 names = {'CS3U';'CS2U';'CS1U';'CS1L';'CS2L';'CS3L';'PF1';...
         'PF2';'PF3';'PF4';'PF5';'PF6'; 'VSU'; 'VSL'};
-- 
GitLab