ararpy 0.2.1__tar.gz → 0.2.3__tar.gz
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-0.2.1 → ararpy-0.2.3}/PKG-INFO +10 -1
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/__init__.py +2 -2
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/calc/corr.py +15 -16
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/calc/jvalue.py +7 -5
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/files/calc_file.py +4 -2
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/smp/basic.py +2 -2
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/smp/corr.py +20 -18
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/smp/export.py +1 -1
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/smp/initial.py +2 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/smp/sample.py +31 -15
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/smp/table.py +6 -7
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy.egg-info/PKG-INFO +10 -1
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy.egg-info/SOURCES.txt +1 -0
- ararpy-0.2.3/ararpy.egg-info/requires.txt +8 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/setup.py +5 -5
- {ararpy-0.2.1 → ararpy-0.2.3}/LICENSE +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/README.md +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/Example - Check arr.py +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/Example - Granite Cooling History.py +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/Example - Plot temperature calibration.py +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/Example - Show MDD results.py +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/Example - Show all Kfs age spectra.py +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/Example - Show random walk results.py +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/Example - Tc calculation.py +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/calc/__init__.py +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/calc/age.py +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/calc/arr.py +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/calc/basic.py +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/calc/err.py +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/calc/histogram.py +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/calc/isochron.py +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/calc/plot.py +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/calc/raw_funcs.py +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/calc/regression.py +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/calc/spectra.py +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/examples/022_VU124-M11a.ahd +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/examples/20WHA0103.age +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/examples/22WHA0078.xls +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/examples/22WHA0433.age +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/examples/22WHA0433.arr +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/examples/22WHA0433.full.xls +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/examples/24WHN0001-51-592.XLS +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/examples/AHD.input-filter +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/examples/ArAr.calc +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/examples/ArArCALC.age +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/examples/NGX-600 - Copy.TXT +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/examples/NGX-600.TXT +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/examples/NGX-XLS.input-filter +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/examples/Qtegra-exported-xls.input-filter +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/examples/S01-239.csv +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/examples/WH01.irra +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/examples/WHA.pdf +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/examples/raw_example.xls +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/examples/sample-default.smp +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/files/__init__.py +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/files/arr_file.py +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/files/basic.py +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/files/new_file.py +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/files/raw_file.py +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/files/xls.py +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/smp/EXPORT_TO_PDF_DATA_PROPERTIES.py +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/smp/__init__.py +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/smp/calculation.py +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/smp/consts.py +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/smp/diffusion_funcs.py +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/smp/info.py +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/smp/json.py +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/smp/plots.py +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/smp/raw.py +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/smp/style.py +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/test.py +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/thermo/__init__.py +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/thermo/arrhenius.py +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/thermo/atomic_level_random_walk.py +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy/thermo/basic.py +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy.egg-info/dependency_links.txt +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/ararpy.egg-info/top_level.txt +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/setup.cfg +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/tests/test.py +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/tests/test2.py +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/tests/test_error_correlation.py +0 -0
- {ararpy-0.2.1 → ararpy-0.2.3}/tests/test_regression_methods.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ararpy
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.3
|
|
4
4
|
Summary: A project for Ar-Ar geochronology
|
|
5
5
|
Home-page: https://github.com/wuyangchn/ararpy.git
|
|
6
6
|
Author: Yang Wu
|
|
@@ -12,6 +12,14 @@ Classifier: Operating System :: OS Independent
|
|
|
12
12
|
Requires-Python: >=3.5
|
|
13
13
|
Description-Content-Type: text/markdown
|
|
14
14
|
License-File: LICENSE
|
|
15
|
+
Requires-Dist: chardet
|
|
16
|
+
Requires-Dist: numpy
|
|
17
|
+
Requires-Dist: pandas
|
|
18
|
+
Requires-Dist: parse
|
|
19
|
+
Requires-Dist: scipy
|
|
20
|
+
Requires-Dist: xlrd
|
|
21
|
+
Requires-Dist: XlsxWriter
|
|
22
|
+
Requires-Dist: pdf_maker
|
|
15
23
|
Dynamic: author
|
|
16
24
|
Dynamic: author-email
|
|
17
25
|
Dynamic: classifier
|
|
@@ -20,6 +28,7 @@ Dynamic: description-content-type
|
|
|
20
28
|
Dynamic: home-page
|
|
21
29
|
Dynamic: license
|
|
22
30
|
Dynamic: license-file
|
|
31
|
+
Dynamic: requires-dist
|
|
23
32
|
Dynamic: requires-python
|
|
24
33
|
Dynamic: summary
|
|
25
34
|
|
|
@@ -16,10 +16,10 @@ from . import calc, smp, files, thermo, test
|
|
|
16
16
|
""" Information """
|
|
17
17
|
|
|
18
18
|
name = 'ararpy'
|
|
19
|
-
version = '0.2.
|
|
19
|
+
version = '0.2.3'
|
|
20
20
|
__version__ = version
|
|
21
21
|
full_version = version
|
|
22
|
-
last_update = '
|
|
22
|
+
last_update = '2026-01-01'
|
|
23
23
|
|
|
24
24
|
""" ArArPy Functions """
|
|
25
25
|
|
|
@@ -272,6 +272,7 @@ def Monte_Carlo_F(ar40m: Tuple[float, float], ar39m: Tuple[float, float], ar38m:
|
|
|
272
272
|
G40: Tuple[float, float], G39: Tuple[float, float], G38: Tuple[float, float],
|
|
273
273
|
G37: Tuple[float, float], G36: Tuple[float, float],
|
|
274
274
|
stand_time_year: float, JNFactor: Tuple[float, float],
|
|
275
|
+
KCaFactor: Tuple[float, float], KClFactor: Tuple[float, float],
|
|
275
276
|
**options):
|
|
276
277
|
"""
|
|
277
278
|
|
|
@@ -359,6 +360,9 @@ def Monte_Carlo_F(ar40m: Tuple[float, float], ar39m: Tuple[float, float], ar38m:
|
|
|
359
360
|
R38v39k = random_normal_relative(*R38v39k, size=Monte_Carlo_Size)
|
|
360
361
|
R36v38clp = random_normal_relative(*R36v38clp, size=Monte_Carlo_Size)
|
|
361
362
|
|
|
363
|
+
KCa = random_normal_relative(*KCaFactor, size=Monte_Carlo_Size)
|
|
364
|
+
KCl = random_normal_relative(*KClFactor, size=Monte_Carlo_Size)
|
|
365
|
+
|
|
362
366
|
JNFactor = random_normal_absolute(*JNFactor, size=Monte_Carlo_Size)
|
|
363
367
|
|
|
364
368
|
def do_simulation():
|
|
@@ -380,31 +384,23 @@ def Monte_Carlo_F(ar40m: Tuple[float, float], ar39m: Tuple[float, float], ar38m:
|
|
|
380
384
|
_ar39 = (ar39m[i] / G39[i] - ar39b[i] / (G39[i] if blank_gain_corr else 1)) * P39Mdf * P39Decay
|
|
381
385
|
_ar40 = (ar40m[i] / G40[i] - ar40b[i] / (G40[i] if blank_gain_corr else 1)) * P40Mdf
|
|
382
386
|
|
|
387
|
+
_ar37ca = _ar37
|
|
388
|
+
|
|
383
389
|
if force_to_zero:
|
|
384
|
-
|
|
385
|
-
_ar37 = max(_ar37, 0)
|
|
386
|
-
_ar38 = max(_ar38, 0)
|
|
387
|
-
_ar39 = max(_ar39, 0)
|
|
388
|
-
_ar40 = max(_ar40, 0)
|
|
390
|
+
_ar37ca = max(_ar37, 0)
|
|
389
391
|
|
|
390
|
-
_ar37ca = _ar37
|
|
391
392
|
_ar39ca = _ar37ca * R39v37ca[i]
|
|
392
393
|
_ar38ca = _ar37ca * R38v37ca[i]
|
|
393
394
|
_ar36ca = _ar37ca * R36v37ca[i]
|
|
394
395
|
|
|
396
|
+
_ar39k = _ar39 - _ar39ca
|
|
397
|
+
|
|
395
398
|
if force_to_zero:
|
|
396
|
-
|
|
397
|
-
_ar38ca = min(_ar38ca, _ar38)
|
|
398
|
-
_ar36ca = min(_ar36ca, _ar36)
|
|
399
|
+
_ar39k = max(_ar39k, 0)
|
|
399
400
|
|
|
400
|
-
_ar39k = _ar39 - _ar39ca
|
|
401
401
|
_ar38k = _ar39k * R38v39k[i]
|
|
402
402
|
_ar40k = _ar39k * R40v39k[i]
|
|
403
403
|
|
|
404
|
-
if force_to_zero:
|
|
405
|
-
_ar38k = min(_ar38k, _ar38 - _ar38ca)
|
|
406
|
-
_ar40k = min(_ar40k, _ar40)
|
|
407
|
-
|
|
408
404
|
_ar38res = _ar38 - _ar38k - _ar38ca
|
|
409
405
|
_ar36res = _ar36 - _ar36ca
|
|
410
406
|
|
|
@@ -433,6 +429,8 @@ def Monte_Carlo_F(ar40m: Tuple[float, float], ar39m: Tuple[float, float], ar38m:
|
|
|
433
429
|
|
|
434
430
|
factor = JNFactor[i]
|
|
435
431
|
|
|
432
|
+
_CaK = _ar37ca / _ar39k / KCa[i]
|
|
433
|
+
|
|
436
434
|
i += 1
|
|
437
435
|
|
|
438
436
|
yield _ar36a, 0, _ar36ca, _ar36cl, _ar37ca, _ar38cl, _ar38a, 0, _ar38k, _ar38ca, _ar39k, _ar39ca, _ar40r, _ar40a, 0, _ar40k, \
|
|
@@ -442,7 +440,7 @@ def Monte_Carlo_F(ar40m: Tuple[float, float], ar39m: Tuple[float, float], ar38m:
|
|
|
442
440
|
(_ar39k * factor) / _ar40r, _ar38cl / _ar40r, \
|
|
443
441
|
_ar38cl / (_ar39k * factor), _ar40r / (_ar39k * factor), \
|
|
444
442
|
_ar36res / _ar40ar, _ar38res / _ar40ar, (_ar39k * factor) / _ar40ar, \
|
|
445
|
-
_ar36, _ar37, _ar38, _ar39, _ar40
|
|
443
|
+
_ar36, _ar37, _ar38, _ar39, _ar40, _CaK
|
|
446
444
|
|
|
447
445
|
data = np.array(list(do_simulation()))
|
|
448
446
|
means = data.mean(axis=0)
|
|
@@ -467,8 +465,9 @@ def Monte_Carlo_F(ar40m: Tuple[float, float], ar39m: Tuple[float, float], ar38m:
|
|
|
467
465
|
corrected_data = np.column_stack((means[29:34], stds[29:34])).ravel()
|
|
468
466
|
|
|
469
467
|
F = np.append(means[25], stds[25])
|
|
468
|
+
CaK = np.append(means[34], stds[34])
|
|
470
469
|
|
|
471
|
-
return *F, *degas_data, *nor_iso, *inv_iso, *cl1_iso, *cl2_iso, *cl3_iso, *threed_iso, *corrected_data
|
|
470
|
+
return *F, *degas_data, *nor_iso, *inv_iso, *cl1_iso, *cl2_iso, *cl3_iso, *threed_iso, *corrected_data, *CaK
|
|
472
471
|
|
|
473
472
|
# print("F = {0} ± {1}".format(np.mean(F), np.std(F)))
|
|
474
473
|
#
|
|
@@ -32,8 +32,10 @@ def j_value(age, sage, r, sr, f, rsf):
|
|
|
32
32
|
f = f * 1000000 # exchange to unit of Ma
|
|
33
33
|
rsf = f * rsf / 100 # exchange to absolute error
|
|
34
34
|
k0 = (np.exp(f * age) - 1) / r
|
|
35
|
-
v1 = rsf ** 2 * (age * np.exp(f * age) / r) ** 2
|
|
36
|
-
v2 = sage ** 2 * (f * np.exp(f * age) / r) ** 2
|
|
37
|
-
v3 = sr ** 2 * ((1 - np.exp(f * age)) / r ** 2) ** 2
|
|
38
|
-
k1 = np.sqrt(
|
|
39
|
-
|
|
35
|
+
v1 = rsf ** 2 * (age * np.exp(f * age) / r) ** 2 # lambda
|
|
36
|
+
v2 = sage ** 2 * (f * np.exp(f * age) / r) ** 2 # age
|
|
37
|
+
v3 = sr ** 2 * ((1 - np.exp(f * age)) / r ** 2) ** 2 # 40/39
|
|
38
|
+
k1 = np.sqrt(v3)
|
|
39
|
+
k2 = np.sqrt(v3 + v2)
|
|
40
|
+
k3 = np.sqrt(v3 + v2 + v1)
|
|
41
|
+
return k0, k1, k2, k3
|
|
@@ -81,7 +81,7 @@ def open_252(data: pd.DataFrame, logs01: pd.DataFrame, logs02: pd.DataFrame):
|
|
|
81
81
|
162, 163, 164, 165, 166, 167, 168, 169, # 40 r, a, c, k 26-33
|
|
82
82
|
]
|
|
83
83
|
publish_values_index = [
|
|
84
|
-
|
|
84
|
+
188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205,
|
|
85
85
|
]
|
|
86
86
|
apparent_age_values_index = [
|
|
87
87
|
198, 199, 200, 201, -999, -999, 202, 203, # f, sf, ages, s, s, s, 40Arr%, 39Ar%
|
|
@@ -244,7 +244,9 @@ def open_240(data: pd.DataFrame, logs01: pd.DataFrame, logs02: pd.DataFrame):
|
|
|
244
244
|
148, -999, 149, -999, 150, -999, 151, -999,
|
|
245
245
|
]
|
|
246
246
|
publish_values_index = [
|
|
247
|
-
|
|
247
|
+
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
|
248
|
+
-1, -1, -1, -1,
|
|
249
|
+
-1, -1, -1, -1,
|
|
248
250
|
]
|
|
249
251
|
apparent_age_values_index = [
|
|
250
252
|
# f, sf, ages, s, s, s, 39Ar%
|
|
@@ -119,7 +119,7 @@ def calc_apparent_ages(smp: Sample):
|
|
|
119
119
|
raise TypeError(f"Sample type is not supported: {smp.Info.sample.type}")
|
|
120
120
|
|
|
121
121
|
smp.ApparentAgeValues[2:6] = v[0:4]
|
|
122
|
-
smp.PublishValues[
|
|
122
|
+
smp.PublishValues[12:14] = copy.deepcopy(v[0:2])
|
|
123
123
|
|
|
124
124
|
|
|
125
125
|
def calc_j(ar40ar39=None, params: dict = None, smp: Sample = None, index: list = None):
|
|
@@ -591,7 +591,7 @@ def get_diff_smp(backup: (dict, Sample), smp: (dict, Sample)):
|
|
|
591
591
|
if _res != {}:
|
|
592
592
|
res.update({name: _res})
|
|
593
593
|
continue
|
|
594
|
-
if str(backup[name]) == str(attr)
|
|
594
|
+
if str(backup[name]) == str(attr):
|
|
595
595
|
continue
|
|
596
596
|
res.update({name: attr})
|
|
597
597
|
return res
|
|
@@ -55,7 +55,6 @@ def corr_blank(sample: Sample):
|
|
|
55
55
|
for i in range(0, 10, 2):
|
|
56
56
|
blank_corrected[i] = [blank_corrected[i][index] if sample.TotalParam[102][index] else j for index, j in enumerate(sample.SampleIntercept[i])]
|
|
57
57
|
blank_corrected[i + 1] = [blank_corrected[i + 1][index] if sample.TotalParam[102][index] else j for index, j in enumerate(sample.SampleIntercept[i + 1])]
|
|
58
|
-
blank_corrected[i] = [0 if j < 0 and sample.TotalParam[101][index] else j for index, j in enumerate(blank_corrected[i])]
|
|
59
58
|
sample.BlankCorrected = blank_corrected
|
|
60
59
|
|
|
61
60
|
|
|
@@ -147,9 +146,6 @@ def corr_decay(sample: Sample):
|
|
|
147
146
|
*sample.MassDiscrCorrected[2:4], t1, t2, t3, *sample.TotalParam[44:46], isRelative=True)
|
|
148
147
|
decay_corrected[6:8] = calc.corr.decay(
|
|
149
148
|
*sample.MassDiscrCorrected[6:8], t1, t2, t3, *sample.TotalParam[42:44], isRelative=True)
|
|
150
|
-
# Negative number set to zero in decay correction
|
|
151
|
-
decay_corrected[2] = [0 if i < 0 else i for i in decay_corrected[2]]
|
|
152
|
-
decay_corrected[6] = [0 if i < 0 else i for i in decay_corrected[6]]
|
|
153
149
|
except Exception as e:
|
|
154
150
|
print(traceback.format_exc())
|
|
155
151
|
raise ValueError(f'Decay correction error: {str(e)}')
|
|
@@ -162,6 +158,10 @@ def corr_decay(sample: Sample):
|
|
|
162
158
|
sample.CorrectedValues[6] = [val if corrDecay39[idx] else 0 for idx, val in enumerate(decay_corrected[6])]
|
|
163
159
|
sample.CorrectedValues[7] = [val if corrDecay39[idx] else 0 for idx, val in enumerate(decay_corrected[7])]
|
|
164
160
|
|
|
161
|
+
data = np.array(sample.CorrectedValues)
|
|
162
|
+
data[1:10:2] = data[1:10:2] = np.abs(np.divide(data[1:10:2], data[0:10:2])) * 100
|
|
163
|
+
sample.PublishValues[0:10] = copy.deepcopy(data.tolist())
|
|
164
|
+
|
|
165
165
|
|
|
166
166
|
# =======================
|
|
167
167
|
# Degas Calcium derived 37Ar 36Ar 38Ar 39Ar
|
|
@@ -189,8 +189,10 @@ def calc_degas_ca(sample: Sample):
|
|
|
189
189
|
if not validate_params(**params_to_check):
|
|
190
190
|
return
|
|
191
191
|
|
|
192
|
+
set_negative_zero = sample.TotalParam[101]
|
|
192
193
|
corrDegasCa = sample.TotalParam[106]
|
|
193
|
-
ar37ca = sample.CorrectedValues[2:4]
|
|
194
|
+
ar37ca = copy.deepcopy(sample.CorrectedValues[2:4])
|
|
195
|
+
ar37ca[0] = [0 if val < 0 and set_negative_zero[i] else val for i, val in enumerate(ar37ca[0])]
|
|
194
196
|
ar39ca = calc.arr.mul_factor(ar37ca, sample.TotalParam[8:10], isRelative=True)
|
|
195
197
|
ar38ca = calc.arr.mul_factor(ar37ca, sample.TotalParam[10:12], isRelative=True)
|
|
196
198
|
ar36ca = calc.arr.mul_factor(ar37ca, sample.TotalParam[12:14], isRelative=True)
|
|
@@ -201,7 +203,6 @@ def calc_degas_ca(sample: Sample):
|
|
|
201
203
|
sample.DegasValues[19] = [val if corrDegasCa[idx] else 0 for idx, val in enumerate(ar38ca[1])]
|
|
202
204
|
sample.DegasValues[22] = [val if corrDegasCa[idx] else 0 for idx, val in enumerate(ar39ca[0])] # 39Ca
|
|
203
205
|
sample.DegasValues[23] = [val if corrDegasCa[idx] else 0 for idx, val in enumerate(ar39ca[1])]
|
|
204
|
-
sample.PublishValues[1] = copy.deepcopy(sample.DegasValues[8])
|
|
205
206
|
|
|
206
207
|
|
|
207
208
|
# =======================
|
|
@@ -242,7 +243,6 @@ def calc_degas_k(sample: Sample):
|
|
|
242
243
|
sample.DegasValues[17] = [val if corrDecasK[idx] else 0 for idx, val in enumerate(ar38k[1])]
|
|
243
244
|
sample.DegasValues[30] = [val if corrDecasK[idx] else 0 for idx, val in enumerate(ar40k[0])]
|
|
244
245
|
sample.DegasValues[31] = [val if corrDecasK[idx] else 0 for idx, val in enumerate(ar40k[1])]
|
|
245
|
-
sample.PublishValues[3] = copy.deepcopy(sample.DegasValues[20])
|
|
246
246
|
|
|
247
247
|
|
|
248
248
|
# =======================
|
|
@@ -351,7 +351,6 @@ def calc_degas_cl(sample: Sample):
|
|
|
351
351
|
|
|
352
352
|
sample.DegasValues[6:8] = copy.deepcopy(ar36cl)
|
|
353
353
|
sample.DegasValues[10:12] = copy.deepcopy(ar38cl)
|
|
354
|
-
sample.PublishValues[2] = copy.deepcopy(sample.DegasValues[10])
|
|
355
354
|
|
|
356
355
|
|
|
357
356
|
# =======================
|
|
@@ -408,7 +407,6 @@ def calc_degas_atm(sample: Sample):
|
|
|
408
407
|
sample.DegasValues[13] = [val if corrDecasAtm[idx] else 0 for idx, val in enumerate(ar38a[1])]
|
|
409
408
|
sample.DegasValues[26] = [val if corrDecasAtm[idx] else 0 for idx, val in enumerate(ar40a[0])] # Ar40a
|
|
410
409
|
sample.DegasValues[27] = [val if corrDecasAtm[idx] else 0 for idx, val in enumerate(ar40a[1])]
|
|
411
|
-
sample.PublishValues[0] = copy.deepcopy(sample.DegasValues[ 0])
|
|
412
410
|
|
|
413
411
|
|
|
414
412
|
# =======================
|
|
@@ -439,7 +437,6 @@ def calc_degas_r(sample: Sample):
|
|
|
439
437
|
ar40r = calc.arr.sub(ar40ar, sample.DegasValues[26:28])
|
|
440
438
|
ar40r[0] = [0 if item < 0 and sample.TotalParam[101][index] else item for index, item in enumerate(ar40r[0])]
|
|
441
439
|
sample.DegasValues[24:26] = copy.deepcopy(ar40r)
|
|
442
|
-
sample.PublishValues[4] = copy.deepcopy(sample.DegasValues[24])
|
|
443
440
|
|
|
444
441
|
|
|
445
442
|
def calc_degas_c(sample: Sample):
|
|
@@ -588,7 +585,8 @@ def calc_ratio(sample: Sample):
|
|
|
588
585
|
calc.arr.rec_factor(sample.TotalParam[20:22], isRelative=True))
|
|
589
586
|
|
|
590
587
|
sample.ApparentAgeValues[6] = ar40r_percent
|
|
591
|
-
sample.PublishValues[
|
|
588
|
+
sample.PublishValues[10:12] = copy.deepcopy(sample.ApparentAgeValues[0:2])
|
|
589
|
+
sample.PublishValues[14:18] = copy.deepcopy([*sample.ApparentAgeValues[6:8], *CaK])
|
|
592
590
|
|
|
593
591
|
sample.IsochronValues[0:5], sample.IsochronValues[6:11] = calc_nor_inv_isochrons(sample)
|
|
594
592
|
sample.IsochronValues[12:17], sample.IsochronValues[18:23], sample.IsochronValues[24:29] = \
|
|
@@ -629,13 +627,11 @@ def calc_ratio_monte_carlo(sample: Sample):
|
|
|
629
627
|
# corrected
|
|
630
628
|
sample.CorrectedValues = res[2 + 32 + 39:2 + 32 + 39 + 10]
|
|
631
629
|
# publish
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
sample.PublishValues[
|
|
635
|
-
sample.PublishValues[
|
|
636
|
-
sample.PublishValues[
|
|
637
|
-
sample.PublishValues[5:7] = copy.deepcopy(sample.ApparentAgeValues[2:4])
|
|
638
|
-
sample.PublishValues[7:9] = copy.deepcopy(sample.ApparentAgeValues[6:8])
|
|
630
|
+
data = np.array(sample.CorrectedValues)
|
|
631
|
+
data[1:10:2] = data[1:10:2] = np.abs(np.divide(data[1:10:2], data[0:10:2])) * 100
|
|
632
|
+
sample.PublishValues[0:10] = copy.deepcopy(data.tolist())
|
|
633
|
+
sample.PublishValues[10:14] = copy.deepcopy(sample.ApparentAgeValues[0:4])
|
|
634
|
+
sample.PublishValues[14:16] = copy.deepcopy(sample.ApparentAgeValues[6:8])
|
|
639
635
|
|
|
640
636
|
|
|
641
637
|
def monte_carlo_f(sample: Sample):
|
|
@@ -731,6 +727,10 @@ def monte_carlo_f(sample: Sample):
|
|
|
731
727
|
R38v36a = np.transpose(sample.TotalParam[4:6])
|
|
732
728
|
R36v38clp = np.transpose(sample.TotalParam[56:58])
|
|
733
729
|
|
|
730
|
+
R36v38cl = np.transpose(sample.TotalParam[18:20]) # ?
|
|
731
|
+
KCaFactor = np.transpose(sample.TotalParam[20:22])
|
|
732
|
+
KClFactor = np.transpose(sample.TotalParam[22:24])
|
|
733
|
+
|
|
734
734
|
stand_time_year = np.transpose(sample.TotalParam[32])
|
|
735
735
|
JNFactor = np.transpose(sample.TotalParam[136:138])
|
|
736
736
|
|
|
@@ -764,6 +764,8 @@ def monte_carlo_f(sample: Sample):
|
|
|
764
764
|
L37ar=L37ar[i], L39ar=L39ar[i], L36cl=L36cl[i],
|
|
765
765
|
MDF=MDF[i], stand_time_year=stand_time_year[i],
|
|
766
766
|
JNFactor=JNFactor[i],
|
|
767
|
+
KCaFactor=KCaFactor[i],
|
|
768
|
+
KClFactor=KClFactor[i],
|
|
767
769
|
blank_gain_corr=sample.TotalParam[111][i],
|
|
768
770
|
MDF_method=sample.TotalParam[100][i],
|
|
769
771
|
force_to_zero=sample.TotalParam[101][i],
|
|
@@ -1219,7 +1219,7 @@ class WritingWorkbook:
|
|
|
1219
1219
|
[(4, 11, 1), list(map(lambda x: 2*x, self.sample.ApparentAgeValues[3])), {'num_format': '± ' + self.default_fmt_prop['num_format']}],
|
|
1220
1220
|
[(4, 12, 1), self.sample.ApparentAgeValues[6], {}],
|
|
1221
1221
|
[(4, 13, 1), self.sample.ApparentAgeValues[7], {}],
|
|
1222
|
-
[(4, 14, 1), self.sample.PublishValues[
|
|
1222
|
+
[(4, 14, 1), self.sample.PublishValues[16], {}],
|
|
1223
1223
|
[(4 + num_step, 0, 0), [''] * 15, {'bold': 1, 'top': 1}],
|
|
1224
1224
|
|
|
1225
1225
|
[(5 + num_step, 0), "Table 2. 40Ar/39Ar age summary", {'bold': 1, 'align': 'left'}],
|
|
@@ -128,6 +128,8 @@ def initial(smp: Sample):
|
|
|
128
128
|
smp.BlankIntercept = arr.create_arr((len(samples.BLANK_INTERCEPT_HEADERS) - 3, 0))
|
|
129
129
|
smp.SampleIntercept = arr.create_arr((len(samples.SAMPLE_INTERCEPT_HEADERS) - 3, 0))
|
|
130
130
|
smp.PublishValues = arr.create_arr((len(samples.PUBLISH_TABLE_HEADERS) - 3, 0))
|
|
131
|
+
smp.BlankCorrected = arr.create_arr((10, 0))
|
|
132
|
+
smp.MassDiscrCorrected = arr.create_arr((10, 0))
|
|
131
133
|
smp.DecayCorrected = arr.create_arr((10, 0))
|
|
132
134
|
smp.CorrectedValues = arr.create_arr((len(samples.CORRECTED_HEADERS) - 3, 0))
|
|
133
135
|
smp.DegasValues = arr.create_arr((len(samples.DEGAS_HEADERS) - 3, 0))
|
|
@@ -52,24 +52,36 @@ DEGAS_HEADERS = [
|
|
|
52
52
|
]
|
|
53
53
|
PUBLISH_TABLE_HEADERS = [
|
|
54
54
|
'Sequence', '', 'Mark', # 0-2
|
|
55
|
-
'\u00B3\u2076Ar
|
|
56
|
-
'\u00B3\
|
|
57
|
-
'
|
|
58
|
-
'
|
|
55
|
+
'\u00B3\u2076Ar', '%1\u03C3',
|
|
56
|
+
'\u00B3\u2077Ar', '%1\u03C3',
|
|
57
|
+
'\u00B3\u2078Ar', '%1\u03C3',
|
|
58
|
+
'\u00B3\u2079Ar', '%1\u03C3',
|
|
59
|
+
'\u2074\u2070Ar', '%1\u03C3', # 3-12
|
|
60
|
+
'\u2074\u2070Ar/\u00B3\u2076Ar', '1\u03C3', # 13-14
|
|
61
|
+
'Apparent Age', '1\u03C3', '\u2074\u2070Ar[r]%', '\u00B3\u2079Ar[K]%', # 15-18
|
|
62
|
+
'Ca/K', '1\u03C3', # 19-20
|
|
59
63
|
]
|
|
60
64
|
PUBLISH_TABLE_HEADERS_AIR = [
|
|
61
65
|
'Sequence', '', 'Mark', # 0-2
|
|
62
|
-
'\u00B3\u2076Ar
|
|
63
|
-
'\u00B3\
|
|
64
|
-
'
|
|
65
|
-
'
|
|
66
|
+
'\u00B3\u2076Ar', '%1\u03C3',
|
|
67
|
+
'\u00B3\u2077Ar', '%1\u03C3',
|
|
68
|
+
'\u00B3\u2078Ar', '%1\u03C3',
|
|
69
|
+
'\u00B3\u2079Ar', '%1\u03C3',
|
|
70
|
+
'\u2074\u2070Ar', '%1\u03C3', # 3-12
|
|
71
|
+
'\u2074\u2070Ar/\u00B3\u2076Ar', '1\u03C3', # 13-14
|
|
72
|
+
'MDF', '1\u03C3', '\u2074\u2070Ar[r]%', '\u00B3\u2076Ar%', # 15-18
|
|
73
|
+
'Ca/K', '1\u03C3', # 19-20
|
|
66
74
|
]
|
|
67
75
|
PUBLISH_TABLE_HEADERS_STD = [
|
|
68
76
|
'Sequence', '', 'Mark', # 0-2
|
|
69
|
-
'\u00B3\u2076Ar
|
|
70
|
-
'\u00B3\
|
|
71
|
-
'
|
|
72
|
-
'
|
|
77
|
+
'\u00B3\u2076Ar', '%1\u03C3',
|
|
78
|
+
'\u00B3\u2077Ar', '%1\u03C3',
|
|
79
|
+
'\u00B3\u2078Ar', '%1\u03C3',
|
|
80
|
+
'\u00B3\u2079Ar', '%1\u03C3',
|
|
81
|
+
'\u2074\u2070Ar', '%1\u03C3', # 3-12
|
|
82
|
+
'\u2074\u2070Ar/\u00B3\u2076Ar', '1\u03C3', # 13-14
|
|
83
|
+
'J', '1\u03C3', '\u2074\u2070Ar[r]%', '\u00B3\u2076Ar%', # 15-18
|
|
84
|
+
'Ca/K', '1\u03C3', # 19-20
|
|
73
85
|
]
|
|
74
86
|
SPECTRUM_TABLE_HEADERS = [
|
|
75
87
|
'Sequence', '', 'Mark', # 0-2
|
|
@@ -200,9 +212,13 @@ DEGAS_SHORT_HEADERS = [
|
|
|
200
212
|
]
|
|
201
213
|
PUBLISH_TABLE_SHORT_HEADERS = [
|
|
202
214
|
'Seq', 'Label', 'Mark', # 0-2
|
|
203
|
-
'Ar36
|
|
204
|
-
'
|
|
205
|
-
'
|
|
215
|
+
'Ar36', '%1s',
|
|
216
|
+
'Ar37', '%1s',
|
|
217
|
+
'Ar38', '%1s',
|
|
218
|
+
'Ar39', '%1s',
|
|
219
|
+
'Ar40', '%1s',
|
|
220
|
+
'Apparent Age', '1s', 'Ar40r%', 'Ar39K%',
|
|
221
|
+
'Ca/K', '1s'
|
|
206
222
|
]
|
|
207
223
|
SPECTRUM_TABLE_SHORT_HEADERS = [
|
|
208
224
|
'Seq', 'Label', 'Mark', # 0-2
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
import ast
|
|
13
13
|
import re
|
|
14
14
|
import copy
|
|
15
|
+
import numpy as np
|
|
15
16
|
from .. import calc
|
|
16
17
|
from . import (sample as samples, basic)
|
|
17
18
|
|
|
@@ -46,13 +47,11 @@ def update_table_data(smp: Sample, only_table: str = None):
|
|
|
46
47
|
elif key == '4':
|
|
47
48
|
data = [smp.SequenceName, smp.SequenceValue, smp.IsochronMark, *smp.DegasValues]
|
|
48
49
|
elif key == '5':
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
smp.PublishValues[
|
|
52
|
-
smp.PublishValues[
|
|
53
|
-
smp.PublishValues[
|
|
54
|
-
smp.PublishValues[5:7] = copy.deepcopy(smp.ApparentAgeValues[2:4])
|
|
55
|
-
smp.PublishValues[7:9] = copy.deepcopy(smp.ApparentAgeValues[6:8])
|
|
50
|
+
data = np.array(smp.CorrectedValues)
|
|
51
|
+
data[1:10:2] = np.abs(np.divide(data[1:10:2], data[0:10:2])) * 100
|
|
52
|
+
smp.PublishValues[0:10] = copy.deepcopy(data.tolist())
|
|
53
|
+
smp.PublishValues[10:14] = copy.deepcopy(smp.ApparentAgeValues[0:4])
|
|
54
|
+
smp.PublishValues[14:16] = copy.deepcopy(smp.ApparentAgeValues[6:8])
|
|
56
55
|
data = [smp.SequenceName, smp.SequenceValue, smp.IsochronMark, *smp.PublishValues]
|
|
57
56
|
elif key == '6':
|
|
58
57
|
data = [smp.SequenceName, smp.SequenceValue, smp.IsochronMark, *smp.ApparentAgeValues]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ararpy
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.3
|
|
4
4
|
Summary: A project for Ar-Ar geochronology
|
|
5
5
|
Home-page: https://github.com/wuyangchn/ararpy.git
|
|
6
6
|
Author: Yang Wu
|
|
@@ -12,6 +12,14 @@ Classifier: Operating System :: OS Independent
|
|
|
12
12
|
Requires-Python: >=3.5
|
|
13
13
|
Description-Content-Type: text/markdown
|
|
14
14
|
License-File: LICENSE
|
|
15
|
+
Requires-Dist: chardet
|
|
16
|
+
Requires-Dist: numpy
|
|
17
|
+
Requires-Dist: pandas
|
|
18
|
+
Requires-Dist: parse
|
|
19
|
+
Requires-Dist: scipy
|
|
20
|
+
Requires-Dist: xlrd
|
|
21
|
+
Requires-Dist: XlsxWriter
|
|
22
|
+
Requires-Dist: pdf_maker
|
|
15
23
|
Dynamic: author
|
|
16
24
|
Dynamic: author-email
|
|
17
25
|
Dynamic: classifier
|
|
@@ -20,6 +28,7 @@ Dynamic: description-content-type
|
|
|
20
28
|
Dynamic: home-page
|
|
21
29
|
Dynamic: license
|
|
22
30
|
Dynamic: license-file
|
|
31
|
+
Dynamic: requires-dist
|
|
23
32
|
Dynamic: requires-python
|
|
24
33
|
Dynamic: summary
|
|
25
34
|
|
|
@@ -16,7 +16,7 @@ long_description = (here / 'README.md').read_text(encoding='utf-8')
|
|
|
16
16
|
|
|
17
17
|
setuptools.setup(
|
|
18
18
|
name='ararpy', #
|
|
19
|
-
version='0.2.
|
|
19
|
+
version='0.2.3', # version
|
|
20
20
|
author='Yang Wu',
|
|
21
21
|
author_email='wuycug@hotmail.com',
|
|
22
22
|
description='A project for Ar-Ar geochronology', # short description
|
|
@@ -25,10 +25,10 @@ setuptools.setup(
|
|
|
25
25
|
url='https://github.com/wuyangchn/ararpy.git', # github url
|
|
26
26
|
packages=setuptools.find_packages(),
|
|
27
27
|
package_data={'ararpy': ['examples/*']},
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
install_requires=[
|
|
29
|
+
"chardet", "numpy", "pandas", "parse",
|
|
30
|
+
"scipy", "xlrd", "XlsxWriter", "pdf_maker"
|
|
31
|
+
],
|
|
32
32
|
classifiers=[
|
|
33
33
|
'Development Status :: 3 - Alpha',
|
|
34
34
|
'Programming Language :: Python :: 3',
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|