ararpy 0.1.13__py3-none-any.whl → 0.1.14__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ararpy/argon_diffusion_simulator/__init__.py +12 -0
- ararpy/argon_diffusion_simulator/main.py +542 -0
- ararpy/calc/corr.py +4 -4
- ararpy/calc/plot.py +3 -3
- ararpy/calc/raw_funcs.py +2 -0
- ararpy/calc/regression.py +0 -5
- ararpy/calc/spectra.py +3 -1
- ararpy/smp/corr.py +9 -1
- ararpy/smp/diffusion_funcs.py +34 -12
- ararpy/smp/export.py +620 -374
- ararpy/smp/json.py +7 -0
- ararpy/smp/plots.py +10 -8
- ararpy/smp/sample.py +9 -6
- {ararpy-0.1.13.dist-info → ararpy-0.1.14.dist-info}/METADATA +10 -2
- {ararpy-0.1.13.dist-info → ararpy-0.1.14.dist-info}/RECORD +18 -16
- {ararpy-0.1.13.dist-info → ararpy-0.1.14.dist-info}/WHEEL +1 -1
- {ararpy-0.1.13.dist-info → ararpy-0.1.14.dist-info}/LICENSE +0 -0
- {ararpy-0.1.13.dist-info → ararpy-0.1.14.dist-info}/top_level.txt +0 -0
ararpy/smp/diffusion_funcs.py
CHANGED
|
@@ -743,6 +743,8 @@ class DiffArrmultiFunc(DiffSample):
|
|
|
743
743
|
for j in range(0, na, 2):
|
|
744
744
|
a1[j + 1] = a1[j + 1] / sum
|
|
745
745
|
|
|
746
|
+
# 生成体积浓度分数随机值,归一到总和为1
|
|
747
|
+
|
|
746
748
|
# Definition of sizes (start with random order numbers greater to smaller)
|
|
747
749
|
sum = 0.0
|
|
748
750
|
for j in range(0, na - 2, 2):
|
|
@@ -753,11 +755,15 @@ class DiffArrmultiFunc(DiffSample):
|
|
|
753
755
|
for j in range(0, na - 2, 2):
|
|
754
756
|
a1[j] = a1[j] / sum * xro
|
|
755
757
|
|
|
758
|
+
# 从后到前随机生成尺寸,归一化到最大值为xro
|
|
759
|
+
|
|
756
760
|
sum = a1[na - 1] + a1[na - 3]
|
|
757
761
|
for j in range(2, na - 3, 2):
|
|
758
762
|
a1[j] = a1[j] - np.log10(sum)
|
|
759
763
|
sum = sum + a1[na - (j + 1) - 2]
|
|
760
764
|
|
|
765
|
+
# 调整尺寸的值,为什么?
|
|
766
|
+
|
|
761
767
|
ro = 10.0 ** a1[0]
|
|
762
768
|
|
|
763
769
|
for j in range(2, na - 3, 2):
|
|
@@ -3716,7 +3722,7 @@ class SmpTemperatureCalibration:
|
|
|
3716
3722
|
if line == "":
|
|
3717
3723
|
break
|
|
3718
3724
|
k = line.split(";")
|
|
3719
|
-
time = dt.strptime(k[0], "%Y-%m-%dT%H:%M:%S%z").timestamp()
|
|
3725
|
+
time = dt.strptime(k[0], "%Y-%m-%dT%H:%M:%S%z").timestamp() # UTC datetime
|
|
3720
3726
|
cumulative_time = 0
|
|
3721
3727
|
if int(k[1]) != last_sp:
|
|
3722
3728
|
last_sp = int(k[1])
|
|
@@ -3731,11 +3737,12 @@ class SmpTemperatureCalibration:
|
|
|
3731
3737
|
except KeyError:
|
|
3732
3738
|
inside_temp = [0, 0]
|
|
3733
3739
|
|
|
3734
|
-
|
|
3740
|
+
# timestamp, cumulative_time of the current temperature, SP, AP, Inside, Inside error
|
|
3741
|
+
libano_log.append([time, cumulative_time, int(k[1]), int(k[2]), (inside_temp[0] + inside_temp[1]) / 2,
|
|
3742
|
+
abs(inside_temp[0] - inside_temp[1]) / 2, 9999])
|
|
3735
3743
|
n += 1
|
|
3736
3744
|
|
|
3737
3745
|
libano_file.close()
|
|
3738
|
-
libano_log = np.array(libano_log).transpose()
|
|
3739
3746
|
|
|
3740
3747
|
# # set time starts with zero
|
|
3741
3748
|
# log_time = [i - log_time[0] for i in log_time]
|
|
@@ -3749,10 +3756,13 @@ class SmpTemperatureCalibration:
|
|
|
3749
3756
|
helix_log = [[], [], [], [], [], [], [], [], [], [], [], []]
|
|
3750
3757
|
nstep = 0
|
|
3751
3758
|
|
|
3759
|
+
time_difference = 147 # helix time - libano time 时间差
|
|
3760
|
+
|
|
3752
3761
|
keys = {
|
|
3753
3762
|
"start_buildup": "GenWorkflow-BuildUp.cs: line 1: Clock reset",
|
|
3754
3763
|
"set_temp": "GenWorkflow-Sampling.cs: Target temperature: key = Intensity, value = ",
|
|
3755
3764
|
"end_sampling": "GenWorkflow-Prepare.cs: line 1: CLOSE for VUcleaningline/VINL2",
|
|
3765
|
+
# "start_sampling": "GenWorkflow-Prepare.cs: line 15: CLOSE for VUcleaningline/VGP5", # Y01样品之后发现VPL1漏气,多加了一步关闭VPL1因此,在那之后是line 15
|
|
3756
3766
|
"start_sampling": "GenWorkflow-Prepare.cs: line 14: CLOSE for VUcleaningline/VGP5",
|
|
3757
3767
|
"end_sequence": "GenWorkflow-PostAcquisition.cs: line 7: Starting Acquisition",
|
|
3758
3768
|
"get_setpoint": "GenWorkflow-Sampling.cs: Target temperature: key = Intensity, value = ",
|
|
@@ -3781,7 +3791,9 @@ class SmpTemperatureCalibration:
|
|
|
3781
3791
|
dt_utc = dt_str[:26] + dt_str[27:] # dt_utc will be like 2024-10-23T19:58:59.666214+02:00
|
|
3782
3792
|
dt_utc = dt.fromisoformat(str(dt_utc)).timestamp()
|
|
3783
3793
|
|
|
3784
|
-
|
|
3794
|
+
dt_utc = dt_utc - time_difference
|
|
3795
|
+
|
|
3796
|
+
if not (self.start_time <= int(dt_utc) <= self.end_time):
|
|
3785
3797
|
continue
|
|
3786
3798
|
if message1.startswith(keys["start_buildup"]):
|
|
3787
3799
|
### start buildup
|
|
@@ -3795,6 +3807,16 @@ class SmpTemperatureCalibration:
|
|
|
3795
3807
|
# 关闭vinlet2,60秒进质谱,之后开vinlet2,90秒抽气
|
|
3796
3808
|
gas_collection_end = dt_utc
|
|
3797
3809
|
helix_log[1].append(dt_utc)
|
|
3810
|
+
try:
|
|
3811
|
+
gas_collection_start = gas_collection_start
|
|
3812
|
+
except NameError:
|
|
3813
|
+
gas_collection_start = buildup_start
|
|
3814
|
+
# 添加阶段标记
|
|
3815
|
+
for each_row in libano_log:
|
|
3816
|
+
# 时间在集气过程中
|
|
3817
|
+
if gas_collection_start <= each_row[0] <= gas_collection_end:
|
|
3818
|
+
each_row[6] = nstep
|
|
3819
|
+
|
|
3798
3820
|
if message1.startswith(keys["start_sampling"]):
|
|
3799
3821
|
# Close VGP5, start peak centering and measurement, IMPORTANT: start to sampling
|
|
3800
3822
|
gas_collection_start = dt_utc
|
|
@@ -3815,6 +3837,8 @@ class SmpTemperatureCalibration:
|
|
|
3815
3837
|
for i in helix_log:
|
|
3816
3838
|
print(len(i))
|
|
3817
3839
|
print(i)
|
|
3840
|
+
|
|
3841
|
+
libano_log = np.array(libano_log).transpose()
|
|
3818
3842
|
helix_log = np.array(helix_log)
|
|
3819
3843
|
|
|
3820
3844
|
|
|
@@ -3843,12 +3867,12 @@ class SmpTemperatureCalibration:
|
|
|
3843
3867
|
yellow_data_index.append(_index)
|
|
3844
3868
|
|
|
3845
3869
|
med = int((_index[0] + _index[-1]) / 2)
|
|
3846
|
-
helix_log[4, i] =
|
|
3847
|
-
helix_log[5, i] =
|
|
3848
|
-
helix_log[6, i] =
|
|
3849
|
-
helix_log[7, i] =
|
|
3850
|
-
helix_log[8, i] =
|
|
3851
|
-
helix_log[9, i] =
|
|
3870
|
+
helix_log[4, i] = libano_log[4, _index][0]
|
|
3871
|
+
helix_log[5, i] = libano_log[5, _index][0]
|
|
3872
|
+
helix_log[6, i] = libano_log[4, _index][-1]
|
|
3873
|
+
helix_log[7, i] = libano_log[5, _index][-1]
|
|
3874
|
+
helix_log[8, i] = libano_log[4, med]
|
|
3875
|
+
helix_log[9, i] = libano_log[5, med]
|
|
3852
3876
|
helix_log[11, i] = gas_in_end - gas_in_start
|
|
3853
3877
|
|
|
3854
3878
|
line = f"{i + 1}\t{helix_log[10, i]}\t{helix_log[11, i]}\t" + '\t'.join(
|
|
@@ -3871,11 +3895,9 @@ class SmpTemperatureCalibration:
|
|
|
3871
3895
|
ax.plot(libano_log[0], libano_log[1], c='green')
|
|
3872
3896
|
ax.plot(libano_log[0], libano_log[2], c='blue')
|
|
3873
3897
|
ax.plot(libano_log[0], libano_log[4], c='red')
|
|
3874
|
-
ax.plot(libano_log[0], libano_log[5], c='red')
|
|
3875
3898
|
for i in range(nstep):
|
|
3876
3899
|
_index = yellow_data_index[i]
|
|
3877
3900
|
ax.plot(libano_log[0, _index], libano_log[4, _index], c='yellow')
|
|
3878
|
-
ax.plot(libano_log[0, _index], libano_log[5, _index], c='yellow')
|
|
3879
3901
|
|
|
3880
3902
|
fig.tight_layout()
|
|
3881
3903
|
plt.show()
|