ararpy 0.1.18__tar.gz → 0.1.191__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.18 → ararpy-0.1.191}/PKG-INFO +1 -1
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/files/raw_file.py +2 -3
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/smp/export.py +164 -224
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/smp/initial.py +2 -1
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/smp/plots.py +3 -5
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/smp/sample.py +3 -2
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy.egg-info/PKG-INFO +1 -1
- {ararpy-0.1.18 → ararpy-0.1.191}/setup.py +1 -1
- {ararpy-0.1.18 → ararpy-0.1.191}/LICENSE +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/README.md +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/__init__.py +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/calc/__init__.py +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/calc/age.py +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/calc/arr.py +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/calc/basic.py +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/calc/corr.py +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/calc/err.py +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/calc/histogram.py +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/calc/isochron.py +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/calc/jvalue.py +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/calc/plot.py +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/calc/raw_funcs.py +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/calc/regression.py +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/calc/spectra.py +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/examples/022_VU124-M11a.ahd +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/examples/20WHA0103.age +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/examples/22WHA0078.xls +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/examples/22WHA0433.age +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/examples/22WHA0433.arr +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/examples/22WHA0433.full.xls +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/examples/24WHN0001-51-592.XLS +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/examples/AHD.input-filter +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/examples/ArAr.calc +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/examples/ArArCALC.age +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/examples/NGX-600 - Copy.TXT +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/examples/NGX-600.TXT +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/examples/NGX-XLS.input-filter +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/examples/Qtegra-exported-xls.input-filter +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/examples/S01-239.csv +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/examples/WH01.irra +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/examples/WHA.pdf +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/examples/raw_example.xls +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/examples/sample-default.smp +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/files/__init__.py +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/files/arr_file.py +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/files/basic.py +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/files/calc_file.py +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/files/new_file.py +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/files/xls.py +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/smp/EXPORT_TO_PDF_DATA_PROPERTIES.py +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/smp/__init__.py +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/smp/basic.py +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/smp/calculation.py +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/smp/consts.py +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/smp/corr.py +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/smp/diffusion_funcs.py +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/smp/info.py +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/smp/json.py +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/smp/raw.py +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/smp/style.py +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/smp/table.py +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/test.py +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/thermo/__init__.py +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/thermo/arrhenius.py +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/thermo/atomic_level_random_walk.py +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy/thermo/basic.py +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy.egg-info/SOURCES.txt +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy.egg-info/dependency_links.txt +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/ararpy.egg-info/top_level.txt +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/setup.cfg +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/tests/test.py +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/tests/test2.py +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/tests/test_error_correlation.py +0 -0
- {ararpy-0.1.18 → ararpy-0.1.191}/tests/test_regression_methods.py +0 -0
|
@@ -345,10 +345,9 @@ def get_raw_data(file_contents: List[List[Union[int, float, str, bool, list]]],
|
|
|
345
345
|
break
|
|
346
346
|
|
|
347
347
|
step_list.append(current_step)
|
|
348
|
-
|
|
349
|
-
idx = input_filter[32] * step_index
|
|
348
|
+
idx = input_filter[32] * len(step_list)
|
|
350
349
|
|
|
351
|
-
if not check_box_index[0] or
|
|
350
|
+
if not check_box_index[0] or len(step_list) >= 500: # check_box_index[0]: multiple sequences
|
|
352
351
|
break
|
|
353
352
|
|
|
354
353
|
return step_list
|
|
@@ -12,6 +12,7 @@ from re import findall
|
|
|
12
12
|
from xlsxwriter.workbook import Workbook
|
|
13
13
|
from xlsxwriter.worksheet import Worksheet
|
|
14
14
|
from xlsxwriter.chartsheet import Chartsheet
|
|
15
|
+
from xlsxwriter.format import Format
|
|
15
16
|
import os
|
|
16
17
|
import sys
|
|
17
18
|
import pickle
|
|
@@ -750,6 +751,11 @@ class WritingWorkbook:
|
|
|
750
751
|
self.axis_font_bold = False
|
|
751
752
|
self.axis_num_font_size = 10
|
|
752
753
|
self.line_width = 1.25
|
|
754
|
+
self.default_fmt_prop = {
|
|
755
|
+
'font_name': 'Times New Roman', "font_size": 10, 'num_format': '0.000000',
|
|
756
|
+
'align': 'center', 'valign': 'vcenter',
|
|
757
|
+
}
|
|
758
|
+
self.formats = {'default': Format({'font_name': 'Times New Roman', "font_size": 10, })}
|
|
753
759
|
|
|
754
760
|
for key, value in kwargs.items():
|
|
755
761
|
setattr(self, key, value)
|
|
@@ -774,6 +780,7 @@ class WritingWorkbook:
|
|
|
774
780
|
def get_xls(self):
|
|
775
781
|
# TypeError: NAN/INF not supported in write_number() without 'nan_inf_to_errors' Workbook() option
|
|
776
782
|
xls = Workbook(self.filepath, {"nan_inf_to_errors": True})
|
|
783
|
+
|
|
777
784
|
style = xls.add_format(self.style)
|
|
778
785
|
|
|
779
786
|
sigma = int(self.sample.Info.preference['confidenceLevel'])
|
|
@@ -987,227 +994,7 @@ class WritingWorkbook:
|
|
|
987
994
|
pass
|
|
988
995
|
|
|
989
996
|
# write result sheet
|
|
990
|
-
|
|
991
|
-
title_fmt = xls.add_format({
|
|
992
|
-
'font_size': 10, 'font_name': 'Microsoft Sans Serif', 'bold': True,
|
|
993
|
-
'bg_color': '#ccffff', 'font_color': '#0000ff', 'valign': 'vcenter', 'align': 'center',
|
|
994
|
-
'top': 0, 'bottom': 0 # border width
|
|
995
|
-
})
|
|
996
|
-
title_fmt_2 = xls.add_format({
|
|
997
|
-
'font_size': 10, 'font_name': 'Microsoft Sans Serif', 'bold': True,
|
|
998
|
-
'font_color': '#000000', 'valign': 'vcenter', 'align': 'left',
|
|
999
|
-
'top': 0, 'left': 0, 'bottom': 0, 'right': 0 # border width
|
|
1000
|
-
})
|
|
1001
|
-
two_decimal_fmt = xls.add_format({
|
|
1002
|
-
'num_format': '0.00',
|
|
1003
|
-
'font_size': 10, 'font_name': 'Microsoft Sans Serif', 'bold': False,
|
|
1004
|
-
'font_color': '#000000', 'valign': 'vcenter', 'align': 'center', 'text_wrap': True,
|
|
1005
|
-
'top': 0, 'left': 0, 'bottom': 0, 'right': 0 # border width
|
|
1006
|
-
})
|
|
1007
|
-
five_decimal_fmt = xls.add_format({
|
|
1008
|
-
'num_format': '0.00000',
|
|
1009
|
-
'font_size': 10, 'font_name': 'Microsoft Sans Serif', 'bold': False,
|
|
1010
|
-
'font_color': '#000000', 'valign': 'vcenter', 'align': 'center', 'text_wrap': True,
|
|
1011
|
-
'top': 0, 'left': 0, 'bottom': 0, 'right': 0 # border width
|
|
1012
|
-
})
|
|
1013
|
-
error_fmt = xls.add_format({
|
|
1014
|
-
'num_format': '± 0.00',
|
|
1015
|
-
'font_size': 10, 'font_name': 'Microsoft Sans Serif', 'bold': False,
|
|
1016
|
-
'font_color': '#000000', 'valign': 'vcenter', 'align': 'center', 'text_wrap': True,
|
|
1017
|
-
'top': 0, 'left': 0, 'bottom': 0, 'right': 0 # border width
|
|
1018
|
-
})
|
|
1019
|
-
five_error_fmt = xls.add_format({
|
|
1020
|
-
'num_format': '± 0.00000',
|
|
1021
|
-
'font_size': 10, 'font_name': 'Microsoft Sans Serif', 'bold': False,
|
|
1022
|
-
'font_color': '#000000', 'valign': 'vcenter', 'align': 'center', 'text_wrap': True,
|
|
1023
|
-
'top': 0, 'left': 0, 'bottom': 0, 'right': 0 # border width
|
|
1024
|
-
})
|
|
1025
|
-
percent_fmt = xls.add_format({
|
|
1026
|
-
'num_format': '± 0.00%',
|
|
1027
|
-
'font_size': 10, 'font_name': 'Microsoft Sans Serif', 'bold': False,
|
|
1028
|
-
'font_color': '#000000', 'valign': 'vcenter', 'align': 'center', 'text_wrap': True,
|
|
1029
|
-
'top': 0, 'left': 0, 'bottom': 0, 'right': 0 # border width
|
|
1030
|
-
})
|
|
1031
|
-
int_fmt = xls.add_format({
|
|
1032
|
-
'num_format': '0',
|
|
1033
|
-
'font_size': 10, 'font_name': 'Microsoft Sans Serif', 'bold': False,
|
|
1034
|
-
'font_color': '#000000', 'valign': 'vcenter', 'align': 'center', 'text_wrap': True,
|
|
1035
|
-
'top': 0, 'left': 0, 'bottom': 0, 'right': 0 # border width
|
|
1036
|
-
})
|
|
1037
|
-
string_fmt = xls.add_format({
|
|
1038
|
-
'font_size': 10, 'font_name': 'Microsoft Sans Serif', 'bold': False,
|
|
1039
|
-
'font_color': '#000000', 'valign': 'vcenter', 'align': 'right', 'text_wrap': False,
|
|
1040
|
-
'top': 0, 'left': 0, 'bottom': 0, 'right': 0 # border width
|
|
1041
|
-
})
|
|
1042
|
-
# two_decimal_fmt.set_text_wrap()
|
|
1043
|
-
sht_result.set_column(0, 21, width=8.5) # column width
|
|
1044
|
-
sht_result.set_column(10, 11, width=3) # column width
|
|
1045
|
-
sht_result.merge_range(0, 0, 1, 9, 'Sample Information', title_fmt)
|
|
1046
|
-
title_list = [
|
|
1047
|
-
[7, 0, 8, 0, 'Result'], [7, 1, 8, 1, ''], [7, 2, 8, 2, '40(r)/39(k)'], [7, 3, 8, 3, f'{sigma}σ'],
|
|
1048
|
-
[7, 5, 8, 5, f'{sigma}σ'],
|
|
1049
|
-
[7, 6, 8, 6, 'MSWD'], [7, 7, 8, 7, '39Ar(K)'], [7, 8, 8, 8, 'Ca/K'], [7, 9, 8, 9, f'{sigma}σ'],
|
|
1050
|
-
[7, 12, 8, 12, 'Result'], [7, 13, 8, 13, ''], [7, 14, 8, 14, '40(r)/39(k)'], [7, 15, 8, 15, f'{sigma}σ'],
|
|
1051
|
-
[7, 16, 8, 16, 'Age'], [7, 17, 8, 17, f'{sigma}σ'],
|
|
1052
|
-
[7, 18, 8, 18, 'MSWD'], [7, 20, 8, 20, 'Ca/K'], [7, 21, 8, 21, f'{sigma}σ'],
|
|
1053
|
-
]
|
|
1054
|
-
data_list = [
|
|
1055
|
-
[3, 0, 3, 2, f"Sample = {self.sample.Info.sample.name}"],
|
|
1056
|
-
[3, 3, 3, 5, f"Material = {self.sample.Info.sample.material}"],
|
|
1057
|
-
[3, 6, 3, 8, f"Irradiation = {self.sample.TotalParam[28][0]}"],
|
|
1058
|
-
[4, 0, 4, 2, f"Analyst = {self.sample.Info.laboratory.analyst}"],
|
|
1059
|
-
[4, 3, 4, 5, f"Researcher = {self.sample.Info.researcher.name}"],
|
|
1060
|
-
[4, 6, 4, 8,
|
|
1061
|
-
f"J = {self.sample.TotalParam[67][0]} ± {round(self.sample.TotalParam[68][0] * self.sample.TotalParam[67][0] / 100, len(str(self.sample.TotalParam[67][0])))}"],
|
|
1062
|
-
]
|
|
1063
|
-
for each in title_list:
|
|
1064
|
-
sht_result.merge_range(*each, title_fmt)
|
|
1065
|
-
sht_result.write_column(7, 4, ['Age', f'[{self.sample.Info.preference["ageUnit"]}]'], title_fmt)
|
|
1066
|
-
sht_result.write_column(7, 19, ['³⁹Ar[K]', '[%, n]'], title_fmt)
|
|
1067
|
-
for each in data_list:
|
|
1068
|
-
sht_result.merge_range(*each, two_decimal_fmt)
|
|
1069
|
-
|
|
1070
|
-
def _write_results(sht: Worksheet, start_row: int, start_col: int, title: str, data: list):
|
|
1071
|
-
if len(data) < 13:
|
|
1072
|
-
return
|
|
1073
|
-
sht.merge_range(start_row, start_col, start_row + 1, start_col + 1, title, title_fmt_2)
|
|
1074
|
-
sht.merge_range(start_row, start_col + 2, start_row + 1, start_col + 2, data[0], five_decimal_fmt)
|
|
1075
|
-
sht.write_number(start_row, start_col + 3, data[1], five_error_fmt)
|
|
1076
|
-
sht.write_number(start_row + 1, start_col + 3, data[2], percent_fmt)
|
|
1077
|
-
sht.merge_range(start_row, start_col + 4, start_row + 1, start_col + 4, data[3], two_decimal_fmt)
|
|
1078
|
-
sht.write_number(start_row, start_col + 5, data[4], error_fmt)
|
|
1079
|
-
sht.write_number(start_row + 1, start_col + 5, data[5], percent_fmt)
|
|
1080
|
-
sht.write_column(start_row + 2, start_col + 4, ['internal error', 'total external error'], string_fmt)
|
|
1081
|
-
sht.write_column(start_row + 2, start_col + 5, data[6:8], error_fmt)
|
|
1082
|
-
sht.merge_range(start_row, start_col + 6, start_row + 1, start_col + 6, data[8], two_decimal_fmt)
|
|
1083
|
-
sht.write_number(start_row, start_col + 7, data[9], percent_fmt)
|
|
1084
|
-
sht.write_number(start_row + 1, start_col + 7, data[10], int_fmt)
|
|
1085
|
-
sht.merge_range(start_row, start_col + 8, start_row + 1, start_col + 8, data[11], five_decimal_fmt)
|
|
1086
|
-
sht.write_number(start_row, start_col + 9, data[12], five_error_fmt)
|
|
1087
|
-
sht.write_number(start_row + 1, start_col + 9, data[13], percent_fmt)
|
|
1088
|
-
|
|
1089
|
-
# TGA
|
|
1090
|
-
try:
|
|
1091
|
-
age_res = self.sample.Info.results.age_spectra['TGA']
|
|
1092
|
-
total_ca = [sum(self.sample.DegasValues[8]), err.add(*self.sample.DegasValues[9])]
|
|
1093
|
-
total_k = [sum(self.sample.DegasValues[20]), err.add(*self.sample.DegasValues[21])]
|
|
1094
|
-
cak = total_ca[0] / total_k[0] / self.sample.TotalParam[20][0]
|
|
1095
|
-
scak = err.div(total_ca, total_k, [self.sample.TotalParam[20][0], self.sample.TotalParam[21][0] * self.sample.TotalParam[20][0] / 100])
|
|
1096
|
-
_write_results(
|
|
1097
|
-
sht_result, 10, 0, 'Total Age',
|
|
1098
|
-
[age_res['F'], age_res['sF'] * sigma, abs(age_res['sF'] * sigma / age_res['F']), age_res['age'],
|
|
1099
|
-
age_res['s1'] * sigma, abs(age_res['s1'] * sigma / age_res['age']), age_res['s2'] * sigma, age_res['s3'] * sigma,
|
|
1100
|
-
age_res['MSWD'], age_res['Ar39'] / 100,
|
|
1101
|
-
age_res['Num'], cak, scak * sigma, abs(scak * sigma / cak)]
|
|
1102
|
-
)
|
|
1103
|
-
_write_results(
|
|
1104
|
-
sht_result, 10, 12, 'Total Age',
|
|
1105
|
-
[age_res['F'], age_res['sF'] * sigma, abs(age_res['sF'] * sigma / age_res['F']), age_res['age'],
|
|
1106
|
-
age_res['s1'] * sigma, abs(age_res['s1'] * sigma / age_res['age']), age_res['s2'] * sigma, age_res['s3'] * sigma,
|
|
1107
|
-
age_res['MSWD'], age_res['Ar39'] / 100,
|
|
1108
|
-
age_res['Num'], cak, scak * sigma, abs(scak * sigma / cak)]
|
|
1109
|
-
)
|
|
1110
|
-
except TypeError:
|
|
1111
|
-
print(traceback.format_exc())
|
|
1112
|
-
pass
|
|
1113
|
-
|
|
1114
|
-
# age spectra, weighted mean age with 296
|
|
1115
|
-
try:
|
|
1116
|
-
age_res = self.sample.Info.results.age_spectra[0]
|
|
1117
|
-
seq = self.sample.SelectedSequence1
|
|
1118
|
-
total_ca = [sum(np.array(self.sample.DegasValues[8])[seq]), err.add(*np.array(self.sample.DegasValues[9])[seq])]
|
|
1119
|
-
total_k = [sum(np.array(self.sample.DegasValues[20])[seq]), err.add(*np.array(self.sample.DegasValues[21])[seq])]
|
|
1120
|
-
cak = total_ca[0] / total_k[0] / self.sample.TotalParam[20][0]
|
|
1121
|
-
scak = err.div(total_ca, total_k, [self.sample.TotalParam[20][0], self.sample.TotalParam[21][0] * self.sample.TotalParam[20][0] / 100])
|
|
1122
|
-
_write_results(
|
|
1123
|
-
sht_result, 15, 0, f'Set 1 Plateau with air ratio {self.sample.TotalParam[0][0]}',
|
|
1124
|
-
[age_res['F'], age_res['sF'] * sigma, abs(age_res['sF'] * sigma / age_res['F']), age_res['age'],
|
|
1125
|
-
age_res['s1'] * sigma, abs(age_res['s1'] * sigma / age_res['age']), age_res['s2'] * sigma, age_res['s3'] * sigma,
|
|
1126
|
-
age_res['MSWD'], age_res['Ar39'] / 100,
|
|
1127
|
-
age_res['Num'], cak, scak * sigma, abs(scak * sigma / cak)]
|
|
1128
|
-
)
|
|
1129
|
-
except (IndexError, TypeError, ZeroDivisionError):
|
|
1130
|
-
print(traceback.format_exc())
|
|
1131
|
-
pass
|
|
1132
|
-
try:
|
|
1133
|
-
age_res = self.sample.Info.results.age_spectra[1]
|
|
1134
|
-
seq = self.sample.SelectedSequence2
|
|
1135
|
-
total_ca = [sum(np.array(self.sample.DegasValues[8])[seq]), err.add(*np.array(self.sample.DegasValues[9])[seq])]
|
|
1136
|
-
total_k = [sum(np.array(self.sample.DegasValues[20])[seq]), err.add(*np.array(self.sample.DegasValues[21])[seq])]
|
|
1137
|
-
cak = total_ca[0] / total_k[0] / self.sample.TotalParam[20][0]
|
|
1138
|
-
scak = err.div(total_ca, total_k, [self.sample.TotalParam[20][0], self.sample.TotalParam[21][0] * self.sample.TotalParam[20][0] / 100])
|
|
1139
|
-
_write_results(
|
|
1140
|
-
sht_result, 15, 12, f'Set 2 Plateau with air ratio {self.sample.TotalParam[0][0]}',
|
|
1141
|
-
[age_res['F'], age_res['sF'] * sigma, abs(age_res['sF'] * sigma / age_res['F']), age_res['age'],
|
|
1142
|
-
age_res['s1'] * sigma, abs(age_res['s1'] * sigma / age_res['age']), age_res['s2'] * sigma, age_res['s3'] * sigma,
|
|
1143
|
-
age_res['MSWD'], age_res['Ar39'] / 100,
|
|
1144
|
-
age_res['Num'], cak, scak * sigma, abs(scak * sigma / cak)]
|
|
1145
|
-
)
|
|
1146
|
-
except (IndexError, TypeError, ZeroDivisionError):
|
|
1147
|
-
print(traceback.format_exc())
|
|
1148
|
-
pass
|
|
1149
|
-
|
|
1150
|
-
# age spectra, weighted mean age with inverse intercept
|
|
1151
|
-
try:
|
|
1152
|
-
age_res = self.sample.Info.results.age_plateau[0]
|
|
1153
|
-
seq = self.sample.SelectedSequence1
|
|
1154
|
-
total_ca = [sum(np.array(self.sample.DegasValues[8])[seq]), err.add(*np.array(self.sample.DegasValues[9])[seq])]
|
|
1155
|
-
total_k = [sum(np.array(self.sample.DegasValues[20])[seq]), err.add(*np.array(self.sample.DegasValues[21])[seq])]
|
|
1156
|
-
cak = total_ca[0] / total_k[0] / self.sample.TotalParam[20][0]
|
|
1157
|
-
scak = err.div(total_ca, total_k, [self.sample.TotalParam[20][0], self.sample.TotalParam[21][0] * self.sample.TotalParam[20][0] / 100])
|
|
1158
|
-
_write_results(
|
|
1159
|
-
sht_result, 20, 0, 'Set 1 Plateau with intercept correction',
|
|
1160
|
-
[age_res['F'], age_res['sF'] * sigma, abs(age_res['sF'] * sigma / age_res['F']), age_res['age'],
|
|
1161
|
-
age_res['s1'] * sigma, abs(age_res['s1'] * sigma / age_res['age']), age_res['s2'] * sigma, age_res['s3'] * sigma,
|
|
1162
|
-
age_res['MSWD'], age_res['Ar39'] / 100,
|
|
1163
|
-
age_res['Num'], cak, scak * sigma, abs(scak * sigma / cak)]
|
|
1164
|
-
)
|
|
1165
|
-
except (IndexError, TypeError, ZeroDivisionError):
|
|
1166
|
-
print(traceback.format_exc())
|
|
1167
|
-
pass
|
|
1168
|
-
try:
|
|
1169
|
-
age_res = self.sample.Info.results.age_plateau[1]
|
|
1170
|
-
seq = self.sample.SelectedSequence2
|
|
1171
|
-
total_ca = [sum(np.array(self.sample.DegasValues[8])[seq]), err.add(*np.array(self.sample.DegasValues[9])[seq])]
|
|
1172
|
-
total_k = [sum(np.array(self.sample.DegasValues[20])[seq]), err.add(*np.array(self.sample.DegasValues[21])[seq])]
|
|
1173
|
-
cak = total_ca[0] / total_k[0] / self.sample.TotalParam[20][0]
|
|
1174
|
-
scak = err.div(total_ca, total_k, [self.sample.TotalParam[20][0], self.sample.TotalParam[21][0] * self.sample.TotalParam[20][0] / 100])
|
|
1175
|
-
_write_results(
|
|
1176
|
-
sht_result, 20, 12, 'Set 2 Plateau with intercept correction',
|
|
1177
|
-
[age_res['F'], age_res['sF'] * sigma, abs(age_res['sF'] * sigma / age_res['F']), age_res['age'],
|
|
1178
|
-
age_res['s1'] * sigma, abs(age_res['s1'] * sigma / age_res['age']), age_res['s2'] * sigma, age_res['s3'] * sigma,
|
|
1179
|
-
age_res['MSWD'], age_res['Ar39'] / 100,
|
|
1180
|
-
age_res['Num'], cak, scak * sigma, abs(scak * sigma / cak)]
|
|
1181
|
-
)
|
|
1182
|
-
except (IndexError, TypeError, ZeroDivisionError):
|
|
1183
|
-
print(traceback.format_exc())
|
|
1184
|
-
pass
|
|
1185
|
-
|
|
1186
|
-
# Isochron
|
|
1187
|
-
for row_index, figure in enumerate(['figure_2', 'figure_3', 'figure_4', 'figure_5', 'figure_6', 'figure_7']):
|
|
1188
|
-
for col_index, set in enumerate(['set1', 'set2']):
|
|
1189
|
-
try:
|
|
1190
|
-
ar39 = self.sample.Info.results.age_plateau[col_index]['Ar39']
|
|
1191
|
-
num = self.sample.Info.results.age_plateau[col_index]['Num']
|
|
1192
|
-
age_res = self.sample.Info.results.isochron[figure][col_index]
|
|
1193
|
-
seq = [self.sample.SelectedSequence1, self.sample.SelectedSequence2][col_index]
|
|
1194
|
-
total_ca = [sum(np.array(self.sample.DegasValues[8])[seq]),
|
|
1195
|
-
err.add(*np.array(self.sample.DegasValues[9])[seq])]
|
|
1196
|
-
total_k = [sum(np.array(self.sample.DegasValues[20])[seq]),
|
|
1197
|
-
err.add(*np.array(self.sample.DegasValues[21])[seq])]
|
|
1198
|
-
cak = total_ca[0] / total_k[0] / self.sample.TotalParam[20][0]
|
|
1199
|
-
scak = err.div(total_ca, total_k, [self.sample.TotalParam[20][0], self.sample.TotalParam[21][0] * self.sample.TotalParam[20][0] / 100])
|
|
1200
|
-
_name = ['Normal Ioschron', 'Inverse Isochron', 'K-Cl-Ar Plot 1', 'K-Cl-Ar Plot 2', 'K-Cl-Ar Plot 3', '3D plot'][row_index]
|
|
1201
|
-
_write_results(
|
|
1202
|
-
sht_result, 25 + row_index * 5, 0 + col_index * 12, f'{["Set 1", "Set 2"][col_index]} {_name}',
|
|
1203
|
-
[age_res['F'], age_res['sF'] * sigma, abs(age_res['sF'] * sigma / age_res['F']), age_res['age'],
|
|
1204
|
-
age_res['s1'] * sigma, abs(age_res['s1'] * sigma / age_res['age']), age_res['s2'] * sigma, age_res['s3'] * sigma,
|
|
1205
|
-
age_res['MSWD'], ar39 / 100,
|
|
1206
|
-
num, cak, scak * sigma, abs(scak * sigma / cak)]
|
|
1207
|
-
)
|
|
1208
|
-
except (IndexError, TypeError, ZeroDivisionError):
|
|
1209
|
-
print(traceback.format_exc())
|
|
1210
|
-
continue
|
|
997
|
+
sht_summary = self.write_sht_summary("Summary", xls)
|
|
1211
998
|
|
|
1212
999
|
# write tables and charts
|
|
1213
1000
|
for sht_name, [prop_name, sht_type, row, col, _, smp_attr_name, header_name] in self.template.sheet():
|
|
@@ -1223,13 +1010,166 @@ class WritingWorkbook:
|
|
|
1223
1010
|
except (BaseException, Exception):
|
|
1224
1011
|
print(traceback.format_exc())
|
|
1225
1012
|
return None
|
|
1013
|
+
|
|
1226
1014
|
xls.get_worksheet_by_name("Reference").hide()
|
|
1227
|
-
xls.get_worksheet_by_name("Isochrons").hidden = 0 # unhiden isochrons worksheet
|
|
1228
|
-
xls.get_worksheet_by_name("
|
|
1015
|
+
# xls.get_worksheet_by_name("Isochrons").hidden = 0 # unhiden isochrons worksheet
|
|
1016
|
+
xls.get_worksheet_by_name("Summary").activate()
|
|
1229
1017
|
xls.close()
|
|
1230
1018
|
print('导出完毕,文件路径:%s' % self.filepath)
|
|
1231
1019
|
return True
|
|
1232
1020
|
|
|
1021
|
+
def set_cell_format(self):
|
|
1022
|
+
pass
|
|
1023
|
+
|
|
1024
|
+
def get_cell_format(self, class_name):
|
|
1025
|
+
return self.formats.get(class_name, self.formats['default'])
|
|
1026
|
+
|
|
1027
|
+
def write_sht_summary(self, sht_name, xls):
|
|
1028
|
+
sht = xls.add_worksheet(sht_name)
|
|
1029
|
+
sht.hide_gridlines(2) # 0 = show grids, 1 = hide print grid, else = hide print and screen grids
|
|
1030
|
+
sht.set_column(0, 21, width=12) # column width
|
|
1031
|
+
sht.set_column(0, 0, width=16) # column width
|
|
1032
|
+
sht.set_column(2, 2, width=8.5) # column width
|
|
1033
|
+
|
|
1034
|
+
method = f"{self.sample.Info.sample.method}"
|
|
1035
|
+
name = self.sample.Info.sample.name
|
|
1036
|
+
material = self.sample.Info.sample.material
|
|
1037
|
+
weight = self.sample.Info.sample.weight
|
|
1038
|
+
J_value = self.sample.TotalParam[67][0]
|
|
1039
|
+
J_error = self.sample.TotalParam[68][0]
|
|
1040
|
+
sigma = self.sample.Info.preference['confidenceLevel']
|
|
1041
|
+
sequence_type = {"StepLaser": "Laser", "StepFurnace": "Temperature", "StepCrusher": "Drop", }.get(method, "Step Value")
|
|
1042
|
+
sequence_unit = self.sample.Info.sample.sequence_unit if self.sample.Info.sample.sequence_unit != "" else "Unit"
|
|
1043
|
+
age_unit = self.sample.Info.preference['ageUnit']
|
|
1044
|
+
num_step = len(self.sample.SequenceName)
|
|
1045
|
+
set1_ratio = [self.sample.Info.results.isochron['figure_3'][0]['initial'], self.sample.Info.results.isochron['figure_2'][0]['initial'], self.sample.TotalParam[116][0]][int(self.sample.TotalParam[115][0])]
|
|
1046
|
+
set2_ratio = [self.sample.Info.results.isochron['figure_3'][1]['initial'], self.sample.Info.results.isochron['figure_2'][1]['initial'], self.sample.TotalParam[118][0]][int(self.sample.TotalParam[115][0])]
|
|
1047
|
+
|
|
1048
|
+
content = [
|
|
1049
|
+
[(0, 0, 0, 14), f"Table 1. 40Ar/39Ar dating results", {'bold': 1, 'top': 1, 'bottom': 1, 'align': 'left'}],
|
|
1050
|
+
[(1, 0, 2, 0), f"Step", {'bold': 1}],
|
|
1051
|
+
[(1, 1), f"{sequence_type}", {'bold': 1}],
|
|
1052
|
+
[(2, 1), f"({sequence_unit})", {'bold': 1}],
|
|
1053
|
+
[(1, 2, 2, 2), f"Set", {'bold': 1}],
|
|
1054
|
+
[(1, 3, 2, 3), f"36Arair", {'bold': 1}],
|
|
1055
|
+
[(1, 4, 2, 4), f"36ArCa", {'bold': 1}],
|
|
1056
|
+
[(1, 5, 2, 5), f"36ArCl", {'bold': 1}],
|
|
1057
|
+
[(1, 6, 2, 6), f"36ArK", {'bold': 1}],
|
|
1058
|
+
[(1, 7, 2, 7), f"36Ar*", {'bold': 1}],
|
|
1059
|
+
[(1, 8, 2, 8), f"39Ar/40Ar", {'bold': 1}],
|
|
1060
|
+
[(1, 9, 2, 9), f"36Ar/40Ar", {'bold': 1}],
|
|
1061
|
+
[(1, 10), f"Apparent Age", {'bold': 1}],
|
|
1062
|
+
[(1, 11), f"± {sigma} σ", {'bold': 1}],
|
|
1063
|
+
[(2, 10, 2, 11), f"({age_unit})", {'bold': 1}],
|
|
1064
|
+
[(1, 12), f"40Ar*", {'bold': 1}],
|
|
1065
|
+
[(2, 12), f"(%)", {'bold': 1}],
|
|
1066
|
+
[(1, 13), f"39ArK", {'bold': 1}],
|
|
1067
|
+
[(2, 13), f"(%)", {'bold': 1}],
|
|
1068
|
+
[(1, 14, 2, 14), f"Ca/K", {'bold': 1}],
|
|
1069
|
+
[(3, 0, 3, 14), f"Sample {name} ({material}){' by ' if method != '' else ''}{method}, weight = {weight} mg, J = {J_value} ± {J_error}", {'bold': 1, 'italic': 1, 'top': 6, 'align': 'left'}],
|
|
1070
|
+
[(4, 0, 1), self.sample.SequenceName, {'align': 'left'}],
|
|
1071
|
+
[(4, 1, 1), self.sample.SequenceValue, {'num_format': 'General'}],
|
|
1072
|
+
[(4, 2, 1), list(map(lambda x: int(x) if str(x).isnumeric() else "", self.sample.IsochronMark)), {'num_format': 'General'}],
|
|
1073
|
+
[(4, 3, 1), self.sample.DegasValues[0], {}],
|
|
1074
|
+
[(4, 4, 1), self.sample.DegasValues[8], {}],
|
|
1075
|
+
[(4, 5, 1), self.sample.DegasValues[10], {}],
|
|
1076
|
+
[(4, 6, 1), self.sample.DegasValues[20], {}],
|
|
1077
|
+
[(4, 7, 1), self.sample.DegasValues[24], {}],
|
|
1078
|
+
[(4, 8, 1), self.sample.IsochronValues[6], {}],
|
|
1079
|
+
[(4, 9, 1), self.sample.IsochronValues[8], {}],
|
|
1080
|
+
[(4, 10, 1), self.sample.ApparentAgeValues[2], {}],
|
|
1081
|
+
[(4, 11, 1), list(map(lambda x: 2*x, self.sample.ApparentAgeValues[3])), {'num_format': '± ' + self.default_fmt_prop['num_format']}],
|
|
1082
|
+
[(4, 12, 1), self.sample.ApparentAgeValues[6], {}],
|
|
1083
|
+
[(4, 13, 1), self.sample.ApparentAgeValues[7], {}],
|
|
1084
|
+
[(4, 14, 1), self.sample.PublishValues[9], {}],
|
|
1085
|
+
[(4 + num_step, 0, 0), [''] * 15, {'bold': 1, 'top': 1}],
|
|
1086
|
+
|
|
1087
|
+
[(5 + num_step, 0, 5 + num_step, 8), "Table 2. 40Ar/39Ar age summary", {'bold': 1, 'align': 'left'}],
|
|
1088
|
+
[(6 + num_step, 0, 7 + num_step, 0), "Group", {'bold': 1, 'top': 1}],
|
|
1089
|
+
[(6 + num_step, 1, 7 + num_step, 1), "40Arr/39K", {'bold': 1, 'top': 1}],
|
|
1090
|
+
[(6 + num_step, 2, 7 + num_step, 2), f"± {sigma} σ", {'bold': 1, 'top': 1}],
|
|
1091
|
+
[(6 + num_step, 3), "Age", {'bold': 1, 'top': 1}],
|
|
1092
|
+
[(7 + num_step, 3), f"({age_unit})", {'bold': 1, 'top': 0}],
|
|
1093
|
+
[(6 + num_step, 4), f"Analytical", {'bold': 1, 'top': 1, 'align': 'left'}],
|
|
1094
|
+
[(7 + num_step, 4), f"± {sigma} σ", {'bold': 1, 'top': 0, 'align': 'left'}],
|
|
1095
|
+
[(6 + num_step, 5), f"Internal", {'bold': 1, 'top': 1, 'align': 'left'}],
|
|
1096
|
+
[(7 + num_step, 5), f"± {sigma} σ", {'bold': 1, 'top': 0, 'align': 'left'}],
|
|
1097
|
+
[(6 + num_step, 6), f"Full external", {'bold': 1, 'top': 1, 'align': 'left'}],
|
|
1098
|
+
[(7 + num_step, 6), f"± {sigma} σ", {'bold': 1, 'top': 0, 'align': 'left'}],
|
|
1099
|
+
[(6 + num_step, 7, 7 + num_step, 7), f"MSWD", {'bold': 1, 'top': 1}],
|
|
1100
|
+
[(6 + num_step, 8, 7 + num_step, 8), f"39ArK", {'bold': 1, 'top': 1}],
|
|
1101
|
+
[(8 + num_step, 0), f"Total gas age", {'bold': 1, 'top': 6, 'italic': 1, 'align': 'left'}],
|
|
1102
|
+
[(8 + num_step, 1, 0), [''] * 8, {'top': 6}],
|
|
1103
|
+
[(9 + num_step, 0, 10 + num_step, 0), f"Total", {'bold': 1, 'align': 'center'}],
|
|
1104
|
+
[(12 + num_step, 0), f"40Ar/36Ar ratio ({self.sample.TotalParam[0][0]:.2f}) corrected plateau ages", {'bold': 1, 'italic': 1, 'align': 'left'}],
|
|
1105
|
+
[(18 + num_step, 0), f"{['Intercept of inverse isochron', 'Intercept of normal isochron', 'Inputted argon ratio'][int(self.sample.TotalParam[115][0])]} "
|
|
1106
|
+
f"(set 1 {set1_ratio} and set 2 {set2_ratio}) corrected plateau ages", {'bold': 1, 'italic': 1, 'align': 'left'}],
|
|
1107
|
+
[(24 + num_step, 0), f"Inverse isochron ages", {'bold': 1, 'italic': 1, 'align': 'left'}],
|
|
1108
|
+
[(30 + num_step, 0), f"Three-dimension ages", {'bold': 1, 'italic': 1, 'align': 'left'}],
|
|
1109
|
+
]
|
|
1110
|
+
|
|
1111
|
+
tga_res = self.sample.Info.results.age_spectra['TGA']
|
|
1112
|
+
content.extend([
|
|
1113
|
+
[(9 + num_step, 1, 10 + num_step, 1), tga_res['F'], {'num_format': '0.00000'}],
|
|
1114
|
+
[(9 + num_step, 2, 10 + num_step, 2), tga_res['sF'], {'num_format': '0.00000'}],
|
|
1115
|
+
[(9 + num_step, 3, 10 + num_step, 3), tga_res['age'], {'num_format': '0.00'}],
|
|
1116
|
+
[(9 + num_step, 4), tga_res['s1'] * sigma, {'num_format': '± 0.00', 'align': 'left'}],
|
|
1117
|
+
[(9 + num_step, 5), tga_res['s2'] * sigma, {'num_format': '± 0.00', 'align': 'left'}],
|
|
1118
|
+
[(9 + num_step, 6), tga_res['s3'] * sigma, {'num_format': '± 0.00', 'align': 'left'}],
|
|
1119
|
+
[(10 + num_step, 4), tga_res['s1'] * sigma / abs(tga_res['age']), {'num_format': '± 0.00%', 'align': 'left'}],
|
|
1120
|
+
[(10 + num_step, 5), tga_res['s1'] * sigma / abs(tga_res['age']), {'num_format': '± 0.00%', 'align': 'left'}],
|
|
1121
|
+
[(10 + num_step, 6), tga_res['s1'] * sigma / abs(tga_res['age']), {'num_format': '± 0.00%', 'align': 'left'}],
|
|
1122
|
+
[(9 + num_step, 7, 10 + num_step, 7), tga_res['MSWD'], {'num_format': '0.00'}],
|
|
1123
|
+
[(9 + num_step, 8, 10 + num_step, 8), tga_res['Ar39'] / 100, {'num_format': '0.00%'}],
|
|
1124
|
+
])
|
|
1125
|
+
|
|
1126
|
+
row = 13
|
|
1127
|
+
ar39 = [0, 0]
|
|
1128
|
+
for res in [
|
|
1129
|
+
self.sample.Info.results.age_spectra, self.sample.Info.results.age_plateau,
|
|
1130
|
+
self.sample.Info.results.isochron['figure_3'], self.sample.Info.results.isochron['figure_7']
|
|
1131
|
+
]:
|
|
1132
|
+
for index, _ in enumerate(['Set 1', 'Set 2']):
|
|
1133
|
+
ar39[index] = res[index].get('Ar39', ar39[index] * 100) / 100
|
|
1134
|
+
print(res[index])
|
|
1135
|
+
try:
|
|
1136
|
+
content.extend([
|
|
1137
|
+
[(row + num_step, 0, row + 1 + num_step, 0), _, {'bold': 1, 'align': 'center'}],
|
|
1138
|
+
[(row + num_step, 1, row + 1 + num_step, 1), res[index]['F'], {'num_format': '0.00000'}],
|
|
1139
|
+
[(row + num_step, 2, row + 1 + num_step, 2), res[index]['sF'], {'num_format': '0.00000'}],
|
|
1140
|
+
[(row + num_step, 3, row + 1 + num_step, 3), res[index]['age'], {'num_format': '0.00'}],
|
|
1141
|
+
[(row + num_step, 4), res[index]['s1'] * sigma, {'num_format': '± 0.00', 'align': 'left'}],
|
|
1142
|
+
[(row + num_step, 5), res[index]['s2'] * sigma, {'num_format': '± 0.00', 'align': 'left'}],
|
|
1143
|
+
[(row + num_step, 6), res[index]['s3'] * sigma, {'num_format': '± 0.00', 'align': 'left'}],
|
|
1144
|
+
[(row + 1 + num_step, 4), res[index]['s1'] * sigma / abs(res[index]['age']), {'num_format': '± 0.00%', 'align': 'left'}],
|
|
1145
|
+
[(row + 1 + num_step, 5), res[index]['s1'] * sigma / abs(res[index]['age']), {'num_format': '± 0.00%', 'align': 'left'}],
|
|
1146
|
+
[(row + 1 + num_step, 6), res[index]['s1'] * sigma / abs(res[index]['age']), {'num_format': '± 0.00%', 'align': 'left'}],
|
|
1147
|
+
[(row + num_step, 7, row + 1 + num_step, 7), res[index]['MSWD'], {'num_format': '0.00'}],
|
|
1148
|
+
[(row + num_step, 8, row + 1 + num_step, 8), ar39[index], {'num_format': '0.00%'}],
|
|
1149
|
+
])
|
|
1150
|
+
except ZeroDivisionError:
|
|
1151
|
+
pass
|
|
1152
|
+
row += 2
|
|
1153
|
+
row += 2
|
|
1154
|
+
content.append([(row - 2 + num_step, 0, 0), [''] * 9, {'top': 1}])
|
|
1155
|
+
|
|
1156
|
+
for pos, value, _prop in content:
|
|
1157
|
+
prop = self.default_fmt_prop.copy()
|
|
1158
|
+
prop.update(_prop)
|
|
1159
|
+
fmt = Format(prop, xls.xf_format_indices, xls.dxf_format_indices)
|
|
1160
|
+
xls.formats.append(fmt)
|
|
1161
|
+
if isinstance(value, (list, np.ndarray)) and len(pos) == 3:
|
|
1162
|
+
[sht.write_row, sht.write_column][pos[2]](*pos[:2], value, fmt)
|
|
1163
|
+
elif len(pos) == 2:
|
|
1164
|
+
isnumeric = isinstance(value, (float, int)) and not np.isnan(value) and not np.isinf(value)
|
|
1165
|
+
[sht.write_string, sht.write_number][isnumeric](*pos, value if isnumeric else str(value), fmt)
|
|
1166
|
+
elif len(pos) == 4:
|
|
1167
|
+
isnumeric = isinstance(value, (float, int)) and not np.isnan(value) and not np.isinf(value)
|
|
1168
|
+
sht.merge_range(*pos, value if isnumeric else str(value), fmt)
|
|
1169
|
+
|
|
1170
|
+
return sht
|
|
1171
|
+
|
|
1172
|
+
|
|
1233
1173
|
def write_sht_table(self, sht_name, prop_name, sht_type, row, col, _, smp_attr_name, header_name, style, xls, sigma=1):
|
|
1234
1174
|
sht = xls.add_worksheet(sht_name)
|
|
1235
1175
|
data = arr.transpose(getattr(self.sample, smp_attr_name, None).data)
|
|
@@ -1427,7 +1367,7 @@ class WritingWorkbook:
|
|
|
1427
1367
|
|
|
1428
1368
|
return chart
|
|
1429
1369
|
|
|
1430
|
-
def get_chart_age_spectra(self, xls: Workbook, sht: Chartsheet, data_area: list, axis_range: list, age_unit
|
|
1370
|
+
def get_chart_age_spectra(self, xls: Workbook, sht: Chartsheet, data_area: list, axis_range: list, age_unit='Ma'):
|
|
1431
1371
|
# ==============SpectraDiagram===============
|
|
1432
1372
|
[xMin, xMax, yMin, yMax] = axis_range
|
|
1433
1373
|
# Initializing a chart
|
|
@@ -141,7 +141,8 @@ def initial(smp: Sample):
|
|
|
141
141
|
setattr(smp, 'Info', ArArBasic(
|
|
142
142
|
id='0', name='info', attr_name='Info', arr_version=samples.VERSION,
|
|
143
143
|
sample=ArArBasic(
|
|
144
|
-
name='SAMPLE NAME', material='MATERIAL', location='LOCATION', type='Unknown'
|
|
144
|
+
name='SAMPLE NAME', material='MATERIAL', location='LOCATION', type='Unknown', method='',
|
|
145
|
+
sequence_unit='', weight=''
|
|
145
146
|
),
|
|
146
147
|
researcher=ArArBasic(
|
|
147
148
|
name='RESEARCHER', addr='ADDRESS', email='EMAIL'
|
|
@@ -315,11 +315,9 @@ def get_3D_results(data: list, sequence: list, sample: Sample):
|
|
|
315
315
|
age = basic.calc_age([f, sf], smp=sample)
|
|
316
316
|
except:
|
|
317
317
|
# print(f"Warning: {traceback.format_exc()}")
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
ar40ar36, sar40ar36, P
|
|
321
|
-
f, sf = 0, 0
|
|
322
|
-
iso_res.update(dict(zip(iso_res, [*k, *age, np.nan, ar40ar36, sar40ar36, P, f, sf])))
|
|
318
|
+
pass
|
|
319
|
+
else:
|
|
320
|
+
iso_res.update(dict(zip(iso_res, [*k, *age, np.nan, ar40ar36, sar40ar36, P, f, sf])))
|
|
323
321
|
return iso_res
|
|
324
322
|
|
|
325
323
|
|
|
@@ -743,7 +743,7 @@ DEFAULT_PLOT_STYLES = {
|
|
|
743
743
|
},
|
|
744
744
|
}
|
|
745
745
|
|
|
746
|
-
VERSION = '
|
|
746
|
+
VERSION = '20250321'
|
|
747
747
|
|
|
748
748
|
NAMED_DICT = {
|
|
749
749
|
"unknown": {"header": SAMPLE_INTERCEPT_HEADERS.copy()},
|
|
@@ -847,7 +847,8 @@ class Sample:
|
|
|
847
847
|
# self.__version = '20240730' # change parameter table for thermo calculation
|
|
848
848
|
# self.__version = '20241028' # gain correction
|
|
849
849
|
# self.__version = '20250102' # gain correction to blanks
|
|
850
|
-
self.__version = '
|
|
850
|
+
# self.__version = '20250321' # error sigma adjustment
|
|
851
|
+
self.__version = '20250301' # update sample info
|
|
851
852
|
|
|
852
853
|
@property
|
|
853
854
|
def version(self):
|
|
@@ -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.191', # 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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|