This repository was archived by the owner on Jan 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Probability Count
Kelvin edited this page Oct 28, 2020
·
11 revisions
probability.get_count(
search_items,
location_type,
csv=False,
output_dir='/output'
)
Returns an array of ProbabilityCount
product for the given IDs. Optionally creates a csv file.
(More information on the Probability Count can be found on the Probability Count Page on the First Street Foundation API Data Dictionary)
-
search_items:
list/file of SearchItems
, property parcels to retrieve probability count for. -
location_type:
string
, one of{neighborhood, city, zcta, tract, county, cd, state}
, for the search item type. -
csv:
bool
, whether to create a CSV for the retrieved data. -
output_dir:
string
, location to output the created CSV (ifcsv
is True).
# Call probability.get_count on a list with 2 FSIDs
python -m firststreet -p probability.get_count -i 19;31 -l state
# Call probability.get_count on a file of SearchItems
python -m firststreet -p probability.get_count -f sample.txt -l state
# Contents of sample.py
# Create a `FirstStreet` object.
import firststreet
fs = firststreet.FirstStreet("api-key")
# Call probability.get_count on a list with 2 state FSIDs
probability_count = fs.probability.get_count([19, 31], "state", csv=True)
# Call probability.get_count on a file of SearchItems
probability_count = fs.probability.get_count("sample.txt", "state", csv=True)
Key | Type | Description | Example |
---|---|---|---|
fsid | int | First Street ID (FSID) is a unique identifier assigned to each location. | 392804911 |
count | Array Dict | The total count of properties with flood risk within the location broken down by depth threshold, return period and year. The low, mid, high count is returned as an array of dict within the associated threshold, return period and year. Available depth bins returned as an array of dict begin at 0-5cm of flooding (displayed as "0") and are provided in 5 cm increments up to 120-125cm of flooding (displayed as "120"). Everything with greater than 125cm of flooding is bulked together at 125. Depth bins are broken down by the following return periods as an array of dict - 500, 250, 100, 20, 5, and 2 years. The years available within the an array of dict model are 2020 and 2050. | See below |
Key | Type | Description | Example |
---|---|---|---|
year | int | The year (2020 or 2050) the probability was calculated for. | 2020 |
data | Array of Dict | A collection of Probability Count Data | See below |
Key | Type | Description | Example |
---|---|---|---|
returnPeriod | int | The return period (500, 100, 20, 5, or 2 years) that the depth was calculated for. 2 year return period is only available in coastal areas. | 500 |
data | Array of Dict | A collection of Probability Bin Count Data | See below |
Key | Type | Description | Example |
---|---|---|---|
threshold | string | The depth of flooding (in centimeters) that the probability was calculated for. Available depth bins begin at 0-5cm of flooding (displayed as “0”) and are provided in 5 cm increments up to 120-125cm of flooding (displayed as “120"). Everything with greater than 125cm of flooding is bulked together at 125. Flood depth is calculated at the lowest elevation of the building footprint (largest if more than 1 exists, or property centroid where footprint does not exist). | 0 |
data | Dict | Depth Count Bin Data | See below |
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 |
-
Installation
-
Usage
-
Products
-
Update