Esempio n. 1
0
def generate_all_plots(withSyntheticData=True):

    ts, bnn, ts_sorted, Bundeslaender_sorted, dates, datacolumns = dataMangling.dataMangled(
        withSynthetic=withSyntheticData)
    print()

    print("Plotting takes a bit of time. Patience please. Thanks.")
    done = dataPlotting.plot_all_Bundeslaender(ts,
                                               bnn,
                                               dates,
                                               datacolumns,
                                               ifPrint=False)
    print("plot_all_Bundeslaender: %d items" % len(done))

    listOfAGSs = ts["AGS"].tolist()
    print("Plotting %d images, for each Kreis. Patience please: " %
          len(listOfAGSs))
    done = dataPlotting.plot_Kreise(ts,
                                    bnn,
                                    dates,
                                    datacolumns,
                                    listOfAGSs,
                                    ifPrint=False)
    print("plot_Kreise done: %d items" % len(done))
    print()

    return True
Esempio n. 2
0
def generate_all_pages(withSyntheticData=True):

    ts, bnn, ts_sorted, Bundeslaender_sorted, dates, datacolumns = dataMangling.dataMangled(
        withSynthetic=withSyntheticData)
    print()

    distances = districtDistances.load_distances()
    cmap = dataTable.colormap()

    haupt = dataFiles.load_master_sheet_haupt(
        timestamp="")  # timestamp="" means newest
    print()
    Bundeslaender_filenames = dataPages.Bundeslaender_alle(
        Bundeslaender_sorted,
        ts,
        ts_sorted,
        datacolumns,
        bnn,
        distances,
        cmap,
        km=50,
        haupt=haupt)
    print(Bundeslaender_filenames)

    fn = dataPages.Deutschland(Bundeslaender_sorted, datacolumns, cmap,
                               ts_sorted, bnn)
    print("\n" + fn)

    return True
Esempio n. 3
0
def generate_hotspot_files():

    ts, bnn, ts_sorted, Bundeslaender_sorted, dates, datacolumns = dataMangling.dataMangled(
        ifPrint=False)
    distances = districtDistances.load_distances()
    print(
        "50 km, relative threshold; or absolute threshold, and not already among relative threshold:"
    )
    for AGS in (5558, 16072, 9163, 16076, 9473, 9263, 9278, 8231, 4011, 5382,
                9362, 9478, 5370, 3459, 9463, 9376, 9475, 5554, 8231, 4012,
                3352, 16052, 9473, 7315, 3159, 9771, 5754, 3361, 15003, 5570,
                3103, 6632, 3458, 3401, 5170, 5111, 5915, 5112, 9188, 9279,
                7334, 9173, 5366, 5158, 7312, 11000, 5112, 3241, 9162, 5913,
                4011, 5315, 6412, 9761, 5958, 16055, 1051, 5122, 3460, 8128,
                7232, 5113, 2000, 5911, 8136, 5562):
        neighbour_districts_table_page(AGS=AGS,
                                       distances=distances,
                                       km=50,
                                       bnn=bnn)

    print("\n100 km:")
    for AGS in (5754, ):
        neighbour_districts_table_page(AGS=AGS,
                                       distances=distances,
                                       km=100,
                                       bnn=bnn)
    print("\n150 km")
    for AGS in ():
        neighbour_districts_table_page(AGS=AGS,
                                       distances=distances,
                                       km=150,
                                       bnn=bnn)
Esempio n. 4
0
def loadAndShowSomeExtremeValues():
    print("\n show some insights\n")
    ts, bnn, ts_sorted, Bundeslaender_sorted, dates, datacolumns = dataMangling.dataMangled(
        withSynthetic=True)
    # print (ts_sorted.columns)

    showSomeExtremeValues(ts_sorted, datacolumns)
    showBundeslaenderRanked(Bundeslaender_sorted, datacolumns)
Esempio n. 5
0
        filenames.append(filename)
        population += pop_BL
        if ifPrint:
            print(title, filename)
        done.append((title, filename))
    print("\nTotal population covered:", population)
    if ifPrint:
        print("%d filenames written: %s" % (len(filenames), filenames))
    return done


if __name__ == '__main__':

    # ts, bnn = dataFiles.data(withSynthetic=True)
    # dates = dataMangling.dates_list(ts)
    ts, bnn, ts_sorted, Bundeslaender_sorted, dates, datacolumns = dataMangling.dataMangled(
        withSynthetic=True)

    examples = True
    if examples:
        test_plot_Kreis(ts, bnn, dates, datacolumns)
        test_plot_Bundesland(ts, bnn, dates, datacolumns)
        test_plot_Bundesland(ts,
                             bnn,
                             dates,
                             datacolumns,
                             Bundesland="Deutschland")

    longrunner = True
    if longrunner:
        plot_Kreise(ts, bnn, dates, datacolumns, ts["AGS"].tolist())
        plot_all_Bundeslaender(ts, bnn, dates, datacolumns)
Esempio n. 6
0
             'green': ((0.0, 0.0, 1.0),
                       (0.5, 0.0, 0.0),
                       (1.0, 0.0, 0.0))}
    cmap = mcolors.LinearSegmentedColormap('my_colormap', cdict, 100)
    """
    # cmap = matplotlib.colors.LinearSegmentedColormap.from_list("", ["green","yellow","red"])
    cmap = matplotlib.colors.LinearSegmentedColormap.from_list(
        "", ["green", "yellow", "red"])

    cmap.set_bad("white")
    return cmap


if __name__ == '__main__':

    ts, bnn, ts_sorted, Bundeslaender_sorted, dates, datacolumns = dataMangling.dataMangled(
    )

    AGS = 1001
    AGS = 5370
    print(ts_sorted["centerday"][AGS])

    cmap = colormap()

    print(toHTMLRow(ts_sorted, AGS, datacolumns, cmap, labels=["%s" % AGS]))

    district_AGSs = [1001, 1002, 5370, 9377]
    district_AGSs = ts_sorted.index.tolist()

    distances = districtDistances.load_distances()
    print(
        Districts_to_HTML_table(ts_sorted,