MSL Battery NY vs CO2

Code below can be selected with mouse or other text selection techniques.

Gnuplot is a powerful, free, open source plotting utility: http://gnuplot.info

# MLO CO2
SRC_MLO="ftp://aftp.cmdl.noaa.gov/products/trends/co2/co2_annmean_mlo.txt"

# Law dome "20y smoothed" and interpolated
SRC_LAW_DOME="https://www1.ncdc.noaa.gov/pub/data/paleo/icecore/antarctica/law/law_co2.txt"

# NOAA Battery NY MSL
SRC_NOAA="http://tidesandcurrents.noaa.gov/sltrends/sltrends_station.shtml?stnid=8518750"

# Code for gaussian filter here:
 https://climategrog.wordpress.com/2013/12/08/gaussian-low-pass-script/


awk '($1>1893){print}'  MSL_Battery.dat > MSL_Battery_1893-.dat
../gauss.awk MSL_Battery_1893-.dat 12

# gnuplot script for graph:

fCO2(x)=5.35*log(x/280.)
integ(x)=(!istarted)?(istarted=1,int_last=x):(int_last=int_last+x)
integ2(x)=(!istarted2)?(istarted2=1,int_last2=x):(int_last2=int_last2+x)

set ytics nomir
set y2tics
set key top left Left rev
set ylab "mean sea level rise / meter"
set y2lab "accumulated radiative flux / ( W/m^2 * years)"
set xlab SRC_NOAA."\n".SRC_MLO."\n".SRC_LAW_DOME
set termopt noenh


istarted2=istarted=0; plot "../PMSL/MSL_Battery_1893--gauss12.dat" w l tit "MSL Battery NY ( 12mo filter )" \
, "law_20y.dat" u 1:(integ(fCO2($2))) w l tit "integrated CO2 radiative forcing: 5.35 * log ( CO2 / 280 )" axes x1y2 \
, "law_20y.dat" u 1:(($1>1958)?NaN:integ2(fCO2($2))) w l tit "pre-1958 CO2 from Law Dome ice core" axes x1y2 \