Exemplo n.º 1
0
def comparison_plot_renderer(data, variable_options, site_choice, DataResample,
                             start_date, end_date, medianswitch, title, xtitle,
                             ytitle, label_format):

    if not data:
        return ''
    data = data.split(',')

    # Find min year for site
    start_year, end_year = LoadData.get_site_year_range_db(data[1])

    df = load_station_data(data[0], data[1],
                           [start_year, int(data[3])], data[4:])
    if not isinstance(df, pd.DataFrame):
        return ''
    variable_options = data[4:]

    from dataplot.DataTools.AnalysisTools import ComparisonPlots
    # if comparison_tabs == 'week_comp':
    return ComparisonPlots.CompareWeeks(df,
                                        variable_options=variable_options,
                                        site_choice=site_choice,
                                        DataResample=DataResample,
                                        start_date=start_date,
                                        end_date=end_date,
                                        show_median=medianswitch,
                                        title=title,
                                        xtitle=xtitle,
                                        ytitle=ytitle,
                                        label_format=label_format)
Exemplo n.º 2
0
def get_site_minimum_year(site):
    start_year, end_year = LoadData.get_site_year_range_db(site)

    options = [{
        'label': i,
        'value': i
    } for i in range(start_year, end_year + 1)]
    return options
Exemplo n.º 3
0
def fill_maximum_year(site):
    start_year, end_year = LoadData.get_site_year_range_db(site)
    return end_year