Difference between revisions of "TOSCA simulation for Pol He3 Field"

From HallCWiki
Jump to: navigation, search
(How to run these scripts to combine maps)
 
(18 intermediate revisions by the same user not shown)
Line 3: Line 3:
 
==Introduction ==
 
==Introduction ==
  
The TOSCA simulation geometry files were prepared by Steven Lassiter. <br>
+
The TOSCA simulation geometry files were prepared by Steven Lassiter. <br>
The simulation were performed by both Steven and Jixie.<br>
+
The simulation were performed by both Steven and Jixie.<br>
+
 
In D2N, the target base was not rotated. The axis of horizontal large coils (HL) is along Lab X axis.  <br>
+
In D2N, the target base was not rotated. The axis of horizontal large coils (HL) is along Lab X axis.  <br>
The axis of horizontal small coils (HS) is along Lab Z axis. <br>
+
The axis of horizontal small coils (HS) is along Lab Z axis. <br>
In A1N, the target base was rotated clockwise (top view) about Y axis by 45 degrees. <br>
+
In A1N, the target base was rotated clockwise (top view) about Y axis by 45 degrees. <br>
 +
 
 +
Please keep in mind that the coordinate system in the TOSCA simulation is defined in this way: <br>
 +
X axis goes to beam right, y axis goes up, Z axis goes to upstream. <br>
 +
We have rotated the output about Y axis by 180 degrees to make it in the Lab frame. <br>
 
   
 
   
Please keep in mind that the coordinate system in the TOSCA simulation is defined in this way: <br>
+
Jixie has analyzed the simulated field of each individual set of coils and compared them to the<br>
X axis goes to beam right, y axis goes up, Z axis goes to upstream. <br>
+
real measurement to determine what is the real current that is matched to the current density used in <br>
We have rotated the output about Y axis by 180 degrees to make it in the Lab frame. <br>
+
TOSCA simulation. <br>
  
 
==Where is the maps located ==
 
==Where is the maps located ==
Line 21: Line 25:
 
==Scripts to combine maps ==
 
==Scripts to combine maps ==
  
Jixie provides python code to combine these 7 rotated individual maps (HB, HL, HS, VL, VS, HLCC and HSCC) <br>
+
Jixie provides python scrips to combine these 7 rotated individual maps (HB, HL, HS, VL, VS, HLCC and HSCC) <br>
into one map with each map scaled to the given current.
+
into one map with each map scaled to the given current. These scrips will also make some plots of "Field vs Y|Z" <br>
 +
and "Gradient vs Y|Z". These scrips are stored at <br>
 +
ifarm1901:/u/group/c-polhe3/Users/jixie/TOSCA/Scripts/A1N.py<br>
 +
ifarm1901:/u/group/c-polhe3/Users/jixie/TOSCA/Scripts/D2N.py<br>
 +
 
 +
The output of these scripts (combined table, pdf files and figures) are stored at: <br>
 +
ifarm1901:/u/group/c-polhe3/Users/jixie/TOSCA/Scripts/A1NOutput<br>
 +
ifarm1901:/u/group/c-polhe3/Users/jixie/TOSCA/Scripts/D2NOutput<br>
 +
 
 +
==How to run these scripts to combine maps ==
 +
First of all, the script require matplotlib, numpy, pandas modules. You need to install
 +
them before running it. <br>
 +
Note that ifarm1901 does not install all modules by default. You need to work
 +
on your own installation.
 +
 
 +
1) change "TableDir" to where the tables are located. <br>
 +
 
 +
2) change "OutDir" as it is where to keep the output files <br>
 +
 
 +
3) configure "Target_Currents_xxxxx[4][7]" 2-D list. It contains 4 rows and 7 columns.<br>
 +
The rows [0],[1],[2],[3] represent target polarization polarity of 0. 90, 180, and 270 deg, respectively. <br>
 +
The structure of each row are the currents for these coils: HB,HL,HS,VL,VS,HLCC,HSCC.<br>
 +
 
 +
4) Keep in mind that in D2N experiment, HS coil current in read back is in opposite<br>
 +
sign, VL and VS are switched. <br>
 +
In A1N experiment, HS coil current in read back is also in opposite sign.<br>
 +
Make sure you know these when you provide "Target_current" and be enough careful.<br>
 +
 
 +
5) This script can make some plot using functions. For example "PlotGradientVsZ(xx,yy,figname)"  <br>
 +
will plot the 9 gradients as a function of z at line (x=xx,y=yy).<br>
 +
User need to specify xx and yy locations and output figure name. <br>

Latest revision as of 15:50, 18 October 2021

By Jixie Zhang, Sep 9th,2020

Introduction

The TOSCA simulation geometry files were prepared by Steven Lassiter.
The simulation were performed by both Steven and Jixie.

In D2N, the target base was not rotated. The axis of horizontal large coils (HL) is along Lab X axis.
The axis of horizontal small coils (HS) is along Lab Z axis.
In A1N, the target base was rotated clockwise (top view) about Y axis by 45 degrees.

Please keep in mind that the coordinate system in the TOSCA simulation is defined in this way:
X axis goes to beam right, y axis goes up, Z axis goes to upstream.
We have rotated the output about Y axis by 180 degrees to make it in the Lab frame.

Jixie has analyzed the simulated field of each individual set of coils and compared them to the
real measurement to determine what is the real current that is matched to the current density used in
TOSCA simulation.

Where is the maps located

The rotated TOSCA field maps for each single set of coils are stored in group dir:
ifarm1901:/u/group/c-polhe3/Users/jixie/TOSCA/A1NMap
ifarm1901:/u/group/c-polhe3/Users/jixie/TOSCA/D2NMap

Scripts to combine maps

Jixie provides python scrips to combine these 7 rotated individual maps (HB, HL, HS, VL, VS, HLCC and HSCC)
into one map with each map scaled to the given current. These scrips will also make some plots of "Field vs Y|Z"
and "Gradient vs Y|Z". These scrips are stored at
ifarm1901:/u/group/c-polhe3/Users/jixie/TOSCA/Scripts/A1N.py
ifarm1901:/u/group/c-polhe3/Users/jixie/TOSCA/Scripts/D2N.py

The output of these scripts (combined table, pdf files and figures) are stored at:
ifarm1901:/u/group/c-polhe3/Users/jixie/TOSCA/Scripts/A1NOutput
ifarm1901:/u/group/c-polhe3/Users/jixie/TOSCA/Scripts/D2NOutput

How to run these scripts to combine maps

First of all, the script require matplotlib, numpy, pandas modules. You need to install them before running it.
Note that ifarm1901 does not install all modules by default. You need to work on your own installation.

1) change "TableDir" to where the tables are located.

2) change "OutDir" as it is where to keep the output files

3) configure "Target_Currents_xxxxx[4][7]" 2-D list. It contains 4 rows and 7 columns.
The rows [0],[1],[2],[3] represent target polarization polarity of 0. 90, 180, and 270 deg, respectively.
The structure of each row are the currents for these coils: HB,HL,HS,VL,VS,HLCC,HSCC.

4) Keep in mind that in D2N experiment, HS coil current in read back is in opposite
sign, VL and VS are switched.
In A1N experiment, HS coil current in read back is also in opposite sign.
Make sure you know these when you provide "Target_current" and be enough careful.

5) This script can make some plot using functions. For example "PlotGradientVsZ(xx,yy,figname)"
will plot the 9 gradients as a function of z at line (x=xx,y=yy).
User need to specify xx and yy locations and output figure name.