Breakthrough-Energy / PreREISE

Generate input data for scenario framework
https://breakthrough-energy.github.io/docs/
MIT License
21 stars 28 forks source link

Handle urban area with missing daily VMT per capita #342

Closed rouille closed 1 year ago

rouille commented 1 year ago

Pull Request doc

Purpose

Use annual VMT per capita in state to calculate the total annual VMT in urban areas that have missing daily VMT per capita

What the code is doing

Testing

Manual testing to check that some urban areas with missing data have reasonable values compared to other urban areas in the state.

Where to look

Usage Example/Visuals

>>> from prereise.gather.demanddata.transportation_electrification.generate_scaling_factors import (
...     census_ua_url,
...     census_state_url,
...     tht_data_url,
...     load_census_ua,
...     load_census_state,
...     load_dot_vmt_per_capita,
...     calculate_vmt_for_ua,
...     calculate_vmt_for_state,
...     calculate_urban_rural_fraction,
...     get_efs_vmt_projection_for_state,
...     generate_scaling_factor,
... )
>>> from prereise.gather.demanddata.nrel_efs.get_efs_annual_data import (
...     get_efs_annual_data,
...     nrel_annual_efs_url,
... )
>>> 
>>> census_ua = load_census_ua(census_ua_url)
>>> census_state = load_census_state(census_state_url)
NST01
>>> tht_ua, tht_state = load_dot_vmt_per_capita(tht_data_url)
>>> vmt_ua = calculate_vmt_for_ua(census_ua, tht_ua, tht_state)
>>> vmt_ua["OR"]
                      Annual VMT
Portland, OR-WA     1.024164e+10
Salem, OR           1.485755e+09
Albany, OR          4.917825e+08
Corvallis, OR       2.872120e+08
Medford, OR         1.002208e+09
Eugene, OR          1.583623e+09
Grants Pass, OR     4.358975e+08
Bend, OR            4.988977e+08
Walla Walla, WA-OR  7.614401e+07
Longview, WA-OR     1.876433e+07

Time estimate

5min