Source code for taurex.data.profiles.temperature.isothermal
"""Isothermal temperature profile."""importtypingastimportnumpyasnpimportnumpy.typingasnptfromtaurex.data.fittableimportfitparamfromtaurex.outputimportOutputGroupfrom.tprofileimportTemperatureProfile
[docs]classIsothermal(TemperatureProfile):"""An isothermal temperature-pressure profile."""def__init__(self,T:t.Optional[float]=1500)->None:# noqa: N803"""Initialize isothermal class Parameters ---------- T : float Isothermal Temperature to set in Kelvin """super().__init__("Isothermal")self._iso_temp=T@fitparam(param_name="T",param_latex="$T$",default_fit=False,default_bounds=[300.0,2000.0],)defisoTemperature(self)->float:# noqa: N802"""Isothermal temperature in Kelvin"""returnself._iso_temp@isoTemperature.setterdefisoTemperature(self,value:float)->None:# noqa: N802self._iso_temp=value@propertydefprofile(self)->npt.NDArray[np.float64]:"""Returns an isothermal temperature profile."""returnnp.full(self.nlayers,self._iso_temp,dtype=np.float64)
[docs]defwrite(self,output:OutputGroup)->OutputGroup:"""Write isothermal temperature profile to output group."""temperature=super().write(output)temperature.write_scalar("T",self._iso_temp)returntemperature
[docs]@classmethoddefinput_keywords(cls)->t.Tuple[str]:"""Return all input keywords."""return("isothermal",)