# Plot CO2 yearly emissions profile based on Enphase and FUELINST data. # Damon Hart-Davis licenses this file to you # under the Apache Licence, Version 2.0 (the "Licence"); # you may not use this file except in compliance # with the Licence. You may obtain a copy of the Licence at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the Licence is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the Licence for the # specific language governing permissions and limitations # under the Licence. # # Author(s) / Copyright (s): Damon Hart-Davis 2020 # Derived from graphing/storesim/load-profile-1.txt 20210103. # Prepare graph with a command similar to: #sh script/storesim/load_profile.sh # # Consists of hourly buckets of mean imports from grid and grid intensity. # The timestamp is UTC at the start of the specified bucket. # The import is in watts, the intensity in gCO2e/kWh effective at premises. # # Input format: # #2020-01-01T01:00Z,72.0906,209.167 #2020-01-01T02:00Z,77.9957,206 #2020-01-01T03:00Z,81.7087,200.4 #2020-01-01T04:00Z,71.7366,182 #2020-01-01T05:00Z,67.4731,180.333 #2020-01-01T06:00Z,195.651,197.167 #2020-01-01T07:00Z,162.984,205 #2020-01-01T08:00Z,458.225,218.667 #2020-01-01T09:00Z,293.469,240 # Input file contains comma-separated values fields set datafile separator comma # Input filename supplied as: # gnuplot -e "infilename='in.dat'" if (!exists("infilename")) infilename='.work/tmp/batsim1-daymean.dat.tmp' # Output filename supplied as: # gnuplot -e "outfilename='out.png'" if (!exists("outfilename")) outfilename='CO2-emissions-hourly.png' # X-axis format supplied as: # gnuplot -e "xafmt='%m'" if (!exists("xafmt")) xafmt='%m' # Title if (exists("title")) set title title if (!exists("title")) set title "CO2 Emissions Profile" # Select a size that works nicely scaled as a banner hero image. set terminal png size 3200,800 #set terminal png size 640,480 #set terminal png size 1280,480 set output outfilename set grid #set key bottom left horizontal #set key below horizontal set xdata time #set xrange [1:13] set timefmt "%Y-%m-%dT%H:%M:%SZ" set format x xafmt set format y2 "%gW" set format y "%gkgCO2/h" set y2tics # Setting lw 2 for emssions to make easier to read for colourblind. plot infilename using 1:2 title "grid imports" with lines axes x1y2, \ "" using 1:(($2*$3)/1000000) title "emissions" with lines lw 2