API
Data retrieval
UKCarbonIntensityData.get_regional_data
— Functionget_carbon_intensity(start_date::ZonedDateTime, end_date::ZonedDateTime)
Returns a NamedTuple with two fields named intensity
and generation
. Both tables contain data spanning the period defined by the start_date
and end_date
. the intensity
field contains a dataframe of the forecast data of the regional carbon intensity, and the generation
field contains a dataframe of the regional generation as a percent of the total generation.
UKCarbonIntensityData.get_carbon_intensity
— Functionget_carbon_intensity(start_date::ZonedDateTime, end_date::ZonedDateTime)
Returns a DataFrame of the nationwide forecast and actual carbon intensity between the given start_date
and end_date
.
UKCarbonIntensityData.get_todays_forecast
— Functionget_todays_forecast(;regional::Bool=false, region::AbstractString="")
Returns a DataFrame of the forecast and actual carbon intensity between for the 48 hours of the day the query is called. By default return national level data, pass regional=true
to return data with regional spatial resolution. To retreive data for a single region, pass the region = <desired region>
where <desired region> must be included in the the AVAILABLE_REGIONS
.
Plot Recipes
UKCarbonIntensityData.todays_plot
— Typetodays_plot(; region = "")
Plot the 48 forecast for the carbon intensity starting from midnight on the day that the function is called. By default shows the national forecast. If the region
kwarg is a valid region, then plot data for this region only. Valid regions are contained in AVAILABLE_REGIONS
.
UKCarbonIntensityData.carbon_intensity
— Typecarbon_intensity(start_date, end_date)
Plots the recorded carbon intensity over the period given by the start_date
and end_date
.
Mappings
UKCarbonIntensityData.AVAILABLE_REGIONS
— ConstantDict mapping region names to region ids.