ararpy 0.1.197__py3-none-any.whl → 0.1.199__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.
- ararpy/__init__.py +1 -1
- ararpy/calc/age.py +0 -2
- ararpy/calc/arr.py +5 -4
- ararpy/calc/corr.py +4 -4
- ararpy/calc/jvalue.py +1 -1
- ararpy/calc/plot.py +5 -2
- ararpy/smp/basic.py +71 -14
- ararpy/smp/corr.py +4 -5
- ararpy/smp/initial.py +16 -7
- ararpy/smp/plots.py +103 -76
- ararpy/smp/sample.py +44 -11
- ararpy/smp/style.py +23 -16
- {ararpy-0.1.197.dist-info → ararpy-0.1.199.dist-info}/METADATA +1 -1
- {ararpy-0.1.197.dist-info → ararpy-0.1.199.dist-info}/RECORD +17 -17
- {ararpy-0.1.197.dist-info → ararpy-0.1.199.dist-info}/WHEEL +0 -0
- {ararpy-0.1.197.dist-info → ararpy-0.1.199.dist-info}/licenses/LICENSE +0 -0
- {ararpy-0.1.197.dist-info → ararpy-0.1.199.dist-info}/top_level.txt +0 -0
ararpy/__init__.py
CHANGED
ararpy/calc/age.py
CHANGED
|
@@ -67,8 +67,6 @@ def calc_age_min(F, sF, **kwargs) -> tuple:
|
|
|
67
67
|
# Kp = arr.array_as_float(kwargs.pop('Kp'))
|
|
68
68
|
# sKp = arr.array_as_float(kwargs.pop('sKp') * Kp / 100)
|
|
69
69
|
|
|
70
|
-
print(f"{t = }, {st = }")
|
|
71
|
-
|
|
72
70
|
# recalculation using Min et al.(2000) equation
|
|
73
71
|
# lmd = A * W * Y / (f * No)
|
|
74
72
|
V = f * No / ((Ab + Ae) * W * Y)
|
ararpy/calc/arr.py
CHANGED
|
@@ -67,10 +67,11 @@ def div(a, b):
|
|
|
67
67
|
n = np.shape([a, b])[-1]
|
|
68
68
|
k0, k1 = [], []
|
|
69
69
|
for i in range(n):
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
(np.divide(a[1][i] ** 2, b[0][i] ** 2) +
|
|
73
|
-
|
|
70
|
+
try:
|
|
71
|
+
k0.append(np.divide(a[0][i], b[0][i]))
|
|
72
|
+
k1.append((np.divide(a[1][i] ** 2, b[0][i] ** 2) + np.divide(a[0][i] ** 2 * b[1][i] ** 2, b[0][i] ** 4)) ** .5)
|
|
73
|
+
except TypeError as e:
|
|
74
|
+
raise TypeError(f"a = {a[0][i]}, b = {b[0][i]}, {e}")
|
|
74
75
|
return [k0, k1]
|
|
75
76
|
|
|
76
77
|
|
ararpy/calc/corr.py
CHANGED
|
@@ -72,18 +72,18 @@ def mdf(rm: float, srm: float, m1: float, m2: float, ra: float = 298.56,
|
|
|
72
72
|
v3 = err.div((np.log(ra / rm), v1), (np.log(ratio_m), v2))
|
|
73
73
|
k4 = err.div((np.log(ra / rm) / np.log(ratio_m), v3), (m1, sm1))
|
|
74
74
|
except Exception:
|
|
75
|
-
k3, k4 =
|
|
75
|
+
k3, k4 = 0, 0
|
|
76
76
|
# pow
|
|
77
77
|
try:
|
|
78
78
|
k5 = pow((ra / rm), (1 / delta_m)) # Renne2009, B.D. Turrin2010
|
|
79
79
|
k6 = err.pow((ra / rm, err.div((ra, sra), (rm, srm))),
|
|
80
80
|
(1 / delta_m, err.div((1, 0), (delta_m, sdelta_m))))
|
|
81
81
|
except Exception:
|
|
82
|
-
k5, k6 =
|
|
83
|
-
return k1, k2, k3, k4, k5, k6
|
|
82
|
+
k5, k6 = 0, 0
|
|
83
|
+
return k1, k2, k2, k2, k3, k4, k4, k4, k5, k6, k6, k6
|
|
84
84
|
else:
|
|
85
85
|
mdf_line_2 = (rm / ra - 1) / delta_m # Ryu et al., 2013
|
|
86
|
-
return mdf_line_2, 0, 0, 0, 0, 0
|
|
86
|
+
return mdf_line_2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
|
87
87
|
|
|
88
88
|
|
|
89
89
|
def discr(a0: list, e0: list, mdf: list, smdf: list, m: list, m40: list,
|
ararpy/calc/jvalue.py
CHANGED
ararpy/calc/plot.py
CHANGED
|
@@ -39,8 +39,11 @@ def get_axis_scale(data: list, count=6, increment=None, extra_count=0, min_inter
|
|
|
39
39
|
"""
|
|
40
40
|
if len(data) == 0:
|
|
41
41
|
return 0, 1, 5, 0.2 # Default return
|
|
42
|
-
_max =
|
|
43
|
-
_min =
|
|
42
|
+
_max = np.ma.masked_invalid(data).max()
|
|
43
|
+
_min = np.ma.masked_invalid(data).min()
|
|
44
|
+
if isinstance(_max, np.ma.core.MaskedConstant) or isinstance(_min, np.ma.core.MaskedConstant):
|
|
45
|
+
return 0, 1, 5, 0.2 # Default return
|
|
46
|
+
_max = float(_max); _min = float(_min)
|
|
44
47
|
interval = (_max - _min) / count
|
|
45
48
|
if interval == 0:
|
|
46
49
|
interval = 10
|
ararpy/smp/basic.py
CHANGED
|
@@ -59,24 +59,81 @@ def calc_apparent_ages(smp: Sample):
|
|
|
59
59
|
|
|
60
60
|
|
|
61
61
|
def calc_j(ar40ar39=None, params: dict = None, smp: Sample = None, index: list = None):
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
params_index_dict = {
|
|
63
|
+
34: 'L', 35: 'rsL', 59: 'Age', 60: 'sAge'
|
|
64
|
+
}
|
|
65
|
+
if ar40ar39 is None and smp is not None:
|
|
66
|
+
ar40ar39 = smp.ApparentAgeValues[0:2] # ar40ar39 air, error
|
|
67
|
+
if len(np.shape(ar40ar39)) == 1:
|
|
68
|
+
ar40ar39 = np.reshape(ar40ar39, (2, 1))
|
|
69
|
+
if index is None:
|
|
70
|
+
index = list(range(np.shape(ar40ar39)[-1]))
|
|
71
|
+
if smp is None and params is None:
|
|
72
|
+
raise ValueError(f"Parameters are required for calculating mdf, or it is empty.")
|
|
73
|
+
if params is not None:
|
|
74
|
+
for key, val in params.items():
|
|
75
|
+
if not isinstance(val, list):
|
|
76
|
+
params[key] = list(val)
|
|
77
|
+
if smp is not None:
|
|
78
|
+
try:
|
|
79
|
+
params_from_smp = dict(zip(
|
|
80
|
+
list(params_index_dict.values()),
|
|
81
|
+
[[smp.TotalParam[i][j] for j in index] for i in params_index_dict.keys()]
|
|
82
|
+
))
|
|
83
|
+
except Exception:
|
|
84
|
+
print(traceback.format_exc())
|
|
85
|
+
raise ValueError(f"Parameters cannot be found in the given sample object")
|
|
86
|
+
if params is not None:
|
|
87
|
+
params_from_smp.update(params)
|
|
88
|
+
params = params_from_smp
|
|
89
|
+
|
|
90
|
+
j = calc.jvalue.j_value(params['Age'], params['sAge'], *ar40ar39, params['L'], params['rsL'])
|
|
91
|
+
|
|
92
|
+
if len(index) == 1:
|
|
93
|
+
return np.array(j).squeeze().tolist()
|
|
94
|
+
else:
|
|
95
|
+
return np.array(j).tolist()
|
|
67
96
|
|
|
68
97
|
|
|
69
98
|
def calc_mdf(ar40ar36=None, params: dict = None, smp: Sample = None, index: list = None):
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
99
|
+
params_index_dict = {
|
|
100
|
+
71: 'M36', 72: 'sM36', 79: 'M40', 80: 'sM40', 93: 'Air', 94: 'sAir', 100: 'Discr'
|
|
101
|
+
}
|
|
102
|
+
if ar40ar36 is None and smp is not None:
|
|
103
|
+
ar40ar36 = smp.ApparentAgeValues[0:2] # ar40ar36 air, error
|
|
104
|
+
if len(np.shape(ar40ar36)) == 1:
|
|
105
|
+
ar40ar36 = np.reshape(ar40ar36, (2, 1))
|
|
106
|
+
if index is None:
|
|
107
|
+
index = list(range(np.shape(ar40ar36)[-1]))
|
|
108
|
+
if smp is None and params is None:
|
|
109
|
+
raise ValueError(f"Parameters are required for calculating mdf, or it is empty.")
|
|
110
|
+
if params is not None:
|
|
111
|
+
for key, val in params.items():
|
|
112
|
+
if not isinstance(val, list):
|
|
113
|
+
params[key] = list(val)
|
|
114
|
+
if smp is not None:
|
|
115
|
+
try:
|
|
116
|
+
params_from_smp = dict(zip(
|
|
117
|
+
list(params_index_dict.values()),
|
|
118
|
+
[[smp.TotalParam[i][j] for j in index] for i in params_index_dict.keys()]
|
|
119
|
+
))
|
|
120
|
+
except Exception:
|
|
121
|
+
print(traceback.format_exc())
|
|
122
|
+
raise ValueError(f"Parameters cannot be found in the given sample object")
|
|
123
|
+
if params is not None:
|
|
124
|
+
params_from_smp.update(params)
|
|
125
|
+
params = params_from_smp
|
|
126
|
+
|
|
75
127
|
mdf = []
|
|
76
|
-
for i in range(len(
|
|
77
|
-
k = calc.corr.mdf(
|
|
78
|
-
|
|
79
|
-
|
|
128
|
+
for i in range(len(index)):
|
|
129
|
+
k = calc.corr.mdf(ar40ar36[0][i], ar40ar36[1][i], params['M36'][i], params['M40'][i],
|
|
130
|
+
params['Air'][i], params['sAir'][i]) # linear, exp, pow
|
|
131
|
+
mdf.append({"linear": k[0:4], "exp": k[4:8], "pow": k[8:12]}[params['Discr'][i].lower()])
|
|
132
|
+
|
|
133
|
+
if len(index) == 1:
|
|
134
|
+
return np.transpose(mdf).squeeze().tolist()
|
|
135
|
+
else:
|
|
136
|
+
return np.transpose(mdf).tolist()
|
|
80
137
|
|
|
81
138
|
|
|
82
139
|
def calc_age(ar40ar39=None, params: dict = None, smp: Sample = None, index: list = None):
|
ararpy/smp/corr.py
CHANGED
|
@@ -25,16 +25,15 @@ from .sample import Sample
|
|
|
25
25
|
def corr_gain(sample: Sample):
|
|
26
26
|
"""Blank Correction"""
|
|
27
27
|
corrGain = True
|
|
28
|
-
gain_corrected = np.zeros([10,
|
|
28
|
+
gain_corrected = np.zeros([10, sample.Info.experiment.step_num])
|
|
29
29
|
try:
|
|
30
30
|
for i in range(5):
|
|
31
31
|
f, sf = np.array(sample.TotalParam[126 + i * 2:128 + i * 2])
|
|
32
32
|
sf = f * sf / 100
|
|
33
33
|
gain_corrected[i * 2:2 + i * 2] = calc.corr.gain(*sample.SampleIntercept[i * 2:2 + i * 2], f, sf)
|
|
34
|
-
except Exception as e:
|
|
35
|
-
print(f"Gain correction failed")
|
|
36
|
-
|
|
37
|
-
return
|
|
34
|
+
except (Exception, BaseException) as e:
|
|
35
|
+
print(f"Gain correction failed: \n{traceback.format_exc()}")
|
|
36
|
+
raise
|
|
38
37
|
for i in range(0, 10, 2):
|
|
39
38
|
gain_corrected[i] = [gain_corrected[i][index] if corrGain else j for index, j in enumerate(sample.SampleIntercept[i])]
|
|
40
39
|
gain_corrected[i + 1] = [gain_corrected[i + 1][index] if corrGain else j for index, j in enumerate(sample.SampleIntercept[i + 1])]
|
ararpy/smp/initial.py
CHANGED
|
@@ -237,7 +237,7 @@ def initial(smp: Sample):
|
|
|
237
237
|
return smp
|
|
238
238
|
|
|
239
239
|
|
|
240
|
-
def initial_plot_styles(
|
|
240
|
+
def initial_plot_styles(smp: Sample, except_attrs=None):
|
|
241
241
|
"""
|
|
242
242
|
Initialize plot components styles based on Default Styles. Except attrs is a list containing attrs
|
|
243
243
|
that are not expected to be initialized.
|
|
@@ -261,13 +261,22 @@ def initial_plot_styles(sample: Sample, except_attrs=None):
|
|
|
261
261
|
for k, v in value.items():
|
|
262
262
|
set_attr(getattr(obj, name), k, v)
|
|
263
263
|
|
|
264
|
-
default_styles =
|
|
264
|
+
default_styles = get_default_plot_style(smp)
|
|
265
265
|
for figure_index, figure_attr in default_styles.items():
|
|
266
|
-
plot = getattr(
|
|
266
|
+
plot = getattr(smp, figure_attr['attr_name'], Plot())
|
|
267
267
|
for key, attr in figure_attr.items():
|
|
268
268
|
set_attr(plot, key, attr)
|
|
269
269
|
|
|
270
270
|
|
|
271
|
+
def get_default_plot_style(smp: Sample):
|
|
272
|
+
sample_type = smp.Info.sample.type
|
|
273
|
+
try:
|
|
274
|
+
age_unit = str(smp.Info.preference['ageUnit']).capitalize()
|
|
275
|
+
except:
|
|
276
|
+
age_unit = "Undefined"
|
|
277
|
+
return copy.deepcopy(samples.DEFAULT_PLOT_STYLES(sample_type, age_unit))
|
|
278
|
+
|
|
279
|
+
|
|
271
280
|
def re_set_smp(smp: Sample):
|
|
272
281
|
std = initial(Sample())
|
|
273
282
|
basic.get_merged_smp(smp, std)
|
|
@@ -296,13 +305,13 @@ def check_version(smp: Sample):
|
|
|
296
305
|
# 20250404
|
|
297
306
|
doNormalize = True
|
|
298
307
|
v, sv = [], []
|
|
299
|
-
if smp.Info.sample.type.lower()
|
|
308
|
+
if smp.Info.sample.type.lower() == "unknown":
|
|
300
309
|
v, sv = smp.TotalParam[67:69]
|
|
301
310
|
sv = np.multiply(v, sv) / 100
|
|
302
|
-
elif smp.Info.sample.type.lower()
|
|
303
|
-
v, sv = smp.TotalParam[95
|
|
311
|
+
elif smp.Info.sample.type.lower() == "air":
|
|
312
|
+
v, sv = smp.TotalParam[93:95]
|
|
304
313
|
sv = np.multiply(v, sv) / 100
|
|
305
|
-
elif smp.Info.sample.type.lower()
|
|
314
|
+
elif smp.Info.sample.type.lower() == "standard":
|
|
306
315
|
v, sv = smp.TotalParam[59:61]
|
|
307
316
|
smp.NormalizeFactor = [
|
|
308
317
|
[1 if v[0] == each or not doNormalize else v[0] / each for each in v],
|
ararpy/smp/plots.py
CHANGED
|
@@ -89,27 +89,27 @@ def set_plot_data(sample: Sample, isInit: bool = True, isIsochron: bool = True,
|
|
|
89
89
|
# =======================
|
|
90
90
|
# Initialize plot data
|
|
91
91
|
# =======================
|
|
92
|
-
def initial_plot_data(
|
|
92
|
+
def initial_plot_data(smp: Sample):
|
|
93
93
|
"""
|
|
94
94
|
Assign initial data for plots
|
|
95
95
|
Parameters
|
|
96
96
|
----------
|
|
97
|
-
|
|
97
|
+
smp : Sample instance
|
|
98
98
|
|
|
99
99
|
Returns
|
|
100
100
|
-------
|
|
101
101
|
None
|
|
102
102
|
"""
|
|
103
103
|
for key, val in ISOCHRON_INDEX_DICT.items():
|
|
104
|
-
figure = basic.get_component_byid(
|
|
104
|
+
figure = basic.get_component_byid(smp, key)
|
|
105
105
|
try:
|
|
106
106
|
# data = [x, sx, y, sy, (z, sz,) r1, (r2, r3,), index from 1]
|
|
107
|
-
figure.data =
|
|
108
|
-
[[i + 1 for i in range(len(
|
|
107
|
+
figure.data = smp.IsochronValues[val['data_index'][0]:val['data_index'][1]] + \
|
|
108
|
+
[[i + 1 for i in range(len(smp.SequenceName))]]
|
|
109
109
|
except (Exception, BaseException):
|
|
110
110
|
print(traceback.format_exc())
|
|
111
111
|
figure.data = [[]] * (val['data_index'][1] - val['data_index'][0]) + \
|
|
112
|
-
[[i + 1 for i in range(len(
|
|
112
|
+
[[i + 1 for i in range(len(smp.SequenceName))]]
|
|
113
113
|
finally:
|
|
114
114
|
# Ellipse
|
|
115
115
|
if key != 'figure_7':
|
|
@@ -122,51 +122,64 @@ def initial_plot_data(sample: Sample):
|
|
|
122
122
|
# Set age spectra lines
|
|
123
123
|
# Try to calculate total gas age
|
|
124
124
|
try:
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
if str(smp.Info.sample.type).lower() == "unknown":
|
|
126
|
+
a0, e0 = sum(smp.DegasValues[24]), pow(sum([i ** 2 for i in smp.DegasValues[25]]), 0.5)
|
|
127
|
+
a1, e1 = sum(smp.DegasValues[20]), pow(sum([i ** 2 for i in smp.DegasValues[21]]), 0.5)
|
|
128
|
+
handle = basic.calc_age
|
|
129
|
+
elif str(smp.Info.sample.type).lower() == "standard":
|
|
130
|
+
a0, e0 = sum(smp.DegasValues[24]), pow(sum([i ** 2 for i in smp.DegasValues[25]]), 0.5)
|
|
131
|
+
a1, e1 = sum(smp.DegasValues[20]), pow(sum([i ** 2 for i in smp.DegasValues[21]]), 0.5)
|
|
132
|
+
handle = basic.calc_j
|
|
133
|
+
elif str(smp.Info.sample.type).lower() == "air":
|
|
134
|
+
a0, e0 = sum(smp.DegasValues[26]), pow(sum([i ** 2 for i in smp.DegasValues[27]]), 0.5)
|
|
135
|
+
a1, e1 = sum(smp.DegasValues[ 0]), pow(sum([i ** 2 for i in smp.DegasValues[ 1]]), 0.5)
|
|
136
|
+
handle = basic.calc_mdf
|
|
137
|
+
else:
|
|
138
|
+
raise TypeError(f"Sample type is not supported: {smp.Info.sample.type}")
|
|
127
139
|
total_f = [a0 / a1, calc.err.div((a0, e0), (a1, e1))]
|
|
128
|
-
total_age =
|
|
140
|
+
total_age = handle(total_f[:2], smp=smp)
|
|
129
141
|
except (Exception, BaseException):
|
|
130
142
|
print(traceback.format_exc())
|
|
131
143
|
total_f = [np.nan] * 2
|
|
132
144
|
total_age = [np.nan] * 4
|
|
133
|
-
|
|
145
|
+
print(f"{total_f = }")
|
|
146
|
+
print(f"{total_age = }")
|
|
147
|
+
smp.Info.results.age_spectra['TGA'].update(
|
|
134
148
|
{'Ar39': 100, 'F': total_f[0], 'sF': total_f[1], 'age': total_age[0],
|
|
135
|
-
's1': total_age[1], 's2': total_age[2], 's3': total_age[3], 'Num': len(
|
|
149
|
+
's1': total_age[1], 's2': total_age[2], 's3': total_age[3], 'Num': len(smp.DegasValues[24])}
|
|
136
150
|
)
|
|
137
151
|
try:
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
sample.AgeSpectraPlot.data = calc.arr.transpose(sample.AgeSpectraPlot.data)
|
|
152
|
+
smp.AgeSpectraPlot.data = calc.spectra.get_data(*smp.ApparentAgeValues[2:4], smp.ApparentAgeValues[7])
|
|
153
|
+
smp.AgeSpectraPlot.data = calc.arr.transpose(smp.AgeSpectraPlot.data)
|
|
141
154
|
except (Exception, BaseException):
|
|
142
155
|
print(traceback.format_exc())
|
|
143
|
-
|
|
156
|
+
smp.AgeSpectraPlot.data = []
|
|
144
157
|
|
|
145
158
|
# Degassing plot
|
|
146
159
|
try:
|
|
147
|
-
if not hasattr(
|
|
148
|
-
setattr(
|
|
160
|
+
if not hasattr(smp, 'DegasPatternPlot'):
|
|
161
|
+
setattr(smp, 'DegasPatternPlot', Plot(id='figure_8', name='Degas Pattern Plot'))
|
|
149
162
|
isotope_percentage = lambda l: [e / sum(l) * 100 if sum(l) != 0 else 0 for e in l]
|
|
150
|
-
|
|
151
|
-
isotope_percentage(
|
|
152
|
-
isotope_percentage(
|
|
153
|
-
isotope_percentage(
|
|
154
|
-
isotope_percentage(
|
|
155
|
-
isotope_percentage(
|
|
156
|
-
isotope_percentage(
|
|
157
|
-
isotope_percentage(
|
|
158
|
-
isotope_percentage(
|
|
159
|
-
isotope_percentage(
|
|
160
|
-
isotope_percentage(
|
|
163
|
+
smp.DegasPatternPlot.data = [
|
|
164
|
+
isotope_percentage(smp.DegasValues[0]), # Ar36a
|
|
165
|
+
isotope_percentage(smp.DegasValues[8]), # Ar37Ca
|
|
166
|
+
isotope_percentage(smp.DegasValues[10]), # Ar38Cl
|
|
167
|
+
isotope_percentage(smp.DegasValues[20]), # Ar39K
|
|
168
|
+
isotope_percentage(smp.DegasValues[24]), # Ar40r
|
|
169
|
+
isotope_percentage(smp.CorrectedValues[0]), # Ar36
|
|
170
|
+
isotope_percentage(smp.CorrectedValues[2]), # Ar37
|
|
171
|
+
isotope_percentage(smp.CorrectedValues[4]), # Ar38
|
|
172
|
+
isotope_percentage(smp.CorrectedValues[6]), # Ar39
|
|
173
|
+
isotope_percentage(smp.CorrectedValues[8]), # Ar40
|
|
161
174
|
]
|
|
162
|
-
|
|
175
|
+
smp.DegasPatternPlot.info = [True] * 10
|
|
163
176
|
except Exception as e:
|
|
164
177
|
print(traceback.format_exc())
|
|
165
178
|
pass
|
|
166
179
|
|
|
167
180
|
# Set age distribution plot data
|
|
168
181
|
try:
|
|
169
|
-
recalc_agedistribution(
|
|
182
|
+
recalc_agedistribution(smp)
|
|
170
183
|
except Exception as e:
|
|
171
184
|
print(traceback.format_exc())
|
|
172
185
|
|
|
@@ -390,7 +403,7 @@ def recalc_plateaus(sample: Sample, **kwargs):
|
|
|
390
403
|
if sample.Info.sample.type == "Standard":
|
|
391
404
|
return recalc_j_plateaus(sample, **kwargs)
|
|
392
405
|
if sample.Info.sample.type == "Air":
|
|
393
|
-
return
|
|
406
|
+
return recalc_mdf_plateaus(sample, **kwargs)
|
|
394
407
|
|
|
395
408
|
|
|
396
409
|
def recalc_age_plateaus(sample: Sample, **kwargs):
|
|
@@ -437,7 +450,7 @@ def recalc_age_plateaus(sample: Sample, **kwargs):
|
|
|
437
450
|
try:
|
|
438
451
|
set1_res, set1_age, set1_data = get_plateau_results(
|
|
439
452
|
sample, sample.SelectedSequence1, calc_ar40ar39(*ratio_set1, smp=sample),
|
|
440
|
-
ar39k_percentage=np.
|
|
453
|
+
ar39k_percentage=np.array(ar39k) / np.sum(ar39k),
|
|
441
454
|
**kwargs)
|
|
442
455
|
except ValueError:
|
|
443
456
|
# print(traceback.format_exc())
|
|
@@ -450,7 +463,7 @@ def recalc_age_plateaus(sample: Sample, **kwargs):
|
|
|
450
463
|
try:
|
|
451
464
|
set2_res, set2_age, set2_data = get_plateau_results(
|
|
452
465
|
sample, sample.SelectedSequence2, calc_ar40ar39(*ratio_set2, smp=sample),
|
|
453
|
-
ar39k_percentage=np.
|
|
466
|
+
ar39k_percentage=np.array(ar39k) / np.sum(ar39k),
|
|
454
467
|
**kwargs)
|
|
455
468
|
except ValueError:
|
|
456
469
|
# print(traceback.format_exc())
|
|
@@ -464,7 +477,7 @@ def recalc_age_plateaus(sample: Sample, **kwargs):
|
|
|
464
477
|
# Weighted mean ages of two sets with 298.56 (defoult air ratio)
|
|
465
478
|
try:
|
|
466
479
|
set1_res = get_wma_results(
|
|
467
|
-
sample, sample.SelectedSequence1, ar40rar39k=ar40rar39k, ar39k_percentage=np.
|
|
480
|
+
sample, sample.SelectedSequence1, ar40rar39k=ar40rar39k, ar39k_percentage=np.array(ar39k) / np.sum(ar39k))
|
|
468
481
|
except ValueError:
|
|
469
482
|
pass
|
|
470
483
|
# raise ValueError(f"Set 1 WMA calculation error.")
|
|
@@ -472,7 +485,7 @@ def recalc_age_plateaus(sample: Sample, **kwargs):
|
|
|
472
485
|
sample.Info.results.age_spectra.update({0: set1_res})
|
|
473
486
|
try:
|
|
474
487
|
set2_res = get_wma_results(
|
|
475
|
-
sample, sample.SelectedSequence2, ar40rar39k=ar40rar39k, ar39k_percentage=np.
|
|
488
|
+
sample, sample.SelectedSequence2, ar40rar39k=ar40rar39k, ar39k_percentage=np.array(ar39k) / np.sum(ar39k))
|
|
476
489
|
except ValueError:
|
|
477
490
|
pass
|
|
478
491
|
# raise ValueError(f"Set 2 WMA calculation error.")
|
|
@@ -552,6 +565,41 @@ def recalc_age_plateaus(sample: Sample, **kwargs):
|
|
|
552
565
|
# # """end"""
|
|
553
566
|
|
|
554
567
|
|
|
568
|
+
def recalc_mdf_plateaus(sample: Sample, **kwargs):
|
|
569
|
+
"""
|
|
570
|
+
Calculate age plateaus results
|
|
571
|
+
Parameters
|
|
572
|
+
----------
|
|
573
|
+
sample : sample instance
|
|
574
|
+
kwargs : optional args, keys in [r1, sr1, r2, sr2]
|
|
575
|
+
|
|
576
|
+
Returns
|
|
577
|
+
-------
|
|
578
|
+
None
|
|
579
|
+
"""
|
|
580
|
+
ar36a, sar36a = calc.arr.mul(sample.DegasValues[0:2], sample.NormalizeFactor)
|
|
581
|
+
ar40aar36a = sample.ApparentAgeValues[0:2]
|
|
582
|
+
mdf = sample.ApparentAgeValues[2:4]
|
|
583
|
+
|
|
584
|
+
try:
|
|
585
|
+
set1_res, _, set1_data = get_plateau_results(sample, sample.SelectedSequence1, ar40rar39k=ar40aar36a)
|
|
586
|
+
except ValueError:
|
|
587
|
+
pass
|
|
588
|
+
else:
|
|
589
|
+
sample.Info.results.age_plateau.update({0: set1_res})
|
|
590
|
+
sample.AgeSpectraPlot.set1.data = calc.arr.transpose(set1_data)
|
|
591
|
+
sample.AgeSpectraPlot.text1.text = ""
|
|
592
|
+
|
|
593
|
+
try:
|
|
594
|
+
set2_res, _, set2_data = get_plateau_results(sample, sample.SelectedSequence2, ar40rar39k=ar40aar36a)
|
|
595
|
+
except ValueError:
|
|
596
|
+
pass
|
|
597
|
+
else:
|
|
598
|
+
sample.Info.results.age_plateau.update({1: set2_res})
|
|
599
|
+
sample.AgeSpectraPlot.set2.data = calc.arr.transpose(set2_data)
|
|
600
|
+
sample.AgeSpectraPlot.text2.text = ""
|
|
601
|
+
|
|
602
|
+
|
|
555
603
|
def calc_ar40ar39(r, sr, smp):
|
|
556
604
|
"""
|
|
557
605
|
Calculate Ar40r / Ar39K based on passed initial ratio.
|
|
@@ -586,20 +634,20 @@ def calc_ar40ar39(r, sr, smp):
|
|
|
586
634
|
return ar40rar39k
|
|
587
635
|
|
|
588
636
|
|
|
589
|
-
def get_plateau_results(
|
|
637
|
+
def get_plateau_results(smp: Sample, sequence: list, ar40rar39k: list = None,
|
|
590
638
|
ar39k_percentage: list = None, **kwargs):
|
|
591
639
|
"""
|
|
592
640
|
Get initial ratio re-corrected plateau results
|
|
593
641
|
Parameters
|
|
594
642
|
----------
|
|
595
|
-
|
|
643
|
+
smp : sample instance
|
|
596
644
|
sequence : data slice index
|
|
597
645
|
ar40rar39k :
|
|
598
646
|
ar39k_percentage : Ar39K released
|
|
599
647
|
|
|
600
648
|
Returns
|
|
601
649
|
-------
|
|
602
|
-
three
|
|
650
|
+
three items tuple, result dict, age, and plot data, results keys = [
|
|
603
651
|
'F', 'sF', 'Num', 'MSWD', 'Chisq', 'Pvalue',
|
|
604
652
|
'age', 's1', 's2', 's3', 'Ar39', 'rs'
|
|
605
653
|
]
|
|
@@ -616,21 +664,28 @@ def get_plateau_results(sample: Sample, sequence: list, ar40rar39k: list = None,
|
|
|
616
664
|
if len(sequence) == 0:
|
|
617
665
|
return plateau_res, [], []
|
|
618
666
|
if ar40rar39k is None:
|
|
619
|
-
ar40rar39k =
|
|
667
|
+
ar40rar39k = smp.ApparentAgeValues[0:2]
|
|
620
668
|
if ar39k_percentage is None:
|
|
621
|
-
ar39k_percentage =
|
|
669
|
+
ar39k_percentage = smp.ApparentAgeValues[7]
|
|
670
|
+
|
|
671
|
+
if str(smp.Info.sample.type).lower() == "unknown":
|
|
672
|
+
handle = basic.calc_age
|
|
673
|
+
elif str(smp.Info.sample.type).lower() == "standard":
|
|
674
|
+
handle = basic.calc_j
|
|
675
|
+
elif str(smp.Info.sample.type).lower() == "air":
|
|
676
|
+
handle = basic.calc_mdf
|
|
677
|
+
else:
|
|
678
|
+
raise TypeError(f"Sample type is not supported: {smp.Info.sample.type}")
|
|
622
679
|
|
|
623
|
-
age =
|
|
680
|
+
age = handle(ar40ar39=ar40rar39k, smp=smp)[0:2]
|
|
624
681
|
plot_data = calc.spectra.get_data(*age, ar39k_percentage, indices=sequence, **kwargs)
|
|
625
682
|
f_values = _get_partial(sequence, *ar40rar39k)
|
|
626
683
|
age = _get_partial(sequence, *age)
|
|
627
684
|
sum_ar39k = sum(_get_partial(sequence, ar39k_percentage)[0])
|
|
628
685
|
wmf = calc.arr.wtd_mean(*f_values)
|
|
629
|
-
wmage =
|
|
686
|
+
wmage = handle(wmf[0:2], smp=smp)
|
|
630
687
|
|
|
631
|
-
plateau_res.update(dict(zip(
|
|
632
|
-
plateau_res_keys, [*wmf, *wmage, sum_ar39k, np.nan]
|
|
633
|
-
)))
|
|
688
|
+
plateau_res.update(dict(zip(plateau_res_keys, [*wmf, *wmage, sum_ar39k, np.nan])))
|
|
634
689
|
return plateau_res, age, plot_data
|
|
635
690
|
|
|
636
691
|
|
|
@@ -679,13 +734,11 @@ def get_wma_results(sample: Sample, sequence: list, ar40rar39k: list = None, ar3
|
|
|
679
734
|
|
|
680
735
|
def recalc_j_plateaus(sample: Sample, **kwargs):
|
|
681
736
|
|
|
682
|
-
|
|
683
|
-
|
|
737
|
+
ar40rar39k = sample.ApparentAgeValues[0:2]
|
|
684
738
|
j = sample.ApparentAgeValues[2:4]
|
|
685
739
|
|
|
686
740
|
try:
|
|
687
|
-
set1_res, _, set1_data =
|
|
688
|
-
get_j_plateau_results(sample, sample.SelectedSequence1, j)
|
|
741
|
+
set1_res, _, set1_data = get_plateau_results(sample, sample.SelectedSequence1, ar40rar39k=ar40rar39k)
|
|
689
742
|
except ValueError:
|
|
690
743
|
pass
|
|
691
744
|
else:
|
|
@@ -694,8 +747,7 @@ def recalc_j_plateaus(sample: Sample, **kwargs):
|
|
|
694
747
|
sample.AgeSpectraPlot.text1.text = "" # 注意和js的配合,js那边根据text是否为空判断是否重新生成文字
|
|
695
748
|
|
|
696
749
|
try:
|
|
697
|
-
set2_res, _, set2_data =
|
|
698
|
-
get_j_plateau_results(sample, sample.SelectedSequence2, j)
|
|
750
|
+
set2_res, _, set2_data = get_plateau_results(sample, sample.SelectedSequence2, ar40rar39k=ar40rar39k)
|
|
699
751
|
except ValueError:
|
|
700
752
|
pass
|
|
701
753
|
else:
|
|
@@ -704,31 +756,6 @@ def recalc_j_plateaus(sample: Sample, **kwargs):
|
|
|
704
756
|
sample.AgeSpectraPlot.text2.text = "" # 注意和js的配合,js那边根据text是否为空判断是否重新生成文字
|
|
705
757
|
|
|
706
758
|
|
|
707
|
-
def get_j_plateau_results(sample: Sample, sequence: list, j: list, ar39k_percentage: list = None):
|
|
708
|
-
|
|
709
|
-
def _get_partial(points, *args):
|
|
710
|
-
# return [arg[min(points): max(points) + 1] for arg in args]
|
|
711
|
-
return [[arg[i] for i in points] for arg in args]
|
|
712
|
-
|
|
713
|
-
if ar39k_percentage is None:
|
|
714
|
-
ar39k_percentage = sample.ApparentAgeValues[7]
|
|
715
|
-
sum_ar39k = sum(_get_partial(sequence, ar39k_percentage)[0])
|
|
716
|
-
|
|
717
|
-
j_values = _get_partial(sequence, *j)
|
|
718
|
-
wmj = calc.arr.wtd_mean(*j_values)
|
|
719
|
-
plot_data = [[sum(ar39k_percentage[:min(sequence)]), sum(ar39k_percentage[:max(sequence) + 1])],
|
|
720
|
-
[wmj[0], wmj[0]]]
|
|
721
|
-
|
|
722
|
-
plateau_res_keys = [
|
|
723
|
-
'F', 'sF', 'Num', 'MSWD', 'Chisq', 'Pvalue', 'age', 's1', 's2', 's3', 'Ar39',
|
|
724
|
-
'rs', # 'rs' means relative error of the total sum
|
|
725
|
-
]
|
|
726
|
-
plateau_res = dict(zip(plateau_res_keys, [np.nan for i in plateau_res_keys]))
|
|
727
|
-
plateau_res.update(dict(zip(plateau_res_keys, [*wmj, np.nan, np.nan, np.nan, np.nan, sum_ar39k, np.nan])))
|
|
728
|
-
|
|
729
|
-
return plateau_res, 0, plot_data
|
|
730
|
-
|
|
731
|
-
|
|
732
759
|
# =======================
|
|
733
760
|
# Age Distribution Plot
|
|
734
761
|
# =======================
|
ararpy/smp/sample.py
CHANGED
|
@@ -54,7 +54,21 @@ PUBLISH_TABLE_HEADERS = [
|
|
|
54
54
|
'Sequence', '', # 0-1
|
|
55
55
|
'\u00B3\u2076Ar[a]', '\u00B3\u2077Ar[Ca]', '\u00B3\u2078Ar[Cl]', # 2-4
|
|
56
56
|
'\u00B3\u2079Ar[K]', '\u2074\u2070Ar[r]', # 5-6
|
|
57
|
-
'Apparent Age', '1\u03C3', '\u2074\
|
|
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', '', # 0-1
|
|
62
|
+
'\u00B3\u2076Ar[a]', '\u00B3\u2077Ar[Ca]', '\u00B3\u2078Ar[Cl]', # 2-4
|
|
63
|
+
'\u00B3\u2079Ar[K]', '\u2074\u2070Ar[r]', # 5-6
|
|
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', '', # 0-1
|
|
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 = [
|
|
@@ -63,6 +77,18 @@ SPECTRUM_TABLE_HEADERS = [
|
|
|
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', '', # 0-1
|
|
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', '', # 0-1
|
|
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
|
|
@@ -108,12 +134,12 @@ TOTAL_PARAMS_HEADERS = [
|
|
|
108
134
|
'Decay Activity \u2074\u2070K(\u03B2<sup>-</sup>)', '%1\u03C3', # 54-55
|
|
109
135
|
'Decay Activity \u2074\u2070K(\u03B2<sup>+</sup>)', '%1\u03C3', # 56-57
|
|
110
136
|
'\u00B3\u2076Cl/\u00B3\u2078Cl Productivity', '%1\u03C3', # 58-59
|
|
111
|
-
'Std Name', 'Std Age', '1\u03C3', '\u2074\u2070Ar%', '1\u03C3', 'K%', '1\u03C3',
|
|
112
|
-
'\u2074\u2070Ar<sup>*</sup>/K', '1\u03C3', #
|
|
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
|
|
113
139
|
'J', '%1\u03C3', 'MDF', '%1\u03C3', # 69-72
|
|
114
|
-
'Mass \u00B3\u2076Ar', '%1\u03C3', 'Mass \u00B3\u2077Ar', '%1\u03C3',
|
|
115
|
-
'Mass \u00B3\u2078Ar', '%1\u03C3', 'Mass \u00B3\u2079Ar', '%1\u03C3',
|
|
116
|
-
'Mass \u2074\u2070', '%1\u03C3', 'K Mass', '%1\u03C3', #
|
|
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
|
|
117
143
|
'No', '%1\u03C3', 'Year', '%1\u03C3', '\u2074\u2070K/K', '%1\u03C3',
|
|
118
144
|
'\u00B3\u2075Cl/\u00B3\u2077Cl', '%1\u03C3', 'HCl/Cl', '%1\u03C3', # 85-94
|
|
119
145
|
'\u2074\u2070Ar/\u00B3\u2076Ar air', '%1\u03C3', # 95-96
|
|
@@ -259,19 +285,26 @@ TOTAL_PARAMS_SHORT_HEADERS = [
|
|
|
259
285
|
'40Gain', '%1s', # 136-137
|
|
260
286
|
]
|
|
261
287
|
|
|
262
|
-
DEFAULT_PLOT_STYLES = {
|
|
288
|
+
DEFAULT_PLOT_STYLES = lambda sample_type, age_unit: {
|
|
263
289
|
'figure_1': {
|
|
264
|
-
'id': 'figure_1', 'name': 'Age Spectra'
|
|
290
|
+
'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",
|
|
291
|
+
'type': 'spectra', 'attr_name': 'AgeSpectraPlot',
|
|
265
292
|
'rightside_text': [],
|
|
266
|
-
'title': {'id': 'title', 'show': True,
|
|
293
|
+
'title': {'id': 'title', 'show': True,
|
|
294
|
+
'text': 'Age Spectra' if sample_type == "Unknown" else 'J Spectra' if sample_type == "Standard" else "MDF" if sample_type == "Air" else "Unkown Title",
|
|
295
|
+
'position': 'center',
|
|
267
296
|
'font_size': 18, 'color': '#333333', 'opacity': 1, 'type': 'text', 'font_weight': 'bolder',
|
|
268
297
|
'font_family': 'Microsoft Sans Serif', },
|
|
269
298
|
'xaxis': {
|
|
270
|
-
'title': {'text': 'Cumulative {sup|39}Ar Released (%)'
|
|
299
|
+
'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",
|
|
300
|
+
'type': 'text', }, 'type': 'axis',
|
|
271
301
|
'min': 0, 'max': 100, 'show_splitline': False, 'ticks_inside': False, 'split_number': 5, 'interval': 10,
|
|
272
302
|
},
|
|
273
303
|
'yaxis': {
|
|
274
|
-
'title': {
|
|
304
|
+
'title': {
|
|
305
|
+
'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",
|
|
306
|
+
'type': 'text',
|
|
307
|
+
}, 'type': 'axis',
|
|
275
308
|
'min': 0, 'max': 100, 'show_splitline': False, 'ticks_inside': False, 'split_number': 5, 'interval': 10,
|
|
276
309
|
},
|
|
277
310
|
'set1': {'id': 'Points Set 1', 'type': 'set', },
|
ararpy/smp/style.py
CHANGED
|
@@ -19,13 +19,26 @@ Sample = samples.Sample
|
|
|
19
19
|
Table = samples.Table
|
|
20
20
|
Plot = samples.Plot
|
|
21
21
|
|
|
22
|
-
TABLEHEADER = lambda index:
|
|
23
|
-
'',
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
]
|
|
22
|
+
TABLEHEADER = lambda index, sample_type: {
|
|
23
|
+
'Unknown': ['',
|
|
24
|
+
samples.SAMPLE_INTERCEPT_HEADERS, samples.BLANK_INTERCEPT_HEADERS,
|
|
25
|
+
samples.CORRECTED_HEADERS, samples.DEGAS_HEADERS, samples.PUBLISH_TABLE_HEADERS,
|
|
26
|
+
samples.SPECTRUM_TABLE_HEADERS, samples.ISOCHRON_TABLE_HEADERS,
|
|
27
|
+
samples.TOTAL_PARAMS_HEADERS
|
|
28
|
+
],
|
|
29
|
+
'Standard': ['',
|
|
30
|
+
samples.SAMPLE_INTERCEPT_HEADERS, samples.BLANK_INTERCEPT_HEADERS,
|
|
31
|
+
samples.CORRECTED_HEADERS, samples.DEGAS_HEADERS, samples.PUBLISH_TABLE_HEADERS_STD,
|
|
32
|
+
samples.SPECTRUM_TABLE_HEADERS_STD, samples.ISOCHRON_TABLE_HEADERS,
|
|
33
|
+
samples.TOTAL_PARAMS_HEADERS
|
|
34
|
+
],
|
|
35
|
+
'Air': ['',
|
|
36
|
+
samples.SAMPLE_INTERCEPT_HEADERS, samples.BLANK_INTERCEPT_HEADERS,
|
|
37
|
+
samples.CORRECTED_HEADERS, samples.DEGAS_HEADERS, samples.PUBLISH_TABLE_HEADERS_AIR,
|
|
38
|
+
samples.SPECTRUM_TABLE_HEADERS_AIR, samples.ISOCHRON_TABLE_HEADERS,
|
|
39
|
+
samples.TOTAL_PARAMS_HEADERS
|
|
40
|
+
],
|
|
41
|
+
}[sample_type][index]
|
|
29
42
|
|
|
30
43
|
|
|
31
44
|
# =======================
|
|
@@ -58,13 +71,6 @@ def set_plot_style(smp: Sample):
|
|
|
58
71
|
setattr(figure, 'title', Plot.Text())
|
|
59
72
|
setattr(getattr(figure, 'title'), 'text', f"{suffix} {getattr(figure, 'name', '')}")
|
|
60
73
|
|
|
61
|
-
age_unit = "Undefined"
|
|
62
|
-
try:
|
|
63
|
-
age_unit = str(smp.Info.preference['ageUnit']).capitalize()
|
|
64
|
-
except:
|
|
65
|
-
print(traceback.format_exc())
|
|
66
|
-
smp.AgeSpectraPlot.yaxis.title.text = f"Apparent Age ({age_unit})"
|
|
67
|
-
|
|
68
74
|
|
|
69
75
|
def reset_plot_scale(smp: Sample, only_figure: str = None):
|
|
70
76
|
"""
|
|
@@ -160,7 +166,8 @@ def reset_text(smp: Sample, only_figure: str = None):
|
|
|
160
166
|
-------
|
|
161
167
|
None
|
|
162
168
|
"""
|
|
163
|
-
|
|
169
|
+
default_styles = initial.get_default_plot_style(smp)
|
|
170
|
+
for figure_id in list(default_styles.keys()):
|
|
164
171
|
if only_figure is not None and figure_id != only_figure:
|
|
165
172
|
continue
|
|
166
173
|
figure = basic.get_component_byid(smp, figure_id)
|
|
@@ -190,7 +197,7 @@ def set_table_style(sample: Sample):
|
|
|
190
197
|
"""
|
|
191
198
|
for key, comp in basic.get_components(sample).items():
|
|
192
199
|
if isinstance(comp, Table):
|
|
193
|
-
comp.header = TABLEHEADER(index=int(comp.id))
|
|
200
|
+
comp.header = TABLEHEADER(sample_type=sample.Info.sample.type, index=int(comp.id))
|
|
194
201
|
comp.set_coltypes()
|
|
195
202
|
# comp.colcount = len(comp.header)
|
|
196
203
|
# comp.coltypes = [{'type': 'numeric'}] * (comp.colcount)
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
ararpy/__init__.py,sha256=
|
|
1
|
+
ararpy/__init__.py,sha256=pYgGSZqLShU0gpXzw0ACDxxCRJRm2Y78YlZxBAkes00,6858
|
|
2
2
|
ararpy/test.py,sha256=4F46-JJ1Ge12HGae0qO44Qc6kiEMHBgn2MsY_5LlHDo,3973
|
|
3
3
|
ararpy/calc/__init__.py,sha256=kUjRuLE8TLuKOv3i976RnGJoEMj23QBZDu37LWs81U4,322
|
|
4
|
-
ararpy/calc/age.py,sha256=
|
|
5
|
-
ararpy/calc/arr.py,sha256=
|
|
4
|
+
ararpy/calc/age.py,sha256=OcStt55LoYW1brs7a5_Ovv1NUSR5uZVQHDVGGmA_Pqg,5784
|
|
5
|
+
ararpy/calc/arr.py,sha256=jD1Fd0Cj3xc7NqgnG4cp3VWQWxUlV0qCtPBZZokDG8o,15246
|
|
6
6
|
ararpy/calc/basic.py,sha256=uJCCUFaPd9zvfkggrdbFYSGLl2pt7UJ7ENgXanzHy68,4036
|
|
7
|
-
ararpy/calc/corr.py,sha256=
|
|
7
|
+
ararpy/calc/corr.py,sha256=6hlBlFIM8HyN6CDuWPGqiLpVM88pZJLEuRm8vAyg9ng,18747
|
|
8
8
|
ararpy/calc/err.py,sha256=63LtprqjemlIb1QGDst4Ggcv5KMSDHdlAIL-nyQs1eA,2691
|
|
9
9
|
ararpy/calc/histogram.py,sha256=0GVbDdsjd91KQ1sa2B7NtZ4KGo0XpRIJapgIrzAwQUo,5777
|
|
10
10
|
ararpy/calc/isochron.py,sha256=ej9G2e68k6yszonWHsLcEubh3TA7eh1upTJP_X0ttAA,5726
|
|
11
|
-
ararpy/calc/jvalue.py,sha256=
|
|
12
|
-
ararpy/calc/plot.py,sha256=
|
|
11
|
+
ararpy/calc/jvalue.py,sha256=OL5zPYU8Pac-wOxUWPCgu3onh2n01xDnhpi2mlUsjJM,1146
|
|
12
|
+
ararpy/calc/plot.py,sha256=sUqjKBdAEjFarUoSCLqf8cbUM0rEAdZhmtyXB2K7LkA,2139
|
|
13
13
|
ararpy/calc/raw_funcs.py,sha256=UC01lvA6GyZ5FJv43jgoUULAFoLnZJMxeSa0BeVFCAM,2637
|
|
14
14
|
ararpy/calc/regression.py,sha256=w5kni6LGqvISvlvbBZnJ3N2c5eQjgkz3bBbj0PXPyGs,40251
|
|
15
15
|
ararpy/calc/spectra.py,sha256=_Q23eP9necHlaCoHf3_UfW1N3JmVZj5rcWFro8GS-CA,1995
|
|
@@ -41,26 +41,26 @@ ararpy/files/raw_file.py,sha256=5hnZMS7r78lA0ZXrBEN5SWVurQyl0QsHOI9rJz5BQv8,2230
|
|
|
41
41
|
ararpy/files/xls.py,sha256=DVcZ_yRnc19p-m4leGGjt-YPDpSa2udYKmGyrM0qub0,640
|
|
42
42
|
ararpy/smp/EXPORT_TO_PDF_DATA_PROPERTIES.py,sha256=baDM437tu6hsPv0uYfod0TREXlPd6kvMBFT1S9ZZlkk,3024
|
|
43
43
|
ararpy/smp/__init__.py,sha256=k6_fa27UJsQK7K7oC5GYlwMo6l0Xd8af3QtOrZz2XJk,478
|
|
44
|
-
ararpy/smp/basic.py,sha256=
|
|
44
|
+
ararpy/smp/basic.py,sha256=slRu3VnnQ4zCaA5GFqcd_N_Pby1_8lIsvhhLhHIJ7As,24821
|
|
45
45
|
ararpy/smp/calculation.py,sha256=LCFJWjLVLEKEQ5b7RFUIxsMahEzgLdodW4kCYXV5Z34,2919
|
|
46
46
|
ararpy/smp/consts.py,sha256=XIdjdz8cYxspG2jMnoItdlUsxr3hKbNFJjMZJh1bpzw,393
|
|
47
|
-
ararpy/smp/corr.py,sha256=
|
|
47
|
+
ararpy/smp/corr.py,sha256=s1t8VCM7M8WnwfIxWNIRva4ofGJPEPYpKxlb25skH8E,26515
|
|
48
48
|
ararpy/smp/diffusion_funcs.py,sha256=4-PMMIZWzjk2HOYYWNgSp4GmApygp1MmOxJ2g3xrqWc,175049
|
|
49
49
|
ararpy/smp/export.py,sha256=s89L5B1aHoCeJIjcw6nXA6NtV0j_5XXaWnOETWnomCs,115043
|
|
50
50
|
ararpy/smp/info.py,sha256=iKUELm-BuUduDlJKC1d8tKKNHbwwbNmhUg2pi6bcBvA,489
|
|
51
|
-
ararpy/smp/initial.py,sha256=
|
|
51
|
+
ararpy/smp/initial.py,sha256=VSNku2fYD1xGkpHxMqnSJCAhSQawfsDCdqYCxtDJryQ,17196
|
|
52
52
|
ararpy/smp/json.py,sha256=BTZCjVN0aj9epc700nwkYEYMKN2lHBYo-pLmtnz5oHY,2300
|
|
53
|
-
ararpy/smp/plots.py,sha256=
|
|
53
|
+
ararpy/smp/plots.py,sha256=Grx4GY2kh5KtvAwUV1iIDvQNQSrQd7IaliQ4cT6w01Y,33637
|
|
54
54
|
ararpy/smp/raw.py,sha256=51n-rrbW2FqeZHQyevuG7iObPLGvIBzTe414QDVM1FE,6523
|
|
55
|
-
ararpy/smp/sample.py,sha256=
|
|
56
|
-
ararpy/smp/style.py,sha256=
|
|
55
|
+
ararpy/smp/sample.py,sha256=ZOrQt3Ilm6tJbQCwh_btoZOXdkCngZFHCt10Nh0UmpI,57727
|
|
56
|
+
ararpy/smp/style.py,sha256=gCJ3F_vHnetrfbzEt-KgG5clRfosvJ00RJg6tN53QsQ,7678
|
|
57
57
|
ararpy/smp/table.py,sha256=9bNAOqAIOc0nSC3LNeqjJKUYSJSM28Ji3o9VimwMU8A,6645
|
|
58
58
|
ararpy/thermo/__init__.py,sha256=6VBuqTRFl403PVqOuMkVrut0nKaQsAosBmfW91X1dMg,263
|
|
59
59
|
ararpy/thermo/arrhenius.py,sha256=Ass1ichHfqIAtpv8eLlgrUc1UOb3Urh1qzr1E3gLB4U,233
|
|
60
60
|
ararpy/thermo/atomic_level_random_walk.py,sha256=Q97zfe2h2RaxADkoBAqd0uEiP16BFOajrTmXHMkL2EQ,25502
|
|
61
61
|
ararpy/thermo/basic.py,sha256=nBGHI9uK7VdJwThwBIOcKAzdnYqPyQseFoY6s4zKizk,11504
|
|
62
|
-
ararpy-0.1.
|
|
63
|
-
ararpy-0.1.
|
|
64
|
-
ararpy-0.1.
|
|
65
|
-
ararpy-0.1.
|
|
66
|
-
ararpy-0.1.
|
|
62
|
+
ararpy-0.1.199.dist-info/licenses/LICENSE,sha256=cvG5t_C1qY_zUyJI7sNOa7gCArdngNPaOrfujl2LYuc,1085
|
|
63
|
+
ararpy-0.1.199.dist-info/METADATA,sha256=qXSAfULa1Ha9bpoyosss1MzEfO69BEjReHjLkIcaTEU,24517
|
|
64
|
+
ararpy-0.1.199.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
|
65
|
+
ararpy-0.1.199.dist-info/top_level.txt,sha256=9iTpsPCYuRYq09yQTk9d2lqB8JtTEOmbN-IcGB-K3vY,7
|
|
66
|
+
ararpy-0.1.199.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|