Skip to content

Commit 9c31cbd

Browse files
committed
start at synthetic data generation
use method file, mass spec class. - create new referenceMaterial class
1 parent d6f385d commit 9c31cbd

File tree

10 files changed

+383
-11
lines changed

10 files changed

+383
-11
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.DS_Store
22
*.asv
33
*.m~
4+
CollectorRelativeEfficiencies/.DS_Store

BaselineTiming/BaselineTiming_v1.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
R = 1E11; % resistor size
77
amplifierNoiseVariance = 4*kB*T*R; %Johnson-Nyquist noise
88

9-
cpsPerVolt = 6.24150934*10^18/R; % elementary charge, Ohm's Law
9+
cpsPerVolt = 6.241509074460763e+18 / R; % elementary charge, Ohm's Law
1010

1111
ttotal = 100; % seconds
1212
tints = 1000; % total time integrations

CollectorRelativeEfficiencies/src/faradayRelativeEfficiency.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55

66
%% 1. input a filename from data folder
77

8-
%dataFolder = "Sm/SmKU1A-A2.RAW";
8+
dataFolder = "Sm/SmKU1A-A2.RAW";
99
%dataFolder = "Sm/SmEfficiency_Bead3Run3.RAW";
10-
%dataFolder = "Pb/21042022 NBS 982 cup efficiency.RAW"; not yet
11-
dataFolder = "Pb/A520_Pb.RAW";
10+
%dataFolder = "Pb/21042022 NBS 982 cup efficiency.RAW";
11+
%dataFolder = "Pb/A520_Pb.RAW";
1212
%dataFolder = "Pb/B195.RAW";
1313

1414
%% 2. parse the data file

CollectorRelativeEfficiencies/src/processMethod.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
seqString = string(method.onpeaks(iSeq).Info(13).Value);
3333
seqAssign = split(seqString, ",");
3434
seqAssign = split(seqAssign, ":");
35+
if size(seqAssign,2) == 1, seqAssign = seqAssign'; end %if one mass
3536

3637
% detectors names are concatenated with sequence name, eg "H3S1"
3738
activeCollectors = extractBefore(seqAssign(:,2), seqName)';
@@ -96,11 +97,10 @@
9697
warning('off', 'MATLAB:rankDeficientMatrix') % suppress warning
9798
collectorDeltasFromAxPos = (massDiffMatrix\massDiffVector)';
9899
warning('on', 'all'); % restore warning
99-
collectorDeltas = [collectorDeltasFromAxPos(1:AxialPositionDetectorIndex-1) ...
100+
detectorDeltas = [collectorDeltasFromAxPos(1:AxialPositionDetectorIndex-1) ...
100101
0 collectorDeltasFromAxPos(AxialPositionDetectorIndex:end)];
101102

102103

103-
104104
% create a F_ind matrix for further data reduction
105105
% first, find unique MassIDs (stings, label for unique isotopes)
106106
OPTableStack = stack(OPTable, FaraNames);
@@ -133,19 +133,19 @@
133133

134134
AxMass = double(string(method.baselines(iBL).Info(4).Value)) + ...
135135
double(string(method.baselines(iBL).Info(10).Value));
136-
BLTable{iBL,FaraNames} = AxMass + collectorDeltas;
136+
BLTable{iBL,FaraNames} = AxMass + detectorDeltas;
137137

138138
end % for iBL
139139

140140
end
141141

142-
142+
% save
143143
method.OPTable = OPTable;
144144
method.OPMasses = OPMasses;
145145
method.F_ind = F_ind;
146146
method.BLTable = BLTable;
147147
method.MassIDs = MassIDs;
148-
method.collectorDeltas = collectorDeltas;
148+
method.detectorDeltas = detectorDeltas;
149149

150150
end % function processMethod
151151

PeakShapes/beamShapeCollectorWidth.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
%filename = "HY30ZK z10 Pb-1004-PKC-205Pb-PM-S2B7C1.txt";
88
%filename = "HY30ZK z10 Pb-1004-PKC-207Pb-PM-S4B8C1.TXT";
99
%filename = "6NHCl dpblank-210204A-169-PKC-208Pb-PM-S5B2C1.txt";
10-
filename = "NBS987 StaticAxH1H2 Bead1Run1-393-PKC-86Sr-Ax-S1B8C1.txt";
10+
%filename = "NBS987 StaticAxH1H2 Bead1Run1-393-PKC-86Sr-Ax-S1B8C1.txt";
1111
%filename = "Ryan-PKC-270UO-PM-Peak.TXT";
12+
filename = "A519_Pb-2531-PKC-208Pb-H2-S3B6C1.TXT";
1213
data = dataModel(filename);
1314

1415
%%
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
Timestamp, 2021-12-27 1:26:18 PM
2+
Collector, High2
3+
Mass ID, 208Pb
4+
Initial Mass, 206.0417
5+
Peak Centre Mass,206.0460
6+
Method, PeakScanning
7+
PDT, 0.0010
8+
Baseline, -0.000098
9+
DetThreshold, 0.000465
10+
DeltaMass, 0.618125
11+
IntegPeriod, ms100
12+
13+
Mass, Intensity
14+
205.42359, -0.00034014
15+
205.43719, 0.00063939
16+
205.45079, -0.00026551
17+
205.46439, 0.00003861
18+
205.47798, 0.00060353
19+
205.49158, 0.00071895
20+
205.50518, 0.00040352
21+
205.51878, 0.00047866
22+
205.53238, 0.00061341
23+
205.54598, 0.00013565
24+
205.55958, 0.00030309
25+
205.57318, -0.00017032
26+
205.58677, 0.00048666
27+
205.60037, 0.00001971
28+
205.61397, 0.00014401
29+
205.62757, 0.00046869
30+
205.64117, 0.00055460
31+
205.65477, 0.00007642
32+
205.66837, 0.00008908
33+
205.68197, 0.00045044
34+
205.69556, 0.00059677
35+
205.70916, 0.00072478
36+
205.72276, 0.00013717
37+
205.73636, 0.00049211
38+
205.74996, 0.00051202
39+
205.76356, 0.00054887
40+
205.77716, 0.00097283
41+
205.79076, 0.00964054
42+
205.80435, 0.07849303
43+
205.81795, 0.36572604
44+
205.83155, 1.12340222
45+
205.84515, 3.40752727
46+
205.85875, 8.17217257
47+
205.87235, 16.98035129
48+
205.88595, 25.34956280
49+
205.89955, 33.82899095
50+
205.91314, 40.94078432
51+
205.92674, 45.19383785
52+
205.94034, 46.52775023
53+
205.95394, 46.72123009
54+
205.96754, 46.74474255
55+
205.98114, 46.74228797
56+
205.99474, 46.73332508
57+
206.00834, 46.73048193
58+
206.02193, 46.72413493
59+
206.03553, 46.71793844
60+
206.04913, 46.72488407
61+
206.06273, 46.71721061
62+
206.07633, 46.70845636
63+
206.08993, 46.70581353
64+
206.10353, 46.70086017
65+
206.11713, 46.68048426
66+
206.13072, 46.59098895
67+
206.14432, 46.33385257
68+
206.15792, 45.62379042
69+
206.17152, 43.26348050
70+
206.18512, 37.02508477
71+
206.19872, 29.92276465
72+
206.21232, 22.29205535
73+
206.22592, 13.67145029
74+
206.23951, 6.41862498
75+
206.25311, 1.76478397
76+
206.26671, 0.27310877
77+
206.28031, 0.02432764
78+
206.29391, 0.00209995
79+
206.30751, 0.00066776
80+
206.32111, 0.00017804
81+
206.33471, 0.00093135
82+
206.34830, -0.00007227
83+
206.36190, -0.00007957
84+
206.37550, 0.00063105
85+
206.38910, 0.00042428
86+
206.40270, 0.00042301
87+
206.41630, -0.00028795
88+
206.42990, 0.00032857
89+
206.44350, -0.00060484
90+
206.45709, 0.00049129
91+
206.47069, -0.00034172
92+
206.48429, 0.00008737
93+
206.49789, 0.00057102
94+
206.51149, 0.00047915
95+
206.52509, 0.00014548
96+
206.53869, -0.00035668
97+
206.55229, 0.00056787
98+
206.56588, -0.00011574
99+
206.57948, -0.00000788
100+
206.59308, 0.00028348
101+
206.60668, 0.00009677
102+
206.62028, 0.00048249
103+
206.63388, -0.00000656
104+
206.64748, 0.00014883
105+
206.65984, 0.00052031

PeakShapes/massSpecModel.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
case "PhoenixKansas_1e12"
2828
%massSpec.collectorWidthMM = 0.95135;
29-
massSpec.collectorWidthMM = 0.87;
29+
massSpec.collectorWidthMM = 0.855;
3030
massSpec.theoreticalBeamWidthMM = 0.35;
3131
massSpec.effectiveRadiusMagnetMM = 540;
3232
massSpec.faradayNames = ["L5", "L4", "L3", "L2", "Ax", "H1", "H2", "H3", "H4"];
Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
<?xml version="1.0" standalone="yes"?>
2+
<ANALYSIS_METHOD>
3+
<HEADER>
4+
<Filename>Pb 4-5-6-7-8 Daly 10-5-5-5-2 sec.TIMSAM</Filename>
5+
<DateModified>10/11/2022 11:00:16</DateModified>
6+
<DateCreated>10/11/2022 11:00:16</DateCreated>
7+
<CreatedBy>User1</CreatedBy>
8+
<ModifiedBy>User2</ModifiedBy>
9+
</HEADER>
10+
<SETTINGS>
11+
<IntersperseBaselines>False</IntersperseBaselines>
12+
<BaselineFrequency>EveryBlock</BaselineFrequency>
13+
<PKCCycleInterval>0</PKCCycleInterval>
14+
<TotalBlocks>100</TotalBlocks>
15+
<TotalCycles>10</TotalCycles>
16+
<CalculateRatios>True</CalculateRatios>
17+
<InitialBLMagnetDelay>3000</InitialBLMagnetDelay>
18+
<DeflectBeamProtection>False</DeflectBeamProtection>
19+
<PerformBeamInterpCycles>True</PerformBeamInterpCycles>
20+
<PerformInterBlocks>True</PerformInterBlocks>
21+
<AxialColl>PhotoMultiplier</AxialColl>
22+
<ActiveSEMCollectors />
23+
<MagnetFlybackSettleTime>1000</MagnetFlybackSettleTime>
24+
<CorrectForBaselines>True</CorrectForBaselines>
25+
<CorrectForDeadtimes>True</CorrectForDeadtimes>
26+
<IsoWorks_Method>Pb-4-5-6-7-8 Daly 10-5-5-5-2 sec</IsoWorks_Method>
27+
<Rejection_Sigma>10</Rejection_Sigma>
28+
<Rejection_Percentage>0</Rejection_Percentage>
29+
<ActiveSubChannel>PrimaryA</ActiveSubChannel>
30+
<ProcessingUnits>CPS</ProcessingUnits>
31+
<TFE_Enabled>False</TFE_Enabled>
32+
<TFE_MonitorPeak>205Pb:PMS2</TFE_MonitorPeak>
33+
<TFE_IntensityThreshold>0.1</TFE_IntensityThreshold>
34+
<TFE_IntervalPeakCentring>False</TFE_IntervalPeakCentring>
35+
<TFE_PeakCentringInterval>01:00</TFE_PeakCentringInterval>
36+
<TFE_PeakCentringMonitorThreshold>0.5</TFE_PeakCentringMonitorThreshold>
37+
<Export_IsotopePoints>True</Export_IsotopePoints>
38+
<Export_ASCFile>None</Export_ASCFile>
39+
<Export_ASCOptions>SingleCollector</Export_ASCOptions>
40+
<Export_ASCActiveColl>Axial</Export_ASCActiveColl>
41+
<Export_TXTEveryCYCLE>True</Export_TXTEveryCYCLE>
42+
<Export_TripoliLiveData>True</Export_TripoliLiveData>
43+
</SETTINGS>
44+
<BASELINE>
45+
<Sequence>1</Sequence>
46+
<Enabled>True</Enabled>
47+
<MassID>BL1</MassID>
48+
<AxMass>204.500</AxMass>
49+
<IntegPeriod>ms100</IntegPeriod>
50+
<IntegTime>30.0</IntegTime>
51+
<PKCParentID />
52+
<BLReferences>204Pb:PMS1</BLReferences>
53+
<MagnetSettleTime>2000</MagnetSettleTime>
54+
<AxMassOffset>-0.5000</AxMassOffset>
55+
<CurveFit>None</CurveFit>
56+
<TraceColour>SeaGreen</TraceColour>
57+
</BASELINE>
58+
<ONPEAK>
59+
<Sequence>1</Sequence>
60+
<Enabled>True</Enabled>
61+
<MassID>204Pb</MassID>
62+
<MassIDCollector>PhotoMultiplier</MassIDCollector>
63+
<AxMass>204.000</AxMass>
64+
<IntegPeriod>ms100</IntegPeriod>
65+
<IntegTime>10.0</IntegTime>
66+
<PeakCentre>False</PeakCentre>
67+
<PKCCollector>PhotoMultiplier</PKCCollector>
68+
<PKCMethod>None</PKCMethod>
69+
<PKCParentID>205Pb:PMS2</PKCParentID>
70+
<BLReferences>BL1</BLReferences>
71+
<CollectorArray>205Pb:H1S1,206Pb:H2S1,207Pb:H3S1,208Pb:H4S1,204Pb:PMS1</CollectorArray>
72+
<MagnetSettleTime>1500</MagnetSettleTime>
73+
<AxMassOffset>-0.1000</AxMassOffset>
74+
<CurveFit>None</CurveFit>
75+
<TraceColour>Tomato</TraceColour>
76+
</ONPEAK>
77+
<ONPEAK>
78+
<Sequence>2</Sequence>
79+
<Enabled>True</Enabled>
80+
<MassID>205Pb</MassID>
81+
<MassIDCollector>PhotoMultiplier</MassIDCollector>
82+
<AxMass>205.000</AxMass>
83+
<IntegPeriod>ms100</IntegPeriod>
84+
<IntegTime>5.0</IntegTime>
85+
<PeakCentre>True</PeakCentre>
86+
<PKCCollector>PhotoMultiplier</PKCCollector>
87+
<PKCMethod>PeakScanning</PKCMethod>
88+
<PKCParentID />
89+
<BLReferences>BL1</BLReferences>
90+
<CollectorArray>206Pb:H1S2,207Pb:H2S2,208Pb:H3S2,205Pb:PMS2</CollectorArray>
91+
<MagnetSettleTime>1500</MagnetSettleTime>
92+
<AxMassOffset>0.0000</AxMassOffset>
93+
<CurveFit>None</CurveFit>
94+
<TraceColour>Violet</TraceColour>
95+
</ONPEAK>
96+
<ONPEAK>
97+
<Sequence>3</Sequence>
98+
<Enabled>True</Enabled>
99+
<MassID>206Pb</MassID>
100+
<MassIDCollector>PhotoMultiplier</MassIDCollector>
101+
<AxMass>206.000</AxMass>
102+
<IntegPeriod>ms100</IntegPeriod>
103+
<IntegTime>5.0</IntegTime>
104+
<PeakCentre>True</PeakCentre>
105+
<PKCCollector>PhotoMultiplier</PKCCollector>
106+
<PKCMethod>PeakScanning</PKCMethod>
107+
<PKCParentID />
108+
<BLReferences>BL1</BLReferences>
109+
<CollectorArray>207Pb:H1S3,208Pb:H2S3,206Pb:PMS3</CollectorArray>
110+
<MagnetSettleTime>1500</MagnetSettleTime>
111+
<AxMassOffset>0.0000</AxMassOffset>
112+
<CurveFit>None</CurveFit>
113+
<TraceColour>YellowGreen</TraceColour>
114+
</ONPEAK>
115+
<ONPEAK>
116+
<Sequence>4</Sequence>
117+
<Enabled>True</Enabled>
118+
<MassID>207Pb</MassID>
119+
<MassIDCollector>PhotoMultiplier</MassIDCollector>
120+
<AxMass>207.000</AxMass>
121+
<IntegPeriod>ms100</IntegPeriod>
122+
<IntegTime>5.0</IntegTime>
123+
<PeakCentre>True</PeakCentre>
124+
<PKCCollector>PhotoMultiplier</PKCCollector>
125+
<PKCMethod>PeakScanning</PKCMethod>
126+
<PKCParentID />
127+
<BLReferences>BL1</BLReferences>
128+
<CollectorArray>208Pb:H1S4,207Pb:PMS4</CollectorArray>
129+
<MagnetSettleTime>1500</MagnetSettleTime>
130+
<AxMassOffset>0.0000</AxMassOffset>
131+
<CurveFit>None</CurveFit>
132+
<TraceColour>Black</TraceColour>
133+
</ONPEAK>
134+
<ONPEAK>
135+
<Sequence>5</Sequence>
136+
<Enabled>True</Enabled>
137+
<MassID>208Pb</MassID>
138+
<MassIDCollector>PhotoMultiplier</MassIDCollector>
139+
<AxMass>208.000</AxMass>
140+
<IntegPeriod>ms100</IntegPeriod>
141+
<IntegTime>2.0</IntegTime>
142+
<PeakCentre>True</PeakCentre>
143+
<PKCCollector>PhotoMultiplier</PKCCollector>
144+
<PKCMethod>PeakScanning</PKCMethod>
145+
<PKCParentID />
146+
<BLReferences>BL1</BLReferences>
147+
<CollectorArray>208Pb:PMS5</CollectorArray>
148+
<MagnetSettleTime>1500</MagnetSettleTime>
149+
<AxMassOffset>0.0000</AxMassOffset>
150+
<CurveFit>None</CurveFit>
151+
<TraceColour>LightSeaGreen</TraceColour>
152+
</ONPEAK>
153+
<EQUILIBRATION>
154+
<Enabled>False</Enabled>
155+
<Collector>Axial</Collector>
156+
<AxMass>40.000</AxMass>
157+
<MassID>Ar40</MassID>
158+
<Duration>30</Duration>
159+
<IntegPeriod>ms1000</IntegPeriod>
160+
<StoreToDB>False</StoreToDB>
161+
</EQUILIBRATION>
162+
</ANALYSIS_METHOD>

SyntheticData/src/makeSyntheticData.m

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
%% make synthetic .txt data file for a Phoenix TIMS
2+
% use real method files parsed by FaradayRelativeEfficiency codes
3+
% use a mass spectrometer model from PeakShapes class definition
4+
% add an ion beam intensity time-series
5+
% output: .TXT file in syndata subfolder
6+
%
7+
% created by Noah McLean for Tripoli and FaradayRelativeEfficiencies on 28-Feb-2023
8+
9+
%% 1. Setup
10+
11+
% add TIMSLAB to path to use its functions/classes
12+
addpath(genpath("../../../TIMSLAB"));
13+
massSpec = massSpecModel("PhoenixKansas_1e12");
14+
15+
refmat = referenceMaterial("NBS981");
16+
methodName = "Pb 4-5-6-7-8 Daly 10-5-5-5-2 sec.TIMSAM";
17+
nBlocks = 10;
18+
intensityFunction = @(t) 1e6; % cps of major isotope
19+
%intensityFunction = @(ampl, freq, minInt, t) ampl*(ceil(freq*t)-freq*t)+minInt; % sawtooth
20+
21+
% isotopic fractionation for Faradays and Ion Counters
22+
betaFaraday = -0.2; % 0.10%/amu at Pb mass
23+
betaDaly = -0.3; % 0.15%/amu at Pb mass
24+
% using (a/b)meas = (a/b)true*(Ma/Mb)^beta
25+
26+
% collector relative efficiencies
27+
% L5 L4 L3 L2 Ax IC H1 H2 H3 H4
28+
CREtrue = [1 1 1 1 1 0.9 1 1 1 1];
29+
30+
method = parseTIMSAM(methodName);
31+
CollNames = ["L5", "L4", "L3", "L2", "Ax", "PM", "H1", "H2", "H3", "H4"];
32+
method = processMethod(method, CollNames);
33+
34+
%% 2.

0 commit comments

Comments
 (0)