Skip to content
This repository was archived by the owner on Jan 18, 2023. It is now read-only.

Probability Count Summary

Kelvin edited this page May 20, 2021 · 13 revisions

Probability Count-Summary Method

probability.get_count_summary(
    search_items, 
    csv=False, 
    output_dir='/output'
)

Delivers the total count of locations with flood risk corresponding with the property broken down by depth threshold, return period and year.

Returns an array of ProbabilityCountSummary product for the given property IDs. Only property IDs are accepted. Optionally creates a csv file.

Arguments:

  • search_items: list/file of SearchItems, property parcels to retrieve probability count-summary for.
  • csv: bool, whether to create a CSV for the retrieved data.
  • output_dir: string, location to output the created CSV (if csv is True).

Example (Command Line):

Call probability.get_count_summary on a list with 2 FSIDs

python -m firststreet -p probability.get_count_summary -s 190836953;392804911

Call probability.get_count_summary on a lat/lng or address

python -m firststreet -p probability.get_count_summary -s 37.16314,-76.55782;38.50303,-106.72863 -l property
python -m firststreet -p probability.get_count_summary -s "247 Water Street, New York, New York";"135 East 46th Street New York, New York" -l property

Call probability.get_count_summary on a file of SearchItems

python -m firststreet -p probability.get_count_summary -s sample_property.txt

Example (Python File):

# Contents of sample.py
# Create a `FirstStreet` object.  
import firststreet
fs = firststreet.FirstStreet("api-key")

# Call probability.get_count_summary on a list with 2 property FSIDs
probability_count_summary = fs.probability.get_count_summary(search_items=[190836953, 193139123])

# Call probability.get_count_summary on a lat/lng or address
probability_count_summary = fs.probability.get_count_summary(search_items=[(37.16314,-76.55782)], csv=True)
probability_count_summary = fs.probability.get_count_summary(search_items=["247 Water Street, New York, New York"], csv=True)

# Call probability.get_count_summary on a file of SearchItems
probability_count_summary = fs.probability.get_count_summary(search_items="sample_property.txt", csv=True)

Probability Count-Summary Objects

ProbabilityCountSummary Object

Key Type Description Example
fsid str First Street ID (FSID) is a unique identifier assigned to each location. 392804911
valid_id bool Whether the input FSID returned valid data from the server. True
neighborhood Array[dict] The count of flooding to a building footprint within the neighborhood broken down by the year of annual risk. The low, mid, high count is returned as a dict within the associated year. Available years within the array of dictionary are 2020 and 2050. See Location Dictionary Below
city Array[dict] The count of flooding to a building footprint within the city broken down by the year of annual risk. The low, mid, high count is returned as a dict within the associated year. Available years within the array of dictionary are 2020 and 2050. See Location Dictionary Below
zcta Array[dict] The count of flooding to a building footprint within the zcta broken down by the year of annual risk. The low, mid, high count is returned as a dict within the associated year. Available years within the array of dictionary are 2020 and 2050. See Location Dictionary Below
tract Array[dict] The count of flooding to a building footprint within the tract broken down by the year of annual risk. The low, mid, high count is returned as a dict within the associated year. Available years within the array of dictionary are 2020 and 2050. See Location Dictionary Below
county Array[dict] The count of flooding to a building footprint within the county broken down by the year of annual risk. The low, mid, high count is returned as a dict within the associated year. Available years within the array of dictionary are 2020 and 2050. See Location Dictionary Below
cd Array[dict] The count of flooding to a building footprint within the cd broken down by the year of annual risk. The low, mid, high count is returned as a dict within the associated year. Available years within the array of dictionary are 2020 and 2050. See Location Dictionary Below
state Array[dict] The count of flooding to a building footprint within the state broken down by the year of annual risk. The low, mid, high count is returned as a dict within the associated year. Available years within the array of dictionary are 2020 and 2050. See Location Dictionary Below

Location Dictionary

Key Type Description Example
fsid int First Street ID (FSID) is a unique identifier assigned to each location. 392804911
name string The name of the location 'North Newport News'
count Array[dict] A collection of Count Data See Below

Count Data

Key Type Description Example
year int The year (2020 or 2050) the probability was calculated for. 2020
data Array[dict] A collection of Probability Count Data See below

Probability Count Data

Key Type Description Example
low int The total count of properties that exist in that return period and depth bin, based on the low scenario of the RCP 4.5 emissions curve. 125
mid int The total count of properties that exist in that return period and depth bin, based on the mid scenario of the RCP 4.5 emissions curve. 150
high int The total count of properties that exist in that return period and depth bin, based on the high scenario of the RCP 4.5 emissions curve. 175
Clone this wiki locally