screamlab 0.3.1__tar.gz → 0.3.2__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.
- {screamlab-0.3.1/screamlab.egg-info → screamlab-0.3.2}/PKG-INFO +1 -1
- screamlab-0.3.2/VERSION +1 -0
- {screamlab-0.3.1 → screamlab-0.3.2}/screamlab/__pycache__/dataset.cpython-310.pyc +0 -0
- {screamlab-0.3.1 → screamlab-0.3.2}/screamlab/__pycache__/dataset.cpython-313.pyc +0 -0
- {screamlab-0.3.1 → screamlab-0.3.2}/screamlab/__pycache__/functions.cpython-310.pyc +0 -0
- {screamlab-0.3.1 → screamlab-0.3.2}/screamlab/__pycache__/io.cpython-310.pyc +0 -0
- {screamlab-0.3.1 → screamlab-0.3.2}/screamlab/__pycache__/settings.cpython-310.pyc +0 -0
- {screamlab-0.3.1 → screamlab-0.3.2}/screamlab/__pycache__/settings.cpython-313.pyc +0 -0
- {screamlab-0.3.1 → screamlab-0.3.2}/screamlab/__pycache__/utils.cpython-310.pyc +0 -0
- {screamlab-0.3.1 → screamlab-0.3.2}/screamlab/dataset.py +3 -1
- {screamlab-0.3.1 → screamlab-0.3.2}/screamlab/functions.py +75 -0
- {screamlab-0.3.1 → screamlab-0.3.2}/screamlab/io.py +1 -1
- {screamlab-0.3.1 → screamlab-0.3.2}/screamlab/settings.py +4 -1
- {screamlab-0.3.1 → screamlab-0.3.2}/screamlab/utils.py +92 -3
- {screamlab-0.3.1 → screamlab-0.3.2/screamlab.egg-info}/PKG-INFO +1 -1
- screamlab-0.3.1/VERSION +0 -1
- {screamlab-0.3.1 → screamlab-0.3.2}/LICENSE +0 -0
- {screamlab-0.3.1 → screamlab-0.3.2}/MANIFEST.in +0 -0
- {screamlab-0.3.1 → screamlab-0.3.2}/README.rst +0 -0
- {screamlab-0.3.1 → screamlab-0.3.2}/screamlab/__init__.py +0 -0
- {screamlab-0.3.1 → screamlab-0.3.2}/screamlab/__pycache__/__init__.cpython-310.pyc +0 -0
- {screamlab-0.3.1 → screamlab-0.3.2}/screamlab/__pycache__/__init__.cpython-312.pyc +0 -0
- {screamlab-0.3.1 → screamlab-0.3.2}/screamlab/__pycache__/__init__.cpython-313.pyc +0 -0
- {screamlab-0.3.1 → screamlab-0.3.2}/screamlab/__pycache__/__init__.cpython-38.pyc +0 -0
- {screamlab-0.3.1 → screamlab-0.3.2}/screamlab/__pycache__/dataset.cpython-312.pyc +0 -0
- {screamlab-0.3.1 → screamlab-0.3.2}/screamlab/__pycache__/functions.cpython-312.pyc +0 -0
- {screamlab-0.3.1 → screamlab-0.3.2}/screamlab/__pycache__/functions.cpython-313.pyc +0 -0
- {screamlab-0.3.1 → screamlab-0.3.2}/screamlab/__pycache__/io.cpython-312.pyc +0 -0
- {screamlab-0.3.1 → screamlab-0.3.2}/screamlab/__pycache__/io.cpython-313.pyc +0 -0
- {screamlab-0.3.1 → screamlab-0.3.2}/screamlab/__pycache__/settings.cpython-312.pyc +0 -0
- {screamlab-0.3.1 → screamlab-0.3.2}/screamlab/__pycache__/utils.cpython-312.pyc +0 -0
- {screamlab-0.3.1 → screamlab-0.3.2}/screamlab/__pycache__/utils.cpython-313.pyc +0 -0
- {screamlab-0.3.1 → screamlab-0.3.2}/screamlab.egg-info/SOURCES.txt +0 -0
- {screamlab-0.3.1 → screamlab-0.3.2}/screamlab.egg-info/dependency_links.txt +0 -0
- {screamlab-0.3.1 → screamlab-0.3.2}/screamlab.egg-info/requires.txt +0 -0
- {screamlab-0.3.1 → screamlab-0.3.2}/screamlab.egg-info/top_level.txt +0 -0
- {screamlab-0.3.1 → screamlab-0.3.2}/setup.cfg +0 -0
- {screamlab-0.3.1 → screamlab-0.3.2}/setup.py +0 -0
- {screamlab-0.3.1 → screamlab-0.3.2}/tests/test_dataset.py +0 -0
- {screamlab-0.3.1 → screamlab-0.3.2}/tests/test_exporter_with_real_data.py +0 -0
- {screamlab-0.3.1 → screamlab-0.3.2}/tests/test_exporter_with_real_data_pseudo_2D.py +0 -0
- {screamlab-0.3.1 → screamlab-0.3.2}/tests/test_io.py +0 -0
- {screamlab-0.3.1 → screamlab-0.3.2}/tests/test_settings.py +0 -0
- {screamlab-0.3.1 → screamlab-0.3.2}/tests/test_utils.py +0 -0
screamlab-0.3.2/VERSION
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.3.2
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -182,9 +182,11 @@ class Dataset:
|
|
|
182
182
|
"biexponential_with_offset": utils.BiexpFitterWithOffset,
|
|
183
183
|
"exponential": utils.ExpFitter,
|
|
184
184
|
"exponential_with_offset": utils.ExpFitterWithOffset,
|
|
185
|
-
"stretched_exponential": utils.
|
|
185
|
+
"stretched_exponential": utils.StretchedExponentialFitter,
|
|
186
186
|
"exponential_decay": utils.ExpDecayFitter,
|
|
187
187
|
"exponential_decay_with_offset": utils.ExpDecayFitterWithOffset,
|
|
188
|
+
"stretched_exponential_decay": utils.StretchedExponentialDecayFitter,
|
|
189
|
+
"biexponential_decay": utils.BiexponentialDecayFitter,
|
|
188
190
|
}
|
|
189
191
|
|
|
190
192
|
for b_type in self.props.buildup_types:
|
|
@@ -169,6 +169,53 @@ def calc_stretched_exponential(time_vals, param):
|
|
|
169
169
|
)
|
|
170
170
|
|
|
171
171
|
|
|
172
|
+
def calc_stretchedexpdecay(time_vals, param):
|
|
173
|
+
"""
|
|
174
|
+
Compute values of a stretched exponential decay function over time.
|
|
175
|
+
|
|
176
|
+
The function models the equation:
|
|
177
|
+
I(t) = Af * exp((-t / tf)^beta)
|
|
178
|
+
|
|
179
|
+
where:
|
|
180
|
+
- I(t) : The output value at time t
|
|
181
|
+
- A : Amplitude (maximum value the function approaches)
|
|
182
|
+
- tf : Time constant (controls the rate of growth)
|
|
183
|
+
- beta : stretching exponent
|
|
184
|
+
|
|
185
|
+
Returns
|
|
186
|
+
-------
|
|
187
|
+
list: Stretched exponential profile evaluated at t.
|
|
188
|
+
|
|
189
|
+
"""
|
|
190
|
+
return list(
|
|
191
|
+
param[0] * np.exp(-((np.asarray(time_vals) / param[1]) ** param[2]))
|
|
192
|
+
)
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
def calc_biexpdecay(time_vals, param):
|
|
196
|
+
"""
|
|
197
|
+
Compute values of a biexponential decay function over time.
|
|
198
|
+
|
|
199
|
+
The function models the equation:
|
|
200
|
+
I(t) = Af * exp(-t / tf)) + As * exp(-t / ts))
|
|
201
|
+
|
|
202
|
+
where:
|
|
203
|
+
- I(t) : The output value at time t
|
|
204
|
+
- Af, As: Amplitudes (maximum value the function approaches)
|
|
205
|
+
- tf, ts: Time constants (controls the rate of growth)
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
Returns
|
|
209
|
+
-------
|
|
210
|
+
list: Biexponential profile evaluated at t.
|
|
211
|
+
|
|
212
|
+
"""
|
|
213
|
+
return list(
|
|
214
|
+
param[0] * np.exp(-np.asarray(time_vals) / param[2])
|
|
215
|
+
+ param[1] * np.exp(-np.asarray(time_vals) / param[3])
|
|
216
|
+
)
|
|
217
|
+
|
|
218
|
+
|
|
172
219
|
def calc_expdecay(time_vals, param):
|
|
173
220
|
"""
|
|
174
221
|
Compute values of an exponential growth function over time.
|
|
@@ -459,6 +506,32 @@ def format_mapping():
|
|
|
459
506
|
"---",
|
|
460
507
|
"I0",
|
|
461
508
|
],
|
|
509
|
+
"stretched_exponential_decay": [
|
|
510
|
+
"Af",
|
|
511
|
+
"tf",
|
|
512
|
+
"---",
|
|
513
|
+
"---",
|
|
514
|
+
"---",
|
|
515
|
+
"Rf",
|
|
516
|
+
"---",
|
|
517
|
+
"Sf",
|
|
518
|
+
"---",
|
|
519
|
+
"beta",
|
|
520
|
+
"---",
|
|
521
|
+
],
|
|
522
|
+
"biexponential_decay": [
|
|
523
|
+
"Af",
|
|
524
|
+
"tf",
|
|
525
|
+
"As",
|
|
526
|
+
"ts",
|
|
527
|
+
"---",
|
|
528
|
+
"Rf",
|
|
529
|
+
"Rs",
|
|
530
|
+
"Sf",
|
|
531
|
+
"Ss",
|
|
532
|
+
"---",
|
|
533
|
+
"---",
|
|
534
|
+
],
|
|
462
535
|
}
|
|
463
536
|
|
|
464
537
|
|
|
@@ -506,6 +579,8 @@ def return_func_map():
|
|
|
506
579
|
"stretched_exponential": calc_stretched_exponential,
|
|
507
580
|
"exponential_decay": calc_expdecay,
|
|
508
581
|
"exponential_decay_with_offset": calc_expdecaywithoffset,
|
|
582
|
+
"stretched_exponential_decay": calc_stretchedexpdecay,
|
|
583
|
+
"biexponential_decay": calc_biexpdecay,
|
|
509
584
|
}
|
|
510
585
|
|
|
511
586
|
|
|
@@ -320,7 +320,7 @@ class Exporter:
|
|
|
320
320
|
self._plot_buildup(buildup_type)
|
|
321
321
|
if self.dataset.props.spectrum_fit_type != "numint":
|
|
322
322
|
self._write_global_fit_results_to_semicolon_separated_file()
|
|
323
|
-
|
|
323
|
+
self._write_buildup_fit_to_semicolon_separated_file()
|
|
324
324
|
self._csv_output()
|
|
325
325
|
|
|
326
326
|
def _plot_topspin_data(self):
|
|
@@ -217,7 +217,8 @@ class Properties:
|
|
|
217
217
|
List of str, optional: A list of buildup function types
|
|
218
218
|
|
|
219
219
|
Options supporded: "exponential","biexponential", "exponential_with_offset",
|
|
220
|
-
"biexponential_with_offset", "stretched_exponential"
|
|
220
|
+
"biexponential_with_offset", "stretched_exponential",
|
|
221
|
+
"stretched_exponential_decay", "biexponential_decay".
|
|
221
222
|
|
|
222
223
|
Default is ["exponential"].
|
|
223
224
|
|
|
@@ -235,6 +236,8 @@ class Properties:
|
|
|
235
236
|
"stretched_exponential",
|
|
236
237
|
"exponential_decay",
|
|
237
238
|
"exponential_decay_with_offset",
|
|
239
|
+
"stretched_exponential_decay",
|
|
240
|
+
"biexponential_decay",
|
|
238
241
|
}
|
|
239
242
|
if not isinstance(value, list):
|
|
240
243
|
raise TypeError(
|
|
@@ -20,6 +20,9 @@ Classes:
|
|
|
20
20
|
- BiexpFitterWithOffset: A variant of `BiexpFitter`
|
|
21
21
|
with an additional offset parameter.
|
|
22
22
|
- StretchedExponentialFitter: A fitter for stretched exponential buildup behavior.
|
|
23
|
+
- ExponentialDecayFitter: A fitter for exponential decay behaviour.
|
|
24
|
+
- StretchedExponentialDecayFitter: A fitter for stretched exponential decay behaviour.
|
|
25
|
+
- BiexponentialDecayFitter: A fitter for biexponential decay behaviour
|
|
23
26
|
"""
|
|
24
27
|
|
|
25
28
|
import copy
|
|
@@ -718,6 +721,92 @@ class BiexpFitter(BuildupFitter):
|
|
|
718
721
|
return functions.calc_biexponential(tdel, param)
|
|
719
722
|
|
|
720
723
|
|
|
724
|
+
class StretchedExponentialDecayFitter(BuildupFitter):
|
|
725
|
+
"""
|
|
726
|
+
Class for fitting streched exponential decay data.
|
|
727
|
+
|
|
728
|
+
This fits buildup curves using an streched exponential term
|
|
729
|
+
characterized by amplitude (Af), time constant (tf), and stretching factor (beta)..
|
|
730
|
+
|
|
731
|
+
The model function is defined as:
|
|
732
|
+
I(t) = Af * exp(-(t_pol / tf)^beta))
|
|
733
|
+
|
|
734
|
+
where:
|
|
735
|
+
- Af : amplitudes of the exponential components
|
|
736
|
+
- tf : time constants of the exponential components (tf > 0)
|
|
737
|
+
- beta : stretching factor (beta > 0, controls deviation from a simple exponential)
|
|
738
|
+
- t_pol : polarization time (independent variable)
|
|
739
|
+
- I(t_pol): peak intensity at polarization time t_pol
|
|
740
|
+
|
|
741
|
+
|
|
742
|
+
"""
|
|
743
|
+
|
|
744
|
+
def _get_default_param_dict(self, peak):
|
|
745
|
+
"""
|
|
746
|
+
Define default parameters for strechted exponential fitting.
|
|
747
|
+
|
|
748
|
+
:param peak: Peak object containing peak_sign and buildup values.
|
|
749
|
+
:return: Dictionary of default parameters with keys: Af, tf, beta.
|
|
750
|
+
"""
|
|
751
|
+
return {
|
|
752
|
+
"Af": self._get_intensity_dict(peak),
|
|
753
|
+
"tf": self._get_time_dict(peak),
|
|
754
|
+
"beta": self._get_beta_dict(),
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
def _calc_intensity(self, tdel, param):
|
|
758
|
+
"""
|
|
759
|
+
Calculate exponential decay intensity.
|
|
760
|
+
|
|
761
|
+
:param tdel: Time delays.
|
|
762
|
+
:param param: List of parameters.
|
|
763
|
+
:return: Calculated intensity values.
|
|
764
|
+
"""
|
|
765
|
+
return functions.calc_stretchedexpdecay(tdel, param)
|
|
766
|
+
|
|
767
|
+
|
|
768
|
+
class BiexponentialDecayFitter(BuildupFitter):
|
|
769
|
+
"""
|
|
770
|
+
Class for fitting biexponential decay data.
|
|
771
|
+
|
|
772
|
+
The biexponential model fits buildup curves using two exponential terms
|
|
773
|
+
characterized by amplitudes (Af, As) and time constants (tf, ts).
|
|
774
|
+
|
|
775
|
+
The model function is defined as:
|
|
776
|
+
I(t) = Af * exp(-t_pol / tf)) + As * exp(-t_pol / ts))
|
|
777
|
+
|
|
778
|
+
where:
|
|
779
|
+
- Af, As : amplitudes of the exponential components
|
|
780
|
+
- tf, ts : time constants of the exponential components (tf, ts > 0)
|
|
781
|
+
- t_pol : polarization time (independent variable)
|
|
782
|
+
- I(t_pol) : peak intensity at polarization time t_pol
|
|
783
|
+
"""
|
|
784
|
+
|
|
785
|
+
def _get_default_param_dict(self, peak):
|
|
786
|
+
"""
|
|
787
|
+
Define default parameters for biexponential fitting.
|
|
788
|
+
|
|
789
|
+
:param peak: Peak object containing peak_sign and buildup values.
|
|
790
|
+
:return: Dictionary of default parameters with keys: Af, As, tf, ts.
|
|
791
|
+
"""
|
|
792
|
+
return {
|
|
793
|
+
"Af": self._get_intensity_dict(peak),
|
|
794
|
+
"As": self._get_intensity_dict(peak),
|
|
795
|
+
"tf": self._get_time_dict(peak),
|
|
796
|
+
"ts": self._get_time_dict(peak),
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
def _calc_intensity(self, tdel, param):
|
|
800
|
+
"""
|
|
801
|
+
Calculate exponential decay intensity.
|
|
802
|
+
|
|
803
|
+
:param tdel: Time delays.
|
|
804
|
+
:param param: List of parameters.
|
|
805
|
+
:return: Calculated intensity values.
|
|
806
|
+
"""
|
|
807
|
+
return functions.calc_biexpdecay(tdel, param)
|
|
808
|
+
|
|
809
|
+
|
|
721
810
|
class ExpDecayFitter(BuildupFitter):
|
|
722
811
|
"""
|
|
723
812
|
Class for fitting exponential decay models to experimental data.
|
|
@@ -726,7 +815,7 @@ class ExpDecayFitter(BuildupFitter):
|
|
|
726
815
|
characterized by an amplitude (A) and a time constants (t).
|
|
727
816
|
|
|
728
817
|
The model function is defined as:
|
|
729
|
-
I(t_pol) = A * exp(-t_pol / t)
|
|
818
|
+
I(t_pol) = A * exp(-t_pol / t)
|
|
730
819
|
|
|
731
820
|
where:
|
|
732
821
|
- A : amplitudes of the exponential components
|
|
@@ -766,7 +855,7 @@ class ExpDecayFitterWithOffset(BuildupFitter):
|
|
|
766
855
|
characterized by an amplitude (A), an intensity offset (I0) and a time constants (t).
|
|
767
856
|
|
|
768
857
|
The model function is defined as:
|
|
769
|
-
I(t_pol) = I0 + A * exp(-t_pol / t)
|
|
858
|
+
I(t_pol) = I0 + A * exp(-t_pol / t)
|
|
770
859
|
|
|
771
860
|
where:
|
|
772
861
|
- A : amplitudes of the exponential components
|
|
@@ -926,7 +1015,7 @@ class ExpFitterWithOffset(BuildupFitter):
|
|
|
926
1015
|
return functions.calc_exponential_with_offset(tdel, param)
|
|
927
1016
|
|
|
928
1017
|
|
|
929
|
-
class
|
|
1018
|
+
class StretchedExponentialFitter(BuildupFitter):
|
|
930
1019
|
"""
|
|
931
1020
|
Class for fitting streched exponential models to buildup data.
|
|
932
1021
|
|
screamlab-0.3.1/VERSION
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
0.3.1
|
|
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
|