taurex 3.2.2__tar.gz → 3.2.4__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.
- {taurex-3.2.2 → taurex-3.2.4}/PKG-INFO +1 -1
- {taurex-3.2.2 → taurex-3.2.4}/pyproject.toml +1 -1
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/contributions/leemie.py +5 -4
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/chemistry/__init__.py +2 -0
- taurex-3.2.4/src/taurex/data/profiles/chemistry/gas/customgas.py +121 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/parameter/classfactory.py +2 -3
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/plot/plotter.py +16 -4
- {taurex-3.2.2 → taurex-3.2.4}/LICENSE +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/README.md +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/__init__.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/_citation.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/_version.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/binning/__init__.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/binning/binner.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/binning/fluxbinner.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/binning/lightcurvebinner.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/binning/nativebinner.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/binning/simplebinner.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/cache/__init__.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/cache/ciaacache.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/cache/globalcache.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/cache/ktablecache.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/cache/opacitycache.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/cache/singleton.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/chemistry.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/cia/__init__.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/cia/cia.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/cia/hitrancia.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/cia/picklecia.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/constants.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/contributions/__init__.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/contributions/absorption.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/contributions/cia.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/contributions/contribution.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/contributions/flatmie.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/contributions/hm.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/contributions/rayleigh.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/contributions/simpleclouds.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/core/__init__.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/core/priors.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/__init__.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/citation.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/fittable.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/planet.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/__init__.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/chemistry/autochemistry.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/chemistry/chemistry.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/chemistry/filechemistry.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/chemistry/gas/__init__.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/chemistry/gas/arraygas.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/chemistry/gas/constantgas.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/chemistry/gas/gas.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/chemistry/gas/powergas.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/chemistry/gas/twolayergas.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/chemistry/gas/twopointgas.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/chemistry/taurexchemistry.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/pressure/__init__.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/pressure/arraypressure.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/pressure/filepressure.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/pressure/pressureprofile.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/temperature/__init__.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/temperature/file.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/temperature/guillot.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/temperature/isothermal.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/temperature/npoint.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/temperature/rodgers.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/temperature/temparray.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/temperature/tprofile.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/spectrum/__init__.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/spectrum/array.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/spectrum/iraclis.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/spectrum/lightcurve.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/spectrum/observed.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/spectrum/spectrum.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/spectrum/taurex.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/stellar/__init__.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/stellar/phoenix.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/stellar/star.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/exceptions.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/instruments/__init__.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/instruments/instrument.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/instruments/instrumentfile.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/instruments/snr.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/log/__init__.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/log/logger.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/mixin/__init__.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/mixin/core.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/mixin/mixins.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/model/__init__.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/model/directimage.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/model/emission.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/model/lightcurve/__init__.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/model/lightcurve/lightcurve.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/model/lightcurve/lightcurvedata.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/model/model.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/model/simplemodel.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/model/transmission.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/mpi.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/opacity/__init__.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/opacity/exotransmit.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/opacity/fakeopacity.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/opacity/hdf5opacity.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/opacity/interpolateopacity.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/opacity/ktables/__init__.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/opacity/ktables/hdfktable.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/opacity/ktables/ktable.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/opacity/ktables/nemesisktables.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/opacity/ktables/picklektable.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/opacity/opacity.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/opacity/pickleopacity.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/opacity/radisopacity.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/optimizer/__init__.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/optimizer/dypolychord.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/optimizer/multinest.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/optimizer/nestle.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/optimizer/optimizer.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/optimizer/polychord.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/output/__init__.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/output/hdf5.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/output/output.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/output/writeable.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/parameter/__init__.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/parameter/factory.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/parameter/parameterparser.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/planet.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/plot/__init__.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/plot/corner.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/plugins/__init__.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/pressure.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/spectrum.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/stellar.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/taurex.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/taurexdefs.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/temperature.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/types.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/util/__init__.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/util/emission.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/util/fitting.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/util/fortran.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/util/geometry.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/util/hdf5.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/util/math.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/util/math_numba.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/util/module.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/util/output.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/util/scattering.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/util/spectrum.py +0 -0
- {taurex-3.2.2 → taurex-3.2.4}/src/taurex/util/util.py +0 -0
|
@@ -143,8 +143,9 @@ class LeeMieContribution(Contribution):
|
|
|
143
143
|
@fitparam(
|
|
144
144
|
param_name="lee_mie_q",
|
|
145
145
|
param_latex=r"$Q_\mathrm{ext}$",
|
|
146
|
+
default_mode="log",
|
|
146
147
|
default_fit=False,
|
|
147
|
-
default_bounds=[-
|
|
148
|
+
default_bounds=[1e-30, 1e6],
|
|
148
149
|
)
|
|
149
150
|
def mieQ(self) -> float: # noqa: N802
|
|
150
151
|
"""Extinction coefficient."""
|
|
@@ -159,7 +160,7 @@ class LeeMieContribution(Contribution):
|
|
|
159
160
|
param_latex=r"$P^{lee}_\mathrm{top}$",
|
|
160
161
|
default_mode="log",
|
|
161
162
|
default_fit=False,
|
|
162
|
-
default_bounds=[-
|
|
163
|
+
default_bounds=[1e-30, 1e6],
|
|
163
164
|
)
|
|
164
165
|
def mieTopPressure(self) -> float: # noqa: N802
|
|
165
166
|
"""Pressure at top of cloud deck in Pa."""
|
|
@@ -175,7 +176,7 @@ class LeeMieContribution(Contribution):
|
|
|
175
176
|
param_latex=r"$P^{lee}_\mathrm{bottom}$",
|
|
176
177
|
default_mode="log",
|
|
177
178
|
default_fit=False,
|
|
178
|
-
default_bounds=[-
|
|
179
|
+
default_bounds=[1e-30, 1e6],
|
|
179
180
|
)
|
|
180
181
|
def mieBottomPressure(self) -> float: # noqa: N802
|
|
181
182
|
"""Pressure at bottom of cloud deck in Pa."""
|
|
@@ -191,7 +192,7 @@ class LeeMieContribution(Contribution):
|
|
|
191
192
|
param_latex=r"$\chi^{lee}_\mathrm{mie}$",
|
|
192
193
|
default_mode="log",
|
|
193
194
|
default_fit=False,
|
|
194
|
-
default_bounds=[-
|
|
195
|
+
default_bounds=[1e-40, 1],
|
|
195
196
|
)
|
|
196
197
|
def mieMixing(self) -> float: # noqa: N802
|
|
197
198
|
"""Mixing ratio in atmosphere."""
|
|
@@ -6,5 +6,7 @@ from .taurexchemistry import TaurexChemistry
|
|
|
6
6
|
from .gas.constantgas import ConstantGas
|
|
7
7
|
from .gas.twolayergas import TwoLayerGas
|
|
8
8
|
from .gas.powergas import PowerGas
|
|
9
|
+
from .gas.customgas import CustomGas
|
|
10
|
+
from .gas.twopointgas import TwoPointGas
|
|
9
11
|
from .filechemistry import ChemistryFile
|
|
10
12
|
from .autochemistry import AutoChemistry
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"""Constant gas profile."""
|
|
2
|
+
import typing as t
|
|
3
|
+
|
|
4
|
+
import numpy as np
|
|
5
|
+
import numpy.typing as npt
|
|
6
|
+
|
|
7
|
+
from taurex.output import OutputGroup
|
|
8
|
+
from taurex.util import molecule_texlabel
|
|
9
|
+
|
|
10
|
+
from .gas import Gas
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class CustomGas(Gas):
|
|
14
|
+
"""Constant gas profile.
|
|
15
|
+
|
|
16
|
+
Molecular abundace is constant at each layer of the
|
|
17
|
+
atmosphere
|
|
18
|
+
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
def __init__(
|
|
22
|
+
self,
|
|
23
|
+
molecule_name: t.Optional[str] = "H2O",
|
|
24
|
+
mix_ratio: npt.NDArray[np.float64] = None,
|
|
25
|
+
) -> None:
|
|
26
|
+
"""Initialize constant gas profile.
|
|
27
|
+
|
|
28
|
+
Parameters
|
|
29
|
+
-----------
|
|
30
|
+
molecule_name : str
|
|
31
|
+
Name of molecule
|
|
32
|
+
|
|
33
|
+
mix_ratio : float
|
|
34
|
+
Mixing ratio of the molecule
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
"""
|
|
38
|
+
super().__init__("CustomGas", molecule_name)
|
|
39
|
+
self._mix_ratio = mix_ratio
|
|
40
|
+
self.add_active_gas_param()
|
|
41
|
+
|
|
42
|
+
@property
|
|
43
|
+
def mixProfile(self) -> npt.NDArray[np.float64]: # noqa: N802
|
|
44
|
+
"""
|
|
45
|
+
|
|
46
|
+
Mixing profile
|
|
47
|
+
|
|
48
|
+
Returns
|
|
49
|
+
-------
|
|
50
|
+
mix: :obj:`array`
|
|
51
|
+
Mix ratio for molecule at each layer
|
|
52
|
+
|
|
53
|
+
"""
|
|
54
|
+
|
|
55
|
+
return self._mix_array
|
|
56
|
+
|
|
57
|
+
def initialize_profile(
|
|
58
|
+
self,
|
|
59
|
+
nlayers: t.Optional[int] = None,
|
|
60
|
+
temperature_profile: t.Optional[npt.NDArray[np.float64]] = None,
|
|
61
|
+
pressure_profile: t.Optional[npt.NDArray[np.float64]] = None,
|
|
62
|
+
altitude_profile: t.Optional[npt.NDArray[np.float64]] = None,
|
|
63
|
+
) -> None:
|
|
64
|
+
"""Initialize the mixing profile.
|
|
65
|
+
|
|
66
|
+
Parameters
|
|
67
|
+
-----------
|
|
68
|
+
nlayers: int
|
|
69
|
+
Number of layers in atmosphere
|
|
70
|
+
temperature_profile: :obj:`array`
|
|
71
|
+
Temperature profile of atmosphere
|
|
72
|
+
pressure_profile: :obj:`array`
|
|
73
|
+
Pressure profile of atmosphere
|
|
74
|
+
altitude_profile: :obj:`array`
|
|
75
|
+
Altitude profile of atmosphere, deprecated
|
|
76
|
+
|
|
77
|
+
"""
|
|
78
|
+
self._mix_array = self._mix_ratio
|
|
79
|
+
|
|
80
|
+
def add_active_gas_param(self) -> None:
|
|
81
|
+
"""Add the mixing ratio as a fitting parameter.
|
|
82
|
+
|
|
83
|
+
Fitting parameter identifier is the molecule name.
|
|
84
|
+
Generates a fitting parameter on the fly by building
|
|
85
|
+
getter and setter functions and passing them to
|
|
86
|
+
:func:`taurex.fitting.fittable.Fittable.add_fittable_param`
|
|
87
|
+
|
|
88
|
+
"""
|
|
89
|
+
|
|
90
|
+
mol_name = self.molecule
|
|
91
|
+
param_name = self.molecule
|
|
92
|
+
param_tex = molecule_texlabel(mol_name)
|
|
93
|
+
|
|
94
|
+
def read_mol(self):
|
|
95
|
+
return self._mix_ratio
|
|
96
|
+
|
|
97
|
+
def write_mol(self, value):
|
|
98
|
+
self._mix_ratio = value
|
|
99
|
+
|
|
100
|
+
read_mol.__doc__ = f"{mol_name} constant mix ratio (VMR)"
|
|
101
|
+
|
|
102
|
+
fget = read_mol
|
|
103
|
+
fset = write_mol
|
|
104
|
+
|
|
105
|
+
bounds = [1.0e-12, 0.1]
|
|
106
|
+
|
|
107
|
+
default_fit = False
|
|
108
|
+
self.add_fittable_param(
|
|
109
|
+
param_name, param_tex, fget, fset, "log", default_fit, bounds
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
def write(self, output: OutputGroup):
|
|
113
|
+
"""Write constant gas profile to output."""
|
|
114
|
+
gas_entry = super().write(output)
|
|
115
|
+
gas_entry.write_scalar("mix_ratio", self._mix_ratio)
|
|
116
|
+
|
|
117
|
+
return gas_entry
|
|
118
|
+
|
|
119
|
+
@classmethod
|
|
120
|
+
def input_keywords(cls) -> t.Tuple[str]:
|
|
121
|
+
return ("custom",)
|
|
@@ -205,13 +205,12 @@ class ClassFactory(Singleton):
|
|
|
205
205
|
# Make sure they're unique
|
|
206
206
|
all_files = set(
|
|
207
207
|
sum(
|
|
208
|
-
[p.glob("*.py") for p in paths],
|
|
208
|
+
[list(p.glob("*.py")) for p in paths],
|
|
209
209
|
[],
|
|
210
210
|
)
|
|
211
211
|
)
|
|
212
|
-
|
|
213
212
|
for f in all_files:
|
|
214
|
-
self.info("Loading extensions from %s", f)
|
|
213
|
+
self.log.info("Loading extensions from %s", f)
|
|
215
214
|
module_name = f.stem
|
|
216
215
|
spec = importlib.util.spec_from_file_location(module_name, f)
|
|
217
216
|
foo = importlib.util.module_from_spec(spec)
|
|
@@ -39,6 +39,11 @@ class Plotter(object):
|
|
|
39
39
|
|
|
40
40
|
if not os.path.exists(self.out_folder):
|
|
41
41
|
os.makedirs(self.out_folder)
|
|
42
|
+
|
|
43
|
+
def find_nearest(self, array, value):
|
|
44
|
+
array = np.asarray(array)
|
|
45
|
+
idx = (np.abs(array - value)).argmin()
|
|
46
|
+
return idx, array[idx]
|
|
42
47
|
|
|
43
48
|
@property
|
|
44
49
|
def num_solutions(self,fd_position='Output'):
|
|
@@ -775,7 +780,7 @@ class Plotter(object):
|
|
|
775
780
|
plt.close()
|
|
776
781
|
|
|
777
782
|
|
|
778
|
-
def plot_fitted_tau(self):
|
|
783
|
+
def plot_fitted_tau(self, wl_min:float=.5, wl_max:float=12.):
|
|
779
784
|
N = self.num_solutions
|
|
780
785
|
for solution_idx, solution_val in self.solution_iter():
|
|
781
786
|
|
|
@@ -784,6 +789,12 @@ class Plotter(object):
|
|
|
784
789
|
|
|
785
790
|
pressure = solution_val['Profiles']['pressure_profile'][:]
|
|
786
791
|
wavelength = solution_val['Spectra']['native_wlgrid'][:]
|
|
792
|
+
|
|
793
|
+
wavelength_right = self.find_nearest(wavelength, wl_min)[0]
|
|
794
|
+
wavelength_left = self.find_nearest(wavelength, wl_max)[0]
|
|
795
|
+
|
|
796
|
+
wavelength = wavelength[wavelength_left:wavelength_right+1]
|
|
797
|
+
contribution = contribution[...,wavelength_left:wavelength_right+1]
|
|
787
798
|
|
|
788
799
|
self._plot_tau(contribution,pressure,wavelength)
|
|
789
800
|
|
|
@@ -795,7 +806,8 @@ class Plotter(object):
|
|
|
795
806
|
grid = plt.GridSpec(1, 4, wspace=0.4, hspace=0.3)
|
|
796
807
|
fig = plt.figure('Contribution function')
|
|
797
808
|
ax1 = plt.subplot(grid[0, :3])
|
|
798
|
-
plt.imshow(contribution, aspect='auto')
|
|
809
|
+
pos = plt.imshow(contribution, aspect='auto')
|
|
810
|
+
plt.colorbar(pos, ax=ax1)
|
|
799
811
|
|
|
800
812
|
### mapping of the pressure array onto the ticks:
|
|
801
813
|
y_labels = np.array([pow(10., p) for p in np.arange(np.ceil(np.log10(np.max(pressure))), np.floor(np.log10(np.min(pressure)))-1.,step=-1)])
|
|
@@ -823,8 +835,8 @@ class Plotter(object):
|
|
|
823
835
|
plt.xticks(x_ticks, x_labels)
|
|
824
836
|
plt.gca().invert_yaxis()
|
|
825
837
|
plt.gca().invert_xaxis()
|
|
826
|
-
plt.xlabel(r"Wavelength
|
|
827
|
-
plt.ylabel("Pressure
|
|
838
|
+
plt.xlabel(r"Wavelength [$\mu$m]")
|
|
839
|
+
plt.ylabel("Pressure [bar]")
|
|
828
840
|
|
|
829
841
|
ax2 = plt.subplot(grid[0, 3])
|
|
830
842
|
|
|
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
|
|
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
|
|
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
|
|
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
|