def test_compute_after_smooth_goddard_2013(pm_da_ds3d, pm_da_control3d): """Test compute_perfect_model works after smoothings.""" pm_da_control3d = smooth_goddard_2013(pm_da_control3d) pm_da_ds3d = smooth_goddard_2013(pm_da_ds3d) actual = compute_perfect_model(pm_da_ds3d, pm_da_control3d) north_atlantic = actual.sel(lat=slice(40, 50), lon=slice(-30, -20)) assert not north_atlantic.isnull().any()
def test_compute_after_smooth_goddard_2013(PM_da_initialized_3d_full, PM_da_control_3d_full): """Test compute_perfect_model works after smoothings.""" PM_da_control_3d_full = smooth_goddard_2013(PM_da_control_3d_full) PM_da_initialized_3d_full = smooth_goddard_2013(PM_da_initialized_3d_full) actual = compute_perfect_model(PM_da_initialized_3d_full, PM_da_control_3d_full) north_atlantic = actual.sel(lat=slice(40, 50), lon=slice(-30, -20)) assert not north_atlantic.isnull().any()
def test_smooth_goddard_2013(PM_da_control_3d_full): """Test whether Goddard 2013 recommendations are fulfilled by smooth_Goddard_2013.""" da = PM_da_control_3d_full actual = smooth_goddard_2013(da) # test that x, y not in dims assert 'x' not in actual.dims assert 'y' not in actual.dims # tests whether nlat, nlon got reduced assert actual.time.size < da.time.size assert actual.lon.size < da.lon.size assert actual.lat.size < da.lat.size