Ejemplo n.º 1
0
def test_find_cloud_bases():
    x = np.array([[0, 1, 1, 1],
                  [0, 0, 1, 0],
                  [1, 0, 1, 0],
                  [1, 1, 0, 0],
                  [0, 0, 0, 1]])
    b = np.array([[0, 1, 0, 0],
                  [0, 0, 1, 0],
                  [1, 0, 1, 0],
                  [1, 0, 0, 0],
                  [0, 0, 0, 1]])
    assert_array_almost_equal(atmos.find_cloud_bases(x), b)
Ejemplo n.º 2
0
def _fix_liquid_dominated_radar(obs, falling_from_radar, is_liquid):
    """Radar signals inside liquid clouds are NOT ice if Z is
    increasing in height inside the cloud.
    """
    liquid_bases = atmos.find_cloud_bases(is_liquid)
    liquid_tops = atmos.find_cloud_tops(is_liquid)
    base_indices = np.where(liquid_bases)
    top_indices = np.where(liquid_tops)

    for n, base, _, top in zip(*base_indices, *top_indices):
        z_prof = obs.z[n, :]
        if _is_z_missing_above_liquid(z_prof, top) and _is_z_increasing(
                z_prof, base, top):
            falling_from_radar[n, base:top + 1] = False

    return falling_from_radar