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
Environmental Precipitation
Kelvin edited this page May 20, 2021
·
5 revisions
environmental.get_precipitation(
search_items,
csv=False,
output_dir='/output'
)Delivers the future projections for 2020, 2035 and 2050, from the average change in extreme precipitation event intensity using historical data for the county.
This method returns an array of EnvironmentalPrecipitation product for the given county IDs. Optionally creates a csv file.
(More information on the Environmental Precipitation product can be found on the Environmental Precipitation Page on the First Street Foundation API Data Dictionary)
-
search_items:
list/file of SearchItems, county ids to retrieve environmental precipitation for. -
csv:
bool, whether to create a CSV for the retrieved data. -
output_dir:
string, location to output the created CSV (ifcsvis True).
python -m firststreet -p environmental.get_precipitation -s 19117;39027python -m firststreet -p environmental.get_precipitation -s 37.16314,-76.55782;38.50303,-106.72863
python -m firststreet -p environmental.get_precipitation -s "Bronx County, New York";"Essex County, New York"python -m firststreet -p environmental.get_precipitation -s sample_county.txt# Contents of sample.py
# Create a `FirstStreet` object.
import firststreet
fs = firststreet.FirstStreet("api-key")
# Call environmental.get_precipitation on a list with 1 county FSID
environmental_precipitation = fs.environmental.get_precipitation([19117, 39027])
# Call environmental.get_precipitation on a lat/lng or address
environmental_precipitation = fs.environmental.get_precipitation(search_items=[(37.16314,-76.55782)], csv=True)
environmental_precipitation = fs.environmental.get_precipitation(search_items=["Essex County, New York"], csv=True)
# Call environmental.get_precipitation on a file of SearchItems
environmental_precipitation = fs.environmental.get_precipitation("sample_county.txt", csv=True)| Key | Type | Description | Example |
|---|---|---|---|
| fsid | str | First Street ID (FSID) is a unique identifier assigned to each location. | 450350223646 |
| projected | Array[dict] | The projections for 2020, 2035, and 2050 as [PrecipProjection] with the low, mid and high countywide average change (using historical precipitation data from 1980-2010 (centered on 1995)) in extreme precipitation event intensity as an array of dictionary based on 3 potential climate model realizations of the RCP 4.5 emissions scenario. | See below |
| Key | Type | Description | Example |
|---|---|---|---|
| year | int | The year (2020, 2030, 2040, or 2050) of the projection. | 2030 |
| data | Array[dict] | A Precip Projection Data dict | See below |
| Key | Type | Description | Example |
|---|---|---|---|
| low | int | The countywide average change (using historical precipitation data from 1980-2010 (centered on 1995)) in extreme precipitation event intensity in centimeters based on the low scenario of the RCP 4.5 emissions curve. | 0.926 |
| mid | int | The countywide average change (using historical precipitation data from 1980-2010 (centered on 1995)) in extreme precipitation event intensity in centimeters based on the mid scenario of the RCP 4.5 emissions curve. | 0.973 |
| high | int | The countywide average change (using historical precipitation data from 1980-2010 (centered on 1995)) in extreme precipitation event intensity in centimeters based on the high scenario of the RCP 4.5 emissions curve. | 1.014 |
-
Installation
-
Usage
-
Products
-
Update