def test_triple_to_grid_float32_msg_99(self): out = triple_to_grid(data_msg_99.astype(np.float32), x_in.astype(np.float32), y_in.astype(np.float32), x_out.astype(np.float32), y_out.astype(np.float32), missing_value=-99) np.testing.assert_array_almost_equal(out_expected_msg_99, out.values)
def test_triple_to_grid_float32_distmx(self): out = triple_to_grid(data.astype(np.float32), x_in.astype(np.float32), y_in.astype(np.float32), x_out.astype(np.float32), y_out.astype(np.float32), distmx=distmx) np.testing.assert_array_equal(out_expected_distmx.astype(np.float32), out.values)
def test_triple_to_grid_float64_msg_99(self): out = triple_to_grid(data_msg_99, x_in, y_in, x_out, y_out, missing_value=-99) np.testing.assert_array_equal(out_expected_msg_99, out.values)
def test_triple_to_grid_float64_distmx_msg_nan(self): out = triple_to_grid(data_msg_nan, x_in, y_in, x_out, y_out, missing_value=np.nan, distmx=distmx) np.testing.assert_array_equal(out_expected_distmx_msg_nan, out.values)
def test_triple_to_grid_float32_distmx_msg_nan(self): out = triple_to_grid(data_msg_nan.astype(np.float32), x_in.astype(np.float32), y_in.astype(np.float32), x_out.astype(np.float32), y_out.astype(np.float32), missing_value=np.nan, distmx=distmx) np.testing.assert_array_equal( out_expected_distmx_msg_nan.astype(np.float32), out.values.astype(np.float32))
def test_triple_to_grid_float64(self): out = triple_to_grid(data, x_in, y_in, x_out, y_out) np.testing.assert_array_equal(out_expected, out.values)
def test_triple_to_grid_float64_xr(self): out = triple_to_grid(xr.DataArray(data), xr.DataArray(x_in), xr.DataArray(y_in), xr.DataArray(x_out), xr.DataArray(y_out)) np.testing.assert_array_equal(out_expected, out.values)