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 Chance
Kelvin edited this page Nov 3, 2020
·
14 revisions
probability.get_chance(
search_items,
csv=False,
output_dir='/output'
)
Delivers the risk likelihood (% probability) for flooding to the building footprint broken down by depth threshold and year of annual risk.
This method returns an array of ProbabilityChance
product for the given property IDs. Only property IDs are accepted. Optionally creates a csv file.
(More information on the Probability Chance product can be found on the Probability Chance Page on the First Street Foundation API Data Dictionary)
-
search_items:
list/file of SearchItems
, property parcels to retrieve probability chance for. -
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_chance on a list with 2 FSIDs
python -m firststreet -p probability.get_chance -s 190836953;392804911
# Call probability.get_chance on a file of SearchItems
python -m firststreet -p probability.get_chance -s sample.txt
# Contents of sample.py
# Create a `FirstStreet` object.
import firststreet
fs = firststreet.FirstStreet("api-key")
# Call probability.get_chance on a list with 2 property FSIDs
probability_chance = fs.probability.get_chance(search_items=[190836953, 193139123])
# Call probability.get_chance on a file of SearchItems
probability_chance = fs.probability.get_chance(search_items="sample.txt", csv=True)
Key | Type | Description | Example |
---|---|---|---|
fsid | int | 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 |
chance | Array[dict] | The risk likelihood (% probability) for flooding to the building footprint broken down by depth threshold and year of annual risk. The low, mid, high likelihood is returned as [DepthThresholdData] within the associated threshold and year. Available depth thresholds include >0cm, >15cm, and >30cm, returned as [DepthChanceData] and are broken down by the following years within the [DepthChance] model - 2020, 2025, 2030, 2035, 2040, 2045, and 2050. | See below |
Key | Type | Description | Example |
---|---|---|---|
year | int | The year (2020, 2025, 2030, 2035, 2040, 2045, or 2050) the probability was calculated for. | 2020 |
data | Array[dict] | A collection of Depth Chance Data | See below |
Key | Type | Description | Example |
---|---|---|---|
threshold | string | The depth threshold in centimeters (0, 15cm, or 30cm) that the probability was calculated for. | 0 |
data | Array[dict] | Depth Threshold Data | See below |
Key | Type | Description | Example |
---|---|---|---|
low | int | The likelihood (% probability) of flooding given as a value from 0-1 (rounded to two decimal places) at the specified depth based on the low scenario of the RCP 4.5 emissions curve. | .2 |
mid | int | The likelihood (% probability) of flooding given as a value from 0-1 (rounded to two decimal places) at the specified depth based on the mid scenario of the RCP 4.5 emissions curve. | .3 |
high | int | The likelihood (% probability) of flooding given as a value from 0-1 (rounded to two decimal places) at the specified depth based on the high scenario of the RCP 4.5 emissions curve. | .6 |
-
Installation
-
Usage
-
Products
-
Update