n_user_levels) # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Make misc variables # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # New: I split the old "control" classes into additional classes that I think # are more accurately named and grouped. I think many of these variables in # DISORT are horribly named. For clarity, I included the "DISORT" name as the # variable name, and the name I prefer as the property # (i.e. fisot = isotropic_flux). There's really no reason to define any of these # variables here---you can just put them directly into the disort call---but I # thought it might be helpful. # Semi-new: another note, that many of these variables take a boolean or float # value. I made them optional, and use default values that disort_mulit uses incident_flux = IncidentFlux() fbeam = incident_flux.beam_flux fisot = incident_flux.isotropic_flux te = ThermalEmission() plank = te.thermal_emission btemp = te.bottom_temperature ttemp = te.top_temperature temis = te.top_emissivity mb = ModelBehavior() accur = mb.accuracy deltamplus = mb.delta_m_plus dopseudosphere = mb.do_pseudo_sphere header = mb.header ibcnd = mb.incidence_beam_conditions
def test_isotropic_flux_defaults_to_0(self) -> None: self.assertEqual(0, IncidentFlux().isotropic_flux)
def test_isotropic_flux_is_read_only(self) -> None: incidence = IncidentFlux() with self.assertRaises(AttributeError): incidence.isotropic_flux = 0
def test_beam_flux_defaults_to_pi(self) -> None: self.assertEqual(np.pi, IncidentFlux().beam_flux)
def test_isotropic_flux_is_unchanged(self) -> None: incidence = IncidentFlux(isotropic_flux=10.0) self.assertEqual(10.0, incidence.isotropic_flux)
def test_beam_flux_is_unchanged(self) -> None: incidence = IncidentFlux(beam_flux=2.7564) self.assertEqual(2.7564, incidence.beam_flux)
def test_ndarray_isotropic_flux_raises_type_error(self) -> None: with self.assertRaises(TypeError): IncidentFlux(isotropic_flux=self.array_fluxes)
def test_str_isotropic_flux_raises_type_error(self) -> None: with self.assertRaises(TypeError): IncidentFlux(isotropic_flux='foo')
def test_int_isotropic_flux_raises_no_error(self) -> None: IncidentFlux(isotropic_flux=3)
def test_int_beam_flux_raises_no_error(self) -> None: IncidentFlux(beam_flux=3)