def test_particle_layer_eval_ckd(mode_ckd, tmpdir, test_particles_dataset, bins): """eval methods return expected values for a scattering-only layer.""" layer = ParticleLayer( dataset=test_particles_dataset, n_layers=1, tau_550=1.0, bottom=0.0 * ureg.km, top=1.0 * ureg.km, ) spectral_config = CKDMeasureSpectralConfig(bin_set="10nm", bins=bins) spectral_ctx = spectral_config.spectral_ctxs()[0] assert np.isclose(layer.eval_sigma_t(spectral_ctx), 1.0 / ureg.km) assert np.isclose(layer.eval_sigma_s(spectral_ctx), 0.8 / ureg.km) assert np.isclose(layer.eval_sigma_a(spectral_ctx), 0.2 / ureg.km) assert np.isclose(layer.eval_albedo(spectral_ctx).magnitude, 0.8) ctx = KernelDictContext(spectral_ctx=spectral_ctx) assert layer.eval_width(ctx) == 12.5 * ureg.km
def test_particle_layer_eval_mono( mode_mono, tmpdir, test_particles_dataset, wavelength ): """eval methods return expected values for a scattering-only layer.""" layer = ParticleLayer( dataset=test_particles_dataset, n_layers=1, tau_550=1.0, bottom=0.0 * ureg.km, top=1.0 * ureg.km, ) spectral_ctx = MonoSpectralContext(wavelength=wavelength) assert np.isclose(layer.eval_sigma_t(spectral_ctx), 1.0 / ureg.km) assert np.isclose(layer.eval_sigma_s(spectral_ctx), 0.8 / ureg.km) assert np.isclose(layer.eval_sigma_a(spectral_ctx), 0.2 / ureg.km) assert np.isclose(layer.eval_albedo(spectral_ctx).magnitude, 0.8) ctx = KernelDictContext(spectral_ctx=spectral_ctx) assert layer.eval_width(ctx) == 12.5 * ureg.km