def test_land_points(self): """Test it returns arrays of zeros if points are land.""" plugin = FallingSnowLevel() sea_points = np.ones((3, 3)) * False gradients, intercepts = plugin.linear_wet_bulb_fit( self.wet_bulb_temperature, self.heights, sea_points) self.assertArrayAlmostEqual(np.zeros((3, 3)), gradients) self.assertArrayAlmostEqual(np.zeros((3, 3)), intercepts)
def test_basic(self): """Test we find the correct gradient and intercepts for simple case""" plugin = FallingSnowLevel() gradients, intercepts = plugin.linear_wet_bulb_fit( self.wet_bulb_temperature, self.heights, self.sea_points) self.assertArrayAlmostEqual(self.expected_gradients, gradients) self.assertArrayAlmostEqual(self.expected_intercepts, intercepts)