orto 1.11.0__tar.gz → 1.11.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.
- {orto-1.11.0 → orto-1.11.2}/PKG-INFO +1 -1
- orto-1.11.2/orto/__version__.py +1 -0
- {orto-1.11.0 → orto-1.11.2}/orto/cli.py +28 -5
- {orto-1.11.0 → orto-1.11.2}/orto/data.py +15 -27
- {orto-1.11.0 → orto-1.11.2}/orto/plotter.py +3 -1
- {orto-1.11.0 → orto-1.11.2}/orto.egg-info/PKG-INFO +1 -1
- {orto-1.11.0 → orto-1.11.2}/setup.py +1 -1
- orto-1.11.0/orto/__version__.py +0 -1
- {orto-1.11.0 → orto-1.11.2}/LICENSE +0 -0
- {orto-1.11.0 → orto-1.11.2}/README.md +0 -0
- {orto-1.11.0 → orto-1.11.2}/orto/__init__.py +0 -0
- {orto-1.11.0 → orto-1.11.2}/orto/constants.py +0 -0
- {orto-1.11.0 → orto-1.11.2}/orto/exceptions.py +0 -0
- {orto-1.11.0 → orto-1.11.2}/orto/extractor.py +0 -0
- {orto-1.11.0 → orto-1.11.2}/orto/input.py +0 -0
- {orto-1.11.0 → orto-1.11.2}/orto/job.py +0 -0
- {orto-1.11.0 → orto-1.11.2}/orto/utils.py +0 -0
- {orto-1.11.0 → orto-1.11.2}/orto.egg-info/SOURCES.txt +0 -0
- {orto-1.11.0 → orto-1.11.2}/orto.egg-info/dependency_links.txt +0 -0
- {orto-1.11.0 → orto-1.11.2}/orto.egg-info/entry_points.txt +0 -0
- {orto-1.11.0 → orto-1.11.2}/orto.egg-info/requires.txt +0 -0
- {orto-1.11.0 → orto-1.11.2}/orto.egg-info/top_level.txt +0 -0
- {orto-1.11.0 → orto-1.11.2}/pyproject.toml +0 -0
- {orto-1.11.0 → orto-1.11.2}/setup.cfg +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '1.11.2'
|
|
@@ -929,6 +929,8 @@ def plot_xes_func(uargs):
|
|
|
929
929
|
x_values = np.asarray(data['energy (cm^-1)'])
|
|
930
930
|
elif uargs.x_unit == 'wavelength':
|
|
931
931
|
x_values = 1E7 / np.asarray(data['energy (cm^-1)'])
|
|
932
|
+
elif uargs.x_unit == 'wavelength_rev':
|
|
933
|
+
x_values = 1E7 / np.asarray(data['energy (cm^-1)'])
|
|
932
934
|
elif uargs.x_unit == 'energy':
|
|
933
935
|
x_values = np.asarray(data['energy (ev)'])
|
|
934
936
|
|
|
@@ -1040,6 +1042,7 @@ def plot_xas_func(uargs):
|
|
|
1040
1042
|
|
|
1041
1043
|
# Remove transitions with zero oscillator strength from
|
|
1042
1044
|
# beginning and end of spectrum
|
|
1045
|
+
print(data['fosc'], x_values)
|
|
1043
1046
|
if not uargs.no_trim:
|
|
1044
1047
|
# Find first non-zero oscillator strength
|
|
1045
1048
|
first_nonzero = np.where(data['fosc'] > 1E-6)[0][0]
|
|
@@ -1201,14 +1204,23 @@ def plot_abs_func(uargs, save_data_only=False):
|
|
|
1201
1204
|
x_vals = abs_data.wavenumbers
|
|
1202
1205
|
min_factor = 0.8
|
|
1203
1206
|
max_factor = 1.1
|
|
1207
|
+
x_reversed = False
|
|
1204
1208
|
elif uargs.x_unit == 'wavelength':
|
|
1205
1209
|
x_vals = abs_data.wavelengths
|
|
1206
1210
|
max_factor = 1.1
|
|
1207
1211
|
min_factor = 0.8
|
|
1212
|
+
x_reversed = False
|
|
1213
|
+
elif uargs.x_unit == 'wavelength_rev':
|
|
1214
|
+
x_vals = abs_data.wavelengths
|
|
1215
|
+
max_factor = 1.1
|
|
1216
|
+
min_factor = 0.8
|
|
1217
|
+
x_reversed = True
|
|
1218
|
+
uargs.x_unit = 'wavelength'
|
|
1208
1219
|
elif uargs.x_unit == 'energy':
|
|
1209
1220
|
x_vals = abs_data.energies
|
|
1210
1221
|
min_factor = 0.9995
|
|
1211
1222
|
max_factor = 1.0005
|
|
1223
|
+
x_reversed = False
|
|
1212
1224
|
|
|
1213
1225
|
# Set x_min and x_max
|
|
1214
1226
|
if isinstance(uargs.x_lim[0], str):
|
|
@@ -1243,7 +1255,8 @@ def plot_abs_func(uargs, save_data_only=False):
|
|
|
1243
1255
|
num_points=10000,
|
|
1244
1256
|
x_min=x_min,
|
|
1245
1257
|
x_max=x_max,
|
|
1246
|
-
comment=unique_names[it]
|
|
1258
|
+
comment=unique_names[it],
|
|
1259
|
+
x_reversed=x_reversed
|
|
1247
1260
|
)
|
|
1248
1261
|
|
|
1249
1262
|
if save_data_only:
|
|
@@ -2417,7 +2430,7 @@ def read_args(arg_list=None):
|
|
|
2417
2430
|
|
|
2418
2431
|
gen_abs.add_argument(
|
|
2419
2432
|
'--zero_osc',
|
|
2420
|
-
default=1E-
|
|
2433
|
+
default=1E-7,
|
|
2421
2434
|
type=float,
|
|
2422
2435
|
help=(
|
|
2423
2436
|
'Oscillator strengths below this value are treated as zero\n'
|
|
@@ -2539,9 +2552,9 @@ def read_args(arg_list=None):
|
|
|
2539
2552
|
plot_abs.add_argument(
|
|
2540
2553
|
'--x_unit',
|
|
2541
2554
|
type=str,
|
|
2542
|
-
choices=['energy', 'wavelength', 'wavenumber'],
|
|
2555
|
+
choices=['energy', 'wavelength', 'wavelength_rev', 'wavenumber'],
|
|
2543
2556
|
default='energy',
|
|
2544
|
-
help='x units to use for spectrum'
|
|
2557
|
+
help='x units to use for spectrum (rev = reversed axis direction)'
|
|
2545
2558
|
)
|
|
2546
2559
|
|
|
2547
2560
|
plot_abs.add_argument(
|
|
@@ -2582,7 +2595,7 @@ def read_args(arg_list=None):
|
|
|
2582
2595
|
|
|
2583
2596
|
plot_abs.add_argument(
|
|
2584
2597
|
'--zero_osc',
|
|
2585
|
-
default=1E-
|
|
2598
|
+
default=1E-7,
|
|
2586
2599
|
type=float,
|
|
2587
2600
|
help=(
|
|
2588
2601
|
'Oscillator strengths below this value are treated as zero\n'
|
|
@@ -2612,6 +2625,16 @@ def read_args(arg_list=None):
|
|
|
2612
2625
|
)
|
|
2613
2626
|
)
|
|
2614
2627
|
|
|
2628
|
+
plot_abs.add_argument(
|
|
2629
|
+
'--no_trim',
|
|
2630
|
+
action='store_true',
|
|
2631
|
+
default=False,
|
|
2632
|
+
help=(
|
|
2633
|
+
'Do not trim spectrum to non-zero oscillator strength\n'
|
|
2634
|
+
'Default: %(default)s'
|
|
2635
|
+
)
|
|
2636
|
+
)
|
|
2637
|
+
|
|
2615
2638
|
plot_xes = plot_parser.add_parser(
|
|
2616
2639
|
'xes',
|
|
2617
2640
|
description='Plots XES from CI calculation output',
|
|
@@ -33,6 +33,9 @@ class AbsorptionSpectrum():
|
|
|
33
33
|
Full width at half maximum used in spectrum generation
|
|
34
34
|
comment: str, default=''
|
|
35
35
|
Comment or metadata for the spectrum
|
|
36
|
+
x_reversed: bool, default False
|
|
37
|
+
Whether the x axis is reversed (e.g. for wavelength spectra)\n
|
|
38
|
+
By default, False - increasing x values from left to right
|
|
36
39
|
|
|
37
40
|
Attributes
|
|
38
41
|
----------
|
|
@@ -61,7 +64,7 @@ class AbsorptionSpectrum():
|
|
|
61
64
|
def __init__(self, x_grid: NDArray, x_unit: str, x_label: str,
|
|
62
65
|
x_label_mathmode: str, y_unit: str, y_label: str,
|
|
63
66
|
y_label_mathmode: str, y_values: NDArray, fwhm: float,
|
|
64
|
-
comment: str = '') -> None:
|
|
67
|
+
comment: str = '', x_reversed: bool = False) -> None:
|
|
65
68
|
self.x_grid = x_grid
|
|
66
69
|
self.x_unit = x_unit
|
|
67
70
|
self.x_label = x_label
|
|
@@ -72,30 +75,9 @@ class AbsorptionSpectrum():
|
|
|
72
75
|
self.fwhm = fwhm
|
|
73
76
|
self.y_values = y_values
|
|
74
77
|
self.comment = comment
|
|
78
|
+
self.x_reversed = x_reversed
|
|
75
79
|
return
|
|
76
80
|
|
|
77
|
-
@classmethod
|
|
78
|
-
def from_data(cls, x_grid: NDArray, y_values: NDArray,
|
|
79
|
-
fwhm: float) -> 'AbsorptionSpectrum':
|
|
80
|
-
'''
|
|
81
|
-
Creates AbsorptionSpectrum object from data
|
|
82
|
-
|
|
83
|
-
Parameters
|
|
84
|
-
----------
|
|
85
|
-
x_grid: NDArray
|
|
86
|
-
Grid of x values (energies, wavelengths, or wavenumbers)
|
|
87
|
-
y_values: NDArray
|
|
88
|
-
Absorption spectrum values at each point in x_grid
|
|
89
|
-
fwhm: float
|
|
90
|
-
Full width at half maximum used in spectrum generation
|
|
91
|
-
|
|
92
|
-
Returns
|
|
93
|
-
-------
|
|
94
|
-
AbsorptionSpectrum
|
|
95
|
-
Created AbsorptionSpectrum object
|
|
96
|
-
'''
|
|
97
|
-
return cls(x_grid, y_values, fwhm)
|
|
98
|
-
|
|
99
81
|
|
|
100
82
|
class AbsorptionData():
|
|
101
83
|
'''
|
|
@@ -236,7 +218,7 @@ class AbsorptionData():
|
|
|
236
218
|
def from_extractor_dataset(cls,
|
|
237
219
|
dataset: dict[str, list[int | float]],
|
|
238
220
|
operator: str,
|
|
239
|
-
remove_zero_osc: float = 1E-
|
|
221
|
+
remove_zero_osc: float = 1E-7) -> 'AbsorptionData': # noqa
|
|
240
222
|
'''
|
|
241
223
|
Creates AbsorptionData object from data extractor
|
|
242
224
|
|
|
@@ -246,7 +228,7 @@ class AbsorptionData():
|
|
|
246
228
|
Dataset from orto AbsorptionExtractor.data
|
|
247
229
|
operator: str
|
|
248
230
|
Type of operator used to calculate transitions
|
|
249
|
-
remove_zero_osc: float, default=1E-
|
|
231
|
+
remove_zero_osc: float, default=1E-7
|
|
250
232
|
Remove transitions with oscillator strength below this value
|
|
251
233
|
|
|
252
234
|
Returns
|
|
@@ -261,6 +243,7 @@ class AbsorptionData():
|
|
|
261
243
|
# Remove transitions with zero oscillator strength from
|
|
262
244
|
# beginning and end of spectrum
|
|
263
245
|
osc_strengths = np.array(osc_strengths)
|
|
246
|
+
|
|
264
247
|
# Find first non-zero oscillator strength
|
|
265
248
|
try:
|
|
266
249
|
first_nonzero = np.where(osc_strengths > remove_zero_osc)[0][0]
|
|
@@ -281,7 +264,8 @@ class AbsorptionData():
|
|
|
281
264
|
def generate_spectrum(self, fwhm: float, lineshape: str, x_min: float,
|
|
282
265
|
x_max: float, num_points: int,
|
|
283
266
|
x_type: str = 'energy',
|
|
284
|
-
comment: str = ''
|
|
267
|
+
comment: str = '',
|
|
268
|
+
x_reversed: bool = False) -> AbsorptionSpectrum:
|
|
285
269
|
'''
|
|
286
270
|
Generates absorption spectrum using Gaussian broadening
|
|
287
271
|
|
|
@@ -305,6 +289,9 @@ class AbsorptionData():
|
|
|
305
289
|
'wavenumber' (cm^-1)
|
|
306
290
|
comment: str
|
|
307
291
|
Comment to add to spectrum metadata
|
|
292
|
+
x_reversed: bool
|
|
293
|
+
Whether to reverse the x axis (e.g. for wavelength spectra)\n
|
|
294
|
+
By default, False - increasing x values from left to right
|
|
308
295
|
|
|
309
296
|
Returns
|
|
310
297
|
-------
|
|
@@ -386,7 +373,8 @@ class AbsorptionData():
|
|
|
386
373
|
y_label_mathmode=y_label_mathmode,
|
|
387
374
|
y_values=y_vals,
|
|
388
375
|
fwhm=fwhm,
|
|
389
|
-
comment=comment
|
|
376
|
+
comment=comment,
|
|
377
|
+
x_reversed=x_reversed
|
|
390
378
|
)
|
|
391
379
|
|
|
392
380
|
self.spectrum = spectrum
|
|
@@ -118,7 +118,6 @@ def plot_absorption_spectrum(abs_data: data.AbsorptionData,
|
|
|
118
118
|
ax.set_ylabel(abs_data.spectrum.y_label_mathmode)
|
|
119
119
|
|
|
120
120
|
if abs_data.spectrum.x_label.split()[0].lower() == 'wavelength':
|
|
121
|
-
ax.invert_xaxis()
|
|
122
121
|
stick_x_values = [
|
|
123
122
|
wavelength + x_shift
|
|
124
123
|
for wavelength in abs_data.wavelengths
|
|
@@ -134,6 +133,9 @@ def plot_absorption_spectrum(abs_data: data.AbsorptionData,
|
|
|
134
133
|
for wavenumber in abs_data.wavenumbers
|
|
135
134
|
]
|
|
136
135
|
|
|
136
|
+
if abs_data.spectrum.x_reversed:
|
|
137
|
+
ax.invert_xaxis()
|
|
138
|
+
|
|
137
139
|
x_values = abs_data.spectrum.x_grid + x_shift
|
|
138
140
|
|
|
139
141
|
# Main spectrum
|
orto-1.11.0/orto/__version__.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = '1.11.0'
|
|
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
|