示例#1
0
    arbis_matched["TLCar"] = arbis_matched["TLCar"].astype('int64')
    arbis_matched["TLHGV"] = arbis_matched["TLHGV"].astype('int64')

    # Add month of roadwork
    arbis_matched['Month'] = arbis_imported['Von'].dt.strftime('%b')
    months = [
        'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct',
        'Nov', 'Dec'
    ]

    ##################
    ### Congestion ###
    ##################

    plot_congestion_dist([
        "TempMax", "TempAvg", "SpatMax", "SpatAvg", "TempDist", "SpatDist",
        "Coverage", "TLCar", "TLHGV"
    ], arbis_matched, plot_path, file_prefix, save_plot, show_plot)

    plot_congestion_scatter(["TempMax"], ["SpatMax"], arbis_matched, plot_path,
                            file_prefix, save_plot, show_plot)

    plot_congestion_scatter(["TempAvg"], ["SpatAvg"], arbis_matched, plot_path,
                            file_prefix, save_plot, show_plot)

    plot_congestion_scatter(["TempDist"], ["SpatDist"], arbis_matched,
                            plot_path, file_prefix, save_plot, show_plot)

    plot_congestion_scatter(["TLCar"], ["TLHGV"], arbis_matched, plot_path,
                            file_prefix, save_plot, show_plot)

    ##################
    # select temporal outside, 0 - 30
    baysis_selected = baysis_selected.loc[(baysis_selected["TempIL"].isin(
        [-1, 1, 2]))]

    # select spatial before or during
    baysis_selected = baysis_selected.loc[(baysis_selected["SpatGL"].isin(
        [1, 2]))]

    ####################################
    ### Congestion (Before Cleaning) ###
    ####################################

    plot_congestion_dist([
        "TempMax", "TempAvg", "SpatMax", "SpatAvg", "TempDist", "SpatDist",
        "Coverage", "TLCar", "TLHGV"
    ], baysis_selected, plot_path + 'cong_before_clean/', file_prefix,
                         save_plot, show_plot)

    ################
    ### Cleaning ###
    ################

    baysis_selected = baysis_selected.drop(
        baysis_selected[baysis_selected['SpatMax'] > 50000].index)

    ####################################
    ### Congestion (After Cleaning) ###
    ####################################

    plot_congestion_dist([
示例#3
0
    arbis_matched["TimeLossCar"] = arbis_matched["TimeLossCar"].astype('int64')
    arbis_matched["TimeLossHGV"] = arbis_matched["TimeLossHGV"].astype('int64')

    # Add month of roadwork
    arbis_matched['Month'] = arbis_imported['Von'].dt.strftime('%b')
    months = [
        'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct',
        'Nov', 'Dec'
    ]

    ##################
    ### Congestion ###
    ##################

    plot_congestion_dist([
        "TempExMax", "SpatExMax", "TempDist", "SpatDist", "Coverage",
        "TimeLossCar", "TimeLossHGV"
    ], arbis_matched, plot_path, file_prefix, save_plot, show_plot)

    plot_congestion_scatter(["TempExMax"], ["SpatExMax"], arbis_matched,
                            plot_path, file_prefix, save_plot, show_plot)

    plot_congestion_scatter(["TempDist"], ["SpatDist"], arbis_matched,
                            plot_path, file_prefix, save_plot, show_plot)

    plot_congestion_scatter(["TimeLossCar"], ["TimeLossHGV"], arbis_matched,
                            plot_path, file_prefix, save_plot, show_plot)

    locators = [
        "temporalGlobalLoc", "spatialGlobalLoc", "temporalInternalLoc",
        "spatialInternalLoc"
    ]