ararpy 0.1.14__tar.gz → 0.1.15__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.1.14 → ararpy-0.1.15}/PKG-INFO +1 -1
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/argon_diffusion_simulator/main.py +94 -5
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/calc/age.py +2 -2
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/calc/basic.py +1 -1
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/calc/corr.py +5 -5
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/files/calc_file.py +17 -9
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/smp/initial.py +9 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/smp/plots.py +4 -4
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/smp/sample.py +4 -3
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy.egg-info/PKG-INFO +1 -1
- {ararpy-0.1.14 → ararpy-0.1.15}/setup.py +1 -1
- {ararpy-0.1.14 → ararpy-0.1.15}/LICENSE +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/README.md +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/__init__.py +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/argon_diffusion_simulator/__init__.py +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/calc/__init__.py +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/calc/arr.py +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/calc/err.py +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/calc/histogram.py +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/calc/isochron.py +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/calc/jvalue.py +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/calc/plot.py +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/calc/raw_funcs.py +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/calc/regression.py +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/calc/spectra.py +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/examples/022_VU124-M11a.ahd +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/examples/20WHA0103.age +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/examples/22WHA0078.xls +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/examples/22WHA0433.age +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/examples/22WHA0433.arr +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/examples/22WHA0433.full.xls +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/examples/24WHN0001-51-592.XLS +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/examples/AHD.input-filter +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/examples/ArAr.calc +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/examples/ArArCALC.age +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/examples/NGX-600 - Copy.TXT +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/examples/NGX-600.TXT +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/examples/NGX-XLS.input-filter +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/examples/Qtegra-exported-xls.input-filter +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/examples/S01-239.csv +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/examples/WH01.irra +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/examples/WHA.pdf +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/examples/raw_example.xls +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/examples/sample-default.smp +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/files/__init__.py +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/files/arr_file.py +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/files/basic.py +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/files/new_file.py +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/files/raw_file.py +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/files/xls.py +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/smp/EXPORT_TO_PDF_DATA_PROPERTIES.py +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/smp/__init__.py +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/smp/basic.py +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/smp/calculation.py +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/smp/consts.py +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/smp/corr.py +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/smp/diffusion_funcs.py +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/smp/export.py +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/smp/info.py +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/smp/json.py +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/smp/raw.py +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/smp/style.py +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/smp/table.py +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy/test.py +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy.egg-info/SOURCES.txt +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy.egg-info/dependency_links.txt +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/ararpy.egg-info/top_level.txt +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/setup.cfg +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/tests/test.py +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/tests/test2.py +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/tests/test_error_correlation.py +0 -0
- {ararpy-0.1.14 → ararpy-0.1.15}/tests/test_regression_methods.py +0 -0
|
@@ -53,7 +53,7 @@ def _uniform_sphere_step(step_length, shape):
|
|
|
53
53
|
|
|
54
54
|
|
|
55
55
|
def walker(pos, step_length, total_nsteps, min_bound, max_bound, scale=0., compensation=0, remove=True,
|
|
56
|
-
conditions=None, boundary_factor=1):
|
|
56
|
+
conditions=None, boundary_factor=1, decay=0, parent=0):
|
|
57
57
|
|
|
58
58
|
if len(pos) == 0:
|
|
59
59
|
return pos
|
|
@@ -122,7 +122,7 @@ def walker(pos, step_length, total_nsteps, min_bound, max_bound, scale=0., compe
|
|
|
122
122
|
|
|
123
123
|
|
|
124
124
|
def walker2(pos: np.ndarray, duration, step_length, min_bound, max_bound, time_scale, frequency,
|
|
125
|
-
conditions=None, remove: bool = True):
|
|
125
|
+
conditions=None, remove: bool = True, decay=0, parent=0):
|
|
126
126
|
"""
|
|
127
127
|
:return:
|
|
128
128
|
"""
|
|
@@ -132,6 +132,7 @@ def walker2(pos: np.ndarray, duration, step_length, min_bound, max_bound, time_s
|
|
|
132
132
|
|
|
133
133
|
dimension = pos.shape[-1] if len(pos.shape) > 1 else 1
|
|
134
134
|
|
|
135
|
+
|
|
135
136
|
dt = time_scale
|
|
136
137
|
if conditions is None:
|
|
137
138
|
if dimension == 3:
|
|
@@ -141,6 +142,13 @@ def walker2(pos: np.ndarray, duration, step_length, min_bound, max_bound, time_s
|
|
|
141
142
|
|
|
142
143
|
for step in range(int(1e16)):
|
|
143
144
|
|
|
145
|
+
n = parent - int(parent * math.exp(-1 * decay * dt / (3600 * 24 * 365.2425)))
|
|
146
|
+
# print(f"number of new pos = {n}")
|
|
147
|
+
parent = parent - n
|
|
148
|
+
new_pos = np.random.uniform(max(max_bound), min(min_bound), size=(int(n), dimension))
|
|
149
|
+
new_pos = new_pos[np.all((new_pos >= min_bound) & (new_pos <= max_bound), axis=1)]
|
|
150
|
+
pos = np.concatenate((pos, new_pos), axis=0)
|
|
151
|
+
|
|
144
152
|
res = np.zeros(0).reshape(0, dimension)
|
|
145
153
|
for index, each in enumerate(conditions):
|
|
146
154
|
# each = (x1, y1, z1, x2, y2, z2, gamma)
|
|
@@ -235,6 +243,7 @@ class Domain:
|
|
|
235
243
|
# 初始化粒子位置,随机分布在网格内
|
|
236
244
|
# 初始原子个数 1e14 原子密度 个/立方厘米 1e-4是单位换算 cm/µm
|
|
237
245
|
natoms = int(self.atom_density ** (self.dimension / 3) * (abs(max(self.max_bound) - min(self.min_bound)) * 1e-4) ** self.dimension)
|
|
246
|
+
natoms = 1 if natoms == 0 else natoms
|
|
238
247
|
self.positions = np.random.uniform(max(self.max_bound), min(self.min_bound), size=(int(natoms), self.dimension))
|
|
239
248
|
self.positions = self.positions[np.all((self.positions >= self.min_bound) & (self.positions <= self.max_bound), axis=1)]
|
|
240
249
|
for dom in self.inclusions:
|
|
@@ -320,7 +329,7 @@ class DiffSimulation:
|
|
|
320
329
|
|
|
321
330
|
def run_sequence(self, times, temperatures, statuses, targets, domains: List[Domain], nsteps_factor=None,
|
|
322
331
|
simulating: bool = False, epsilon=0.001, start_time=0, k=1.2, use_walker1=True,
|
|
323
|
-
scoring: bool = False):
|
|
332
|
+
scoring: bool = False, decay=0, parent=0):
|
|
324
333
|
pos = copy.deepcopy(self.positions)
|
|
325
334
|
self.seq = [] # 用于记录参数
|
|
326
335
|
|
|
@@ -369,7 +378,8 @@ class DiffSimulation:
|
|
|
369
378
|
_pos = walker(
|
|
370
379
|
copy.deepcopy(pos), step_length=step_length, total_nsteps=total_steps,
|
|
371
380
|
min_bound=self.min_bound, max_bound=self.max_bound, scale=scale,
|
|
372
|
-
compensation=compensation, remove=True, conditions=conditions, boundary_factor=boundary_factor
|
|
381
|
+
compensation=compensation, remove=True, conditions=conditions, boundary_factor=boundary_factor,
|
|
382
|
+
decay=decay, parent=parent
|
|
373
383
|
)
|
|
374
384
|
|
|
375
385
|
# self.seq[index].update({
|
|
@@ -383,7 +393,7 @@ class DiffSimulation:
|
|
|
383
393
|
scale = k
|
|
384
394
|
_pos = walker2(copy.deepcopy(pos), duration=heating_duration, step_length=step_length,
|
|
385
395
|
min_bound=self.min_bound, max_bound=self.max_bound, time_scale=scale,
|
|
386
|
-
frequency=self.frequency, conditions=conditions, remove=True)
|
|
396
|
+
frequency=self.frequency, conditions=conditions, remove=True, decay=decay, parent=parent)
|
|
387
397
|
boundary_factor = 1
|
|
388
398
|
compensation = 0
|
|
389
399
|
|
|
@@ -429,6 +439,8 @@ class DiffSimulation:
|
|
|
429
439
|
|
|
430
440
|
print(f"{index = } {duration} - {heating_duration = } - {temperature = } - {total_steps = } - conc = {len(pos) / self.natoms * 100:.2f}% - {time.time() - _start:.5f}s")
|
|
431
441
|
|
|
442
|
+
self.positions = copy.deepcopy(pos)
|
|
443
|
+
|
|
432
444
|
def run_persecond(self, times, temperatures, statuses, targets, domains: List[Domain], scale=None,
|
|
433
445
|
simulation: bool = False, epsilon=0.001, start_time=0):
|
|
434
446
|
seq = []
|
|
@@ -442,6 +454,83 @@ class DiffSimulation:
|
|
|
442
454
|
|
|
443
455
|
|
|
444
456
|
def run(times, temps, statuses, energies, fractions, ndoms: int = 1, grain_szie=275, atom_density=1e10, frequency=1e13,
|
|
457
|
+
dimension: int = 3, targets: list = None, epsilon: float = 0.001, simulation: bool = False,
|
|
458
|
+
file_name: str = "Y70", ignore_error: bool = False, positions=None, **kwargs):
|
|
459
|
+
"""
|
|
460
|
+
:param times:
|
|
461
|
+
:param temps:
|
|
462
|
+
:param statuses:
|
|
463
|
+
:param energies:
|
|
464
|
+
:param fractions:
|
|
465
|
+
:param dimension:
|
|
466
|
+
:param ndoms:
|
|
467
|
+
:param targets:
|
|
468
|
+
:param epsilon:
|
|
469
|
+
:param simulation:
|
|
470
|
+
:param file_name:
|
|
471
|
+
:param ignore_error:
|
|
472
|
+
:return:
|
|
473
|
+
"""
|
|
474
|
+
|
|
475
|
+
demo = DiffSimulation()
|
|
476
|
+
|
|
477
|
+
def _(n, es, fs):
|
|
478
|
+
# fs 应从大到小,父空间在前,子空间在后
|
|
479
|
+
|
|
480
|
+
# demo.grain_size = 300
|
|
481
|
+
# demo.size_scale = 0.05
|
|
482
|
+
# demo.atom_density = 1e14 # 原子密度 个/立方厘米
|
|
483
|
+
demo.dimension = dimension
|
|
484
|
+
|
|
485
|
+
demo.size_scale = 1
|
|
486
|
+
demo.grain_size = grain_szie
|
|
487
|
+
demo.atom_density = atom_density # 原子密度 个/立方厘米
|
|
488
|
+
demo.frequency = frequency
|
|
489
|
+
|
|
490
|
+
# domains应该从外到内
|
|
491
|
+
domains = []
|
|
492
|
+
for i in range(n-1, 0-1, -1):
|
|
493
|
+
size = int(demo.grain_size * fs[i]) * demo.size_scale
|
|
494
|
+
center = np.zeros(demo.dimension)
|
|
495
|
+
if i == 2:
|
|
496
|
+
ad = demo.atom_density * 5 / 4
|
|
497
|
+
else:
|
|
498
|
+
ad = demo.atom_density
|
|
499
|
+
dom = Domain(
|
|
500
|
+
dimension=demo.dimension, atom_density=ad, min_bound=center - size / 2, max_bound=center + size / 2,
|
|
501
|
+
energy=es[i], fraction=fs[i], inclusions=[domains[-1]] if len(domains) >= 1 else []
|
|
502
|
+
)
|
|
503
|
+
domains.append(dom)
|
|
504
|
+
# domains应该从外到内, 上面为了inclusion以及方便不同扩散域设置不同的密度,要按照从小到大的顺序生成,但是后面行走的时候要根据不同条件设置系数,要从外到内
|
|
505
|
+
demo.domains = sorted(domains, key=lambda dom: dom.fraction, reverse=True)
|
|
506
|
+
|
|
507
|
+
demo.setup()
|
|
508
|
+
|
|
509
|
+
demo.name = f"{file_name}"
|
|
510
|
+
|
|
511
|
+
print(f"Total Atoms: {demo.natoms}, atoms in each dom: {[dom.natoms for dom in demo.domains]} filename: {demo.name}")
|
|
512
|
+
|
|
513
|
+
if positions is not None:
|
|
514
|
+
demo.positions = positions
|
|
515
|
+
demo.natoms = len(positions)
|
|
516
|
+
|
|
517
|
+
demo.run_sequence(times=times, temperatures=temps, statuses=statuses, targets=targets, domains=demo.domains,
|
|
518
|
+
epsilon=epsilon, simulating=simulation, **kwargs)
|
|
519
|
+
# demo.run_persecond(times=times, temperatures=temps, domains=demo.domains, targets=target,
|
|
520
|
+
# epsilon=epsilon, simulation=simulation)
|
|
521
|
+
|
|
522
|
+
return demo
|
|
523
|
+
|
|
524
|
+
try:
|
|
525
|
+
return _(ndoms, energies, fractions), True
|
|
526
|
+
except OverEpsilonError as e:
|
|
527
|
+
if ignore_error:
|
|
528
|
+
return demo, False
|
|
529
|
+
else:
|
|
530
|
+
raise
|
|
531
|
+
|
|
532
|
+
|
|
533
|
+
def run_40ar(times, temps, statuses, energies, fractions, ndoms: int = 1, grain_szie=275, atom_density=1e10, frequency=1e13,
|
|
445
534
|
dimension: int = 3, targets: list = None, epsilon: float = 0.001, simulation: bool = False,
|
|
446
535
|
file_name: str = "Y70", ignore_error: bool = False, **kwargs):
|
|
447
536
|
"""
|
|
@@ -20,6 +20,7 @@ import numpy as np
|
|
|
20
20
|
def calc_age_min(F, sF, **kwargs) -> tuple:
|
|
21
21
|
"""
|
|
22
22
|
Calculate ArAr ages using Min et al. (2000) equation.
|
|
23
|
+
Note that the Ar/K of primary standards is not working currently
|
|
23
24
|
Parameters
|
|
24
25
|
----------
|
|
25
26
|
F : array-like
|
|
@@ -68,7 +69,6 @@ def calc_age_min(F, sF, **kwargs) -> tuple:
|
|
|
68
69
|
# recalculation using Min et al.(2000) equation
|
|
69
70
|
# lmd = A * W * Y / (f * No)
|
|
70
71
|
V = f * No / ((Ab + Ae) * W * Y)
|
|
71
|
-
sf = 0 # the error of f was not considered by Koppers
|
|
72
72
|
sV = pow((V / f * sf) ** 2 + (V / No * sNo) ** 2 + (V / (Ab + Ae)) ** 2 * (sAb ** 2 + sAe ** 2) +
|
|
73
73
|
(V / W * sW) ** 2 + (V / Y * sY) ** 2, 0.5)
|
|
74
74
|
# standard age in year, change to Ma
|
|
@@ -87,7 +87,7 @@ def calc_age_min(F, sF, **kwargs) -> tuple:
|
|
|
87
87
|
KK = np.exp(t / V) - 1 # 40Arr / 40K Use standard age
|
|
88
88
|
XX = BB * KK * R + 1
|
|
89
89
|
k0 = V * np.log(XX)
|
|
90
|
-
e1 = (np.log(XX) * V / f - V * BB * KK * R / (f * XX)) ** 2 * sf ** 2 #
|
|
90
|
+
e1 = (np.log(XX) * V / f - V * BB * KK * R / (f * XX)) ** 2 * sf ** 2 # sF
|
|
91
91
|
e2 = (np.log(XX) * V / No) ** 2 * sNo ** 2 # sNo
|
|
92
92
|
e3 = (-1 * np.log(XX) * V / A + BB * KK * R / (A * XX)) ** 2 * sAb ** 2 # sAb
|
|
93
93
|
e4 = (-1 * np.log(XX) * V / A - Ab * KK * R / (Ae ** 2 * XX)) ** 2 * sAe ** 2 # sAe
|
|
@@ -66,7 +66,7 @@ def merge_dicts(a: dict, b: dict):
|
|
|
66
66
|
"""
|
|
67
67
|
res = copy.deepcopy(a)
|
|
68
68
|
for key, val in b.items():
|
|
69
|
-
if key not in res.keys() and key.isnumeric():
|
|
69
|
+
if key not in res.keys() and str(key).isnumeric():
|
|
70
70
|
key = int(key)
|
|
71
71
|
if key not in res.keys():
|
|
72
72
|
res[key] = val
|
|
@@ -59,14 +59,14 @@ def mdf(rm: float, srm: float, m1: float, m2: float, ra: float = 298.56,
|
|
|
59
59
|
sdelta_m = err.add(sm2, sm1)
|
|
60
60
|
ratio_m = m2 / m1
|
|
61
61
|
sratio_m = err.div((m2, sm2), (m1, sm1))
|
|
62
|
-
|
|
63
|
-
if
|
|
62
|
+
useRyu = False
|
|
63
|
+
if not useRyu:
|
|
64
64
|
# line
|
|
65
|
-
k1 = (ra / rm + delta_m - 1) / delta_m
|
|
65
|
+
k1 = (ra / rm + delta_m - 1) / delta_m
|
|
66
66
|
k2 = err.div(((ra / rm + delta_m - 1), err.div((ra, sra), (rm, srm))), (delta_m, sdelta_m))
|
|
67
67
|
# exp
|
|
68
68
|
try:
|
|
69
|
-
k3 = (np.log(ra / rm) / np.log(ratio_m)) * (1 / m1) + 1
|
|
69
|
+
k3 = (np.log(ra / rm) / np.log(ratio_m)) * (1 / m1) + 1
|
|
70
70
|
v1 = err.log((ra / rm, err.div((ra, sra), (rm, srm))))
|
|
71
71
|
v2 = err.log((ratio_m, sratio_m))
|
|
72
72
|
v3 = err.div((np.log(ra / rm), v1), (np.log(ratio_m), v2))
|
|
@@ -75,7 +75,7 @@ def mdf(rm: float, srm: float, m1: float, m2: float, ra: float = 298.56,
|
|
|
75
75
|
k3, k4 = "Null", "Null"
|
|
76
76
|
# pow
|
|
77
77
|
try:
|
|
78
|
-
k5 = pow((ra / rm), (1 / delta_m)) #
|
|
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:
|
|
@@ -109,6 +109,8 @@ def open_252(data: pd.DataFrame, logs01: pd.DataFrame, logs02: pd.DataFrame):
|
|
|
109
109
|
-999, -999, -999, -999, -999, -999, -999, -999, -999, -999, # 100-109
|
|
110
110
|
-999, -999, -999, -999, -1, # 110-114
|
|
111
111
|
-999, -999, -999, -999, -999, -999, -999, -999, # 115-122
|
|
112
|
+
-999, -999, -999, -999, -999, -999, -999, -999, # 123-130
|
|
113
|
+
-999, -999, -999, -999, -999, # 131-135
|
|
112
114
|
]
|
|
113
115
|
|
|
114
116
|
# double transpose to remove keys
|
|
@@ -283,6 +285,10 @@ def open_240(data: pd.DataFrame, logs01: pd.DataFrame, logs02: pd.DataFrame):
|
|
|
283
285
|
-999, -999, -999, -999, -1,
|
|
284
286
|
# 115-122
|
|
285
287
|
-999, -999, -999, -999, -999, -999, -999, -999,
|
|
288
|
+
# 123-130
|
|
289
|
+
-999, -999, -999, -999, -999, -999, -999, -999,
|
|
290
|
+
# 131-135
|
|
291
|
+
-999, -999, -999, -999, -999,
|
|
286
292
|
]
|
|
287
293
|
|
|
288
294
|
# double transpose to remove keys
|
|
@@ -503,15 +509,17 @@ def open_full_xls(file_path: str, sample_name: str = ''):
|
|
|
503
509
|
-1, -1, # 56-57
|
|
504
510
|
-1, -1, # 58-59
|
|
505
511
|
-1, -1, -1, -1, -1, -1, -1, -1, -1, # 60-68
|
|
506
|
-
10, 11, 12, 13, #
|
|
507
|
-
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, #
|
|
508
|
-
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, #
|
|
509
|
-
-1, -1, -1, -1, #
|
|
510
|
-
-1, -1, -1, -1, #
|
|
511
|
-
-1, -1, -1, -1, -
|
|
512
|
-
-1, -1, -1, -1, #
|
|
513
|
-
-1, -1, -1, -1, #
|
|
514
|
-
-1, #
|
|
512
|
+
10, 11, 12, 13, # 69-72
|
|
513
|
+
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, # 73-84
|
|
514
|
+
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, # 85-94
|
|
515
|
+
-1, -1, -1, -1, # 95-98
|
|
516
|
+
-1, -1, -1, -1, # 99-102
|
|
517
|
+
-1, -1, -1, -1, # 103-106
|
|
518
|
+
-1, -1, -1, -1, # 107-110
|
|
519
|
+
-1, -1, -1, -1, # 111-114
|
|
520
|
+
-1, -1, -1, -1, -1, -1, -1, -1, # 115-122
|
|
521
|
+
-1, -1, -1, -1, -1, -1, -1, -1, # 123-130
|
|
522
|
+
-1, -1, -1, -1, -1, # 131-135
|
|
515
523
|
])
|
|
516
524
|
|
|
517
525
|
month_convert = {'Jan': '01', 'Feb': '02', 'Mar': '03', 'Apr': '04', 'May': '05', 'Jun': '06',
|
|
@@ -49,6 +49,12 @@ spectra_res_keys = [
|
|
|
49
49
|
SPECTRA_RES = dict(zip(
|
|
50
50
|
spectra_res_keys, [np.nan for i in spectra_res_keys])
|
|
51
51
|
)
|
|
52
|
+
settings_keys = [
|
|
53
|
+
'sigma_level'
|
|
54
|
+
]
|
|
55
|
+
SETTINGS_RES = dict(zip(
|
|
56
|
+
settings_keys, [np.nan for i in settings_keys])
|
|
57
|
+
)
|
|
52
58
|
|
|
53
59
|
|
|
54
60
|
# create sample instance
|
|
@@ -176,8 +182,11 @@ def initial(smp: Sample):
|
|
|
176
182
|
reference=ArArBasic(
|
|
177
183
|
name='REFERENCE', journal='JOURNAL', doi='DOI'
|
|
178
184
|
),
|
|
185
|
+
settings=copy.deepcopy(SETTINGS_RES)
|
|
179
186
|
))
|
|
180
187
|
|
|
188
|
+
smp.Info.settings.update({'sigma_level': 1})
|
|
189
|
+
|
|
181
190
|
# Plots and Tables
|
|
182
191
|
setattr(smp, 'UnknownTable', Table(
|
|
183
192
|
id='1', name='Unknown', header=samples.SAMPLE_INTERCEPT_HEADERS,
|
|
@@ -59,7 +59,7 @@ def set_plot_data(sample: Sample, isInit: bool = True, isIsochron: bool = True,
|
|
|
59
59
|
# Initialization, apply age spectra data and isochron plot data
|
|
60
60
|
if isInit:
|
|
61
61
|
try:
|
|
62
|
-
initial_plot_data(sample
|
|
62
|
+
initial_plot_data(sample)
|
|
63
63
|
except (Exception, BaseException):
|
|
64
64
|
# print(traceback.format_exc())
|
|
65
65
|
pass
|
|
@@ -80,7 +80,7 @@ def set_plot_data(sample: Sample, isInit: bool = True, isIsochron: bool = True,
|
|
|
80
80
|
# Recalculate plateaus
|
|
81
81
|
if isPlateau:
|
|
82
82
|
try:
|
|
83
|
-
recalc_plateaus(sample
|
|
83
|
+
recalc_plateaus(sample)
|
|
84
84
|
except (Exception, BaseException):
|
|
85
85
|
# print(traceback.format_exc())
|
|
86
86
|
pass
|
|
@@ -89,7 +89,7 @@ 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(sample: Sample
|
|
92
|
+
def initial_plot_data(sample: Sample):
|
|
93
93
|
"""
|
|
94
94
|
Assign initial data for plots
|
|
95
95
|
Parameters
|
|
@@ -136,7 +136,7 @@ def initial_plot_data(sample: Sample, **kwargs):
|
|
|
136
136
|
)
|
|
137
137
|
try:
|
|
138
138
|
sample.AgeSpectraPlot.data = calc.spectra.get_data(
|
|
139
|
-
*sample.ApparentAgeValues[2:4], sample.ApparentAgeValues[7]
|
|
139
|
+
*sample.ApparentAgeValues[2:4], sample.ApparentAgeValues[7])
|
|
140
140
|
sample.AgeSpectraPlot.data = calc.arr.transpose(sample.AgeSpectraPlot.data)
|
|
141
141
|
except (Exception, BaseException):
|
|
142
142
|
print(traceback.format_exc())
|
|
@@ -743,7 +743,7 @@ DEFAULT_PLOT_STYLES = {
|
|
|
743
743
|
},
|
|
744
744
|
}
|
|
745
745
|
|
|
746
|
-
VERSION = '
|
|
746
|
+
VERSION = '20250301'
|
|
747
747
|
|
|
748
748
|
NAMED_DICT = {
|
|
749
749
|
"unknown": {"header": SAMPLE_INTERCEPT_HEADERS.copy()},
|
|
@@ -846,7 +846,8 @@ class Sample:
|
|
|
846
846
|
# self.__version = '20231116' # change smp parameters
|
|
847
847
|
# self.__version = '20240730' # change parameter table for thermo calculation
|
|
848
848
|
# self.__version = '20241028' # gain correction
|
|
849
|
-
self.__version = '20250102' # gain correction to blanks
|
|
849
|
+
# self.__version = '20250102' # gain correction to blanks
|
|
850
|
+
self.__version = '20250301' # error sigma adjustment
|
|
850
851
|
|
|
851
852
|
@property
|
|
852
853
|
def version(self):
|
|
@@ -943,7 +944,7 @@ class Table:
|
|
|
943
944
|
if header is None:
|
|
944
945
|
header = ['']
|
|
945
946
|
if data is None:
|
|
946
|
-
data = [['']]
|
|
947
|
+
data = [['' for i in range(len(header))]]
|
|
947
948
|
if colcount is None:
|
|
948
949
|
colcount = len(header)
|
|
949
950
|
if rowcount is None:
|
|
@@ -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.1.
|
|
19
|
+
version='0.1.15', # version
|
|
20
20
|
author='Yang Wu',
|
|
21
21
|
author_email='wuycug@hotmail.com',
|
|
22
22
|
description='A project for Ar-Ar geochronology', # short description
|
|
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
|