Exemple #1
0
def test_mapplot_GLDAS_default():  # 16
    filepath = get_path('GLDAS')
    var = ncplot.get_variables(filepath, 'R')[0]  # take the first var
    ncplot.mapplot(filepath, var)
    warnings.warn(
        'Test does not assert output images. Have a look at {}.'.format(
            os.getcwd()))
Exemple #2
0
def test_get_variables():
    filepath = get_path('ISMN_nan')
    exp_result = [
        'R_between_6-ISMN_1-C3S', 'R_between_6-ISMN_2-SMAP',
        'R_between_6-ISMN_3-ASCAT', 'R_between_6-ISMN_4-ESA_CCI_SM_combined',
        'R_between_6-ISMN_5-SMOS'
    ]
    assert ncplot.get_variables(filepath, 'R') == exp_result
Exemple #3
0
def test_mapplot_GLDAS_nan_default(
):  # TODO: find out why it takes 14s to produce the plot.
    filepath = get_path('GLDAS_nan')
    var = ncplot.get_variables(filepath, 'rho')[0]  # take the first var
    ncplot.mapplot(filepath, var)
    warnings.warn(
        'Test does not assert output images. Have a look at {}.'.format(
            os.getcwd()))
Exemple #4
0
def test_mapplot_GLDAS_extent(
):  # TODO: find out why it takes 12s to produce the plot.
    filepath = get_path('GLDAS')
    out_dir = get_path('mapplot')
    out_name = 'mapplot_GLDAS_extent'
    out_type = 'png'
    var = ncplot.get_variables(filepath, 'R')[0]  # take the first var
    ncplot.mapplot(filepath,
                   var,
                   EXTENT_GRID,
                   out_dir,
                   out_name,
                   out_type,
                   map_resolution='50m')
    warnings.warn(
        'Test does not assert output images. Have a look at {}.'.format(
            out_dir))
Exemple #5
0
def test_mapplot_ISMN_extent():
    filepath = get_path('ISMN')
    out_dir = get_path('mapplot')
    out_name = 'mapplot_ISMN_extent'
    out_type = ['png', 'pdf']
    var = ncplot.get_variables(filepath, 'R')[0]  # take the first var
    ncplot.mapplot(filepath,
                   var,
                   EXTENT_SCATTER,
                   out_dir,
                   out_name,
                   out_type,
                   map_resolution='50m',
                   add_us_states=True)
    warnings.warn(
        'Test does not assert output images. Have a look at {}.'.format(
            out_dir))
Exemple #6
0
def test_boxplot_GLDAS_options():
    out_dir = get_path('boxplot')
    filepath = get_path('GLDAS')
    out_name = 'test_boxplot_GLDAS_options'
    variables = ncplot.get_variables(filepath, 'R')[:-1]
    ncplot.boxplot(filepath,
                   variables,
                   out_dir=out_dir,
                   out_name=out_name,
                   out_type=['png', '.svg'],
                   dpi=300,
                   print_stat=False,
                   add_title=False,
                   watermark_pos='bottom')
    warnings.warn(
        'Test does not assert output images. Have a look at {}.'.format(
            out_dir))