From b7b79499bc7c0fc77829b6e27fe8fa70c92cf6b8 Mon Sep 17 00:00:00 2001
From: Francesco Carpanese <francesco.carpanese@epfl.ch>
Date: Thu, 19 Dec 2019 18:20:02 +0100
Subject: [PATCH] Ongoing conversion from COCOS 11 to COCOS 17 for CORSICA

---
 IDS/complete_IDS_CORSICA.m | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/IDS/complete_IDS_CORSICA.m b/IDS/complete_IDS_CORSICA.m
index 01993ee0..0695c437 100644
--- a/IDS/complete_IDS_CORSICA.m
+++ b/IDS/complete_IDS_CORSICA.m
@@ -7,11 +7,18 @@ clc
 data_path_in = '/NoTivoli/carpanes/LIU_RAP_ITER/CORSICA_ids/CORSICA_130510.mat';
 %path_IDS = '/NoTivoli/carpanes/LIU_RAP_ITER/CORSICA_ids/CORSICA_130506.mat';
 
-data_path_out = '/NoTivoli/carpanes/LIU_RAP_ITER/CORSICA_ids/CORSICA_130510_extended.mat';
+data_path_out = '/NoTivoli/carpanes/LIU_RAP_ITER/CORSICA_ids/CORSICA_130510_extended_COCOS17.mat';
 
 % Load the IDS file
 IDS = load(data_path_in);
 
+%% Correct COCOS convention on original data
+
+% Put homogenous = 0 on magnetic but 1 on the coils.
+% Sign of the angle of the magnetic probes. 
+
+
+%% 
 G = G_ITER_generator;
 % Get the structure from generating files
 P = liupiter(1000,'uuu',ones(G.na,1),'vvv',ones(G.nm,1), 'www', ones(G.nf,1)); % Some default setting that could be removed probably to use the liupiter directly
@@ -118,12 +125,13 @@ IDS.tf.time = LXC.t;
 IDS.tf.b_field_tor_vacuum_r.time  = LXC.t;
 IDS.tf.b_field_tor_vacuum_r.data  = LXC.rBt;
 
+%% Convert from 11 to 17
+IDS = ids_generic_cocos_nodes_transformation_symbolic(IDS.magnetics, 'magnetics', 11, 17);
+IDS = ids_generic_cocos_nodes_transformation_symbolic(IDS.magnetics, 'pf_active', 11, 17);
+IDS = ids_generic_cocos_nodes_transformation_symbolic(IDS.magnetics, 'tf', 11, 17);
+
 %% Store the resulting data
 save(data_path_out, '-struct', 'IDS')
 fprintf('\n wrote file %s \n', data_path_out);
 
 
-
-
-
-
-- 
GitLab