def test_grid_to_triple_float32_msg(self): data_asfloat32_msg = data_msg.astype(np.float32) out = grid_to_triple(data_asfloat32_msg, x.astype(np.float32), y.astype(np.float32), msg_py=-99) np.testing.assert_array_equal(out_expected_msg.astype(np.float32), out)
def test_grid_to_triple_float32_nan_2(self): data_asfloat32_nan = data_nan.astype(np.float32) out = grid_to_triple(data_asfloat32_nan, x.astype(np.float32), y.astype(np.float32), msg_py=np.nan) np.testing.assert_array_equal(out_expected_msg.astype(np.float32), out)
def test_grid_to_triple_float64_xr(self): data_xr = xr.DataArray( data, coords={ 'lat': y, 'lon': x, }, dims=['lat', 'lon'], ) out = grid_to_triple(data_xr, x, y) np.testing.assert_array_equal(out_expected, out.values)
def test_grid_to_triple_float32(self): data_asfloat32 = data.astype(np.float32) out = grid_to_triple(data_asfloat32, x.astype(np.float32), y.astype(np.float32)) np.testing.assert_array_equal(out_expected.astype(np.float32), out)
def test_grid_to_triple_float64_msg(self): out = grid_to_triple(data_msg, x, y, msg_py=-99) np.testing.assert_array_equal(out_expected_msg, out.values)
def test_grid_to_triple_float64_nan(self): out = grid_to_triple(data_nan, x, y) np.testing.assert_array_equal(out_expected_msg, out.values)
def test_grid_to_triple_float64_xr_x_y(self): data_xr = xr.DataArray(data) out = grid_to_triple(data_xr, x, y) np.testing.assert_array_equal(out_expected, out.values)