%
%
%  Call_Coil_Const_Calc.m
%
%
%
if 0
% Inputs used to check against
% C:\achim\MagServe_MagData\FACET_Sector_20\Sext\S1E#1\Coil Calibration
wire_field =   5.1758 %  258.9208  ;   %from fit to wire data                
coil_field =   5.2023 % T/m/I   260.2504 ;   %260.256382   % from coil strength at same current 
%                          at  50.0257   
field_units =  'T/m/I';              
old_constant = 13938.42149; %13938.4215; %
radius =    0.0162386;
turns =   49;
imag =    50.0257; % 50.026 %
mag_name = 'S1E#1';
mag_order = 3;   %3 for sextupole , 2 for quad, 1 for dipole 
num_coil_coils = 2;  %%%%<-----------
coil_name= 'dc55s_add';
end
%%
% Now data for   0_625DC25q_coiladd  from  FACET_Sector_20\Quad\Q1E#1\coilpar.ru4
% For set 2, ru3, order 6 :   Imag = 116.5989 +/- 0.0002 A,  Int.Strength = -32.39570 Tm T or T/m,      
% Strength/Imag = -0.277839  up-going
%from strdat.ru4
% Time      Imag    sigImag        GL       sigGL        GL/I   sigGL/I          
%15:38:40  116.59669   0.00032   32.281657  0.000023   0.276866 9.6e-07 
wire_field =  0.277839       % ru3   
coil_field =  0.276866
field_units =  'T/A';              
old_constant = 1763.42345
radius =    0.00752
turns =   10;
imag =    50.0257; % 50.026 %

mag_name = 'Q1E#1';
mag_order = 2;   %3 for sextupole , 2 for quad, 1 for dipole 
num_coil_coils = 2;  %%%%<-----------
coil_name =  '0_625DC25q_coiladd';

%%



Experiment_constant = ...
    Coil_Constant_Calc(wire_field, coil_field, field_units,...
    old_constant, radius, turns, imag, mag_name, mag_order,...
    num_coil_coils, coil_name)
