Ejemplo n.º 1
0
def test_calculate_spectral_width(drizzle_cat_file):
    obj = drizzle.SpectralWidth(drizzle_cat_file)
    width = netCDF4.Dataset(drizzle_cat_file).variables["width"][:]
    v_sigma = netCDF4.Dataset(drizzle_cat_file).variables["v_sigma"][:]
    factor = obj._calc_v_sigma_factor()
    expected = width - factor * v_sigma
    testing.assert_almost_equal(obj._calculate_spectral_width(), expected)
Ejemplo n.º 2
0
def test_calculate_spectral_width(drizzle_cat_file):
    obj = drizzle.SpectralWidth(drizzle_cat_file)
    width = netCDF4.Dataset(drizzle_cat_file).variables['width'][:]
    v_sigma = netCDF4.Dataset(drizzle_cat_file).variables['v_sigma'][:]
    factor = obj._calc_v_sigma_factor()
    compare = width - factor * v_sigma
    testing.assert_almost_equal(obj._calculate_spectral_width(), compare)
Ejemplo n.º 3
0
def test_calc_v_sigma_factor(drizzle_cat_file):
    obj = drizzle.SpectralWidth(drizzle_cat_file)
    height = netCDF4.Dataset(drizzle_cat_file).variables["height"][:]
    uwind = netCDF4.Dataset(drizzle_cat_file).variables["uwind"][:]
    vwind = netCDF4.Dataset(drizzle_cat_file).variables["vwind"][:]
    beam = height * np.deg2rad(0.5)
    wind = utils.l2norm(uwind, vwind)
    a_wind = (wind + beam)**(2 / 3)
    s_wind = (30 * wind + beam)**(2 / 3)
    expected = a_wind / (s_wind - a_wind)
    testing.assert_array_almost_equal(obj._calc_v_sigma_factor(), expected)
Ejemplo n.º 4
0
def class_objects(drizzle_source_file, drizzle_cat_file):
    drizzle_source = drizzle.DrizzleSource(drizzle_source_file)
    drizzle_class = drizzle.DrizzleClassification(drizzle_cat_file)
    spectral_w = drizzle.SpectralWidth(drizzle_cat_file)
    return [drizzle_source, drizzle_class, spectral_w]
Ejemplo n.º 5
0
def test_calc_horizontal_wind(drizzle_cat_file):
    obj = drizzle.SpectralWidth(drizzle_cat_file)
    uwind = netCDF4.Dataset(drizzle_cat_file).variables["uwind"][:]
    vwind = netCDF4.Dataset(drizzle_cat_file).variables["vwind"][:]
    expected = utils.l2norm(uwind, vwind)
    testing.assert_array_almost_equal(obj._calc_horizontal_wind(), expected)
Ejemplo n.º 6
0
def test_calc_beam_divergence(drizzle_cat_file):
    obj = drizzle.SpectralWidth(drizzle_cat_file)
    height = netCDF4.Dataset(drizzle_cat_file).variables["height"][:]
    expected = height * np.deg2rad(0.5)
    testing.assert_almost_equal(obj._calc_beam_divergence(), expected)