Esempio n. 1
0
def test_append_iwc_including_rain(iwc_source_file, iwc_cat_file):
    from cloudnetpy.products.iwc import _append_iwc_including_rain
    ice_class = _IceClassification(iwc_cat_file)
    ice_class.is_ice = np.array([0, 0, 1])
    ice_data = IwcSource(iwc_source_file)
    _append_iwc_including_rain(ice_data, ice_class)
    assert 'iwc_inc_rain' in ice_data.data.keys()
Esempio n. 2
0
def test_find_would_be_ice(falling, cold, melting,  insect, result, iwc_cat_file):
    obj = _IceClassification(iwc_cat_file)
    obj.category_bits['falling'] = falling
    obj.category_bits['cold'] = cold
    obj.category_bits['melting'] = melting
    obj.category_bits['insect'] = insect
    testing.assert_array_equal(obj._find_would_be_ice().data, result)
Esempio n. 3
0
def test_find_uncorrected_ice(is_ice, attenuated, corrected, result,
                              iwc_cat_file):
    obj = _IceClassification(iwc_cat_file)
    obj.quality_bits['attenuated'] = attenuated
    obj.quality_bits['corrected'] = corrected
    obj.is_ice = is_ice
    testing.assert_array_equal(obj._find_uncorrected_ice().data, result)
Esempio n. 4
0
def test_append_iwc(iwc_source_file, iwc_cat_file):
    from cloudnetpy.products.iwc import _append_iwc
    ice_class = _IceClassification(iwc_cat_file)
    ice_class.ice_above_rain = np.array([0, 0, 1])
    ice_data = IwcSource(iwc_source_file)
    ice_data.data['iwc_inc_rain'] = [1, 1, 1]
    _append_iwc(ice_data, ice_class)
    assert 'iwc' in ice_data.data.keys()
Esempio n. 5
0
def test_iwc_error(iwc_source_file, iwc_cat_file):
    from cloudnetpy.products.iwc import _append_iwc_error
    ice_data = IwcSource(iwc_source_file)
    ice_class = _IceClassification(iwc_cat_file)
    ice_class.uncorrected_ice = np.array([1, 0, 1])
    ice_class.is_ice = np.array([0, 0, 1])
    ice_class.ice_above_rain = np.array([1, 1, 0])
    _append_iwc_error(ice_data, ice_class)
    assert 'iwc_error' in ice_data.data.keys()
Esempio n. 6
0
def test_append_iwc_including_rain_indices(iwc_source_file, iwc_cat_file):
    from cloudnetpy.products.iwc import _append_iwc_including_rain
    ice_class = _IceClassification(iwc_cat_file)
    ice_class.is_ice = np.array([0, 0, 1])
    ice_data = IwcSource(iwc_source_file)
    _append_iwc_including_rain(ice_data, ice_class)
    x = ice_data.data['iwc_inc_rain'][:]
    x = x.mask
    assert np.alltrue(x[1:])
Esempio n. 7
0
def test_append_iwc_indices(iwc_source_file, iwc_cat_file):
    from cloudnetpy.products.iwc import _append_iwc
    ice_class = _IceClassification(iwc_cat_file)
    ice_class.ice_above_rain = np.array([0, 0, 1])
    ice_data = IwcSource(iwc_source_file)
    ice_data.data['iwc_inc_rain'] = [1, 1, 1]
    _append_iwc(ice_data, ice_class)
    x = ice_data.data['iwc'][:]
    x = x.mask
    assert np.alltrue(x[:2])
Esempio n. 8
0
def test_find_cold_above_rain(cold, is_rain, melting, result, iwc_cat_file):
    obj = _IceClassification(iwc_cat_file)
    obj.category_bits['cold'] = cold
    obj.category_bits['melting'] = melting
    obj.is_rain = is_rain
    testing.assert_array_equal(obj._find_cold_above_rain().data, result)
Esempio n. 9
0
def test_find_ice_above_rain(is_ice, is_rain, result, iwc_cat_file):
    obj = _IceClassification(iwc_cat_file)
    obj.is_ice = is_ice
    obj.is_rain = is_rain
    testing.assert_array_equal(obj._find_ice_above_rain().data, result)