ararpy 0.1.199__py3-none-any.whl → 0.2.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. ararpy/Example - Check arr.py +52 -0
  2. ararpy/Example - Granite Cooling History.py +411 -0
  3. ararpy/Example - Plot temperature calibration.py +291 -0
  4. ararpy/Example - Show MDD results.py +561 -0
  5. ararpy/Example - Show all Kfs age spectra.py +344 -0
  6. ararpy/Example - Show random walk results.py +363 -0
  7. ararpy/Example - Tc calculation.py +437 -0
  8. ararpy/__init__.py +3 -4
  9. ararpy/calc/age.py +34 -36
  10. ararpy/calc/arr.py +0 -20
  11. ararpy/calc/basic.py +26 -3
  12. ararpy/calc/corr.py +131 -85
  13. ararpy/calc/jvalue.py +7 -5
  14. ararpy/calc/plot.py +1 -2
  15. ararpy/calc/raw_funcs.py +41 -2
  16. ararpy/calc/regression.py +224 -132
  17. ararpy/files/arr_file.py +2 -1
  18. ararpy/files/basic.py +0 -22
  19. ararpy/files/calc_file.py +107 -84
  20. ararpy/files/raw_file.py +242 -229
  21. ararpy/smp/basic.py +133 -34
  22. ararpy/smp/calculation.py +6 -6
  23. ararpy/smp/corr.py +339 -153
  24. ararpy/smp/diffusion_funcs.py +345 -36
  25. ararpy/smp/export.py +247 -129
  26. ararpy/smp/info.py +2 -2
  27. ararpy/smp/initial.py +93 -45
  28. ararpy/smp/json.py +2 -2
  29. ararpy/smp/plots.py +144 -164
  30. ararpy/smp/raw.py +11 -15
  31. ararpy/smp/sample.py +222 -181
  32. ararpy/smp/style.py +26 -7
  33. ararpy/smp/table.py +42 -33
  34. ararpy/thermo/atomic_level_random_walk.py +56 -48
  35. ararpy/thermo/basic.py +2 -2
  36. {ararpy-0.1.199.dist-info → ararpy-0.2.2.dist-info}/METADATA +10 -1
  37. ararpy-0.2.2.dist-info/RECORD +73 -0
  38. {ararpy-0.1.199.dist-info → ararpy-0.2.2.dist-info}/WHEEL +1 -1
  39. ararpy-0.1.199.dist-info/RECORD +0 -66
  40. {ararpy-0.1.199.dist-info → ararpy-0.2.2.dist-info}/licenses/LICENSE +0 -0
  41. {ararpy-0.1.199.dist-info → ararpy-0.2.2.dist-info}/top_level.txt +0 -0
ararpy/smp/sample.py CHANGED
@@ -22,69 +22,69 @@ from types import MethodType
22
22
  import pandas as pd
23
23
 
24
24
  SAMPLE_INTERCEPT_HEADERS = [
25
- 'Sequence', '', # 0-1
25
+ 'Sequence', '', 'Mark', # 0-2
26
26
  '\u00B3\u2076Ar', '1\u03C3', '\u00B3\u2077Ar', '1\u03C3', # 2-5
27
27
  '\u00B3\u2078Ar', '1\u03C3', '\u00B3\u2079Ar', '1\u03C3', # 6-9
28
28
  '\u2074\u2070Ar', '1\u03C3', # 10-11
29
29
  ]
30
30
  BLANK_INTERCEPT_HEADERS = [
31
- 'Sequence', '', # 0-1
31
+ 'Sequence', '', 'Mark', # 0-2
32
32
  '\u00B3\u2076Ar', '1\u03C3', '\u00B3\u2077Ar', '1\u03C3', # 2-5
33
33
  '\u00B3\u2078Ar', '1\u03C3', '\u00B3\u2079Ar', '1\u03C3', # 6-9
34
34
  '\u2074\u2070Ar', '1\u03C3', # 10-11
35
35
  ]
36
36
  CORRECTED_HEADERS = [
37
- 'Sequence', '', # 0-1
37
+ 'Sequence', '', 'Mark', # 0-2
38
38
  '\u00B3\u2076Ar', '1\u03C3', '\u00B3\u2077Ar', '1\u03C3', # 2-5
39
39
  '\u00B3\u2078Ar', '1\u03C3', '\u00B3\u2079Ar', '1\u03C3', # 6-9
40
40
  '\u2074\u2070Ar', '1\u03C3', # 10-11
41
41
  ]
42
42
  DEGAS_HEADERS = [
43
- 'Sequence', '', # 0-1
44
- '\u00B3\u2076Ar[a]', '1\u03C3', '\u00B3\u2076Ar[c]', '1\u03C3', # 2-5
45
- '\u00B3\u2076Ar[Ca]', '1\u03C3', '\u00B3\u2076Ar[Cl]', '1\u03C3', # 6-9
46
- '\u00B3\u2077Ar[Ca]', '1\u03C3', '\u00B3\u2078Ar[Cl]', '1\u03C3', # 10-13
47
- '\u00B3\u2078Ar[a]', '1\u03C3', '\u00B3\u2078Ar[c]', '1\u03C3', # 14-17
48
- '\u00B3\u2078Ar[K]', '1\u03C3', '\u00B3\u2078Ar[Ca]', '1\u03C3', # 18-21
49
- '\u00B3\u2079Ar[K]', '1\u03C3', '\u00B3\u2079Ar[Ca]', '1\u03C3', # 22-25
50
- '\u2074\u2070Ar[r]', '1\u03C3', '\u2074\u2070Ar[a]', '1\u03C3', # 26-29
51
- '\u2074\u2070Ar[c]', '1\u03C3', '\u2074\u2070Ar[K]', '1\u03C3' # 30-33
43
+ 'Sequence', '', 'Mark', # 0-2
44
+ '\u00B3\u2076Ar[a]', '1\u03C3', '\u00B3\u2076Ar[c]', '1\u03C3', # 3
45
+ '\u00B3\u2076Ar[Ca]', '1\u03C3', '\u00B3\u2076Ar[Cl]', '1\u03C3', # 7
46
+ '\u00B3\u2077Ar[Ca]', '1\u03C3', '\u00B3\u2078Ar[Cl]', '1\u03C3', # 11
47
+ '\u00B3\u2078Ar[a]', '1\u03C3', '\u00B3\u2078Ar[c]', '1\u03C3', # 15
48
+ '\u00B3\u2078Ar[K]', '1\u03C3', '\u00B3\u2078Ar[Ca]', '1\u03C3', # 19
49
+ '\u00B3\u2079Ar[K]', '1\u03C3', '\u00B3\u2079Ar[Ca]', '1\u03C3', # 23
50
+ '\u2074\u2070Ar[r]', '1\u03C3', '\u2074\u2070Ar[a]', '1\u03C3', # 27
51
+ '\u2074\u2070Ar[c]', '1\u03C3', '\u2074\u2070Ar[K]', '1\u03C3' # 31-34
52
52
  ]
53
53
  PUBLISH_TABLE_HEADERS = [
54
- 'Sequence', '', # 0-1
54
+ 'Sequence', '', 'Mark', # 0-2
55
55
  '\u00B3\u2076Ar[a]', '\u00B3\u2077Ar[Ca]', '\u00B3\u2078Ar[Cl]', # 2-4
56
56
  '\u00B3\u2079Ar[K]', '\u2074\u2070Ar[r]', # 5-6
57
57
  'Apparent Age', '1\u03C3', '\u2074\u2070Ar[r]%', '\u00B3\u2079Ar[K]%', # 7-10
58
58
  'Ca/K', '1\u03C3', # 11-12
59
59
  ]
60
60
  PUBLISH_TABLE_HEADERS_AIR = [
61
- 'Sequence', '', # 0-1
61
+ 'Sequence', '', 'Mark', # 0-2
62
62
  '\u00B3\u2076Ar[a]', '\u00B3\u2077Ar[Ca]', '\u00B3\u2078Ar[Cl]', # 2-4
63
63
  '\u00B3\u2079Ar[K]', '\u2074\u2070Ar[r]', # 5-6
64
64
  'MDF', '1\u03C3', '\u2074\u2070Ar[r]%', '\u00B3\u2076Ar%', # 7-10
65
65
  'Ca/K', '1\u03C3', # 11-12
66
66
  ]
67
67
  PUBLISH_TABLE_HEADERS_STD = [
68
- 'Sequence', '', # 0-1
68
+ 'Sequence', '', 'Mark', # 0-2
69
69
  '\u00B3\u2076Ar[a]', '\u00B3\u2077Ar[Ca]', '\u00B3\u2078Ar[Cl]', # 2-4
70
70
  '\u00B3\u2079Ar[K]', '\u2074\u2070Ar[r]', # 5-6
71
71
  'J', '1\u03C3', '\u2074\u2070Ar[r]%', '\u00B3\u2076Ar%', # 7-10
72
72
  'Ca/K', '1\u03C3', # 11-12
73
73
  ]
74
74
  SPECTRUM_TABLE_HEADERS = [
75
- 'Sequence', '', # 0-1
75
+ 'Sequence', '', 'Mark', # 0-2
76
76
  '\u2074\u2070Ar/\u00B3\u2079Ar', '1\u03C3', # 2-3
77
77
  'Apparent Age', '1\u03C3', '1\u03C3', '1\u03C3', # 4-7
78
78
  '\u2074\u2070Ar[r]%', '\u00B3\u2079Ar[K]%', # 8-9
79
79
  ]
80
80
  SPECTRUM_TABLE_HEADERS_AIR = [
81
- 'Sequence', '', # 0-1
81
+ 'Sequence', '', 'Mark', # 0-2
82
82
  '\u2074\u2070Ar/\u00B3\u2076Ar', '1\u03C3', # 2-3
83
83
  'MDF', '1\u03C3', '1\u03C3', '1\u03C3', # 4-7
84
84
  '\u2074\u2070Ar[r]%', '\u00B3\u2076Ar%', # 8-9
85
85
  ]
86
86
  SPECTRUM_TABLE_HEADERS_STD = [
87
- 'Sequence', '', # 0-1
87
+ 'Sequence', '', 'Mark', # 0-2
88
88
  '\u2074\u2070Ar/\u00B3\u2076Ar', '1\u03C3', # 2-3
89
89
  'J', '1\u03C3', '1\u03C3', '1\u03C3', # 4-7
90
90
  '\u2074\u2070Ar[r]%', '\u00B3\u2076Ar%', # 8-9
@@ -107,84 +107,88 @@ ISOCHRON_TABLE_HEADERS = [
107
107
  'r1', 'r2', 'r3', # 39-41
108
108
  ]
109
109
  TOTAL_PARAMS_HEADERS = [
110
- 'Sequence', '', # 0-1
110
+ 'Sequence', '', 'Mark', # 0-2
111
111
  '(\u2074\u2070Ar/\u00B3\u2076Ar)t', '%1\u03C3',
112
- '(\u2074\u2070Ar/\u00B3\u2076Ar)c', '%1\u03C3', # 2-5
112
+ '(\u2074\u2070Ar/\u00B3\u2076Ar)c', '%1\u03C3', # 3-6
113
113
  '(\u00B3\u2078Ar/\u00B3\u2076Ar)t', '%1\u03C3',
114
- '(\u00B3\u2078Ar/\u00B3\u2076Ar)c', '%1\u03C3', # 6-9
114
+ '(\u00B3\u2078Ar/\u00B3\u2076Ar)c', '%1\u03C3', # 7-10
115
115
  '(\u00B3\u2079Ar/\u00B3\u2077Ar)Ca', '%1\u03C3',
116
116
  '(\u00B3\u2078Ar/\u00B3\u2077Ar)Ca', '%1\u03C3',
117
- '(\u00B3\u2076Ar/\u00B3\u2077Ar)Ca', '%1\u03C3', # 10-15
117
+ '(\u00B3\u2076Ar/\u00B3\u2077Ar)Ca', '%1\u03C3', # 11-16
118
118
  '(\u2074\u2070Ar/\u00B3\u2079Ar)K', '%1\u03C3',
119
- '(\u00B3\u2078Ar/\u00B3\u2079Ar)K', '%1\u03C3', # 16-19
120
- '(\u00B3\u2076Ar/\u00B3\u2078Ar)Cl', '%1\u03C3', # 20-21
121
- 'K/Ca', '%1\u03C3', 'K/Cl', '%1\u03C3', 'Ca/Cl', '%1\u03C3', # 22-27
122
- 'Cycle Number', 'Irradiation Cycles', # 28-29
123
- 'Irradiation', 'duration', 'Irradiation Time', 'Experiment Time', # 30-33
124
- 'Storage Years', '', # 34-35
125
- 'Decay Constant \u2074\u2070K', '%1\u03C3', # 36-37
126
- 'Decay Constant \u2074\u2070K(EC)', '%1\u03C3', # 38-39
127
- 'Decay Constant \u2074\u2070K(\u03B2<sup>-</sup>)', '%1\u03C3', # 40-41
128
- 'Decay Constant \u2074\u2070K(\u03B2<sup>+</sup>)', '%1\u03C3', # 42-43
129
- 'Decay Constant \u00B3\u2079Ar', '%1\u03C3', # 44-45
130
- 'Decay Constant \u00B3\u2077Ar', '%1\u03C3', # 46-47
131
- 'Decay Constant \u00B3\u2076Cl', '%1\u03C3', # 48-49
132
- 'Decay Activity \u2074\u2070K', '%1\u03C3', # 50-51
133
- 'Decay Activity \u2074\u2070K(EC)', '%1\u03C3', # 52-53
134
- 'Decay Activity \u2074\u2070K(\u03B2<sup>-</sup>)', '%1\u03C3', # 54-55
135
- 'Decay Activity \u2074\u2070K(\u03B2<sup>+</sup>)', '%1\u03C3', # 56-57
136
- '\u00B3\u2076Cl/\u00B3\u2078Cl Productivity', '%1\u03C3', # 58-59
137
- 'Std Name', 'Std Age', '1\u03C3', '\u2074\u2070Ar%', '1\u03C3', 'K%', '1\u03C3', # 60-66
138
- '\u2074\u2070Ar<sup>*</sup>/K', '1\u03C3', # 67-68
139
- 'J', '%1\u03C3', 'MDF', '%1\u03C3', # 69-72
140
- 'Mass \u00B3\u2076Ar', '%1\u03C3', 'Mass \u00B3\u2077Ar', '%1\u03C3', # 73-76
141
- 'Mass \u00B3\u2078Ar', '%1\u03C3', 'Mass \u00B3\u2079Ar', '%1\u03C3', # 77-80
142
- 'Mass \u2074\u2070', '%1\u03C3', 'K Mass', '%1\u03C3', # 81-84
119
+ '(\u00B3\u2078Ar/\u00B3\u2079Ar)K', '%1\u03C3', # 17-20
120
+ '(\u00B3\u2076Ar/\u00B3\u2078Ar)Cl', '%1\u03C3', # 21-22
121
+ 'K/Ca', '%1\u03C3', 'K/Cl', '%1\u03C3', 'Ca/Cl', '%1\u03C3', # 23-28
122
+ 'Cycle Number', 'Irradiation Cycles', # 29-30
123
+ 'Irradiation', 'duration', 'Irradiation Time', 'Experiment Time', # 31-34
124
+ 'Storage Years', '', # 35-36
125
+ 'Decay Constant \u2074\u2070K', '%1\u03C3', # 37-38
126
+ 'Decay Constant \u2074\u2070K(EC)', '%1\u03C3', # 39-40
127
+ 'Decay Constant \u2074\u2070K(\u03B2<sup>-</sup>)', '%1\u03C3', # 41-42
128
+ 'Decay Constant \u2074\u2070K(\u03B2<sup>+</sup>)', '%1\u03C3', # 43-44
129
+ 'Decay Constant \u00B3\u2079Ar', '%1\u03C3', # 45-46
130
+ 'Decay Constant \u00B3\u2077Ar', '%1\u03C3', # 47-48
131
+ 'Decay Constant \u00B3\u2076Cl', '%1\u03C3', # 49-50
132
+ 'Decay Activity \u2074\u2070K', '%1\u03C3', # 51-52
133
+ 'Decay Activity \u2074\u2070K(EC)', '%1\u03C3', # 53-54
134
+ 'Decay Activity \u2074\u2070K(\u03B2<sup>-</sup>)', '%1\u03C3', # 55-56
135
+ 'Decay Activity \u2074\u2070K(\u03B2<sup>+</sup>)', '%1\u03C3', # 57-58
136
+ '\u00B3\u2076Cl/\u00B3\u2078Cl Productivity', '%1\u03C3', # 59-60
137
+ 'Std Name', 'Std Age', '1\u03C3', '\u2074\u2070Ar%', '1\u03C3', 'K%', '1\u03C3', # 61-67
138
+ '\u2074\u2070Ar<sup>*</sup>/K', '1\u03C3', # 68-69
139
+ 'J', '%1\u03C3', 'MDF', '%1\u03C3', # 70-73
140
+ 'Mass \u00B3\u2076Ar', '%1\u03C3', 'Mass \u00B3\u2077Ar', '%1\u03C3', # 74-77
141
+ 'Mass \u00B3\u2078Ar', '%1\u03C3', 'Mass \u00B3\u2079Ar', '%1\u03C3', # 78-81
142
+ 'Mass \u2074\u2070', '%1\u03C3', 'K Mass', '%1\u03C3', # 82-85
143
143
  'No', '%1\u03C3', 'Year', '%1\u03C3', '\u2074\u2070K/K', '%1\u03C3',
144
- '\u00B3\u2075Cl/\u00B3\u2077Cl', '%1\u03C3', 'HCl/Cl', '%1\u03C3', # 85-94
145
- '\u2074\u2070Ar/\u00B3\u2076Ar air', '%1\u03C3', # 95-96
146
- '\u00B3\u2078Ar/\u00B3\u2076Ar air', '%1\u03C3', # 97-98
147
- 'Isochron Fitting', 'Convergence', 'Iteration', 'Discrimination', # 99-102
148
- 'Not Zero', 'Corr Blank', 'Corr Discr', 'Corr \u00B3\u2077Ar Decay', # 103-106
149
- 'Corr \u00B3\u2079Ar Decay', # 107
150
- 'Ca Degassing', 'K Degassing', 'Cl Degassing', 'Trap Degassing', # 108-111
151
- 'Using Min Equation', # 112
144
+ '\u00B3\u2075Cl/\u00B3\u2077Cl', '%1\u03C3', 'HCl/Cl', '%1\u03C3', # 86-95
145
+ '\u2074\u2070Ar/\u00B3\u2076Ar air', '%1\u03C3', # 96-97
146
+ '\u00B3\u2078Ar/\u00B3\u2076Ar air', '%1\u03C3', # 98-99
147
+ 'Isochron Fitting', 'Convergence', 'Iteration', 'Discrimination', # 100-103
148
+ 'Not Neg', 'Corr Blank', 'Corr Discr', 'Corr \u00B3\u2077Ar Decay', # 104-107
149
+ 'Corr \u00B3\u2079Ar Decay', # 108
150
+ 'Ca Degassing', 'K Degassing', 'Cl Degassing', 'Trap Degassing', # 109-112
151
+ 'Using Min Equation', # 113
152
152
  # 'Recalibration', 'Using Std Age', 'Use Std Ratio', # 112-115 to be completed
153
- 'Apply Gain Corr to Blanks', # 113
154
- '', '', # 114-115
155
- 'Auto Plateau Method', # 116 the index includes sequence name and unit
156
- 'Initial Ratio Model', # 117
157
- 'Set1 initial Ratio', # 118
158
- '1\u03C3', # 119
159
- 'Set2 initial Ratio', # 120
160
- '1\u03C3', # 121
161
- 'Isotopic Errors', # 122
162
- 'Parameter Errors', # 123
163
- 'Plot Errors', # 124
164
- 'Heating Time (s)', # 125
165
- 'Heating Actual Temp (C)', # 126
166
- 'Heating AT 1\u03C3', # 127
167
- '36Ar Gain', '%1\u03C3', # 128-129
168
- '37Ar Gain', '%1\u03C3', # 130-131
169
- '38Ar Gain', '%1\u03C3', # 132-133
170
- '39Ar Gain', '%1\u03C3', # 134-135
171
- '40Ar Gain', '%1\u03C3', # 136-137
153
+ 'Apply Gain Corr to Blanks', # 114
154
+ 'Monte Carlo Simulation for 40Arr/39Ark', '', # 115-116
155
+ 'Auto Plateau Method', # 117 the index includes sequence name and unit
156
+ 'Initial Ratio Model', # 118
157
+ 'Set1 initial Ratio', # 119
158
+ '1\u03C3', # 120
159
+ 'Set2 initial Ratio', # 121
160
+ '1\u03C3', # 122
161
+ 'Isotopic Errors', # 123
162
+ 'Parameter Errors', # 124
163
+ 'Plot Errors', # 125
164
+ 'Heating Time (s)', # 126
165
+ 'Heating Actual Temp (C)', # 127
166
+ 'Heating AT 1\u03C3', # 128
167
+ '36Ar Gain', '%1\u03C3', # 129-130
168
+ '37Ar Gain', '%1\u03C3', # 131-132
169
+ '38Ar Gain', '%1\u03C3', # 133-134
170
+ '39Ar Gain', '%1\u03C3', # 135-136
171
+ '40Ar Gain', '%1\u03C3', # 137-138
172
+ 'Normalize Factor', '1\u03C3', # 139-140
172
173
  ]
173
174
 
174
175
  SAMPLE_INTERCEPT_SHORT_HEADERS = [
175
- 'Seq', 'Label', 'Ar36', '1s', 'Ar37', '1s',
176
+ 'Seq', 'Label', 'Mark', # 0-2
177
+ 'Ar36', '1s', 'Ar37', '1s',
176
178
  'Ar38', '1s', 'Ar39', '1s', 'Ar40', '1s'
177
179
  ]
178
180
  BLANK_INTERCEPT_SHORT_HEADERS = [
179
- 'Seq', 'Label', 'Ar36', '1s', 'Ar37', '1s',
181
+ 'Seq', 'Label', 'Mark', # 0-2
182
+ 'Ar36', '1s', 'Ar37', '1s',
180
183
  'Ar38', '1s', 'Ar39', '1s', 'Ar40', '1s'
181
184
  ]
182
185
  CORRECTED_SHORT_HEADERS = [
183
- 'Seq', 'Label', 'Ar36', '1s', 'Ar37', '1s',
186
+ 'Seq', 'Label', 'Mark', # 0-2
187
+ 'Ar36', '1s', 'Ar37', '1s',
184
188
  'Ar38', '1s', 'Ar39', '1s', 'Ar40', '1s'
185
189
  ]
186
190
  DEGAS_SHORT_HEADERS = [
187
- 'Seq', 'Label', # 0-1
191
+ 'Seq', 'Label', 'Mark', # 0-2
188
192
  'Ar36[a]', '1s', 'Ar36[c]', '1s', # 2-5
189
193
  'Ar36[Ca]', '1s', 'Ar36[Cl]', '1s', # 6-9
190
194
  'Ar37[Ca]', '1s', 'Ar38[Cl]', '1s', # 10-13
@@ -195,12 +199,14 @@ DEGAS_SHORT_HEADERS = [
195
199
  'Ar40[c]', '1s', 'Ar40[K]', '1s' # 29-32
196
200
  ]
197
201
  PUBLISH_TABLE_SHORT_HEADERS = [
198
- 'Seq', 'Label', 'Ar36[a]', 'Ar37[Ca]', 'Ar38[Cl]',
202
+ 'Seq', 'Label', 'Mark', # 0-2
203
+ 'Ar36[a]', 'Ar37[Ca]', 'Ar38[Cl]',
199
204
  'Ar39[K]', 'Ar40[r]', 'Apparent Age', '1s', 'Ar40r%',
200
205
  'Ar39K%', 'Ca/K', '1s'
201
206
  ]
202
207
  SPECTRUM_TABLE_SHORT_HEADERS = [
203
- 'Seq', 'Label', 'Ar40/Ar39', '1s', 'Apparent Age',
208
+ 'Seq', 'Label', 'Mark', # 0-2
209
+ 'Ar40/Ar39', '1s', 'Apparent Age',
204
210
  '1s', '1s', '1s', 'Ar40[r]%', 'Ar39[K]%'
205
211
  ]
206
212
  ISOCHRON_TABLE_SHORT_HEADERS = [
@@ -221,68 +227,69 @@ ISOCHRON_TABLE_SHORT_HEADERS = [
221
227
  'r1', 'r2', 'r3', # 39-41
222
228
  ]
223
229
  TOTAL_PARAMS_SHORT_HEADERS = [
224
- 'Seq', 'Label', # 0-1
230
+ 'Seq', 'Label', 'Mark', # 0-2
225
231
  'T_40v36', '%1s',
226
- 'C_40v36', '%1s', # 2-5
232
+ 'C_40v36', '%1s', # 3-6
227
233
  'T_38v36', '%1s',
228
- 'C_38v36', '%1s', # 6-9
234
+ 'C_38v36', '%1s', # 7-10
229
235
  'Ca_39v37', '%1s',
230
236
  'Ca_38v37', '%1s',
231
- 'Ca_36v37', '%1s', # 10-15
237
+ 'Ca_36v37', '%1s', # 11-16
232
238
  'K_40v39', '%1s',
233
- 'K_38v39', '%1s', # 16-19
234
- 'Cl_36v38', '%1s', # 20-21
235
- 'KvCa', '%1s', 'KvCl', '%1s', 'CavCl', '%1s', # 22-27
236
- 'Ncy', 'Icy', # 28-29
237
- 'Irr', 'Dur', 'IrrTime', 'ExpTime', # 30-33
238
- 'StgY', '', # 34-35
239
- 'DCK40', '%1s', # 36-37
240
- 'DCeK40', '%1s', # 38-39
241
- 'DCb-K40', '%1s', # 40-41
242
- 'DCb+K40', '%1s', # 42-43
243
- 'DCAr39', '%1s', # 44-45
244
- 'DCAr37', '%1s', # 46-47
245
- 'DCCl36', '%1s', # 48-49
246
- 'DAK40', '%1s', # 50-51
247
- 'DAeK40', '%1s', # 52-53
248
- 'DAb-K40', '%1s', # 54-55
249
- 'DAb+K40', '%1s', # 56-57
250
- 'Cl36/Cl38P', '%1s', # 58-59
251
- 'StdName', 'StdAge', '1s', 'Ar40%', '1s', 'K%', '1s',
252
- 'F', '1s', # 60-68
253
- 'J', '%1s', 'MDF', '%1s', # 69-72
239
+ 'K_38v39', '%1s', # 17-20
240
+ 'Cl_36v38', '%1s', # 21-22
241
+ 'KvCa', '%1s', 'KvCl', '%1s', 'CavCl', '%1s', # 23-28
242
+ 'Ncy', 'Icy', # 29-30
243
+ 'Irr', 'Dur', 'IrrTime', 'ExpTime', # 31-34
244
+ 'StgY', '', # 35-36
245
+ 'DCK40', '%1s',
246
+ 'DCeK40', '%1s',
247
+ 'DCb-K40', '%1s',
248
+ 'DCb+K40', '%1s',
249
+ 'DCAr39', '%1s',
250
+ 'DCAr37', '%1s',
251
+ 'DCCl36', '%1s',
252
+ 'DAK40', '%1s',
253
+ 'DAeK40', '%1s',
254
+ 'DAb-K40', '%1s',
255
+ 'DAb+K40', '%1s',
256
+ 'Cl36/Cl38P', '%1s', # 37-60
257
+ 'StdName', 'StdAge', '1s', 'Ar40%', '1s', 'K%', '1s', # 61-67
258
+ 'F', '1s', # 68-69
259
+ 'J', '%1s', 'MDF', '%1s', # 70-73
254
260
  'MassAr36', '%1s', 'MassAr37', '%1s',
255
261
  'MassAr38', '%1s', 'MassAr39', '%1s',
256
- 'MassK40', '%1s', 'MassK', '%1s', # 73-84
262
+ 'MassK40', '%1s', 'MassK', '%1s', # 74-85
257
263
  'No', '%1s', 'Year', '%1s', 'K40/K', '%1s',
258
- 'Cl35/Cl37', '%1s', 'HCl/Cl', '%1s', # 85-94
264
+ 'Cl35/Cl37', '%1s', 'HCl/Cl', '%1s', # 86-95
259
265
  'Ar40/Ar36Air', '%1s',
260
- 'Ar38/Ar36Air', '%1s', # 95-98
261
- 'IsochronFitting', 'Convergence', 'Iteration', 'Discrimination', # 99-102
262
- 'NotZero', 'CorrBlank', 'CorrDiscr', 'CorrAr37Decay',
263
- 'CorrAr39Decay', # 103-107
264
- 'CaDegassing', 'KDegassing', 'ClDegassing', 'TrapDegassing', # 108-111
265
- 'UsingMin', # 112
266
+ 'Ar38/Ar36Air', '%1s', # 96-99
267
+ 'IsochronFitting', 'Convergence', 'Iteration', 'Discrimination', # 100-103
268
+ 'NotNeg', 'CorrBlank', 'CorrDiscr', 'CorrAr37Decay',
269
+ 'CorrAr39Decay', # 104-108
270
+ 'CaDegassing', 'KDegassing', 'ClDegassing', 'TrapDegassing', # 109-112
271
+ 'UsingMin', # 113
266
272
  # 'Recalibration', 'Using Std Age', 'Use Std Ratio', # 112-115 to be completed
267
- 'BlankGainCorr', # 113
268
- '', '', # 114-115
269
- 'AutoPlateauMethod', # 116 the index includes sequence name and unit
270
- 'InitialRatioModel', # 117
271
- 'Set1InitialRatio', # 118
272
- '1s', # 119
273
- 'Set2InitialRatio', # 120
274
- '1s', # 121
275
- 'IsotopicErrors', # 122
276
- 'ParameterErrors', # 123
277
- 'PlotErrors', # 124
278
- 'HeatingTime', # 125
279
- 'HeatingActualTemp', # 126
280
- 'HeatingActualTempError', # 127
281
- '36Gain', '%1s', # 128-129
282
- '37Gain', '%1s', # 130-131
283
- '38Gain', '%1s', # 132-133
284
- '39Gain', '%1s', # 134-135
285
- '40Gain', '%1s', # 136-137
273
+ 'BlankGainCorr', # 114
274
+ 'MonteCarlo', '', # 115-116
275
+ 'AutoPlateauMethod', # 117 the index includes sequence name and unit
276
+ 'InitialRatioModel', # 118
277
+ 'Set1InitialRatio', # 119
278
+ '1s', # 120
279
+ 'Set2InitialRatio', # 121
280
+ '1s', # 122
281
+ 'IsotopicErrors', # 123
282
+ 'ParameterErrors', # 124
283
+ 'PlotErrors', # 125
284
+ 'HeatingTime', # 126
285
+ 'HeatingActualTemp', # 127
286
+ 'HeatingActualTempError', # 128
287
+ '36Gain', '%1s',
288
+ '37Gain', '%1s',
289
+ '38Gain', '%1s',
290
+ '39Gain', '%1s',
291
+ '40Gain', '%1s', # 129-138
292
+ 'NormalizeFactor', '1\u03C3', # 139-140
286
293
  ]
287
294
 
288
295
  DEFAULT_PLOT_STYLES = lambda sample_type, age_unit: {
@@ -776,7 +783,7 @@ DEFAULT_PLOT_STYLES = lambda sample_type, age_unit: {
776
783
  },
777
784
  }
778
785
 
779
- VERSION = '20250404'
786
+ VERSION = '20251231'
780
787
 
781
788
  NAMED_DICT = {
782
789
  "unknown": {"header": SAMPLE_INTERCEPT_HEADERS.copy()},
@@ -817,9 +824,51 @@ class ArArData(ArArBasic):
817
824
  class Sample:
818
825
 
819
826
  def __init__(self, **kwargs):
827
+
828
+ # self.__version = '20230521'
829
+ # self.__version = '20230709' # add labels to isochron plots
830
+ # self.__version = '20230724' # change header
831
+ # self.__version = '20230730' # delete calcparams attribute
832
+ # self.__version = '20230827' # using merge smp to update arr version
833
+ # self.__version = '20231116' # change smp parameters
834
+ # self.__version = '20240730' # change parameter table for thermo calculation
835
+ # self.__version = '20241028' # gain correction
836
+ # self.__version = '20250102' # gain correction to blanks
837
+ # self.__version = '20250301' # update sample info
838
+ # self.__version = '20250321' # error sigma adjustment
839
+ # self.__version = '20250328' # Experiment info
840
+ # self.__version = '20250404' # J normalization factor
841
+ # self.__version = '20251001' # add marker col for all tables
842
+ self.__version = '20251231' # move montecarlo to params-112
843
+
820
844
  self.Doi = ""
821
845
  self.RawData = RawData()
822
- self.Info = ArArBasic()
846
+ self.Info = ArArBasic(
847
+ id='0', name='', attr_name='', arr_version=self.__version,
848
+ experiment=ArArBasic(name='', type='', instrument='', mass_spec='', collectors='', step_num=0, ),
849
+ sample=ArArBasic(name='', material='', location='', type='', method='', sequence_unit='', weight='', ),
850
+ researcher=ArArBasic(name='', addr='', email='', ),
851
+ laboratory=ArArBasic(name='', addr='', email='', info='', analyst='', ),
852
+ results=ArArBasic(
853
+ name='', plateau_F=[], plateau_age=[], total_F=[], total_age=[], isochron_F=[], isochron_age=[], J=[],
854
+ isochron={
855
+ 'figure_2': {0: {}, 1: {}, 2: {}, },
856
+ 'figure_3': {0: {}, 1: {}, 2: {}, },
857
+ 'figure_4': {0: {}, 1: {}, 2: {}, },
858
+ 'figure_5': {0: {}, 1: {}, 2: {}, },
859
+ 'figure_6': {0: {}, 1: {}, 2: {}, },
860
+ 'figure_7': {0: {}, 1: {}, 2: {}, },
861
+ },
862
+ age_plateau= {0: {}, 1: {}, 2: {}},
863
+ age_spectra= {'TGA': {}, 0: {}, 1: {}, 2: {}, },
864
+ selection={0: {'data': [], 'name': 'set1'},
865
+ 1: {'data': [], 'name': 'set2'},
866
+ 2: {'data': [], 'name': 'set3'}}
867
+ ),
868
+ reference=ArArBasic(name='', journal='', doi='', ),
869
+ preference=ArArBasic(decimal_places='', to_precision='', confidence_level='', age_unit='', ),
870
+ irradiation= ArArBasic(label='', pos_h='', pos_x='', pos_y='', )
871
+ )
823
872
 
824
873
  self.SequenceName = []
825
874
  self.SequenceValue = []
@@ -845,7 +894,6 @@ class Sample:
845
894
  self.SelectedSequence2 = []
846
895
  self.UnselectedSequence = []
847
896
  self.IsochronMark = []
848
- self.NormalizeFactor = [[], []]
849
897
 
850
898
  # Tables and Plots
851
899
  self.UnknownTable = Table()
@@ -870,25 +918,16 @@ class Sample:
870
918
  for k, v in kwargs.items():
871
919
  setattr(self, k, v)
872
920
 
873
- # self.Components = {}
874
-
875
- # self.__version = '20230521'
876
- # self.__version = '20230709' # add labels to isochron plots
877
- # self.__version = '20230724' # change header
878
- # self.__version = '20230730' # delete calcparams attribute
879
- # self.__version = '20230827' # using merge smp to update arr version
880
- # self.__version = '20231116' # change smp parameters
881
- # self.__version = '20240730' # change parameter table for thermo calculation
882
- # self.__version = '20241028' # gain correction
883
- # self.__version = '20250102' # gain correction to blanks
884
- # self.__version = '20250301' # update sample info
885
- # self.__version = '20250321' # error sigma adjustment
886
- # self.__version = '20250328' # Experiment info
887
- self.__version = '20250404' # J normalization factor
888
-
889
921
  @property
890
922
  def version(self):
891
- return self.__version
923
+ return self.Info.arr_version
924
+
925
+ @version.setter
926
+ def version(self, v):
927
+ if isinstance(v, (str, int)) and str(v).startswith("20"):
928
+ self.Info.arr_version = self.__version = str(v)
929
+ else:
930
+ raise ValueError("Version setter Error")
892
931
 
893
932
  def help(self) -> str: ...
894
933
 
@@ -926,7 +965,7 @@ class Sample:
926
965
 
927
966
  def initial(self): ...
928
967
 
929
- def set_selection(self): ...
968
+ def set_selection(self, index: int, mark: int): ...
930
969
 
931
970
  def update_table(self, data: list, table_id: name): ...
932
971
 
@@ -1006,17 +1045,25 @@ class Table:
1006
1045
  setattr(self, k, v)
1007
1046
  self.set_coltypes()
1008
1047
 
1009
- def set_coltypes(self):
1010
- for i in self.text_indexes:
1011
- if i < self.colcount:
1048
+ def set_coltypes(self, text_indexes=None):
1049
+ if text_indexes is not None:
1050
+ self.text_indexes = text_indexes
1051
+ if not isinstance(self.text_indexes, list):
1052
+ raise TypeError(f"Text_indexes is not allowed: {self.text_indexes}")
1053
+ for i in range(self.colcount):
1054
+ if i in self.text_indexes:
1012
1055
  self.coltypes[i].update({'type': 'text'})
1013
- for i in self.numeric_indexes:
1014
- if i < self.colcount:
1056
+ else:
1015
1057
  self.coltypes[i].update({
1016
1058
  'type': 'numeric',
1017
1059
  'numericFormat': {'pattern': {'mantissa': self.decimal_places}},
1018
1060
  })
1019
1061
 
1062
+ def set_colcount(self, c: int):
1063
+ self.colcount = c
1064
+ while len(self.coltypes) < c:
1065
+ self.coltypes.append({'type': 'text'})
1066
+
1020
1067
 
1021
1068
  class Plot:
1022
1069
  def __init__(self, id='', type='', name='', data=None, info=None, **kwargs):
@@ -1110,27 +1157,33 @@ class Plot:
1110
1157
 
1111
1158
  class Sequence:
1112
1159
  def __init__(self, index=None, data=None, flag=None, name=None, datetime=None,
1113
- type_str=None, results=None, coefficients=None, fitting_method=None,
1160
+ type_str=None, label=None, results=None, coefficients=None, fitting_method=None,
1114
1161
  is_estimated=False, options=None, **kwargs):
1115
1162
  if options is None:
1116
1163
  options = {}
1117
- self.index = index
1118
1164
  if name is None or not isinstance(name, str):
1119
- name = ""
1120
- self.name = name.strip()
1121
- self.datetime = datetime
1122
- self.data = data
1165
+ name = options.get('StepName', "")
1123
1166
  # flag is to check if the data point is selected
1124
1167
  if flag is None and data is not None:
1125
1168
  flag = [[j if i == 0 else True for i, j in enumerate(_m)] for _m in data]
1126
- self.flag = flag
1127
- self.type_str = type_str
1169
+ if type_str is None:
1170
+ type_str = options.get('StepType', "Unknown")
1171
+ if label is None:
1172
+ label = options.get('StepLabel', "")
1128
1173
  if results is None:
1129
1174
  results = []
1130
1175
  if fitting_method is None:
1131
1176
  fitting_method = []
1132
1177
  if coefficients is None:
1133
1178
  coefficients = []
1179
+
1180
+ self.index = index
1181
+ self.datetime = datetime
1182
+ self.data = data
1183
+ self.name = name.strip()
1184
+ self.flag = flag
1185
+ self.type_str = type_str.strip()
1186
+ self.label = str(label).strip()
1134
1187
  self.results = results
1135
1188
  self.coefficients = coefficients
1136
1189
  self.fitting_method = fitting_method
@@ -1148,9 +1201,7 @@ class Sequence:
1148
1201
  def as_type(self, type_str):
1149
1202
  if str(type_str).lower() in ["blk", "b", "blank"]:
1150
1203
  self.type_str = "blank"
1151
- if str(type_str).lower() in ["a", "air"]:
1152
- self.type_str = "air"
1153
- if self.type_str not in ["blank", "air"]:
1204
+ else:
1154
1205
  self.type_str = "unknown"
1155
1206
 
1156
1207
  __as_type = as_type
@@ -1159,10 +1210,7 @@ class Sequence:
1159
1210
  return self.type_str == "blank"
1160
1211
 
1161
1212
  def is_unknown(self):
1162
- return self.type_str != "blank" and self.type_str != "air"
1163
-
1164
- def is_air(self):
1165
- return self.type_str == "air"
1213
+ return self.type_str != "blank"
1166
1214
 
1167
1215
  def as_blank(self):
1168
1216
  return self.as_type("blank")
@@ -1170,9 +1218,6 @@ class Sequence:
1170
1218
  def as_unknown(self):
1171
1219
  return self.as_type("unknown")
1172
1220
 
1173
- def as_air(self):
1174
- return self.as_type("air")
1175
-
1176
1221
  def get_data_df(self):
1177
1222
  ...
1178
1223
 
@@ -1201,7 +1246,7 @@ class RawData:
1201
1246
  self.unit = unit
1202
1247
  self.isotopic_num = isotopic_num
1203
1248
  self.sequence_num = sequence_num
1204
- self.interpolated_blank = None
1249
+ self.interpolated_blank = []
1205
1250
  if sequence is not None:
1206
1251
  self.sequence = sequence
1207
1252
  elif data is not None:
@@ -1211,9 +1256,8 @@ class RawData:
1211
1256
  name=item[0][0] if isinstance(item[0][0], str) and item[0][0] != '' else f"{self.name}-{index + 1:02d}",
1212
1257
  data=item[1:],
1213
1258
  datetime=item[0][1],
1214
- type_str=item[0][2],
1215
1259
  fitting_method=[*kwargs.get("fitting_method", [0] * 5)],
1216
- options=item[0][3]
1260
+ options=item[0][2],
1217
1261
  ) for index, item in enumerate(data)]
1218
1262
  else:
1219
1263
  self.sequence: List[Sequence] = []
@@ -1247,8 +1291,5 @@ class RawData:
1247
1291
  def get_blank(self) -> Union[Sequence, List]:
1248
1292
  ...
1249
1293
 
1250
- def get_air(self) -> Union[Sequence, List]:
1251
- ...
1252
-
1253
1294
  def to_sample(self, mapping: Optional[List[dict]]) -> Sample:
1254
1295
  ...