atra.stats package

Submodules

atra.stats.air_water_vulnerability_stats module

Sum max/min total flow exposed under hazard scenarios at air and water network nodes

join_hazards(nodes_with_flows_df, hazards_df)[source]
main()[source]
read_hazards(hazard_file)[source]
summarise(nodes_with_hazards_df, id_columns, sort_column, mode)[source]

atra.stats.boundary_hazard_percentages module

Summarise network-hazard intersections per-boundary (district, commune or province)

Purpose

Collect network-hazard intersection attributes
  • Combine with boundary Polygons to collect network-boundary intersection attributes
  • Write final results to an Excel sheet

Input data requirements

  1. Correct paths to all files and correct input parameters
  2. Shapefiles of network-hazard intersections results with attributes:
    • edge_id or node_id - String/Integer/Float Edge ID or Node ID of network
    • length - Float length of edge intersecting with hazards
    • geometry - Shapely geometry of edges as LineString or nodes as Points
  3. Shapefile of administrative boundaries of Argentina with attributes:
    • province_i - String/Integer ID of Province
    • pro_name_e - String name of Province in English
    • district_i - String/Integer ID of District
    • dis_name_e - String name of District in English
    • commune_id - String/Integer ID of Commune
    • name_eng - String name of Commune in English
    • geometry - Shapely geometry of boundary Polygon

Results

  1. Excel sheet of network-hazard-boundary intersection with attributes:
    • edge_id/node_id - String name of intersecting edge ID or node ID
    • length - Float length of intersection of edge LineString and hazard Polygon: Only for edges
    • province_id - String/Integer ID of Province
    • province_name - String name of Province in English
    • district_id - String/Integer ID of District
    • district_name - String name of District in English
    • commune_id - String/Integer ID of Commune
    • commune_name - String name of Commune in English
main()[source]

Summarise intersections

  1. Specify the paths from where you to read and write:
    • Input data
    • Intermediate calcuations data
    • Output results
  2. Supply input data and parameters
    • Names of the three Provinces - List of string types
    • Names of modes - List of strings
    • Names of output modes - List of strings
    • Names of hazard bands - List of integers
    • Names of hazard thresholds - List of integers
    • Condition ‘Yes’ or ‘No’ is the users wants to process results
  3. Give the paths to the input data files:
    • Commune boundary and stats data shapefile
    • Hazard datasets description Excel file
    • String name of sheet in hazard datasets description Excel file
  4. Specify the output files and paths to be created

atra.stats.flow_senstivities module

Summarise hazard data

Get OD data and process it

main()[source]
nodes_flows_from_edges(edge_flow_file, nodes_name_file, nodes_name_column, flow_columns)[source]

atra.stats.network_boundary_stats module

atra.stats.network_failure_stats module

Summarise length of edges/number of nodes within each boundary (commune, district, province)

Purpose

Collect network attributes
  • Combine with boundary Polygons to collect network-boundary intersection attributes
  • Write final results to an Excel sheet

Input data requirements

  1. Correct paths to all files and correct input parameters
  2. Shapefiles of networks with attributes:
    • edge_id or node_id - String/Integer/Float Edge ID or Node ID of network
    • length - Float length of edge intersecting with hazards
    • geometry - Shapely geometry of edges as LineString or nodes as Points
  3. Shapefile of administrative boundaries of Argentina with attributes:
    • province_i - String/Integer ID of Province
    • pro_name_e - String name of Province in English
    • district_i - String/Integer ID of District
    • dis_name_e - String name of District in English
    • commune_id - String/Integer ID of Commune
    • name_eng - String name of Commune in English
    • geometry - Shapely geometry of boundary Polygon

Results

  1. Excel sheet of network-hazard-boundary intersection with attributes:
    • edge_id/node_id - String name of intersecting edge ID or node ID
    • length - Float length of intersection of edge LineString and hazard Polygon: Only for edges
    • province_id - String/Integer ID of Province
    • province_name - String name of Province in English
    • district_id - String/Integer ID of District
    • district_name - String name of District in English
    • commune_id - String/Integer ID of Commune
    • commune_name - String name of Commune in English
change_matrix(risk_dataframe, value_threshold, change_threshold)[source]
main()[source]

Summarise

  1. Specify the paths from where you to read and write:
    • Input data
    • Intermediate calcuations data
    • Output results
  2. Supply input data and parameters
    • Names of the three Provinces - List of string types
    • Names of modes - List of strings
    • Names of output modes - List of strings
    • Names of hazard bands - List of integers
    • Names of hazard thresholds - List of integers
    • Condition ‘Yes’ or ‘No’ is the users wants to process results
  3. Give the paths to the input data files:
    • Commune boundary and stats data shapefile
    • String name of sheet in hazard datasets description Excel file
  4. Specify the output files and paths to be created
risk_results_reorganise(risk_dataframe, id_column)[source]
risk_results_reorganise_climate_outlooks(risk_dataframe, id_column)[source]

atra.stats.network_hazard_stats module

Summarise per-hazard total intersections (for the whole system)

Purpose

Collect network-hazard intersection attributes
  • Combine with boundary Polygons to collect network-boundary intersection attributes
  • Write final results to an Excel sheet

Input data requirements

  1. Correct paths to all files and correct input parameters
  2. Shapefiles of network-hazard intersections results with attributes:
    • edge_id or node_id - String/Integer/Float Edge ID or Node ID of network
    • length - Float length of edge intersecting with hazards
    • geometry - Shapely geometry of edges as LineString or nodes as Points
  3. Shapefile of administrative boundaries of Argentina with attributes:
    • province_i - String/Integer ID of Province
    • pro_name_e - String name of Province in English
    • district_i - String/Integer ID of District
    • dis_name_e - String name of District in English
    • commune_id - String/Integer ID of Commune
    • name_eng - String name of Commune in English
    • geometry - Shapely geometry of boundary Polygon

Results

  1. Excel sheet of network-hazard-boundary intersection with attributes:
    • edge_id/node_id - String name of intersecting edge ID or node ID
    • length - Float length of intersection of edge LineString and hazard Polygon: Only for edges
    • province_id - String/Integer ID of Province
    • province_name - String name of Province in English
    • district_id - String/Integer ID of District
    • district_name - String name of District in English
    • commune_id - String/Integer ID of Commune
    • commune_name - String name of Commune in English
hazard_data_summary(hazard_network_dataframe, network_dataframe)[source]
main()[source]

Summarise

  1. Specify the paths from where you to read and write:
    • Input data
    • Intermediate calcuations data
    • Output results
  2. Supply input data and parameters
    • Names of the three Provinces - List of string types
    • Names of modes - List of strings
    • Names of output modes - List of strings
    • Names of hazard bands - List of integers
    • Names of hazard thresholds - List of integers
    • Condition ‘Yes’ or ‘No’ is the users wants to process results
  3. Give the paths to the input data files:
    • Commune boundary and stats data shapefile
    • Hazard datasets description Excel file
    • String name of sheet in hazard datasets description Excel file
  4. Specify the output files and paths to be created

atra.stats.network_stats module

Summarise length of edges/number of nodes within each boundary (commune, district, province)

Purpose

Collect network attributes
  • Combine with boundary Polygons to collect network-boundary intersection attributes
  • Write final results to an Excel sheet

Input data requirements

  1. Correct paths to all files and correct input parameters
  2. Shapefiles of networks with attributes:
    • edge_id or node_id - String/Integer/Float Edge ID or Node ID of network
    • length - Float length of edge intersecting with hazards
    • geometry - Shapely geometry of edges as LineString or nodes as Points
  3. Shapefile of administrative boundaries of Argentina with attributes:
    • province_i - String/Integer ID of Province
    • pro_name_e - String name of Province in English
    • district_i - String/Integer ID of District
    • dis_name_e - String name of District in English
    • commune_id - String/Integer ID of Commune
    • name_eng - String name of Commune in English
    • geometry - Shapely geometry of boundary Polygon

Results

  1. Excel sheet of network-hazard-boundary intersection with attributes:
    • edge_id/node_id - String name of intersecting edge ID or node ID
    • length - Float length of intersection of edge LineString and hazard Polygon: Only for edges
    • province_id - String/Integer ID of Province
    • province_name - String name of Province in English
    • district_id - String/Integer ID of District
    • district_name - String name of District in English
    • commune_id - String/Integer ID of Commune
    • commune_name - String name of Commune in English
main()[source]

Summarise

  1. Specify the paths from where you to read and write:
    • Input data
    • Intermediate calcuations data
    • Output results
  2. Supply input data and parameters
    • Names of the three Provinces - List of string types
    • Names of modes - List of strings
    • Names of output modes - List of strings
    • Names of hazard bands - List of integers
    • Names of hazard thresholds - List of integers
    • Condition ‘Yes’ or ‘No’ is the users wants to process results
  3. Give the paths to the input data files:
    • Commune boundary and stats data shapefile
    • String name of sheet in hazard datasets description Excel file
  4. Specify the output files and paths to be created