calculate_emissions
Calculate Scope 2 CO2e for a facility from its ZIP and kWh, using both GHG Protocol methods: location-based (eGRID subregion rate) and market-based (Green-e residual mix applied to kWh not covered by RECs, PPAs or green tariffs). Returns kg CO2e for each method with the factors used.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kwh | Yes | Electricity consumption in kWh | |
| zip | Yes | 5-digit US ZIP code | |
| year | No | eGRID edition (default 2023). Market-based needs 2023. | |
| renewable_kwh | No | Optional: kWh covered by contractual instruments (RECs, PPAs, green tariff). Counted at zero in the market-based result. Default 0. |