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.
Files changed (148) hide show
  1. {taurex-3.2.2 → taurex-3.2.4}/PKG-INFO +1 -1
  2. {taurex-3.2.2 → taurex-3.2.4}/pyproject.toml +1 -1
  3. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/contributions/leemie.py +5 -4
  4. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/chemistry/__init__.py +2 -0
  5. taurex-3.2.4/src/taurex/data/profiles/chemistry/gas/customgas.py +121 -0
  6. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/parameter/classfactory.py +2 -3
  7. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/plot/plotter.py +16 -4
  8. {taurex-3.2.2 → taurex-3.2.4}/LICENSE +0 -0
  9. {taurex-3.2.2 → taurex-3.2.4}/README.md +0 -0
  10. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/__init__.py +0 -0
  11. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/_citation.py +0 -0
  12. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/_version.py +0 -0
  13. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/binning/__init__.py +0 -0
  14. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/binning/binner.py +0 -0
  15. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/binning/fluxbinner.py +0 -0
  16. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/binning/lightcurvebinner.py +0 -0
  17. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/binning/nativebinner.py +0 -0
  18. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/binning/simplebinner.py +0 -0
  19. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/cache/__init__.py +0 -0
  20. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/cache/ciaacache.py +0 -0
  21. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/cache/globalcache.py +0 -0
  22. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/cache/ktablecache.py +0 -0
  23. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/cache/opacitycache.py +0 -0
  24. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/cache/singleton.py +0 -0
  25. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/chemistry.py +0 -0
  26. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/cia/__init__.py +0 -0
  27. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/cia/cia.py +0 -0
  28. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/cia/hitrancia.py +0 -0
  29. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/cia/picklecia.py +0 -0
  30. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/constants.py +0 -0
  31. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/contributions/__init__.py +0 -0
  32. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/contributions/absorption.py +0 -0
  33. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/contributions/cia.py +0 -0
  34. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/contributions/contribution.py +0 -0
  35. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/contributions/flatmie.py +0 -0
  36. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/contributions/hm.py +0 -0
  37. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/contributions/rayleigh.py +0 -0
  38. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/contributions/simpleclouds.py +0 -0
  39. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/core/__init__.py +0 -0
  40. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/core/priors.py +0 -0
  41. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/__init__.py +0 -0
  42. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/citation.py +0 -0
  43. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/fittable.py +0 -0
  44. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/planet.py +0 -0
  45. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/__init__.py +0 -0
  46. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/chemistry/autochemistry.py +0 -0
  47. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/chemistry/chemistry.py +0 -0
  48. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/chemistry/filechemistry.py +0 -0
  49. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/chemistry/gas/__init__.py +0 -0
  50. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/chemistry/gas/arraygas.py +0 -0
  51. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/chemistry/gas/constantgas.py +0 -0
  52. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/chemistry/gas/gas.py +0 -0
  53. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/chemistry/gas/powergas.py +0 -0
  54. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/chemistry/gas/twolayergas.py +0 -0
  55. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/chemistry/gas/twopointgas.py +0 -0
  56. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/chemistry/taurexchemistry.py +0 -0
  57. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/pressure/__init__.py +0 -0
  58. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/pressure/arraypressure.py +0 -0
  59. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/pressure/filepressure.py +0 -0
  60. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/pressure/pressureprofile.py +0 -0
  61. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/temperature/__init__.py +0 -0
  62. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/temperature/file.py +0 -0
  63. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/temperature/guillot.py +0 -0
  64. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/temperature/isothermal.py +0 -0
  65. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/temperature/npoint.py +0 -0
  66. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/temperature/rodgers.py +0 -0
  67. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/temperature/temparray.py +0 -0
  68. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/profiles/temperature/tprofile.py +0 -0
  69. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/spectrum/__init__.py +0 -0
  70. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/spectrum/array.py +0 -0
  71. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/spectrum/iraclis.py +0 -0
  72. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/spectrum/lightcurve.py +0 -0
  73. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/spectrum/observed.py +0 -0
  74. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/spectrum/spectrum.py +0 -0
  75. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/spectrum/taurex.py +0 -0
  76. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/stellar/__init__.py +0 -0
  77. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/stellar/phoenix.py +0 -0
  78. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/data/stellar/star.py +0 -0
  79. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/exceptions.py +0 -0
  80. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/instruments/__init__.py +0 -0
  81. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/instruments/instrument.py +0 -0
  82. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/instruments/instrumentfile.py +0 -0
  83. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/instruments/snr.py +0 -0
  84. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/log/__init__.py +0 -0
  85. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/log/logger.py +0 -0
  86. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/mixin/__init__.py +0 -0
  87. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/mixin/core.py +0 -0
  88. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/mixin/mixins.py +0 -0
  89. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/model/__init__.py +0 -0
  90. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/model/directimage.py +0 -0
  91. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/model/emission.py +0 -0
  92. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/model/lightcurve/__init__.py +0 -0
  93. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/model/lightcurve/lightcurve.py +0 -0
  94. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/model/lightcurve/lightcurvedata.py +0 -0
  95. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/model/model.py +0 -0
  96. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/model/simplemodel.py +0 -0
  97. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/model/transmission.py +0 -0
  98. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/mpi.py +0 -0
  99. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/opacity/__init__.py +0 -0
  100. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/opacity/exotransmit.py +0 -0
  101. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/opacity/fakeopacity.py +0 -0
  102. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/opacity/hdf5opacity.py +0 -0
  103. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/opacity/interpolateopacity.py +0 -0
  104. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/opacity/ktables/__init__.py +0 -0
  105. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/opacity/ktables/hdfktable.py +0 -0
  106. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/opacity/ktables/ktable.py +0 -0
  107. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/opacity/ktables/nemesisktables.py +0 -0
  108. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/opacity/ktables/picklektable.py +0 -0
  109. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/opacity/opacity.py +0 -0
  110. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/opacity/pickleopacity.py +0 -0
  111. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/opacity/radisopacity.py +0 -0
  112. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/optimizer/__init__.py +0 -0
  113. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/optimizer/dypolychord.py +0 -0
  114. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/optimizer/multinest.py +0 -0
  115. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/optimizer/nestle.py +0 -0
  116. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/optimizer/optimizer.py +0 -0
  117. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/optimizer/polychord.py +0 -0
  118. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/output/__init__.py +0 -0
  119. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/output/hdf5.py +0 -0
  120. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/output/output.py +0 -0
  121. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/output/writeable.py +0 -0
  122. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/parameter/__init__.py +0 -0
  123. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/parameter/factory.py +0 -0
  124. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/parameter/parameterparser.py +0 -0
  125. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/planet.py +0 -0
  126. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/plot/__init__.py +0 -0
  127. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/plot/corner.py +0 -0
  128. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/plugins/__init__.py +0 -0
  129. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/pressure.py +0 -0
  130. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/spectrum.py +0 -0
  131. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/stellar.py +0 -0
  132. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/taurex.py +0 -0
  133. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/taurexdefs.py +0 -0
  134. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/temperature.py +0 -0
  135. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/types.py +0 -0
  136. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/util/__init__.py +0 -0
  137. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/util/emission.py +0 -0
  138. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/util/fitting.py +0 -0
  139. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/util/fortran.py +0 -0
  140. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/util/geometry.py +0 -0
  141. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/util/hdf5.py +0 -0
  142. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/util/math.py +0 -0
  143. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/util/math_numba.py +0 -0
  144. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/util/module.py +0 -0
  145. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/util/output.py +0 -0
  146. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/util/scattering.py +0 -0
  147. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/util/spectrum.py +0 -0
  148. {taurex-3.2.2 → taurex-3.2.4}/src/taurex/util/util.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: taurex
3
- Version: 3.2.2
3
+ Version: 3.2.4
4
4
  Summary: TauREx3
5
5
  Home-page: https://github.com/ahmed-f-alrefaie/taurex3
6
6
  License: BSDv3
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "taurex"
3
- version = "3.2.2"
3
+ version = "3.2.4"
4
4
  description = "TauREx3"
5
5
  authors = ["Ahmed Faris Al-Refaie <ahmed.al-refaie.12@ucl.ac.uk>"]
6
6
  license = "BSDv3"
@@ -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=[-10, 1],
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=[-1, 1],
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=[-1, 1],
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=[-1, 1],
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 ($\mu$m)")
827
- plt.ylabel("Pressure (Bar)")
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