Skip to content

Commit

Permalink
updated spice_scan_to_nxdict function to read in instrument json and …
Browse files Browse the repository at this point in the history
…save parameters in nexus files
  • Loading branch information
Bing Li committed Nov 12, 2024
1 parent c605478 commit d5f8bc2
Show file tree
Hide file tree
Showing 189 changed files with 2,210 additions and 50 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file added scripts/.DS_Store
Binary file not shown.
Binary file added scripts/IPTS32816_HB1A_exp1034/.DS_Store
Binary file not shown.
38 changes: 38 additions & 0 deletions scripts/IPTS32816_HB1A_exp1034/FeSn_film_HB1A.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import matplotlib.pyplot as plt

from tavi.data.scan import Scan
from tavi.instrument.resolution.cooper_nathans import CN
from tavi.plotter import Plot1D
from tavi.sample.xtal import Xtal

instrument_config_json_path = "./scripts/IPTS32816_HB1A_exp1034/hb1a.json"
tas = CN(SPICE_CONVENTION=True)
tas.load_instrument_params_from_json(instrument_config_json_path)

sample_json_path = "./scripts/IPTS32816_HB1A_exp1034/fesn.json"
sample = Xtal.from_json(sample_json_path)
tas.mount_sample(sample)

ei = 14.4503
ef = 14.4503
hkl = (0, 0, 0)
R0 = False


path_to_spice_folder = "./scripts/IPTS32816_HB1A_exp1034/exp1034/"
scan35 = Scan.from_spice(path_to_spice_folder, scan_num=35)
fesn000p5_lscan = scan35.get_data(norm_to=(120, "mcu"))

p2 = Plot1D()
p2.add_scan(fesn000p5_lscan, fmt="o")
fig, ax = plt.subplots()
p2.plot(ax)

scan60 = Scan.from_spice(path_to_spice_folder, scan_num=50)
substrate006_lscan = scan60.get_data(norm_to=(1, "mcu"))

p1 = Plot1D()
p1.add_scan(substrate006_lscan, fmt="o")
fig, ax = plt.subplots()
p1.plot(ax)
plt.show()
Binary file not shown.
Binary file not shown.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[UBMode]
Mode=1

[Data]
ScatteringPlaneVectors="1.000000,1.000000,0.000000,0.000000,0.000000,1.000000"
Peak1="0.000000,0.000000,6.000000,-66.618652,-33.486055,2.498500,0.000500,14.450292,14.466363"
LatticeParams="4.760000,4.760000,12.990667,90.000000,90.000000,120.000000"
Energy=14.450292

[Matrices]
UBMatrix="-0.004551,0.006024,0.076905,-0.210082,-0.210084,0.000270,0.121211,-0.121143,0.003356"
UBInverse="-0.171364,-2.379949,4.118747,0.188043,-2.380021,-4.117977,12.978238,0.045568,0.566301"
BMatrix="0.242584,0.121292,-0.000000,0.000000,0.210084,-0.000000,0.000000,0.000000,0.076978"

[AngleMode]
Mode=0
PlaneNormal="-0.043593,0.000009,0.999049"
InPlaneRef="-0.000000,-1.000000,0.000009"
UpperArc=0.000500
LowerArc=2.498500
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[UBMode]
Mode=1

[Data]
ScatteringPlaneVectors="1.000000,1.000000,0.000000,0.000000,0.000000,1.000000"
Peak1="1.000000,1.000000,0.000000,-59.980586,-29.990293,0.000000,0.000000,14.450292,14.450292"
LatticeParams="4.760000,4.760000,12.990000,90.000000,90.000000,120.000000"
Energy=14.450292

[Matrices]
UBMatrix="0.210084,0.210084,-0.000000,-0.000000,-0.000000,0.076982,0.121292,-0.121292,0.000000"
UBInverse="2.380000,0.000000,4.122281,2.380000,0.000000,-4.122281,0.000000,12.990000,0.000000"
BMatrix="0.242584,0.121292,-0.000000,0.000000,0.210084,-0.000000,0.000000,0.000000,0.076982"

[AngleMode]
Mode=0
PlaneNormal="0.000000,0.000000,1.000000"
InPlaneRef="-0.000000,-1.000000,0.000000"
UpperArc=0.000000
LowerArc=0.000000
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[UBMode]
Mode=1

[Data]
ScatteringPlaneVectors="1.000000,1.000000,0.000000,0.000000,0.000000,1.000000"
Peak1="0.000000,0.000000,6.000000,-66.618652,-33.486055,2.498500,0.000500,14.450292,14.466363"
LatticeParams="4.755618,4.755618,12.990667,90.000000,90.000000,120.000000"
Energy=14.450292

[Matrices]
UBMatrix="-0.004556,0.006029,0.076905,-0.210275,-0.210277,0.000270,0.121322,-0.121254,0.003356"
UBInverse="-0.171206,-2.377758,4.114955,0.187870,-2.377830,-4.114187,12.978238,0.045568,0.566301"
BMatrix="0.242808,0.121404,-0.000000,0.000000,0.210278,-0.000000,0.000000,0.000000,0.076978"

[AngleMode]
Mode=0
PlaneNormal="-0.043593,0.000009,0.999049"
InPlaneRef="-0.000000,-1.000000,0.000009"
UpperArc=0.000500
LowerArc=2.498500
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[UBMode]
Mode=2

[Data]
Peak1="0.000000,0.000000,6.000000,-66.618652,-33.486055,2.498500,0.498000,14.450292,14.466363"
Peak2="1.000000,1.000000,0.000000,-60.004759,59.941035,2.498500,0.498500,14.450292,14.449953"
LatticeParams="4.755618,4.755618,12.990667,90.000000,90.000000,120.000000"
Energy=14.450292

[Matrices]
UBMatrix="-0.004556,0.006029,0.076905,-0.209213,-0.211323,0.000299,0.123145,-0.119422,0.003353"
UBInverse="-0.171207,-2.341903,4.135466,0.187869,-2.413499,-4.093364,12.978238,0.050484,0.565884"
BMatrix="0.242808,0.121404,-0.000000,0.000000,0.210278,-0.000000,0.000000,0.000000,0.076978"

[AngleMode]
Mode=0
PlaneNormal="-0.043593,0.008692,0.999008"
InPlaneRef="0.999043,0.003886,0.043561"
UpperArc=0.498500
LowerArc=2.498502
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[UBMode]
Mode=2

[Data]
Peak1="0.000000,0.000000,6.000000,-66.618652,-33.467100,2.498500,0.498000,14.450292,14.466363"
Peak2="1.000000,1.000000,0.000000,-60.004759,59.941035,2.498500,0.498500,14.450292,14.449953"
LatticeParams="4.755618,4.755618,12.990667,90.000000,90.000000,120.000000"
Energy=14.450292

[Matrices]
UBMatrix="-0.004625,0.005960,0.076905,-0.209213,-0.211324,0.000274,0.123142,-0.119425,0.003353"
UBInverse="-0.171993,-2.341906,4.135432,0.187083,-2.413502,-4.093398,12.978252,0.046186,0.565922"
BMatrix="0.242808,0.121404,-0.000000,0.000000,0.210278,-0.000000,0.000000,0.000000,0.076978"

[AngleMode]
Mode=0
PlaneNormal="-0.043593,0.008692,0.999009"
InPlaneRef="0.999044,0.003555,0.043564"
UpperArc=0.498500
LowerArc=2.498502
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[UBMode]
Mode=2

[Data]
Peak1="0.000000,0.000000,6.000000,-66.618652,-33.467100,2.498500,0.498000,14.450292,14.466363"
Peak2="1.000000,1.000000,0.000000,-60.004759,59.941035,2.498500,0.498500,14.450292,14.449953"
LatticeParams="4.765809,4.765809,12.990667,90.000000,90.000000,120.000000"
Energy=14.450292

[Matrices]
UBMatrix="-0.004615,0.005947,0.076905,-0.208766,-0.210872,0.000274,0.122879,-0.119170,0.003353"
UBInverse="-0.172362,-2.346924,4.144294,0.187484,-2.418674,-4.102170,12.978252,0.046186,0.565922"
BMatrix="0.242288,0.121144,-0.000000,0.000000,0.209828,-0.000000,0.000000,0.000000,0.076978"

[AngleMode]
Mode=0
PlaneNormal="-0.043593,0.008692,0.999009"
InPlaneRef="0.999044,0.003555,0.043564"
UpperArc=0.498500
LowerArc=2.498502
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[UBMode]
Mode=2

[Data]
Peak1="0.000000,0.000000,6.000000,-66.618652,-33.467100,2.498500,0.498000,14.450292,14.466363"
Peak2="1.000000,1.000000,0.000000,-59.924000,59.938145,2.498500,0.498500,14.450292,14.449996"
LatticeParams="4.765809,4.765809,12.990667,90.000000,90.000000,120.000000"
Energy=14.450292

[Matrices]
UBMatrix="-0.004615,0.005947,0.076905,-0.208766,-0.210872,0.000274,0.122879,-0.119170,0.003353"
UBInverse="-0.172362,-2.346924,4.144294,0.187484,-2.418674,-4.102170,12.978252,0.046186,0.565922"
BMatrix="0.242288,0.121144,-0.000000,0.000000,0.209828,-0.000000,0.000000,0.000000,0.076978"

[AngleMode]
Mode=0
PlaneNormal="-0.043593,0.008692,0.999011"
InPlaneRef="0.999044,0.003555,0.043564"
UpperArc=0.498500
LowerArc=2.498502
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[UBMode]
Mode=2

[Data]
Peak1="0.000000,0.000000,6.000000,-66.618652,-33.467100,2.498500,0.498000,14.450292,14.466363"
Peak2="1.000000,1.000000,0.000000,-59.924000,59.938145,2.498500,0.498500,14.450292,14.449996"
LatticeParams="4.764077,4.764077,12.990667,90.000000,90.000000,120.000000"
Energy=14.450292

[Matrices]
UBMatrix="-0.004617,0.005949,0.076905,-0.208842,-0.210948,0.000274,0.122924,-0.119213,0.003353"
UBInverse="-0.172299,-2.346072,4.142788,0.187416,-2.417795,-4.100679,12.978252,0.046186,0.565922"
BMatrix="0.242377,0.121188,-0.000000,0.000000,0.209904,-0.000000,0.000000,0.000000,0.076978"

[AngleMode]
Mode=0
PlaneNormal="-0.043593,0.008692,0.999011"
InPlaneRef="0.999044,0.003555,0.043564"
UpperArc=0.498500
LowerArc=2.498502
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[UBMode]
Mode=2

[Data]
Peak1="0.000000,0.000000,6.000000,-66.618652,-33.467100,2.498500,0.498000,14.450292,14.466363"
Peak2="1.000000,1.000000,0.000000,-59.924000,59.938145,2.498500,0.498500,14.450292,14.449996"
LatticeParams="4.764077,4.764077,12.990667,90.000000,90.000000,120.000000"
Energy=14.450292

[Matrices]
UBMatrix="-0.004617,0.005949,0.076905,-0.208842,-0.210948,0.000274,0.122924,-0.119213,0.003353"
UBInverse="-0.172299,-2.346072,4.142788,0.187416,-2.417795,-4.100679,12.978252,0.046186,0.565922"
BMatrix="0.242377,0.121188,-0.000000,0.000000,0.209904,-0.000000,0.000000,0.000000,0.076978"

[AngleMode]
Mode=0
PlaneNormal="-0.043593,0.008692,0.999011"
InPlaneRef="0.999044,0.003555,0.043564"
UpperArc=0.498500
LowerArc=2.498502
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[UBMode]
Mode=2

[Data]
Peak1="0.000000,0.000000,6.000000,-66.618652,-33.467100,2.498500,0.498000,14.450292,14.466363"
Peak2="1.000000,1.000000,0.000000,-59.924000,59.938145,2.498500,0.498500,14.450292,14.449996"
LatticeParams="4.764077,4.764077,12.990667,90.000000,90.000000,120.000000"
Energy=14.450292

[Matrices]
UBMatrix="-0.004617,0.005949,0.076905,-0.208842,-0.210948,0.000274,0.122924,-0.119213,0.003353"
UBInverse="-0.172299,-2.346072,4.142788,0.187416,-2.417795,-4.100679,12.978252,0.046186,0.565922"
BMatrix="0.242377,0.121188,-0.000000,0.000000,0.209904,-0.000000,0.000000,0.000000,0.076978"

[AngleMode]
Mode=0
PlaneNormal="-0.043593,0.008692,0.999011"
InPlaneRef="0.999044,0.003555,0.043564"
UpperArc=0.498500
LowerArc=2.498502
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[UBMode]
Mode=2

[Data]
Peak1="0.000000,0.000000,6.000000,-66.618652,-33.467100,2.498500,0.498000,14.450292,14.466363"
Peak2="1.000000,1.000000,0.000000,-59.924000,59.938145,2.498500,0.498500,14.450292,14.449996"
LatticeParams="4.767975,4.767975,12.990667,90.000000,90.000000,120.000000"
Energy=14.450292

[Matrices]
UBMatrix="-0.004613,0.005944,0.076905,-0.208671,-0.210776,0.000274,0.122823,-0.119116,0.003353"
UBInverse="-0.172440,-2.347991,4.146177,0.187570,-2.419774,-4.104034,12.978252,0.046186,0.565922"
BMatrix="0.242178,0.121089,-0.000000,0.000000,0.209733,-0.000000,0.000000,0.000000,0.076978"

[AngleMode]
Mode=0
PlaneNormal="-0.043593,0.008692,0.999011"
InPlaneRef="0.999044,0.003555,0.043564"
UpperArc=0.498500
LowerArc=2.498502
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[UBMode]
Mode=2

[Data]
Peak1="0.000000,0.000000,6.000000,-66.618652,-33.467100,2.498500,0.498000,14.450292,14.466363"
Peak2="1.000000,1.000000,0.000000,-59.870000,59.938145,2.498500,0.498500,14.450292,14.449996"
LatticeParams="4.767975,4.767975,12.990667,90.000000,90.000000,120.000000"
Energy=14.450292

[Matrices]
UBMatrix="-0.004613,0.005944,0.076905,-0.208671,-0.210776,0.000274,0.122823,-0.119116,0.003353"
UBInverse="-0.172440,-2.347991,4.146177,0.187570,-2.419774,-4.104034,12.978252,0.046186,0.565922"
BMatrix="0.242178,0.121089,-0.000000,0.000000,0.209733,-0.000000,0.000000,0.000000,0.076978"

[AngleMode]
Mode=0
PlaneNormal="-0.043593,0.008692,0.999011"
InPlaneRef="0.999044,0.003555,0.043564"
UpperArc=0.498500
LowerArc=2.498502
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[UBMode]
Mode=2

[Data]
Peak1="0.000000,0.000000,6.000000,-66.618652,-33.467100,2.498500,0.498000,14.450292,14.466363"
Peak2="1.000000,1.000000,0.000000,-59.870000,59.938145,2.498500,0.498500,14.450292,14.449996"
LatticeParams="4.769421,4.769421,12.990667,90.000000,90.000000,120.000000"
Energy=14.450292

[Matrices]
UBMatrix="-0.004612,0.005942,0.076905,-0.208608,-0.210712,0.000274,0.122786,-0.119080,0.003353"
UBInverse="-0.172492,-2.348703,4.147435,0.187626,-2.420507,-4.105279,12.978252,0.046186,0.565922"
BMatrix="0.242105,0.121052,-0.000000,0.000000,0.209669,-0.000000,0.000000,0.000000,0.076978"

[AngleMode]
Mode=0
PlaneNormal="-0.043593,0.008692,0.999011"
InPlaneRef="0.999044,0.003555,0.043564"
UpperArc=0.498500
LowerArc=2.498502
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[UBMode]
Mode=2

[Data]
Peak1="0.000000,0.000000,6.000000,-66.618652,-33.467100,2.498500,0.498000,14.450292,14.466363"
Peak2="1.000000,1.000000,0.000000,-59.850000,59.938145,2.498500,0.498500,14.450292,14.449996"
LatticeParams="4.769421,4.769421,12.990667,90.000000,90.000000,120.000000"
Energy=14.450292

[Matrices]
UBMatrix="-0.004612,0.005942,0.076905,-0.208608,-0.210712,0.000274,0.122786,-0.119080,0.003353"
UBInverse="-0.172492,-2.348703,4.147435,0.187626,-2.420507,-4.105279,12.978252,0.046186,0.565922"
BMatrix="0.242105,0.121052,-0.000000,0.000000,0.209669,-0.000000,0.000000,0.000000,0.076978"

[AngleMode]
Mode=0
PlaneNormal="-0.043593,0.008692,0.999011"
InPlaneRef="0.999044,0.003555,0.043564"
UpperArc=0.498500
LowerArc=2.498502
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[UBMode]
Mode=2

[Data]
Peak1="0.000000,0.000000,6.000000,-66.618652,-33.467100,2.498500,0.498000,14.450292,14.466363"
Peak2="1.000000,1.000000,0.000000,-59.850000,59.938145,2.498500,0.498500,14.450292,14.449996"
LatticeParams="4.773040,4.773040,12.990667,90.000000,90.000000,120.000000"
Energy=14.450292

[Matrices]
UBMatrix="-0.004608,0.005938,0.076905,-0.208449,-0.210552,0.000274,0.122693,-0.118989,0.003353"
UBInverse="-0.172623,-2.350485,4.150582,0.187769,-2.422344,-4.108394,12.978252,0.046186,0.565922"
BMatrix="0.241921,0.120961,-0.000000,0.000000,0.209510,-0.000000,0.000000,0.000000,0.076978"

[AngleMode]
Mode=0
PlaneNormal="-0.043593,0.008692,0.999011"
InPlaneRef="0.999044,0.003555,0.043564"
UpperArc=0.498500
LowerArc=2.498502
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[UBMode]
Mode=2

[Data]
Peak1="0.000000,0.000000,6.000000,-66.618652,-33.467100,2.498500,0.498000,14.450292,14.466363"
Peak2="1.000000,1.000000,0.000000,-59.800000,59.938145,2.498500,0.498500,14.450292,14.449996"
LatticeParams="4.773040,4.773040,12.990667,90.000000,90.000000,120.000000"
Energy=14.450292

[Matrices]
UBMatrix="-0.004608,0.005938,0.076905,-0.208449,-0.210552,0.000274,0.122693,-0.118989,0.003353"
UBInverse="-0.172623,-2.350485,4.150582,0.187769,-2.422344,-4.108394,12.978252,0.046186,0.565922"
BMatrix="0.241921,0.120961,-0.000000,0.000000,0.209510,-0.000000,0.000000,0.000000,0.076978"

[AngleMode]
Mode=0
PlaneNormal="-0.043593,0.008692,0.999011"
InPlaneRef="0.999044,0.003555,0.043564"
UpperArc=0.498500
LowerArc=2.498502
Loading

0 comments on commit d5f8bc2

Please sign in to comment.