ararpy 0.1.198__py3-none-any.whl → 0.2.1__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 +5 -24
  11. ararpy/calc/basic.py +26 -3
  12. ararpy/calc/corr.py +135 -89
  13. ararpy/calc/jvalue.py +1 -1
  14. ararpy/calc/plot.py +6 -4
  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 +202 -46
  22. ararpy/smp/calculation.py +6 -6
  23. ararpy/smp/corr.py +339 -154
  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 +105 -48
  28. ararpy/smp/json.py +2 -2
  29. ararpy/smp/plots.py +225 -218
  30. ararpy/smp/raw.py +11 -15
  31. ararpy/smp/sample.py +257 -183
  32. ararpy/smp/style.py +48 -22
  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.198.dist-info → ararpy-0.2.1.dist-info}/METADATA +1 -1
  37. ararpy-0.2.1.dist-info/RECORD +73 -0
  38. {ararpy-0.1.198.dist-info → ararpy-0.2.1.dist-info}/WHEEL +1 -1
  39. ararpy-0.1.198.dist-info/RECORD +0 -66
  40. {ararpy-0.1.198.dist-info → ararpy-0.2.1.dist-info}/licenses/LICENSE +0 -0
  41. {ararpy-0.1.198.dist-info → ararpy-0.2.1.dist-info}/top_level.txt +0 -0
ararpy/smp/sample.py CHANGED
@@ -22,47 +22,73 @@ 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
+ '\u00B3\u2076Ar[a]', '\u00B3\u2077Ar[Ca]', '\u00B3\u2078Ar[Cl]', # 2-4
56
+ '\u00B3\u2079Ar[K]', '\u2074\u2070Ar[r]', # 5-6
57
+ 'Apparent Age', '1\u03C3', '\u2074\u2070Ar[r]%', '\u00B3\u2079Ar[K]%', # 7-10
58
+ 'Ca/K', '1\u03C3', # 11-12
59
+ ]
60
+ PUBLISH_TABLE_HEADERS_AIR = [
61
+ 'Sequence', '', 'Mark', # 0-2
55
62
  '\u00B3\u2076Ar[a]', '\u00B3\u2077Ar[Ca]', '\u00B3\u2078Ar[Cl]', # 2-4
56
63
  '\u00B3\u2079Ar[K]', '\u2074\u2070Ar[r]', # 5-6
57
- 'Apparent Age', '1\u03C3', '\u2074\u2070Arr%', '\u00B3\u2079ArK%', # 7-10
64
+ 'MDF', '1\u03C3', '\u2074\u2070Ar[r]%', '\u00B3\u2076Ar%', # 7-10
65
+ 'Ca/K', '1\u03C3', # 11-12
66
+ ]
67
+ PUBLISH_TABLE_HEADERS_STD = [
68
+ 'Sequence', '', 'Mark', # 0-2
69
+ '\u00B3\u2076Ar[a]', '\u00B3\u2077Ar[Ca]', '\u00B3\u2078Ar[Cl]', # 2-4
70
+ '\u00B3\u2079Ar[K]', '\u2074\u2070Ar[r]', # 5-6
71
+ 'J', '1\u03C3', '\u2074\u2070Ar[r]%', '\u00B3\u2076Ar%', # 7-10
58
72
  'Ca/K', '1\u03C3', # 11-12
59
73
  ]
60
74
  SPECTRUM_TABLE_HEADERS = [
61
- 'Sequence', '', # 0-1
75
+ 'Sequence', '', 'Mark', # 0-2
62
76
  '\u2074\u2070Ar/\u00B3\u2079Ar', '1\u03C3', # 2-3
63
77
  'Apparent Age', '1\u03C3', '1\u03C3', '1\u03C3', # 4-7
64
78
  '\u2074\u2070Ar[r]%', '\u00B3\u2079Ar[K]%', # 8-9
65
79
  ]
80
+ SPECTRUM_TABLE_HEADERS_AIR = [
81
+ 'Sequence', '', 'Mark', # 0-2
82
+ '\u2074\u2070Ar/\u00B3\u2076Ar', '1\u03C3', # 2-3
83
+ 'MDF', '1\u03C3', '1\u03C3', '1\u03C3', # 4-7
84
+ '\u2074\u2070Ar[r]%', '\u00B3\u2076Ar%', # 8-9
85
+ ]
86
+ SPECTRUM_TABLE_HEADERS_STD = [
87
+ 'Sequence', '', 'Mark', # 0-2
88
+ '\u2074\u2070Ar/\u00B3\u2076Ar', '1\u03C3', # 2-3
89
+ 'J', '1\u03C3', '1\u03C3', '1\u03C3', # 4-7
90
+ '\u2074\u2070Ar[r]%', '\u00B3\u2076Ar%', # 8-9
91
+ ]
66
92
  ISOCHRON_TABLE_HEADERS = [
67
93
  'Sequence', '', 'Mark', # 0-2
68
94
  '\u00B3\u2079Ar[K]/\u00B3\u2076Ar[a]', '1\u03C3', # 3-4
@@ -81,84 +107,88 @@ ISOCHRON_TABLE_HEADERS = [
81
107
  'r1', 'r2', 'r3', # 39-41
82
108
  ]
83
109
  TOTAL_PARAMS_HEADERS = [
84
- 'Sequence', '', # 0-1
110
+ 'Sequence', '', 'Mark', # 0-2
85
111
  '(\u2074\u2070Ar/\u00B3\u2076Ar)t', '%1\u03C3',
86
- '(\u2074\u2070Ar/\u00B3\u2076Ar)c', '%1\u03C3', # 2-5
112
+ '(\u2074\u2070Ar/\u00B3\u2076Ar)c', '%1\u03C3', # 3-6
87
113
  '(\u00B3\u2078Ar/\u00B3\u2076Ar)t', '%1\u03C3',
88
- '(\u00B3\u2078Ar/\u00B3\u2076Ar)c', '%1\u03C3', # 6-9
114
+ '(\u00B3\u2078Ar/\u00B3\u2076Ar)c', '%1\u03C3', # 7-10
89
115
  '(\u00B3\u2079Ar/\u00B3\u2077Ar)Ca', '%1\u03C3',
90
116
  '(\u00B3\u2078Ar/\u00B3\u2077Ar)Ca', '%1\u03C3',
91
- '(\u00B3\u2076Ar/\u00B3\u2077Ar)Ca', '%1\u03C3', # 10-15
117
+ '(\u00B3\u2076Ar/\u00B3\u2077Ar)Ca', '%1\u03C3', # 11-16
92
118
  '(\u2074\u2070Ar/\u00B3\u2079Ar)K', '%1\u03C3',
93
- '(\u00B3\u2078Ar/\u00B3\u2079Ar)K', '%1\u03C3', # 16-19
94
- '(\u00B3\u2076Ar/\u00B3\u2078Ar)Cl', '%1\u03C3', # 20-21
95
- 'K/Ca', '%1\u03C3', 'K/Cl', '%1\u03C3', 'Ca/Cl', '%1\u03C3', # 22-27
96
- 'Cycle Number', 'Irradiation Cycles', # 28-29
97
- 'Irradiation', 'duration', 'Irradiation Time', 'Experiment Time', # 30-33
98
- 'Storage Years', '', # 34-35
99
- 'Decay Constant \u2074\u2070K', '%1\u03C3', # 36-37
100
- 'Decay Constant \u2074\u2070K(EC)', '%1\u03C3', # 38-39
101
- 'Decay Constant \u2074\u2070K(\u03B2<sup>-</sup>)', '%1\u03C3', # 40-41
102
- 'Decay Constant \u2074\u2070K(\u03B2<sup>+</sup>)', '%1\u03C3', # 42-43
103
- 'Decay Constant \u00B3\u2079Ar', '%1\u03C3', # 44-45
104
- 'Decay Constant \u00B3\u2077Ar', '%1\u03C3', # 46-47
105
- 'Decay Constant \u00B3\u2076Cl', '%1\u03C3', # 48-49
106
- 'Decay Activity \u2074\u2070K', '%1\u03C3', # 50-51
107
- 'Decay Activity \u2074\u2070K(EC)', '%1\u03C3', # 52-53
108
- 'Decay Activity \u2074\u2070K(\u03B2<sup>-</sup>)', '%1\u03C3', # 54-55
109
- 'Decay Activity \u2074\u2070K(\u03B2<sup>+</sup>)', '%1\u03C3', # 56-57
110
- '\u00B3\u2076Cl/\u00B3\u2078Cl Productivity', '%1\u03C3', # 58-59
111
- 'Std Name', 'Std Age', '1\u03C3', '\u2074\u2070Ar%', '1\u03C3', 'K%', '1\u03C3', # 60-66
112
- '\u2074\u2070Ar<sup>*</sup>/K', '1\u03C3', # 67-68
113
- 'J', '%1\u03C3', 'MDF', '%1\u03C3', # 69-72
114
- 'Mass \u00B3\u2076Ar', '%1\u03C3', 'Mass \u00B3\u2077Ar', '%1\u03C3', # 73-76
115
- 'Mass \u00B3\u2078Ar', '%1\u03C3', 'Mass \u00B3\u2079Ar', '%1\u03C3', # 77-80
116
- '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
117
143
  'No', '%1\u03C3', 'Year', '%1\u03C3', '\u2074\u2070K/K', '%1\u03C3',
118
- '\u00B3\u2075Cl/\u00B3\u2077Cl', '%1\u03C3', 'HCl/Cl', '%1\u03C3', # 85-94
119
- '\u2074\u2070Ar/\u00B3\u2076Ar air', '%1\u03C3', # 95-96
120
- '\u00B3\u2078Ar/\u00B3\u2076Ar air', '%1\u03C3', # 97-98
121
- 'Isochron Fitting', 'Convergence', 'Iteration', 'Discrimination', # 99-102
122
- 'Not Zero', 'Corr Blank', 'Corr Discr', 'Corr \u00B3\u2077Ar Decay', # 103-106
123
- 'Corr \u00B3\u2079Ar Decay', # 107
124
- 'Ca Degassing', 'K Degassing', 'Cl Degassing', 'Trap Degassing', # 108-111
125
- '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
126
152
  # 'Recalibration', 'Using Std Age', 'Use Std Ratio', # 112-115 to be completed
127
- 'Apply Gain Corr to Blanks', # 113
128
- '', '', # 114-115
129
- 'Auto Plateau Method', # 116 the index includes sequence name and unit
130
- 'Initial Ratio Model', # 117
131
- 'Set1 initial Ratio', # 118
132
- '1\u03C3', # 119
133
- 'Set2 initial Ratio', # 120
134
- '1\u03C3', # 121
135
- 'Isotopic Errors', # 122
136
- 'Parameter Errors', # 123
137
- 'Plot Errors', # 124
138
- 'Heating Time (s)', # 125
139
- 'Heating Actual Temp (C)', # 126
140
- 'Heating AT 1\u03C3', # 127
141
- '36Ar Gain', '%1\u03C3', # 128-129
142
- '37Ar Gain', '%1\u03C3', # 130-131
143
- '38Ar Gain', '%1\u03C3', # 132-133
144
- '39Ar Gain', '%1\u03C3', # 134-135
145
- '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
146
173
  ]
147
174
 
148
175
  SAMPLE_INTERCEPT_SHORT_HEADERS = [
149
- 'Seq', 'Label', 'Ar36', '1s', 'Ar37', '1s',
176
+ 'Seq', 'Label', 'Mark', # 0-2
177
+ 'Ar36', '1s', 'Ar37', '1s',
150
178
  'Ar38', '1s', 'Ar39', '1s', 'Ar40', '1s'
151
179
  ]
152
180
  BLANK_INTERCEPT_SHORT_HEADERS = [
153
- 'Seq', 'Label', 'Ar36', '1s', 'Ar37', '1s',
181
+ 'Seq', 'Label', 'Mark', # 0-2
182
+ 'Ar36', '1s', 'Ar37', '1s',
154
183
  'Ar38', '1s', 'Ar39', '1s', 'Ar40', '1s'
155
184
  ]
156
185
  CORRECTED_SHORT_HEADERS = [
157
- 'Seq', 'Label', 'Ar36', '1s', 'Ar37', '1s',
186
+ 'Seq', 'Label', 'Mark', # 0-2
187
+ 'Ar36', '1s', 'Ar37', '1s',
158
188
  'Ar38', '1s', 'Ar39', '1s', 'Ar40', '1s'
159
189
  ]
160
190
  DEGAS_SHORT_HEADERS = [
161
- 'Seq', 'Label', # 0-1
191
+ 'Seq', 'Label', 'Mark', # 0-2
162
192
  'Ar36[a]', '1s', 'Ar36[c]', '1s', # 2-5
163
193
  'Ar36[Ca]', '1s', 'Ar36[Cl]', '1s', # 6-9
164
194
  'Ar37[Ca]', '1s', 'Ar38[Cl]', '1s', # 10-13
@@ -169,12 +199,14 @@ DEGAS_SHORT_HEADERS = [
169
199
  'Ar40[c]', '1s', 'Ar40[K]', '1s' # 29-32
170
200
  ]
171
201
  PUBLISH_TABLE_SHORT_HEADERS = [
172
- 'Seq', 'Label', 'Ar36[a]', 'Ar37[Ca]', 'Ar38[Cl]',
202
+ 'Seq', 'Label', 'Mark', # 0-2
203
+ 'Ar36[a]', 'Ar37[Ca]', 'Ar38[Cl]',
173
204
  'Ar39[K]', 'Ar40[r]', 'Apparent Age', '1s', 'Ar40r%',
174
205
  'Ar39K%', 'Ca/K', '1s'
175
206
  ]
176
207
  SPECTRUM_TABLE_SHORT_HEADERS = [
177
- 'Seq', 'Label', 'Ar40/Ar39', '1s', 'Apparent Age',
208
+ 'Seq', 'Label', 'Mark', # 0-2
209
+ 'Ar40/Ar39', '1s', 'Apparent Age',
178
210
  '1s', '1s', '1s', 'Ar40[r]%', 'Ar39[K]%'
179
211
  ]
180
212
  ISOCHRON_TABLE_SHORT_HEADERS = [
@@ -195,83 +227,91 @@ ISOCHRON_TABLE_SHORT_HEADERS = [
195
227
  'r1', 'r2', 'r3', # 39-41
196
228
  ]
197
229
  TOTAL_PARAMS_SHORT_HEADERS = [
198
- 'Seq', 'Label', # 0-1
230
+ 'Seq', 'Label', 'Mark', # 0-2
199
231
  'T_40v36', '%1s',
200
- 'C_40v36', '%1s', # 2-5
232
+ 'C_40v36', '%1s', # 3-6
201
233
  'T_38v36', '%1s',
202
- 'C_38v36', '%1s', # 6-9
234
+ 'C_38v36', '%1s', # 7-10
203
235
  'Ca_39v37', '%1s',
204
236
  'Ca_38v37', '%1s',
205
- 'Ca_36v37', '%1s', # 10-15
237
+ 'Ca_36v37', '%1s', # 11-16
206
238
  'K_40v39', '%1s',
207
- 'K_38v39', '%1s', # 16-19
208
- 'Cl_36v38', '%1s', # 20-21
209
- 'KvCa', '%1s', 'KvCl', '%1s', 'CavCl', '%1s', # 22-27
210
- 'Ncy', 'Icy', # 28-29
211
- 'Irr', 'Dur', 'IrrTime', 'ExpTime', # 30-33
212
- 'StgY', '', # 34-35
213
- 'DCK40', '%1s', # 36-37
214
- 'DCeK40', '%1s', # 38-39
215
- 'DCb-K40', '%1s', # 40-41
216
- 'DCb+K40', '%1s', # 42-43
217
- 'DCAr39', '%1s', # 44-45
218
- 'DCAr37', '%1s', # 46-47
219
- 'DCCl36', '%1s', # 48-49
220
- 'DAK40', '%1s', # 50-51
221
- 'DAeK40', '%1s', # 52-53
222
- 'DAb-K40', '%1s', # 54-55
223
- 'DAb+K40', '%1s', # 56-57
224
- 'Cl36/Cl38P', '%1s', # 58-59
225
- 'StdName', 'StdAge', '1s', 'Ar40%', '1s', 'K%', '1s',
226
- 'F', '1s', # 60-68
227
- '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
228
260
  'MassAr36', '%1s', 'MassAr37', '%1s',
229
261
  'MassAr38', '%1s', 'MassAr39', '%1s',
230
- 'MassK40', '%1s', 'MassK', '%1s', # 73-84
262
+ 'MassK40', '%1s', 'MassK', '%1s', # 74-85
231
263
  'No', '%1s', 'Year', '%1s', 'K40/K', '%1s',
232
- 'Cl35/Cl37', '%1s', 'HCl/Cl', '%1s', # 85-94
264
+ 'Cl35/Cl37', '%1s', 'HCl/Cl', '%1s', # 86-95
233
265
  'Ar40/Ar36Air', '%1s',
234
- 'Ar38/Ar36Air', '%1s', # 95-98
235
- 'IsochronFitting', 'Convergence', 'Iteration', 'Discrimination', # 99-102
236
- 'NotZero', 'CorrBlank', 'CorrDiscr', 'CorrAr37Decay',
237
- 'CorrAr39Decay', # 103-107
238
- 'CaDegassing', 'KDegassing', 'ClDegassing', 'TrapDegassing', # 108-111
239
- '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
240
272
  # 'Recalibration', 'Using Std Age', 'Use Std Ratio', # 112-115 to be completed
241
- 'BlankGainCorr', # 113
242
- '', '', # 114-115
243
- 'AutoPlateauMethod', # 116 the index includes sequence name and unit
244
- 'InitialRatioModel', # 117
245
- 'Set1InitialRatio', # 118
246
- '1s', # 119
247
- 'Set2InitialRatio', # 120
248
- '1s', # 121
249
- 'IsotopicErrors', # 122
250
- 'ParameterErrors', # 123
251
- 'PlotErrors', # 124
252
- 'HeatingTime', # 125
253
- 'HeatingActualTemp', # 126
254
- 'HeatingActualTempError', # 127
255
- '36Gain', '%1s', # 128-129
256
- '37Gain', '%1s', # 130-131
257
- '38Gain', '%1s', # 132-133
258
- '39Gain', '%1s', # 134-135
259
- '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
260
293
  ]
261
294
 
262
- DEFAULT_PLOT_STYLES = {
295
+ DEFAULT_PLOT_STYLES = lambda sample_type, age_unit: {
263
296
  'figure_1': {
264
- 'id': 'figure_1', 'name': 'Age Spectra', 'type': 'spectra', 'attr_name': 'AgeSpectraPlot',
297
+ 'id': 'figure_1', 'name': 'Age Spectra' if sample_type == "Unknown" else 'J Spectra' if sample_type == "Standard" else "MDF" if sample_type == "Air" else "Unkown Title",
298
+ 'type': 'spectra', 'attr_name': 'AgeSpectraPlot',
265
299
  'rightside_text': [],
266
- 'title': {'id': 'title', 'show': True, 'text': 'Age Spectra', 'position': 'center',
300
+ 'title': {'id': 'title', 'show': True,
301
+ 'text': 'Age Spectra' if sample_type == "Unknown" else 'J Spectra' if sample_type == "Standard" else "MDF" if sample_type == "Air" else "Unkown Title",
302
+ 'position': 'center',
267
303
  'font_size': 18, 'color': '#333333', 'opacity': 1, 'type': 'text', 'font_weight': 'bolder',
268
304
  'font_family': 'Microsoft Sans Serif', },
269
305
  'xaxis': {
270
- 'title': {'text': 'Cumulative {sup|39}Ar Released (%)', 'type': 'text', }, 'type': 'axis',
306
+ 'title': {'text': 'Cumulative {sup|39}Ar Released (%)' if sample_type == "Unknown" or sample_type == "Standard" else "Cumulative {sup|36}Ar Released (%)" if sample_type == "Air" else "Unkown Title",
307
+ 'type': 'text', }, 'type': 'axis',
271
308
  'min': 0, 'max': 100, 'show_splitline': False, 'ticks_inside': False, 'split_number': 5, 'interval': 10,
272
309
  },
273
310
  'yaxis': {
274
- 'title': {'text': 'Apparent Age (Ma)', 'type': 'text', }, 'type': 'axis',
311
+ 'title': {
312
+ 'text': f'Apparent Age ({age_unit})' if sample_type == "Unknown" else 'J Values' if sample_type == "Standard" else "MDF" if sample_type == "Air" else "Unkown Title",
313
+ 'type': 'text',
314
+ }, 'type': 'axis',
275
315
  'min': 0, 'max': 100, 'show_splitline': False, 'ticks_inside': False, 'split_number': 5, 'interval': 10,
276
316
  },
277
317
  'set1': {'id': 'Points Set 1', 'type': 'set', },
@@ -743,7 +783,7 @@ DEFAULT_PLOT_STYLES = {
743
783
  },
744
784
  }
745
785
 
746
- VERSION = '20250404'
786
+ VERSION = '20251231'
747
787
 
748
788
  NAMED_DICT = {
749
789
  "unknown": {"header": SAMPLE_INTERCEPT_HEADERS.copy()},
@@ -784,9 +824,51 @@ class ArArData(ArArBasic):
784
824
  class Sample:
785
825
 
786
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
+
787
844
  self.Doi = ""
788
845
  self.RawData = RawData()
789
- 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
+ )
790
872
 
791
873
  self.SequenceName = []
792
874
  self.SequenceValue = []
@@ -812,7 +894,6 @@ class Sample:
812
894
  self.SelectedSequence2 = []
813
895
  self.UnselectedSequence = []
814
896
  self.IsochronMark = []
815
- self.NormalizeFactor = [[], []]
816
897
 
817
898
  # Tables and Plots
818
899
  self.UnknownTable = Table()
@@ -837,25 +918,16 @@ class Sample:
837
918
  for k, v in kwargs.items():
838
919
  setattr(self, k, v)
839
920
 
840
- # self.Components = {}
841
-
842
- # self.__version = '20230521'
843
- # self.__version = '20230709' # add labels to isochron plots
844
- # self.__version = '20230724' # change header
845
- # self.__version = '20230730' # delete calcparams attribute
846
- # self.__version = '20230827' # using merge smp to update arr version
847
- # self.__version = '20231116' # change smp parameters
848
- # self.__version = '20240730' # change parameter table for thermo calculation
849
- # self.__version = '20241028' # gain correction
850
- # self.__version = '20250102' # gain correction to blanks
851
- # self.__version = '20250301' # update sample info
852
- # self.__version = '20250321' # error sigma adjustment
853
- # self.__version = '20250328' # Experiment info
854
- self.__version = '20250404' # J normalization factor
855
-
856
921
  @property
857
922
  def version(self):
858
- 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")
859
931
 
860
932
  def help(self) -> str: ...
861
933
 
@@ -893,7 +965,7 @@ class Sample:
893
965
 
894
966
  def initial(self): ...
895
967
 
896
- def set_selection(self): ...
968
+ def set_selection(self, index: int, mark: int): ...
897
969
 
898
970
  def update_table(self, data: list, table_id: name): ...
899
971
 
@@ -973,17 +1045,25 @@ class Table:
973
1045
  setattr(self, k, v)
974
1046
  self.set_coltypes()
975
1047
 
976
- def set_coltypes(self):
977
- for i in self.text_indexes:
978
- 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:
979
1055
  self.coltypes[i].update({'type': 'text'})
980
- for i in self.numeric_indexes:
981
- if i < self.colcount:
1056
+ else:
982
1057
  self.coltypes[i].update({
983
1058
  'type': 'numeric',
984
1059
  'numericFormat': {'pattern': {'mantissa': self.decimal_places}},
985
1060
  })
986
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
+
987
1067
 
988
1068
  class Plot:
989
1069
  def __init__(self, id='', type='', name='', data=None, info=None, **kwargs):
@@ -1077,27 +1157,33 @@ class Plot:
1077
1157
 
1078
1158
  class Sequence:
1079
1159
  def __init__(self, index=None, data=None, flag=None, name=None, datetime=None,
1080
- type_str=None, results=None, coefficients=None, fitting_method=None,
1160
+ type_str=None, label=None, results=None, coefficients=None, fitting_method=None,
1081
1161
  is_estimated=False, options=None, **kwargs):
1082
1162
  if options is None:
1083
1163
  options = {}
1084
- self.index = index
1085
1164
  if name is None or not isinstance(name, str):
1086
- name = ""
1087
- self.name = name.strip()
1088
- self.datetime = datetime
1089
- self.data = data
1165
+ name = options.get('StepName', "")
1090
1166
  # flag is to check if the data point is selected
1091
1167
  if flag is None and data is not None:
1092
1168
  flag = [[j if i == 0 else True for i, j in enumerate(_m)] for _m in data]
1093
- self.flag = flag
1094
- 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', "")
1095
1173
  if results is None:
1096
1174
  results = []
1097
1175
  if fitting_method is None:
1098
1176
  fitting_method = []
1099
1177
  if coefficients is None:
1100
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()
1101
1187
  self.results = results
1102
1188
  self.coefficients = coefficients
1103
1189
  self.fitting_method = fitting_method
@@ -1115,9 +1201,7 @@ class Sequence:
1115
1201
  def as_type(self, type_str):
1116
1202
  if str(type_str).lower() in ["blk", "b", "blank"]:
1117
1203
  self.type_str = "blank"
1118
- if str(type_str).lower() in ["a", "air"]:
1119
- self.type_str = "air"
1120
- if self.type_str not in ["blank", "air"]:
1204
+ else:
1121
1205
  self.type_str = "unknown"
1122
1206
 
1123
1207
  __as_type = as_type
@@ -1126,10 +1210,7 @@ class Sequence:
1126
1210
  return self.type_str == "blank"
1127
1211
 
1128
1212
  def is_unknown(self):
1129
- return self.type_str != "blank" and self.type_str != "air"
1130
-
1131
- def is_air(self):
1132
- return self.type_str == "air"
1213
+ return self.type_str != "blank"
1133
1214
 
1134
1215
  def as_blank(self):
1135
1216
  return self.as_type("blank")
@@ -1137,9 +1218,6 @@ class Sequence:
1137
1218
  def as_unknown(self):
1138
1219
  return self.as_type("unknown")
1139
1220
 
1140
- def as_air(self):
1141
- return self.as_type("air")
1142
-
1143
1221
  def get_data_df(self):
1144
1222
  ...
1145
1223
 
@@ -1168,7 +1246,7 @@ class RawData:
1168
1246
  self.unit = unit
1169
1247
  self.isotopic_num = isotopic_num
1170
1248
  self.sequence_num = sequence_num
1171
- self.interpolated_blank = None
1249
+ self.interpolated_blank = []
1172
1250
  if sequence is not None:
1173
1251
  self.sequence = sequence
1174
1252
  elif data is not None:
@@ -1178,9 +1256,8 @@ class RawData:
1178
1256
  name=item[0][0] if isinstance(item[0][0], str) and item[0][0] != '' else f"{self.name}-{index + 1:02d}",
1179
1257
  data=item[1:],
1180
1258
  datetime=item[0][1],
1181
- type_str=item[0][2],
1182
1259
  fitting_method=[*kwargs.get("fitting_method", [0] * 5)],
1183
- options=item[0][3]
1260
+ options=item[0][2],
1184
1261
  ) for index, item in enumerate(data)]
1185
1262
  else:
1186
1263
  self.sequence: List[Sequence] = []
@@ -1214,8 +1291,5 @@ class RawData:
1214
1291
  def get_blank(self) -> Union[Sequence, List]:
1215
1292
  ...
1216
1293
 
1217
- def get_air(self) -> Union[Sequence, List]:
1218
- ...
1219
-
1220
1294
  def to_sample(self, mapping: Optional[List[dict]]) -> Sample:
1221
1295
  ...