예제 #1
0
 def test_get_fog_cloud_height2(self):
     lwc = LowWaterCloud(1000., 275., 100., 100., 10e-6)
     lwc.init_cloud_layers(100, 10)
     lwp = lwc.get_liquid_water_path()
     cbh = lwc.optimize_cbh(lwc.cbh)
     fbh = lwc.get_fog_base_height()
     self.assertAlmostEqual(round(lwc.lwp, 3), 100)
     self.assertAlmostEqual(round(lwc.maxlwc, 3), 0.494)
     self.assertAlmostEqual(round(fbh, 0), 612)
예제 #2
0
 def test_get_fog_cloud_height2(self):
     lwc = LowWaterCloud(1000., 275., 100., 100., 10e-6)
     lwc.init_cloud_layers(100, 10)
     lwc.get_liquid_water_path()
     np.random.seed(42)
     lwc.optimize_cbh(lwc.cbh, method="basin")
     fbh = lwc.get_fog_base_height()
     self.assertAlmostEqual(lwc.lwp, 100, 3)
     self.assertAlmostEqual(lwc.maxlwc, 0.494, 3)
     self.assertAlmostEqual(fbh, 612, 0)
예제 #3
0
    def test_reset_layers_after_minimisation(self):
        """Test that layers are properly reset after minimisation

        Test for fix for #29
        """
        lwc = LowWaterCloud(1000., 275., 100., 100., 10e-6)

        lwc.optimize_cbh(lwc.cbh, method="brute")
        brl = lwc.layers
        brfb = lwc.get_fog_base_height()

        np.random.seed(42)
        lwc.optimize_cbh(lwc.cbh, method="basin")
        bhl = lwc.layers
        bhfb = lwc.get_fog_base_height()

        np.testing.assert_almost_equal(
            [l.visibility for l in bhl if l.visibility is not None],
            [l.visibility for l in brl if l.visibility is not None], -1)
        self.assertAlmostEqual(brfb, bhfb, 0)
예제 #4
0
 def test_get_fog_cloud_height(self):
     lwc = LowWaterCloud(2000., 275., 400., 100, 10e-6)
     lwc.init_cloud_layers(100, 50)
     fbh = lwc.get_fog_base_height()
     self.assertAlmostEqual(fbh, 125, 0)