Temperature (taurex.temperature)¶
Base¶
Base temperature class.
- class TemperatureProfile(name: str)[source]¶
Bases:
Fittable,Loggable,Writeable,CitableDefines temperature profile for an atmosphere.
Abstract Class
Must define:
- property averageTemperature: float¶
Average temperature across all layers.
- initialize_profile(planet: Planet | None = None, nlayers: int | None = 100, pressure_profile: ndarray[tuple[int, ...], dtype[_ScalarType_co]] | None = None)[source]¶
Initializes the profile.
- Parameters:
planet (
Planet)nlayers (int) – Number of layers in atmosphere
pressure_profile (
array) – Pressure at each layer of the atmosphere
- property profile: ndarray[tuple[int, ...], dtype[float64]]¶
Temperature profile at each layer.
Must return a temperature profile at each layer of the atmosphere
- Returns:
temperature – Temperature in Kelvin
- Return type:
array
- write(output: OutputGroup) OutputGroup[source]¶
Write temperature profile to output.
Isothermal¶
Isothermal temperature profile.
- class Isothermal(T: float | None = 1500)[source]¶
Bases:
TemperatureProfileAn isothermal temperature-pressure profile.
- property isoTemperature: float¶
Isothermal temperature in Kelvin
- property profile: ndarray[tuple[int, ...], dtype[float64]]¶
Returns an isothermal temperature profile.
- write(output: OutputGroup) OutputGroup[source]¶
Write isothermal temperature profile to output group.
Two-stream approximation (Guillot)¶
Guillot 2010 temperature profile.
- class Guillot2010(T_irr: float | None = 1500, kappa_irr: float | None = 0.01, kappa_v1: float | None = 0.005, kappa_v2: float | None = 0.005, alpha: float | None = 0.5, T_int: float | None = 100)[source]¶
Bases:
TemperatureProfileTP profile from Guillot 2010, A&A, 520, A27 (equation 49).
Using modified 2stream approx. from Line et al. 2012, ApJ, 749,93 (equation 19)
- BIBTEX_ENTRIES = ['\n @article{guillot,\n author = {{Guillot, T.}},\n title = {On the radiative equilibrium of irradiated planetary atmospheres},\n DOI= "10.1051/0004-6361/200913396",\n url= "https://doi.org/10.1051/0004-6361/200913396",\n journal = {A\\&A},\n year = 2010,\n volume = 520,\n pages = "A27",\n month = "",\n }\n ']¶
List of bibtex entries.
- property equilTemperature: float¶
Planet equilibrium temperature
- property internalTemperature: float¶
ratio between kappa_v1 and kappa_v2
- property meanInfraOpacity: float¶
mean infra-red opacity
- property meanOpticalOpacity1: float¶
mean optical opacity one
- property meanOpticalOpacity2: float¶
mean optical opacity two
- property opticalRatio: float¶
ratio between kappa_v1 and kappa_v2.
- property profile: ndarray[tuple[int, ...], dtype[float64]]¶
Returns a guillot temperature temperature profile.
- Returns:
Temperature profile at each layer in Kelvin.
- Return type:
temperature_profile
- write(output: OutputGroup) OutputGroup[source]¶
Write temperature profile to output.
Multi Point¶
Module for NPoint temperature profile.
- exception InvalidTemperatureException[source]¶
Bases:
InvalidModelExceptionException that is called when temperature profile is invalid.
- class NPoint(T_surface: float | None = 1500.0, T_top: float | None = 200.0, P_surface: float | None = None, P_top: float | None = None, temperature_points: _Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes] | None = None, pressure_points: _Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes] | None = None, smoothing_window: int | None = 10, limit_slope: int | None = 9999999)[source]¶
Bases:
TemperatureProfileTemperature profile defined and smoothed by user points.
A temperature profile that is defined at various heights of the atmopshere and then smoothend.
At minimum, temepratures on both the top
T_topand surfaceT_surfacemust be defined. If any intermediate points are given astemperature_pointsthen the same number ofpressure_pointsmust be given as well.A 2-point temperature profile has
len(temperature_points) == 0A 3-point temperature profile haslen(temperature_points) == 1etc.
- check_profile(ppt: _Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], tpt: _Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes])[source]¶
Checks the validity of the temperature profile.
- Parameters:
ppt (array-like) – Pressure points
tpt (array-like) – Temperature points
- Raises:
InvalidTemperatureException – If the temperature profile is invalid
- generate_pressure_fitting_params() None[source]¶
Generates the fitting parameters for the pressure points.
These are given the name
P_point(number)for example, if two extra pressure points are defined between the top and surface then the fitting parameters generated areP_point0andP_point1
- generate_temperature_fitting_params() None[source]¶
Generates the fitting parameters for the temperature points.
These are given the name
T_point(number)for example, if two extra temeprature points are defined between the top and surface then the fitting parameters generated areT_point0andT_point1
- property pressureSurface: float¶
Pressure at planet surface in Pa
- property pressureTop: float¶
Pressure at top of atmosphere in Pa
- property profile: ndarray[tuple[int, ...], dtype[float64]]¶
Returns a smoothed temperature profile.
Computes the temperature profile from the given points and then smooths it using a moving average.
- property temperatureSurface: float¶
Temperature at planet surface in Kelvin
- property temperatureTop: float¶
Temperature at top of atmosphere in Kelvin
- write(output: OutputGroup) OutputGroup[source]¶
Write NPoint temperature profile to output group.
Rodgers¶
Rodgers 2000 temperature profile.
- class Rodgers2000(temperature_layers: _Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes] | None = None, correlation_length: float | None = 5.0, covariance_matrix: ndarray[tuple[int, ...], dtype[float64]] | None = None)[source]¶
Bases:
TemperatureProfileLayer-by-layer temperature introduced in Rodgers et al (2000)
Inverse Methods for Atmospheric Sounding (equation 3.26). Featured in NEMESIS code (Irwin et al., 2008, J. Quant. Spec., 109, 1136 (equation 19) Used in all Barstow et al. papers.
- BIBTEX_ENTRIES = ['\n @MISC{rodger_retrievals,\n author = {{Rodgers}, Clive D.},\n title = "{Inverse Methods for Atmospheric\n Sounding - Theory and Practice}",\n howpublished = {Inverse Methods for Atmospheric Sounding - Theory\n and Practice. Series: Series on Atmospheric Oceanic and Planetary Physics},\n year = "2000",\n month = "Jan",\n doi = {10.1142/9789812813718},\n adsurl = {https://ui.adsabs.harvard.edu/abs/2000SAOPP...2.....R},\n adsnote = {Provided by the SAO/NASA Astrophysics Data System}\n }\n ']¶
List of bibtex entries.
- correlate_temp(cov_mat: ndarray[tuple[int, ...], dtype[float64]]) float64[source]¶
Correlate the temperature profile using the covariance matrix.
- property correlationLength: float¶
Correlation length in scale heights.
- gen_covariance() ndarray[tuple[int, ...], dtype[float64]][source]¶
Generate the covariance matrix if None is supplied.
- generate_temperature_fitting_params() None[source]¶
Generates the temperature fitting parameters
Parameters are generated for each layer of the atmosphere For a 4 layer atmosphere the fitting parameters generated are
T_0,T_1,T_2andT_3
- property profile: ndarray[tuple[int, ...], dtype[float64]]¶
Returns a temperature profile.
- write(output: OutputGroup) OutputGroup[source]¶
Write Rodgers 2000 temperature profile to output group.
Array¶
Temperature profile loaded from array.
- class TemperatureArray(tp_array: _Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes] | None = None, p_points: _Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes] | None = None, reverse: bool | None = False)[source]¶
Bases:
TemperatureProfileTemperature profile loaded from array.
- property profile: ndarray[tuple[int, ...], dtype[float64]]¶
Returns temperature profile.
- Returns:
temperature profile
- Return type:
t_profile
- write(output: OutputGroup) OutputGroup[source]¶
Write temperature profile to output.
File¶
Temperature profile loaded from file.
- class TemperatureFile(filename: str | bytes | PathLike | Path | None = None, skiprows: int | None = 0, temp_col: int | None = 0, press_col: int | None = None, temp_units: str | None = 'K', press_units: str | None = 'Pa', delimiter: str | None = None, reverse: bool | None = False)[source]¶
Bases:
TemperatureArrayA temperature profile read from file.
If pressure is included in file then the temperature profile will be interpolated to the pressure points of the atmosphere.