klassez 0.1.1.dev0__tar.gz → 0.1.1.dev1__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.
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/PKG-INFO +1 -1
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/klassez/Spectra.py +6 -4
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/klassez/__init__.py +1 -1
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/klassez/anal.py +3 -19
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/klassez/figures.py +6 -2
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/klassez/fit.py +4 -3
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/klassez/processing.py +102 -19
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/klassez/sim.py +4 -7
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/klassez.egg-info/PKG-INFO +1 -1
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/klassez.egg-info/SOURCES.txt +0 -2
- klassez-0.1.1.dev0/docs/rebuild_kz.err +0 -5
- klassez-0.1.1.dev0/docs/rebuild_kz.log +0 -36
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/LICENSE.txt +0 -0
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/MANIFEST.in +0 -0
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/README.md +0 -0
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/docs/Makefile +0 -0
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/docs/make.bat +0 -0
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/docs/requirements.txt +0 -0
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/klassez/config.py +0 -0
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/klassez/misc.py +0 -0
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/klassez/tables/gamma.dic +0 -0
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/klassez/tables/nuclei_jeol.dic +0 -0
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/klassez/tables/xterm_colors +0 -0
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/klassez.egg-info/dependency_links.txt +0 -0
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/klassez.egg-info/requires.txt +0 -0
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/klassez.egg-info/top_level.txt +0 -0
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/pyproject.toml +0 -0
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/setup.cfg +0 -0
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/test/T1_0.00.procs +0 -0
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/test/T1_10.00.procs +0 -0
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/test/T1_180.00.procs +0 -0
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/test/T1_90.00.procs +0 -0
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/test/T1_90.procs +0 -0
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/test/T2_10.00.procs +0 -0
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/test/T2_10.procs +0 -0
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/test/acqus_1D +0 -0
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/test/acqus_1D.fvf +0 -0
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/test/acqus_1D.procs +0 -0
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/test/acqus_2D +0 -0
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/test/acqus_2D.procs +0 -0
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/test/cnvg +0 -0
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/test/fit_1D.py +0 -0
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/test/read_process_1D.py +0 -0
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/test/read_process_2D.py +0 -0
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/test/test.log +0 -0
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/test/test.py +0 -0
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/test/test_1D_fit.fvf +0 -0
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/test/test_1D_fit.ivf +0 -0
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/test/test_1D_fit_R1.png +0 -0
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/test/test_1D_fit_R2.png +0 -0
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/test/test_1D_fit_full.png +0 -0
- {klassez-0.1.1.dev0 → klassez-0.1.1.dev1}/test/test_1D_fit_rhist.png +0 -0
|
@@ -904,9 +904,9 @@ class Spectrum_1D:
|
|
|
904
904
|
if filename is None:
|
|
905
905
|
filename = self.datadir / self.filename
|
|
906
906
|
if fvf:
|
|
907
|
-
filename_x = filename.with_suffix('.fvf')
|
|
907
|
+
filename_x = Path(filename).with_suffix('.fvf')
|
|
908
908
|
else:
|
|
909
|
-
filename_x = filename.with_suffix('.ivf')
|
|
909
|
+
filename_x = Path(filename).with_suffix('.ivf')
|
|
910
910
|
|
|
911
911
|
# If Hs is not given, sum the intensities
|
|
912
912
|
if Hs is None:
|
|
@@ -1648,7 +1648,7 @@ class Spectrum_2D:
|
|
|
1648
1648
|
if self.acqus['FnMODE'] in ['QF', 'QF-nofreq']:
|
|
1649
1649
|
self.S = processing.hilbert(self.rr)
|
|
1650
1650
|
else:
|
|
1651
|
-
self.S = processing.repack_2D(processing.hilbert2(self.rr))
|
|
1651
|
+
self.S = processing.repack_2D(*processing.hilbert2(self.rr))
|
|
1652
1652
|
|
|
1653
1653
|
# Cut the frequency scales as well
|
|
1654
1654
|
self.freq_f2 = misc.ppm2freq(self.ppm_f2, self.acqus['SFO2'], self.acqus['o2p'])
|
|
@@ -3390,7 +3390,9 @@ class Pseudo_2D(Spectrum_2D):
|
|
|
3390
3390
|
"""
|
|
3391
3391
|
original = deepcopy(self.S)
|
|
3392
3392
|
# Correct the baseline
|
|
3393
|
-
datap =
|
|
3393
|
+
datap = np.empty_like(self.S)
|
|
3394
|
+
for k, data in enumerate(self.rr):
|
|
3395
|
+
datap[k] = processing.abs_v2(self.ppm_f2, data, self.acqus['SFO1'], n=n, lims=lims, alpha=alpha, winsize=winsize, qfil=qfil, qfilp=qfilp)
|
|
3394
3396
|
# Retrieve imaginary part
|
|
3395
3397
|
self.S = processing.hilbert(datap)
|
|
3396
3398
|
return original - datap
|
|
@@ -771,14 +771,7 @@ def integrate(ppm0, data0, SFO1, filename='integrals', X_label=r'$\delta\,$F1 /p
|
|
|
771
771
|
|
|
772
772
|
def calc_bas(isx, idx):
|
|
773
773
|
""" Compute straight line baseline """
|
|
774
|
-
|
|
775
|
-
bas_points = np.array([data[isx], data[idx]])
|
|
776
|
-
# Use the linear regression to connect them, employ the point scale
|
|
777
|
-
_, (bas_m, bas_q) = fit.lr(bas_points, x=np.asarray([isx, idx]))
|
|
778
|
-
# full-length x-scale for baseline
|
|
779
|
-
xb = np.arange(isx, idx+1, 1)
|
|
780
|
-
# baseline = mx + q
|
|
781
|
-
bas = xb * bas_m + bas_q
|
|
774
|
+
bas = processing.sl_bas_onidx(data, (isx, idx))
|
|
782
775
|
return bas
|
|
783
776
|
|
|
784
777
|
def onselect(vsx, vdx):
|
|
@@ -1076,21 +1069,12 @@ def integrate_p2D(ppm0, data0, SFO1, ref=0, indirect_scale=None, filename='integ
|
|
|
1076
1069
|
|
|
1077
1070
|
def calc_bas(y, isx, idx):
|
|
1078
1071
|
""" Compute straight line baseline """
|
|
1079
|
-
|
|
1080
|
-
bas_points = np.array([y[isx], y[idx]])
|
|
1081
|
-
# Use the linear regression to connect them, employ the point scale
|
|
1082
|
-
_, (bas_m, bas_q) = fit.lr(bas_points, x=np.asarray([isx, idx]))
|
|
1083
|
-
# full-length x-scale for baseline
|
|
1084
|
-
xb = np.arange(isx, idx+1, 1)
|
|
1085
|
-
# baseline = mx + q
|
|
1086
|
-
bas = xb * bas_m + bas_q
|
|
1072
|
+
bas = processing.sl_bas_onidx(y, (isx, idx))
|
|
1087
1073
|
return bas
|
|
1088
1074
|
|
|
1089
1075
|
def calc_all_bas(isx, idx):
|
|
1090
1076
|
""" Compute the straight line baseline for all the experiments """
|
|
1091
|
-
all_bas =
|
|
1092
|
-
calc_bas(y, isx, idx)
|
|
1093
|
-
for y in all_data])
|
|
1077
|
+
all_bas = processing.sl_bas_onidx(all_data, (isx, idx))
|
|
1094
1078
|
return all_bas
|
|
1095
1079
|
|
|
1096
1080
|
def axy_plot(y):
|
|
@@ -1341,7 +1341,7 @@ def stacked_plot(ppmscale, S, xlims=None, lw=0.5, X_label=r'$\delta\ $ F1 /ppm',
|
|
|
1341
1341
|
print('Done.', c='tab:cyan')
|
|
1342
1342
|
|
|
1343
1343
|
|
|
1344
|
-
def dotmd(ppmscale, S, labels=None, lw=0.8, n_xticks=10):
|
|
1344
|
+
def dotmd(ppmscale, S, labels=None, lw=0.8, n_xticks=10, rev=True):
|
|
1345
1345
|
"""
|
|
1346
1346
|
Interactive display of multiple 1D spectra.
|
|
1347
1347
|
|
|
@@ -1357,6 +1357,8 @@ def dotmd(ppmscale, S, labels=None, lw=0.8, n_xticks=10):
|
|
|
1357
1357
|
Linewidth of the spectra plots
|
|
1358
1358
|
n_xticks : int
|
|
1359
1359
|
Number of numbered ticks on the x-axis of the figure
|
|
1360
|
+
rev : bool
|
|
1361
|
+
When ``True``, the x-scale goes from maximum (left) to minimum (right)
|
|
1360
1362
|
|
|
1361
1363
|
Returns
|
|
1362
1364
|
-------
|
|
@@ -1486,7 +1488,9 @@ def dotmd(ppmscale, S, labels=None, lw=0.8, n_xticks=10):
|
|
|
1486
1488
|
# Auto-adjusts the limits for the y-axis
|
|
1487
1489
|
misc.set_ylim(ax, np.concatenate(S))
|
|
1488
1490
|
# Make pretty scales
|
|
1489
|
-
misc.pretty_scale(ax, (np.
|
|
1491
|
+
misc.pretty_scale(ax, (np.min(np.concatenate(ppmscale)), np.max(np.concatenate(ppmscale))), axis='x', n_major_ticks=n_xticks)
|
|
1492
|
+
if rev:
|
|
1493
|
+
ax.set_xlim(ax.get_xlim()[::-1])
|
|
1490
1494
|
misc.pretty_scale(ax, ax.get_ylim(), axis='y', n_major_ticks=10)
|
|
1491
1495
|
|
|
1492
1496
|
# Pretty y-axis numbers
|
|
@@ -2398,7 +2398,7 @@ def make_iguess_auto(ppm, data, SW, SFO1, o1p, filename='iguess'):
|
|
|
2398
2398
|
# Initialize variables
|
|
2399
2399
|
# Write the info on the file
|
|
2400
2400
|
filename = Path(filename)
|
|
2401
|
-
filename_x = filename.with_suffix('ivf')
|
|
2401
|
+
filename_x = filename.with_suffix('.ivf')
|
|
2402
2402
|
with filename_x.open('a', buffering=1) as f:
|
|
2403
2403
|
now = datetime.now()
|
|
2404
2404
|
date_and_time = now.strftime("%d/%m/%Y at %H:%M:%S")
|
|
@@ -3692,8 +3692,8 @@ class Voigt_Fit:
|
|
|
3692
3692
|
# Filename check
|
|
3693
3693
|
if filename is None:
|
|
3694
3694
|
filename = f'{self.filename}'
|
|
3695
|
-
filename += '_rhist'
|
|
3696
3695
|
filename = Path(filename)
|
|
3696
|
+
filename = Path(filename).with_name(filename.stem + '_rhist')
|
|
3697
3697
|
|
|
3698
3698
|
# Select the correct object
|
|
3699
3699
|
if what == 'iguess':
|
|
@@ -8109,9 +8109,10 @@ class DosyFit:
|
|
|
8109
8109
|
# Set the filename, if not given
|
|
8110
8110
|
if filename is None:
|
|
8111
8111
|
filename = f'{self.filename}'
|
|
8112
|
+
filename = Path(filename)
|
|
8112
8113
|
|
|
8113
8114
|
# Make the directories
|
|
8114
|
-
figure_path =
|
|
8115
|
+
figure_path = filename.with_name('Figures_' + filename.stem) / f'{what}'
|
|
8115
8116
|
figure_path.mkdir(exist_ok=True, parents=True)
|
|
8116
8117
|
|
|
8117
8118
|
# Make the figures
|
|
@@ -895,7 +895,7 @@ def fp(data, wf=None, zf=None, fcor=0.5, tdeff=0):
|
|
|
895
895
|
"""
|
|
896
896
|
# Correct the shape of tdeff for pseudo_2D spectra, xf2, and stuff
|
|
897
897
|
if len(data.shape) > 1 and not isinstance(tdeff, (list, tuple, np.ndarray)):
|
|
898
|
-
tdeff = [0 for w in len(data.shape)-1] + [tdeff]
|
|
898
|
+
tdeff = [0 for w in range(len(data.shape)-1)] + [tdeff]
|
|
899
899
|
# Window function
|
|
900
900
|
# Rectangle
|
|
901
901
|
datap = processing.td_eff(data, tdeff)
|
|
@@ -2295,8 +2295,9 @@ def interactive_phase_1D(ppmscale, S, reference=None):
|
|
|
2295
2295
|
|
|
2296
2296
|
def reset(event):
|
|
2297
2297
|
# Reset the phase and pivot values to their starting point
|
|
2298
|
-
nonlocal P
|
|
2299
|
-
P = np.array([0, 0, round(np.mean(
|
|
2298
|
+
nonlocal P, sens
|
|
2299
|
+
P = np.array([0, 0, round(np.mean(ppmscale), 2)])
|
|
2300
|
+
sens = [5, 5, 0.1]
|
|
2300
2301
|
on_scroll(event)
|
|
2301
2302
|
|
|
2302
2303
|
def save(event):
|
|
@@ -2805,20 +2806,6 @@ def integral(fx, x=None, dx=None, lims=None, use_bas=False):
|
|
|
2805
2806
|
|
|
2806
2807
|
:func:`klassez.misc.trim_data`
|
|
2807
2808
|
"""
|
|
2808
|
-
def calc_bas(y, isx, idx):
|
|
2809
|
-
""" Compute straight line baseline """
|
|
2810
|
-
# Two points
|
|
2811
|
-
bas_points = np.array([y[..., isx], y[..., idx]])
|
|
2812
|
-
# Use the linear regression to connect them, employ the point scale
|
|
2813
|
-
bas = []
|
|
2814
|
-
for k, tr in enumerate(bas_points):
|
|
2815
|
-
_, (bas_m, bas_q) = fit.lr(bas_points, x=np.asarray([isx, idx]))
|
|
2816
|
-
# full-length x-scale for baseline
|
|
2817
|
-
xb = np.arange(isx, idx+1, 1)
|
|
2818
|
-
# baseline = mx + q
|
|
2819
|
-
bas.append(xb * bas_m + bas_q)
|
|
2820
|
-
return np.array(bas)
|
|
2821
|
-
|
|
2822
2809
|
# Copy variables for check
|
|
2823
2810
|
fx_in = np.copy(fx)
|
|
2824
2811
|
if x is None: # Make the point scale
|
|
@@ -2836,7 +2823,7 @@ def integral(fx, x=None, dx=None, lims=None, use_bas=False):
|
|
|
2836
2823
|
x_tr, fx_tr = misc.trim_data(x_in, fx_in, lims)
|
|
2837
2824
|
|
|
2838
2825
|
if use_bas:
|
|
2839
|
-
bas =
|
|
2826
|
+
bas = processing.sl_bas_onidx(fx_tr, (0, len(x_tr)-1))
|
|
2840
2827
|
else:
|
|
2841
2828
|
bas = np.zeros_like(x_tr)
|
|
2842
2829
|
|
|
@@ -4980,7 +4967,7 @@ def stack_fids(*fids, filename=None):
|
|
|
4980
4967
|
p2d = np.stack(p2d_fid, axis=0)
|
|
4981
4968
|
|
|
4982
4969
|
# Save the .npy file
|
|
4983
|
-
if isinstance(filename, str):
|
|
4970
|
+
if isinstance(filename, (str, Path)):
|
|
4984
4971
|
np.save(filename, p2d)
|
|
4985
4972
|
|
|
4986
4973
|
return p2d
|
|
@@ -6092,3 +6079,99 @@ def extend_taq(old_taq, newsize=None):
|
|
|
6092
6079
|
dw = misc.calcres(old_taq) # Get the dwell time
|
|
6093
6080
|
new_taq = np.arange(0, dw * newsize, dw) # Compute new scale
|
|
6094
6081
|
return new_taq
|
|
6082
|
+
|
|
6083
|
+
|
|
6084
|
+
def sl_bas_onidx(y, x_idx):
|
|
6085
|
+
"""
|
|
6086
|
+
Computes the straight line that connects ``y[min(x_idx)]`` with ``y[max(x_idx)]``.
|
|
6087
|
+
If ``y`` is a 2darray, a 2darray of lines is returned, one correspondant to each row of ``y``.
|
|
6088
|
+
The lines will be ``max(x_idx) - min(x_idx)`` points long.
|
|
6089
|
+
|
|
6090
|
+
Parameters
|
|
6091
|
+
----------
|
|
6092
|
+
y : 1darray or 2darray
|
|
6093
|
+
Array for which to compute the connecting lines
|
|
6094
|
+
x_idx : tuple
|
|
6095
|
+
Points indices of the endpoints of the connecting lines
|
|
6096
|
+
|
|
6097
|
+
Returns
|
|
6098
|
+
-------
|
|
6099
|
+
bas : 1darray or 2darray
|
|
6100
|
+
Computed connecting lines. Of note, this is squeezed before returning!
|
|
6101
|
+
|
|
6102
|
+
.. seealso::
|
|
6103
|
+
|
|
6104
|
+
:func:`numpy.squeeze`
|
|
6105
|
+
:func:`klassez.fit.lr`
|
|
6106
|
+
"""
|
|
6107
|
+
# Let's be sure the indices are in the correct order
|
|
6108
|
+
x_idx = sorted(x_idx)
|
|
6109
|
+
# Array of shape (y.shape[0], 2) of the endpoints
|
|
6110
|
+
bas_points = np.array([y[..., q] for q in x_idx]).T
|
|
6111
|
+
if len(bas_points.shape) == 1: # add a dimension to use the for after
|
|
6112
|
+
bas_points = [bas_points]
|
|
6113
|
+
|
|
6114
|
+
bas = [] # placeholder
|
|
6115
|
+
# Loop on the rows of the endpoints
|
|
6116
|
+
for k, tr in enumerate(bas_points):
|
|
6117
|
+
# tr contains two points -> only one line exists
|
|
6118
|
+
_, (bas_m, bas_q) = fit.lr(tr, x=np.asarray(x_idx))
|
|
6119
|
+
# Compute the scale for rendering the connecting line correctly
|
|
6120
|
+
xb = np.arange(min(x_idx), max(x_idx) + 1)
|
|
6121
|
+
# Add to placeholder
|
|
6122
|
+
bas.append(xb * bas_m + bas_q)
|
|
6123
|
+
# Remove the extra dimension added before, if needed
|
|
6124
|
+
return np.squeeze(np.array(bas))
|
|
6125
|
+
|
|
6126
|
+
|
|
6127
|
+
def sl_bas(x, y, lims=None):
|
|
6128
|
+
"""
|
|
6129
|
+
Computes the straight line that connects ``y`` between ``lims`` on the ``x`` scale.
|
|
6130
|
+
If ``y`` is a 2darray, a 2darray of lines is returned, one correspondant to each row of ``y``.
|
|
6131
|
+
|
|
6132
|
+
Parameters
|
|
6133
|
+
----------
|
|
6134
|
+
y : 1darray or 2darray
|
|
6135
|
+
Array for which to compute the connecting lines
|
|
6136
|
+
x : 1darray
|
|
6137
|
+
Scale for the referencing of ``lims``
|
|
6138
|
+
lims : tuple
|
|
6139
|
+
``(left, right)`` for selecting the endpoints
|
|
6140
|
+
|
|
6141
|
+
Returns
|
|
6142
|
+
-------
|
|
6143
|
+
bas_overlay : 1darray or 2darray
|
|
6144
|
+
Computed connecting lines, with the same shape of ``y``. Of note, this is squeezed before returning!
|
|
6145
|
+
|
|
6146
|
+
.. seealso::
|
|
6147
|
+
|
|
6148
|
+
:func:`numpy.squeeze`
|
|
6149
|
+
:func:`klassez.processing.sl_bas_onidx`
|
|
6150
|
+
"""
|
|
6151
|
+
# Get the correct arrays to work with
|
|
6152
|
+
if lims is None:
|
|
6153
|
+
# Use the whole data
|
|
6154
|
+
x_tr = deepcopy(x)
|
|
6155
|
+
y_tr = deepcopy(y)
|
|
6156
|
+
# Limits are therefore first and last point of the scale
|
|
6157
|
+
lims = x[0], x[-1]
|
|
6158
|
+
else:
|
|
6159
|
+
# Cut the data according to lims
|
|
6160
|
+
if len(y.shape) > 1:
|
|
6161
|
+
# Use a dummy yscale to cut only on the last dimension
|
|
6162
|
+
x_tr, _, y_tr = misc.trim_data_2D(x, np.arange(y.shape[0]), y, xlim=lims)
|
|
6163
|
+
else:
|
|
6164
|
+
# Just cut
|
|
6165
|
+
x_tr, y_tr = misc.trim_data(x, y, lims=lims)
|
|
6166
|
+
|
|
6167
|
+
# Get the indices of the endpoints ON x NOT xtrim, otherwise the overlay does not work
|
|
6168
|
+
x_idx = [misc.ppmfind(x, v)[0] for v in lims]
|
|
6169
|
+
# Compute the correcting lines
|
|
6170
|
+
bas = sl_bas_onidx(y, x_idx)
|
|
6171
|
+
# Add a dimension to still use the for
|
|
6172
|
+
if len(bas.shape) == 1:
|
|
6173
|
+
bas = [bas]
|
|
6174
|
+
|
|
6175
|
+
# Match the shape of y. Use always the left limit as anchor point
|
|
6176
|
+
overlay_bas = [misc.sum_overlay(np.zeros_like(x), y_b, x[min(x_idx)], x) for y_b in bas]
|
|
6177
|
+
return np.squeeze(np.array(overlay_bas))
|
|
@@ -134,9 +134,7 @@ def load_sim_1D(File):
|
|
|
134
134
|
dic : dict
|
|
135
135
|
Dictionary of the parameters, ready to be read from the simulation functions.
|
|
136
136
|
"""
|
|
137
|
-
|
|
138
|
-
with open(File, 'r') as f:
|
|
139
|
-
inp = f.readlines()
|
|
137
|
+
inp = Path(File).read_text().splitlines(keepends=True)
|
|
140
138
|
keys = []
|
|
141
139
|
vals = []
|
|
142
140
|
for i in range(len(inp)):
|
|
@@ -201,7 +199,7 @@ def sim_1D(File, pv=False):
|
|
|
201
199
|
fid : 1darray
|
|
202
200
|
FID of the simulated spectrum.
|
|
203
201
|
"""
|
|
204
|
-
if isinstance(File, str):
|
|
202
|
+
if isinstance(File, (str, Path)):
|
|
205
203
|
in_file = load_sim_1D(File)
|
|
206
204
|
elif isinstance(File, dict):
|
|
207
205
|
in_file = File
|
|
@@ -247,8 +245,7 @@ def load_sim_2D(File, states=True):
|
|
|
247
245
|
dic : dict
|
|
248
246
|
Dictionary of the parameters, ready to be read from the simulation functions.
|
|
249
247
|
"""
|
|
250
|
-
|
|
251
|
-
inp = f.readlines()
|
|
248
|
+
inp = Path(File).read_text().splitlines(keepends=True)
|
|
252
249
|
keys = []
|
|
253
250
|
vals = []
|
|
254
251
|
for i in range(len(inp)):
|
|
@@ -320,7 +317,7 @@ def sim_2D(File, states=True, alt=True, pv=False):
|
|
|
320
317
|
"""
|
|
321
318
|
|
|
322
319
|
# Generates a dictionary of parameters from an input file
|
|
323
|
-
if isinstance(File, str):
|
|
320
|
+
if isinstance(File, (str, Path)):
|
|
324
321
|
in_file = sim.load_sim_2D(File, states=states)
|
|
325
322
|
elif isinstance(File, dict):
|
|
326
323
|
in_file = File
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
running egg_info
|
|
2
|
-
writing klassez.egg-info/PKG-INFO
|
|
3
|
-
writing dependency_links to klassez.egg-info/dependency_links.txt
|
|
4
|
-
writing requirements to klassez.egg-info/requires.txt
|
|
5
|
-
writing top-level names to klassez.egg-info/top_level.txt
|
|
6
|
-
reading manifest file 'klassez.egg-info/SOURCES.txt'
|
|
7
|
-
reading manifest template 'MANIFEST.in'
|
|
8
|
-
adding license file 'LICENSE.txt'
|
|
9
|
-
writing manifest file 'klassez.egg-info/SOURCES.txt'
|
|
10
|
-
running sdist
|
|
11
|
-
running egg_info
|
|
12
|
-
writing klassez.egg-info/PKG-INFO
|
|
13
|
-
writing dependency_links to klassez.egg-info/dependency_links.txt
|
|
14
|
-
writing requirements to klassez.egg-info/requires.txt
|
|
15
|
-
writing top-level names to klassez.egg-info/top_level.txt
|
|
16
|
-
reading manifest file 'klassez.egg-info/SOURCES.txt'
|
|
17
|
-
reading manifest template 'MANIFEST.in'
|
|
18
|
-
adding license file 'LICENSE.txt'
|
|
19
|
-
writing manifest file 'klassez.egg-info/SOURCES.txt'
|
|
20
|
-
running check
|
|
21
|
-
creating klassez-0.1.1.dev0
|
|
22
|
-
creating klassez-0.1.1.dev0/docs
|
|
23
|
-
creating klassez-0.1.1.dev0/klassez
|
|
24
|
-
creating klassez-0.1.1.dev0/klassez.egg-info
|
|
25
|
-
creating klassez-0.1.1.dev0/klassez/tables
|
|
26
|
-
creating klassez-0.1.1.dev0/test
|
|
27
|
-
copying files to klassez-0.1.1.dev0...
|
|
28
|
-
copying LICENSE.txt -> klassez-0.1.1.dev0
|
|
29
|
-
copying MANIFEST.in -> klassez-0.1.1.dev0
|
|
30
|
-
copying README.md -> klassez-0.1.1.dev0
|
|
31
|
-
copying pyproject.toml -> klassez-0.1.1.dev0
|
|
32
|
-
copying setup.cfg -> klassez-0.1.1.dev0
|
|
33
|
-
copying docs/Makefile -> klassez-0.1.1.dev0/docs
|
|
34
|
-
copying docs/make.bat -> klassez-0.1.1.dev0/docs
|
|
35
|
-
copying docs/rebuild_kz.err -> klassez-0.1.1.dev0/docs
|
|
36
|
-
copying docs/rebuild_kz.log -> klassez-0.1.1.dev0/docs
|
|
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
|