Ejemplo n.º 1
0
def test_get_model_heights(fake_model_file):
    obj = model.Model(str(fake_model_file), ALT_SITE)
    assert_array_equal(
        obj.model_heights,
        ALT_SITE
        + np.array([[1000, 2000, 3000, 4000], [1000, 2000, 3000, 4000], [1000, 2000, 3000, 4000]]),
    )
Ejemplo n.º 2
0
def test_interpolate_to_common_height(fake_model_file):
    obj = model.Model(str(fake_model_file), ALT_SITE)
    radar_wl_band = 0
    obj.interpolate_to_common_height(radar_wl_band)
    for key in ('uwind', 'vwind', 'q', 'temperature', 'pressure', 'rh',
                'gas_atten', 'specific_gas_atten',
                'specific_saturated_gas_atten', 'specific_liquid_atten'):
        assert key in obj.data_sparse
Ejemplo n.º 3
0
def test_interpolate_to_grid(fake_model_file):
    obj = model.Model(str(fake_model_file), ALT_SITE)
    radar_wl_band = 0
    obj.interpolate_to_common_height(radar_wl_band)
    time_grid = np.array([1, 3])
    height_grid = np.array([1, 3])
    obj.interpolate_to_grid(time_grid, height_grid)
    assert_array_equal(obj.height, height_grid)
    assert hasattr(obj, 'data_dense')
Ejemplo n.º 4
0
def test_interpolate_to_common_height(fake_model_file):
    obj = model.Model(str(fake_model_file), ALT_SITE)
    radar_wl_band = 0
    obj.interpolate_to_common_height(radar_wl_band)
    for key in (
        "uwind",
        "vwind",
        "q",
        "temperature",
        "pressure",
        "rh",
        "gas_atten",
        "specific_gas_atten",
        "specific_saturated_gas_atten",
        "specific_liquid_atten",
    ):
        assert key in obj.data_sparse
Ejemplo n.º 5
0
def test_mean_height(fake_model_file):
    obj = model.Model(str(fake_model_file), ALT_SITE)
    assert_array_equal(obj.mean_height,
                       ALT_SITE + np.array([1000, 2000, 3000, 4000]))