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

Environmental Precipitation

Kelvin edited this page May 20, 2021 · 5 revisions

Environmental Precipitation Method

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)

Arguments:

  • 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 (if csv is True).

Example (Command Line):

Call environmental.get_precipitation on a list with 2 state FSIDs

python -m firststreet -p environmental.get_precipitation -s 19117;39027

Call environmental.get_precipitation on a lat/lng or address

python -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"

Call environmental.get_precipitation on a file of SearchItems

python -m firststreet -p environmental.get_precipitation -s sample_county.txt

Example (Python File):

# 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)

Environmental Precipitation Objects

EnvironmentalPrecipitation Object

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

Projected Data

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

Precipitation Projection Data

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

Clone this wiki locally