orto 1.2.0__tar.gz → 1.3.0__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.2.0 → orto-1.3.0}/PKG-INFO +1 -1
- orto-1.3.0/orto/__version__.py +1 -0
- {orto-1.2.0 → orto-1.3.0}/orto/cli.py +45 -45
- {orto-1.2.0 → orto-1.3.0}/orto/extractor.py +62 -1
- {orto-1.2.0 → orto-1.3.0}/orto/plotter.py +80 -26
- {orto-1.2.0 → orto-1.3.0}/orto.egg-info/PKG-INFO +1 -1
- {orto-1.2.0 → orto-1.3.0}/setup.py +1 -1
- orto-1.2.0/orto/__version__.py +0 -1
- {orto-1.2.0 → orto-1.3.0}/README.md +0 -0
- {orto-1.2.0 → orto-1.3.0}/orto/__init__.py +0 -0
- {orto-1.2.0 → orto-1.3.0}/orto/constants.py +0 -0
- {orto-1.2.0 → orto-1.3.0}/orto/exceptions.py +0 -0
- {orto-1.2.0 → orto-1.3.0}/orto/input.py +0 -0
- {orto-1.2.0 → orto-1.3.0}/orto/job.py +0 -0
- {orto-1.2.0 → orto-1.3.0}/orto/utils.py +0 -0
- {orto-1.2.0 → orto-1.3.0}/orto.egg-info/SOURCES.txt +0 -0
- {orto-1.2.0 → orto-1.3.0}/orto.egg-info/dependency_links.txt +0 -0
- {orto-1.2.0 → orto-1.3.0}/orto.egg-info/entry_points.txt +0 -0
- {orto-1.2.0 → orto-1.3.0}/orto.egg-info/requires.txt +0 -0
- {orto-1.2.0 → orto-1.3.0}/orto.egg-info/top_level.txt +0 -0
- {orto-1.2.0 → orto-1.3.0}/pyproject.toml +0 -0
- {orto-1.2.0 → orto-1.3.0}/setup.cfg +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '1.3.0'
|
|
@@ -597,7 +597,7 @@ def plot_abs_func(uargs):
|
|
|
597
597
|
all_data = oe.OldAbsorptionElectricDipoleExtractor.extract(
|
|
598
598
|
uargs.output_file
|
|
599
599
|
)
|
|
600
|
-
|
|
600
|
+
elif uargs.intensity_type == 'velocity':
|
|
601
601
|
all_data = oe.OldAbsorptionVelocityDipoleExtractor.extract(
|
|
602
602
|
uargs.output_file
|
|
603
603
|
)
|
|
@@ -606,65 +606,50 @@ def plot_abs_func(uargs):
|
|
|
606
606
|
all_data = oe.AbsorptionElectricDipoleExtractor.extract(
|
|
607
607
|
uargs.output_file
|
|
608
608
|
)
|
|
609
|
-
|
|
609
|
+
elif uargs.intensity_type == 'velocity':
|
|
610
610
|
all_data = oe.AbsorptionVelocityDipoleExtractor.extract(
|
|
611
611
|
uargs.output_file
|
|
612
612
|
)
|
|
613
|
+
elif uargs.intensity_type == 'semi-classical':
|
|
614
|
+
all_data = oe.AbsorptionSemiClassicalDipoleExtractor.extract(
|
|
615
|
+
uargs.output_file
|
|
616
|
+
)
|
|
613
617
|
|
|
614
618
|
# Plot each section
|
|
615
619
|
for it, data in enumerate(all_data):
|
|
616
620
|
|
|
617
|
-
if uargs.x_lim is None:
|
|
618
|
-
if uargs.x_unit == 'wavenumber':
|
|
619
|
-
uargs.x_lim = [0, max(data['energy (cm^-1)'])]
|
|
620
|
-
if uargs.x_unit == 'wavelength':
|
|
621
|
-
# 1 to 2000 nm
|
|
622
|
-
uargs.x_lim = [5000., 10000000.]
|
|
623
|
-
|
|
624
|
-
if uargs.x_cut is None:
|
|
625
|
-
iup = -2
|
|
626
|
-
ilow = 0
|
|
627
|
-
else:
|
|
628
|
-
ilow = min(
|
|
629
|
-
[
|
|
630
|
-
it
|
|
631
|
-
for it, val in enumerate(data['energy (cm^-1)'])
|
|
632
|
-
if (val - uargs.x_cut[0]) > 0
|
|
633
|
-
]
|
|
634
|
-
)
|
|
635
|
-
iup = max(
|
|
636
|
-
[
|
|
637
|
-
it
|
|
638
|
-
for it, val in enumerate(data['energy (cm^-1)'])
|
|
639
|
-
if (uargs.x_cut[1] - val) > 0
|
|
640
|
-
]
|
|
641
|
-
)
|
|
642
|
-
|
|
643
621
|
if len(all_data) > 1:
|
|
644
622
|
save_name = f'absorption_spectrum_section_{it:d}.png'
|
|
645
623
|
else:
|
|
646
|
-
save_name = '
|
|
624
|
+
save_name = 'absorption_spectrum.png'
|
|
625
|
+
|
|
626
|
+
if uargs.x_unit == 'wavenumber':
|
|
627
|
+
x_values = data['energy (cm^-1)']
|
|
628
|
+
elif uargs.x_unit == 'wavelength':
|
|
629
|
+
x_values = 1E7 / data['energy (cm^-1)']
|
|
630
|
+
elif uargs.x_unit == 'energy':
|
|
631
|
+
x_values = data['energy (ev)']
|
|
647
632
|
|
|
648
633
|
# Plot absorption spectrum
|
|
649
634
|
fig, ax = plotter.plot_abs(
|
|
650
|
-
|
|
651
|
-
|
|
635
|
+
x_values,
|
|
636
|
+
uargs.x_unit,
|
|
637
|
+
data['fosc'],
|
|
652
638
|
show=_SHOW_CONV[uargs.plot],
|
|
653
639
|
save=_SAVE_CONV[uargs.plot],
|
|
654
640
|
save_name=save_name,
|
|
655
641
|
x_lim=uargs.x_lim,
|
|
656
642
|
y_lim=uargs.y_lim,
|
|
657
|
-
|
|
643
|
+
x_shift=uargs.shift,
|
|
658
644
|
linewidth=uargs.linewidth,
|
|
659
645
|
lineshape=uargs.lineshape,
|
|
660
646
|
window_title=f'Absorption Spectrum from {uargs.output_file}',
|
|
661
|
-
show_osc=not uargs.no_osc
|
|
647
|
+
show_osc=not uargs.no_osc,
|
|
648
|
+
normalise=uargs.normalise_absorption
|
|
662
649
|
)
|
|
663
650
|
|
|
664
651
|
if uargs.x_unit == 'wavenumber':
|
|
665
652
|
ax[0].set_xlim([0, 50000])
|
|
666
|
-
if uargs.x_unit == 'wavelength':
|
|
667
|
-
ax[0].set_xlim([0, 2000])
|
|
668
653
|
plt.show()
|
|
669
654
|
|
|
670
655
|
return
|
|
@@ -1622,8 +1607,9 @@ def read_args(arg_list=None):
|
|
|
1622
1607
|
|
|
1623
1608
|
plot_abs.add_argument(
|
|
1624
1609
|
'--intensity_type',
|
|
1610
|
+
'-i',
|
|
1625
1611
|
type=str,
|
|
1626
|
-
choices=['velocity', 'electric'],
|
|
1612
|
+
choices=['velocity', 'electric', 'semi-classical'],
|
|
1627
1613
|
default='electric',
|
|
1628
1614
|
help='Type of intensity to plot (orca_mapspc uses electric)'
|
|
1629
1615
|
)
|
|
@@ -1676,32 +1662,46 @@ def read_args(arg_list=None):
|
|
|
1676
1662
|
plot_abs.add_argument(
|
|
1677
1663
|
'--x_unit',
|
|
1678
1664
|
type=str,
|
|
1679
|
-
choices=['wavenumber', 'wavelength'],
|
|
1665
|
+
choices=['wavenumber', 'energy', 'wavelength'],
|
|
1680
1666
|
default='wavenumber',
|
|
1681
1667
|
help='x units to use for spectrum'
|
|
1682
1668
|
)
|
|
1683
1669
|
|
|
1684
1670
|
plot_abs.add_argument(
|
|
1685
|
-
'--
|
|
1671
|
+
'--shift',
|
|
1686
1672
|
type=float,
|
|
1687
|
-
|
|
1688
|
-
help=
|
|
1673
|
+
default=0.,
|
|
1674
|
+
help=(
|
|
1675
|
+
'Shift spectrum by this amount in x units\n'
|
|
1676
|
+
'Default: %(default)s'
|
|
1677
|
+
)
|
|
1689
1678
|
)
|
|
1690
1679
|
|
|
1691
1680
|
plot_abs.add_argument(
|
|
1692
|
-
'--
|
|
1693
|
-
type=float,
|
|
1681
|
+
'--x_lim',
|
|
1694
1682
|
nargs=2,
|
|
1695
|
-
|
|
1683
|
+
default=['auto', 'auto'],
|
|
1684
|
+
help='x limits of spectrum'
|
|
1696
1685
|
)
|
|
1697
1686
|
|
|
1698
1687
|
plot_abs.add_argument(
|
|
1699
1688
|
'--y_lim',
|
|
1700
1689
|
nargs=2,
|
|
1701
|
-
default=[
|
|
1690
|
+
default=[0., 'auto'],
|
|
1702
1691
|
help='Epsilon limits of spectrum in cm^-1 mol^-1 L'
|
|
1703
1692
|
)
|
|
1704
1693
|
|
|
1694
|
+
plot_abs.add_argument(
|
|
1695
|
+
'--normalise_absorption',
|
|
1696
|
+
'-na',
|
|
1697
|
+
action='store_true',
|
|
1698
|
+
default=False,
|
|
1699
|
+
help=(
|
|
1700
|
+
'Normalises absorption spectrum to maximum value\n'
|
|
1701
|
+
'Default: %(default)s'
|
|
1702
|
+
)
|
|
1703
|
+
)
|
|
1704
|
+
|
|
1705
1705
|
plot_ailft = plot_parser.add_parser(
|
|
1706
1706
|
'ailft_orbs',
|
|
1707
1707
|
description='Plots AI-LFT orbital energies from output file',
|
|
@@ -1911,7 +1911,7 @@ def read_args(arg_list=None):
|
|
|
1911
1911
|
default=5,
|
|
1912
1912
|
help=(
|
|
1913
1913
|
'Width of signal (FWHM for Gaussian, Width for Lorentzian),'
|
|
1914
|
-
' in
|
|
1914
|
+
' in same unit as plot x unit'
|
|
1915
1915
|
)
|
|
1916
1916
|
)
|
|
1917
1917
|
|
|
@@ -1359,7 +1359,7 @@ class AbsorptionElectricDipoleExtractor(extto.BetweenExtractor):
|
|
|
1359
1359
|
'''
|
|
1360
1360
|
|
|
1361
1361
|
result = re.findall(
|
|
1362
|
-
r'\s+(\d
|
|
1362
|
+
r'\s+(\d+[A-Za-z]*-\d*[A-Za-z]\s+->\s+\d+[A-Za-z]*-\d*[A-Za-z])\s+(\d+\.\d+)\s+(\d+\.\d+)\s+(\d+\.\d+)\s+(\d+\.\d+)\s+(\d\.\d{5})\s+(-*\d\.\d{5})\s+(-*\d\.\d{5})\s+(-*\d\.\d{5})', # noqa
|
|
1363
1363
|
block
|
|
1364
1364
|
)
|
|
1365
1365
|
|
|
@@ -1415,6 +1415,67 @@ class AbsorptionVelocityDipoleExtractor(AbsorptionElectricDipoleExtractor):
|
|
|
1415
1415
|
END_PATTERN = rb'(?=-{77})'
|
|
1416
1416
|
|
|
1417
1417
|
|
|
1418
|
+
class AbsorptionSemiClassicalDipoleExtractor(AbsorptionElectricDipoleExtractor): # noqa
|
|
1419
|
+
'''
|
|
1420
|
+
Extracts ABSORPTION SPECTRUM VIA FULL SEMI-CLASSICAL FORMULATION table
|
|
1421
|
+
from ORCA output file for versions newer than 6.
|
|
1422
|
+
'''
|
|
1423
|
+
|
|
1424
|
+
# Regex Start Pattern
|
|
1425
|
+
START_PATTERN = rb'(?<=ABSORPTION SPECTRUM VIA FULL SEMI-CLASSICAL FORMULATION\s[\S\s]{408}\s)' # noqa
|
|
1426
|
+
|
|
1427
|
+
# Regex End Pattern
|
|
1428
|
+
END_PATTERN = rb'(?=-{77})'
|
|
1429
|
+
|
|
1430
|
+
@property
|
|
1431
|
+
def data(self) -> dict[str, list[str | float]]:
|
|
1432
|
+
'''
|
|
1433
|
+
Absorption spectrum data:\n
|
|
1434
|
+
A dictionary with keys:\n
|
|
1435
|
+
transition\n
|
|
1436
|
+
energy (cm^-1)\n
|
|
1437
|
+
energy (ev)\n
|
|
1438
|
+
wavelength (nm)\n
|
|
1439
|
+
fosc\n
|
|
1440
|
+
All values are list[float], but 'transition' entries are list[str]
|
|
1441
|
+
'''
|
|
1442
|
+
return self._data
|
|
1443
|
+
|
|
1444
|
+
@staticmethod
|
|
1445
|
+
def _process_block(block: str) -> dict[str, list[int | float]]: # noqa
|
|
1446
|
+
'''
|
|
1447
|
+
Converts single block into data entries described in self.data
|
|
1448
|
+
|
|
1449
|
+
Parameters
|
|
1450
|
+
----------
|
|
1451
|
+
block: str
|
|
1452
|
+
String block extracted from file
|
|
1453
|
+
|
|
1454
|
+
Returns
|
|
1455
|
+
-------
|
|
1456
|
+
dict[str, list[float]]
|
|
1457
|
+
'''
|
|
1458
|
+
|
|
1459
|
+
result = re.findall(
|
|
1460
|
+
r'\s+(\d+[A-Za-z]*-\d*[A-Za-z]\s+->\s+\d+[A-Za-z]*-\d*[A-Za-z])\s+(\d+\.\d+)\s+(\d+\.\d+)\s+(\d+\.\d+)\s+(\d+\.\d+)', # noqa
|
|
1461
|
+
block
|
|
1462
|
+
)
|
|
1463
|
+
|
|
1464
|
+
result = np.asarray(result, dtype=str).T
|
|
1465
|
+
|
|
1466
|
+
fresult = result[1:].astype(float)
|
|
1467
|
+
|
|
1468
|
+
data = {
|
|
1469
|
+
'state': result[0].tolist(),
|
|
1470
|
+
'energy (ev)': fresult[0].tolist(),
|
|
1471
|
+
'energy (cm^-1)': fresult[1].tolist(),
|
|
1472
|
+
'wavelength (nm)': fresult[2].tolist(),
|
|
1473
|
+
'fosc': fresult[3].tolist(),
|
|
1474
|
+
}
|
|
1475
|
+
|
|
1476
|
+
return data
|
|
1477
|
+
|
|
1478
|
+
|
|
1418
1479
|
class OldAbsorptionElectricDipoleExtractor(extto.BetweenExtractor):
|
|
1419
1480
|
'''
|
|
1420
1481
|
Extracts ABSORPTION SPECTRUM VIA TRANSITION ELECTRIC DIPOLE MOMENTS table
|
|
@@ -75,35 +75,43 @@ def lorentzian(p: ArrayLike, fwhm, p0, area) -> NDArray:
|
|
|
75
75
|
return lor
|
|
76
76
|
|
|
77
77
|
|
|
78
|
-
def plot_abs(
|
|
78
|
+
def plot_abs(x_values: ArrayLike, x_type: str, foscs: ArrayLike,
|
|
79
79
|
lineshape: str = 'gaussian', linewidth: float = 100.,
|
|
80
|
-
x_lim: list[float] =
|
|
81
|
-
abs_type: str = 'napierian',
|
|
80
|
+
x_lim: list[float] = ['auto', 'auto'],
|
|
81
|
+
abs_type: str = 'napierian',
|
|
82
|
+
y_lim: list[float] = [0., 'auto'],
|
|
83
|
+
x_shift: float = 0., normalise: bool = False,
|
|
82
84
|
show_osc: bool = True, save: bool = False,
|
|
83
85
|
save_name: str = 'absorption_spectrum.png', show: bool = False,
|
|
84
86
|
window_title: str = 'Absorption Spectrum') -> tuple[plt.Figure, list[plt.Axes]]: # noqa
|
|
85
87
|
'''
|
|
86
|
-
Plots absorption spectrum with oscillator
|
|
88
|
+
Plots absorption spectrum with intensity specified by oscillator strength.\n # noqa
|
|
89
|
+
Spectrum is computed as a sum of Gaussian or Lorentzian lineshapes.\n
|
|
90
|
+
The x_values can be either wavenumbers [cm^-1], wavelengths [nm] or\n
|
|
91
|
+
energies [eV].\n
|
|
87
92
|
|
|
88
93
|
Parameters
|
|
89
94
|
----------
|
|
90
|
-
|
|
91
|
-
|
|
95
|
+
x_values: array_like
|
|
96
|
+
x_values for each transition, either wavenumber, wavelength or energy\n
|
|
97
|
+
with unit type specified by x_type
|
|
98
|
+
x_type: str {'wavenumber', 'wavelength', 'energy'}
|
|
99
|
+
Type of x_values, either wavenumber [cm^-1], wavelength [nm] or\n
|
|
100
|
+
energy [eV].
|
|
92
101
|
foscs: array_like
|
|
93
102
|
Oscillator strength of each transition
|
|
94
103
|
lineshape: str {'gaussian', 'lorentzian'}
|
|
95
104
|
Lineshape function to use for each transition/signal
|
|
96
105
|
linewidth: float
|
|
97
106
|
Linewidth used in lineshape [cm^-1]
|
|
98
|
-
x_lim: list[float], default [
|
|
107
|
+
x_lim: list[float], default ['auto', 'auto']
|
|
99
108
|
Minimum and maximum x-values to plot [cm^-1 or nm]
|
|
100
|
-
y_lim: list[float | str], default 'auto'
|
|
109
|
+
y_lim: list[float | str], default [0., 'auto']
|
|
101
110
|
Minimum and maximum y-values to plot [cm^-1 mol^-1 L]
|
|
102
|
-
x_unit: str {'wavenumber', 'wavelength'}
|
|
103
|
-
X-unit to use, data will be converted internally.\n
|
|
104
|
-
Assumes cm^-1 for wavenumber and nm for wavelength.
|
|
105
111
|
abs_type: str {'napierian', 'logarithmic'}
|
|
106
112
|
Absorbance (and epsilon) type to use. Orca_mapspc uses napierian
|
|
113
|
+
normalise: bool, default False
|
|
114
|
+
If True, normalise the absorption spectrum to the maximum value.
|
|
107
115
|
show_osc: bool, default True
|
|
108
116
|
If True, show oscillator strength stemplots
|
|
109
117
|
save: bool, default False
|
|
@@ -114,6 +122,7 @@ def plot_abs(wavenumbers: ArrayLike, foscs: ArrayLike,
|
|
|
114
122
|
If True, plot is shown on screen
|
|
115
123
|
window_title: str, default 'UV-Visible Absorption Spectrum'
|
|
116
124
|
Title of figure window, not of plot
|
|
125
|
+
|
|
117
126
|
Returns
|
|
118
127
|
-------
|
|
119
128
|
plt.Figure
|
|
@@ -123,6 +132,11 @@ def plot_abs(wavenumbers: ArrayLike, foscs: ArrayLike,
|
|
|
123
132
|
Matplotlib Axis object for twinx oscillator strength axis
|
|
124
133
|
'''
|
|
125
134
|
|
|
135
|
+
x_values = np.asarray(x_values) + x_shift
|
|
136
|
+
foscs = np.asarray(foscs)
|
|
137
|
+
if len(x_values) != len(foscs):
|
|
138
|
+
raise ValueError('x_values and foscs must have the same length')
|
|
139
|
+
|
|
126
140
|
fig, ax = plt.subplots(1, 1, num=window_title)
|
|
127
141
|
|
|
128
142
|
ls_func = {
|
|
@@ -130,7 +144,38 @@ def plot_abs(wavenumbers: ArrayLike, foscs: ArrayLike,
|
|
|
130
144
|
'lorentzian': lorentzian
|
|
131
145
|
}
|
|
132
146
|
|
|
133
|
-
|
|
147
|
+
if not isinstance(x_lim, list):
|
|
148
|
+
raise ValueError('`x_lim` must be a list of values')
|
|
149
|
+
|
|
150
|
+
if x_lim[0] != x_lim[1]:
|
|
151
|
+
if isinstance(x_lim[0], str):
|
|
152
|
+
if x_lim[0] == 'auto':
|
|
153
|
+
x_lim[0] = ax.get_ylim()[0]
|
|
154
|
+
else:
|
|
155
|
+
x_lim[0] = float(x_lim[0])
|
|
156
|
+
if isinstance(x_lim[1], str):
|
|
157
|
+
if x_lim[1] == 'auto':
|
|
158
|
+
x_lim[1] = ax.get_ylim()[1]
|
|
159
|
+
else:
|
|
160
|
+
x_lim[1] = float(x_lim[1])
|
|
161
|
+
else:
|
|
162
|
+
x_lim = [np.min(x_values), np.max(x_values)]
|
|
163
|
+
|
|
164
|
+
# Set limits and range of continuous variable
|
|
165
|
+
ax.set_xlim([x_lim[0], x_lim[1]])
|
|
166
|
+
x_grid = np.linspace(x_lim[0], x_lim[1], 100000)
|
|
167
|
+
|
|
168
|
+
# Exclude values of x_values out of the range of x_lim
|
|
169
|
+
x_values = np.asarray(
|
|
170
|
+
[val for val in x_values if x_lim[0] <= val <= x_lim[1]]
|
|
171
|
+
)
|
|
172
|
+
# Exclude oscillator strengths for those values
|
|
173
|
+
foscs = np.asarray(
|
|
174
|
+
[
|
|
175
|
+
fosc
|
|
176
|
+
for val, fosc in zip(x_values, foscs)
|
|
177
|
+
if x_lim[0] <= val <= x_lim[1]]
|
|
178
|
+
)
|
|
134
179
|
|
|
135
180
|
# Conversion from oscillator strength to napierian integrated absorption
|
|
136
181
|
# coefficient
|
|
@@ -143,26 +188,29 @@ def plot_abs(wavenumbers: ArrayLike, foscs: ArrayLike,
|
|
|
143
188
|
|
|
144
189
|
# Spectrum as sum of signals. Always computed in wavenumbers.
|
|
145
190
|
spectrum = np.sum([
|
|
146
|
-
ls_func[lineshape](
|
|
147
|
-
for x_value, A_log in zip(
|
|
191
|
+
ls_func[lineshape](x_grid, linewidth, x_value, A_log)
|
|
192
|
+
for x_value, A_log in zip(x_values, A_logs)
|
|
148
193
|
], axis=0)
|
|
149
194
|
|
|
150
|
-
|
|
195
|
+
if normalise:
|
|
196
|
+
# Normalise the spectrum to the maximum value
|
|
197
|
+
spectrum /= np.max(spectrum)
|
|
198
|
+
ax.set_ylabel('Normalised Absorbance (arbitrary units)') # noqa
|
|
199
|
+
else:
|
|
200
|
+
ax.set_ylabel(r'$\epsilon$ (cm$^\mathregular{-1}$ mol$^\mathregular{-1}$ L)') # noqa
|
|
151
201
|
|
|
152
|
-
|
|
153
|
-
if x_unit == 'wavelength':
|
|
154
|
-
x_range = 1E7 / x_range
|
|
155
|
-
wavenumbers = [1E7 / wn for wn in wavenumbers]
|
|
202
|
+
np.savetxt('spectrum.txt', np.vstack([x_grid, spectrum]).T, fmt='%.5f')
|
|
156
203
|
|
|
157
204
|
# Main spectrum
|
|
158
|
-
ax.plot(
|
|
205
|
+
ax.plot(x_grid, spectrum, color='k')
|
|
159
206
|
|
|
160
207
|
if show_osc:
|
|
161
208
|
fax = ax.twinx()
|
|
162
209
|
# Oscillator strength twin axis
|
|
163
|
-
plt.stem(
|
|
210
|
+
plt.stem(x_values, foscs, basefmt=' ')
|
|
164
211
|
fax.yaxis.set_minor_locator(AutoMinorLocator())
|
|
165
212
|
fax.set_ylabel(r'$f_\mathregular{osc}$')
|
|
213
|
+
fax.set_ylim([0., fax.get_ylim()[1]])
|
|
166
214
|
else:
|
|
167
215
|
fax = None
|
|
168
216
|
plt.subplots_adjust(right=0.2)
|
|
@@ -171,21 +219,27 @@ def plot_abs(wavenumbers: ArrayLike, foscs: ArrayLike,
|
|
|
171
219
|
|
|
172
220
|
if y_lim[0] != y_lim[1]:
|
|
173
221
|
if isinstance(y_lim[0], str):
|
|
174
|
-
y_lim[0]
|
|
222
|
+
if y_lim[0] == 'auto':
|
|
223
|
+
y_lim[0] = ax.get_ylim()[0]
|
|
224
|
+
else:
|
|
225
|
+
y_lim[0] = float(y_lim[0])
|
|
175
226
|
if isinstance(y_lim[1], str):
|
|
176
|
-
y_lim[1]
|
|
227
|
+
if y_lim[1] == 'auto':
|
|
228
|
+
y_lim[1] = ax.get_ylim()[1]
|
|
229
|
+
else:
|
|
230
|
+
y_lim[1] = float(y_lim[1])
|
|
177
231
|
ax.set_ylim([y_lim[0], y_lim[1]])
|
|
178
232
|
|
|
179
233
|
ax.xaxis.set_minor_locator(AutoMinorLocator())
|
|
180
234
|
ax.yaxis.set_minor_locator(AutoMinorLocator())
|
|
181
235
|
|
|
182
|
-
|
|
236
|
+
xtype_to_label = {
|
|
183
237
|
'wavenumber': r'Wavenumber (cm$^\mathregular{-1}$)',
|
|
184
238
|
'wavelength': 'Wavelength (nm)',
|
|
239
|
+
'energy': r'Energy (eV)'
|
|
185
240
|
}
|
|
186
241
|
|
|
187
|
-
ax.set_xlabel(
|
|
188
|
-
ax.set_ylabel(r'$\epsilon$ (cm$^\mathregular{-1}$ mol$^\mathregular{-1}$ L)') # noqa
|
|
242
|
+
ax.set_xlabel(xtype_to_label[x_type.lower()])
|
|
189
243
|
|
|
190
244
|
fig.tight_layout()
|
|
191
245
|
|
orto-1.2.0/orto/__version__.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = '1.2.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
|