pro test_age_spectra_sweeps dir = '/Volumes/Data_Gator/Data/' t0 = systime(1) restore,dir+'Surface_Trace_Gas/Tracer_entry_time_series.sav' ny = n_elements(lat_grid_entry) nr = n_elements(ratios) nr_trop = n_elements(ratios_trop) n_ages_trop = n_elements(grn_mean_ages_trop) nte = n_elements(time_entry) d_age = grn_mean_ages_trop[1] - grn_mean_ages_trop[0] d_age_fine = 0.05 n_ages_trop_fine = 2*n_ages_trop grn_mean_ages_trop_fine = findgen(n_ages_trop_fine)*d_age_fine ai = interpol(indgen(n_ages_trop),grn_mean_ages_trop,grn_mean_ages_trop_fine) data = read_ascii(dir+'Surface_Trace_Gas/GMD/n2o/combined/GML_global_N2O.txt',data_start=68) n2o_yr = reform(data.field01[0,*]) n2o_mon = reform(data.field01[1,*]) n2o_date = n2o_yr + (n2o_mon-0.5)/12. n2o_global = reform(data.field01[6,*]) ; Read in GMD marine boundary layer data for CH4. dat = read_ascii(dir+'Surface_Trace_Gas/CH4/CH4_mbl_30S-30N.txt',data_start=72) ch4_time = reform(dat.field1[3,*]) ch4_mbl = reform(dat.field1[4,*]) ; Read in the tropical CH4 time series. restore,dir+'Surface_Trace_Gas/CH4_tropical_time_series.sav' ; Read in the tropical SF6 time series. restore,dir+'Surface_Trace_Gas/SF6_tropical_time_series.sav' ; Read in the tropical CO2 time series. restore,dir+'Surface_Trace_Gas/CO2_tropical_time_series.sav' ; Tropopause data. ncdf_get,dir+'Reanalysis/MERRA2/tp.monmean.zm.nc',['time','tpp','tpt','tpz','lat'],tp,/quiet ny_tp = tp['lat','dim_sizes'] lat_tp = tp['lat','value'] tp_jdays = julday(1,1,1900,0,0) + double(tp['time','value']) caldat,tp_jdays,mon,day,yr tp_yr = float(yr) + float(mon)/12. + 1./24. tpause = fltarr(ny_tp) & tpause_alt = tpause & tpause_mon = fltarr(ny_tp,12) & tpause_mon_alt = tpause_mon & tpause_mon_temp = tpause_mon & tpause_seas = fltarr(ny_tp,4) tpause_seas_alt = tpause_seas & tpause_seas_temp = tpause_seas & tpause_temp = tpause for y = 0, ny_tp[0]-1 do begin tpause[y] = mean(tp['tpp','value',y,*]) tpause_alt[y] = mean(tp['tpz','value',y,*]) tpause_temp[y] = mean(tp['tpt','value',y,*]) for t = 0, 11 do begin ti = where(mon eq t+1) tpause_mon[y,t] = mean(tp['tpp','value',y,ti],/nan) tpause_mon_alt[y,t] = mean(tp['tpz','value',y,ti],/nan) tpause_mon_temp[y,t] = mean(tp['tpt','value',y,ti],/nan) endfor for t = 0, 3 do begin ti = indgen(3)-1+t*3 tpause_seas[y,t] = mean(tpause_mon[y,ti]) tpause_seas_alt[y,t] = mean(tpause_mon_alt[y,ti]) tpause_seas_temp[y,t] = mean(tpause_mon_temp[y,ti]) endfor endfor tpause_theta = tpause_temp * (1e3/tpause)^(2./7.) tpause_mon_theta = tpause_mon_temp * (1e3/tpause_mon)^(2./7.) tpause_seas_theta = tpause_seas_temp * (1e3/tpause_seas)^(2./7.) ; Read in Garny SF6 age correction curve. data = read_ascii(dir+'Models/EMAC/SF6_age_bias_correction_Garny.txt',data_start=5) year_b = reform(data.field1[0,*]) ft_b = reform(data.field1[1,*]) sf6_bias_corr = fltarr(n_ages_trop_fine,n_elements(year_b)) & sf6_bias_corr_trop = fltarr(n_ages_trop,n_elements(year_b)) for t = 0, n_elements(year_b)-1 do begin sf6_bias_corr[*,t] = grn_mean_ages_trop_fine * (ft_b[t] / (5.20991983e+02*exp(-3.80974431e-01*grn_mean_ages_trop_fine))) sf6_bias_corr_trop[*,t] = grn_mean_ages_trop * (ft_b[t] / (5.20991983e+02*exp(-3.80974431e-01*grn_mean_ages_trop))) endfor sf6 = reform(sf6_entry_trop[n_ages_trop/2,ny/2,nr/2,*]) sf6_yrsm = lowpass_cfc(sf6, BOX=12, EDGE_PFCAST=1) sf6_gr = 12*sg_smooth(sf6_yrsm, NLEFT=12/2, NRIGHT=12/2-1, DERIV=1, DELTA=1.0, EDGE_PFCAST=1) tropical_sf6_yrsm = lowpass_cfc(tropical_sf6, BOX=12, EDGE_PFCAST=1) tropical_co2_yrsm = lowpass_cfc(tropical_co2, BOX=12, EDGE_PFCAST=1) tropical_ch4_yrsm = lowpass_cfc(tropical_ch4, BOX=12, EDGE_PFCAST=1) tropical_ch4_mbl_yrsm = lowpass_cfc(ch4_mbl, BOX=12, EDGE_PFCAST=1) restore,dir+'Aircraft/Missions/idlsave_files/N2O_mean_age_curve.sav' n2o_norm_age_co2_avg = n2o_norm_age_co2 restore,dir+'Aircraft/Airborne_Save_Files/Andrews_N2O_age.sav' aircraft = 0 fi = 0 ext = ['early','mid','late'] b_ext = ['early','mid','late_v2024'] ext2 = ['pre2000','mid','post2020'] ext_yrs = ['1994-2000','2002-16','2020-23'] if aircraft then begin restore,dir+'Aircraft/Missions/idlsave_files/aircraft_mean_ages_'+ext[fi]+'.sav' ; restore,dir+'Aircraft/Missions/idlsave_files/aircraft_mean_ages_grid_'+ext[fi]+'.sav' restore,dir+'Aircraft/Missions/idlsave_files/Mean_age_calc_'+ext2[fi]+'.sav' restore,dir+'Aircraft/Missions/idlsave_files/N2O_age_norm_curves_'+ext2[fi]+'.sav' np = n_elements(times_all) ; if fi eq 0 then mission_names = ['aaoe','aase','aase2','ashoe','spade','strat','polaris','solve'] caldat,jday_all,months_all,days_all,years_all months_zero = replicate('',np) & days_zero = months_zero months_zero[where(months_all lt 10)] = '0' days_zero[where(days_all lt 10)] = '0' dates_str = strcompress(string(years_all),/r)+months_zero+strcompress(string(months_all),/r)+days_zero+strcompress(string(days_all),/r) di = uniq(long(dates_str),sort(long(dates_str))) flight_dates = dates_str[di] flight_year_frac = float(strmid(flight_dates,0,4)) + (float(strmid(flight_dates,4,2))-1.)/12. + float(strmid(flight_dates,6,2))/365. ndates = n_elements(di) ti = interpol(indgen(n_elements(n2o_date)),n2o_date,times_all) n2o_surface = interpolate(n2o_global,ti) tic = interpol(indgen(n_elements(ch4_time)),ch4_time,times_all) ch4_surface = interpolate(tropical_ch4_mbl_yrsm,tic) theta_all = theta dates_str_all = dates_str n2o_norm = n2o/n2o_surface chk_n = where(finite(n2o_norm),nchk_n) ; Fill in the N2O. n2o_all = replicate(!values.f_nan,np) n2o_all[chk_n] = n2o[chk_n] for i = 0, nchk_n-2 do begin ni = chk_n[i+1] - (chk_n[i]+1) if ni gt 0 and ni lt 160 then begin ii = findgen(ni) + chk_n[i]+1 n2o_all[ii] = n2o_all[chk_n[i]] + (n2o_all[chk_n[i+1]] - n2o_all[chk_n[i]]) * (findgen(ni)+1.)/(ni+1.) endif endfor n2o_all_norm = n2o_all/n2o_surface ; Fill in the CO2. chk_c = where(finite(co2),nchk_c) co2_all = replicate(!values.f_nan,np) & co2_adj_all = co2_all co2_all[chk_c] = co2[chk_c] co2_adj_all[chk_c] = co2_adj[chk_c] for i = 0, nchk_c-2 do begin ni = chk_c[i+1] - (chk_c[i]+1) if ni gt 0 and ni lt 160 then begin ; if ni gt 0 and ni lt 100 then begin ii = findgen(ni) + chk_c[i]+1 co2_all[ii] = co2_all[chk_c[i]] + (co2_all[chk_c[i+1]] - co2_all[chk_c[i]]) * (findgen(ni)+1.)/(ni+1.) co2_adj_all[ii] = co2_adj_all[chk_c[i]] + (co2_adj_all[chk_c[i+1]] - co2_adj_all[chk_c[i]]) * (findgen(ni)+1.)/(ni+1.) endif endfor ; ch4_entry = ch4_e ; Fill in the CH4. chk_c = where(finite(ch4),nchk_c) ch4_all = replicate(!values.f_nan,np) ch4_all[chk_c] = ch4[chk_c] for i = 0, nchk_c-2 do begin ni = chk_c[i+1] - (chk_c[i]+1) if ni gt 0 and ni lt 160 then begin ; if ni gt 0 and ni lt 100 then begin ii = findgen(ni) + chk_c[i]+1 ch4_all[ii] = ch4_all[chk_c[i]] + (ch4_all[chk_c[i+1]] - ch4_all[chk_c[i]]) * (findgen(ni)+1.)/(ni+1.) endif endfor co2_c = co2_all co2_adj_c = co2_adj_all ch4_c = ch4_all elat_m_all = elat_m lat_all = lat elat_strat_all = elat_m_all yi = interpol(findgen(ny_tp),lat_tp,elat_strat_all) tp_elat = interpolate(tpause_alt,yi) chk = where(alt lt tp_elat,nchk) print,nchk elat_strat_all[chk] = lat[chk] ; chk = where(elat_strat_all ge lat+30,nchk) ; if nchk gt 0 then elat_strat_all[chk] = lat[chk] endif else begin if fi eq 0 then begin restore,dir+'Balloon/OMS_mean_ages.sav' restore,dir+'Balloon/OMS_common_gc.sav' nd = n_elements(oms_dates) flight_dates = oms_dates n2o_norm = 0. & n2o_all_norm = 0. & ch4 = 0. & ch4_all = 0. & co2 = 0. & co2_adj = 0. & sf6 = 0. & sf6_e = 0. & elat_m = 0. & alt = 0. & mission = 0 & time = 0L & dates_str = '' & theta = 0. months_all = 0 & years_all = 0 & days_all = 0 & sf6_age = 0. & co2_age = 0. & n2o = 0. & pres = 0. for d = 0, 8 do begin nbp = n_elements(oms_data[oms_dates[d]+'n2o']) time = [time,oms_data[oms_dates[d]+'time']] if d le 7 then theta = [theta,oms_data[oms_dates[d]+'theta_wv']] else theta = [theta,oms_data[oms_dates[d]+'o3_theta']] n2o = [n2o,oms_data[oms_dates[d]+'n2o']] n2o_norm = [n2o_norm,oms_data[oms_dates[d]+'n2o_norm']] n2o_all_norm = [n2o_all_norm,oms_data[oms_dates[d]+'n2o_all_norm']] ch4 = [ch4,oms_data[oms_dates[d]+'ch4']] if oms_dates[d] eq '19980518' then begin ; Add CH4 data for end of the flight based on profile values on ascent. alt_bin = findgen(40)*0.5+10 & ch4_bin = fltarr(40) for z = 0, 39 do begin zi = where(oms_data[oms_dates[d]+'o3_alt'] ge alt_bin[z]-0.25 and oms_data[oms_dates[d]+'o3_alt'] lt alt_bin[z]+0.25 and finite(oms_data[oms_dates[d]+'ch4_all']),nzi) if nzi gt 0 then ch4_bin[z] = mean(oms_data[oms_dates[d]+'ch4_all',zi]) endfor chk = where(~finite(oms_data[oms_dates[d]+'ch4_all']) and oms_data[oms_dates[d]+'o3_alt'] ge alt_bin[0]-0.25) zii = interpol(indgen(40),alt_bin,oms_data[oms_dates[d]+'o3_alt',chk]) ch4_all_init = oms_data[oms_dates[d]+'ch4_all'] ch4_all_init[chk] = interpolate(ch4_bin,zii) ch4_all = [ch4_all,ch4_all_init] endif else ch4_all = [ch4_all,oms_data[oms_dates[d]+'ch4_all']] co2 = [co2,oms_data[oms_dates[d]+'co2']] co2_adj = [co2_adj,oms_data[oms_dates[d]+'co2_adj']] sf6 = [sf6,oms_data[oms_dates[d]+'sf6']] sf6_age = [sf6_age,oms_data[oms_dates[d]+'age_sf6']] if oms_data.haskey(oms_dates[d]+'age_co2') then co2_age = [co2_age,oms_data[oms_dates[d]+'age_co2']] else co2_age = [co2_age,replicate(!values.f_nan,nbp)] if oms_data.haskey(oms_dates[d]+'sf6e') then sf6_e = [sf6_e,oms_data[oms_dates[d]+'sf6e']] else sf6_e = [sf6_e,replicate(!values.f_nan,nbp)] if d le 7 then elat_m = [elat_m,oms_data[oms_dates[d]+'elat_m']] else elat_m = [elat_m,oms_data[oms_dates[d]+'elat_m_o3']] alt = [alt,oms_data[oms_dates[d]+'o3_alt']] pres = [pres,oms_data[oms_dates[d]+'o3_pres']] mission = [mission,replicate(d+1,nbp)] dates_str = [dates_str,replicate(oms_dates[d],nbp)] months_all = [months_all,replicate(fix(strmid(oms_dates[d],4,2)),nbp)] years_all = [years_all,replicate(fix(strmid(oms_dates[d],0,4)),nbp)] days_all = [days_all,replicate(fix(strmid(oms_dates[d],6,2)),nbp)] endfor sf6[where(sf6 ge 99)] = !values.f_nan elat_m_all = elat_m n2o_all_norm = n2o_norm co2_lag_age = co2_age dates_str_all = dates_str n2o_n_norm = n2o_norm time = time[1:-1] & n2o_all_norm = n2o_all_norm[1:-1] & alt = alt[1:-1] & pres = pres[1:-1] & theta_all = theta[1:-1] tic = interpol(indgen(n_elements(ch4_time)),ch4_time,time_all) ch4_surface = interpolate(tropical_ch4_mbl_yrsm,tic) ; Fill in the CO2. chk_c = where(finite(co2),nchk_c) print,nchk_c chk_s = where(finite(sf6),nchk_s) print,nchk_s co2_all = replicate(!values.f_nan,n_elements(co2)) & co2_adj_all = co2_all co2_all[chk_c] = co2[chk_c] co2_adj_all[chk_c] = co2_adj[chk_c] for i = 0, nchk_c-2 do begin ni = chk_c[i+1] - (chk_c[i]+1) if ni gt 0 and ni lt 100 then begin ii = findgen(ni) + chk_c[i]+1 co2_all[ii] = co2_all[chk_c[i]] + (co2_all[chk_c[i+1]] - co2_all[chk_c[i]]) * (findgen(ni)+1.)/(ni+1.) co2_adj_all[ii] = co2_adj_all[chk_c[i]] + (co2_adj_all[chk_c[i+1]] - co2_adj_all[chk_c[i]]) * (findgen(ni)+1.)/(ni+1.) endif endfor co2_c = co2_all[1:-1] co2_adj_c = co2_adj_all[1:-1] ch4_c = ch4_all[1:-1] ; Fill in the N2O. chk_n2o = where(finite(n2o),nchk_n2o) print,nchk_n2o n2o_all = replicate(!values.f_nan,n_elements(n2o)) n2o_all[chk_n2o] = n2o[chk_n2o] for i = 0, nchk_n2o-2 do begin ni = chk_n2o[i+1] - (chk_n2o[i]+1) if ni gt 0 and ni lt 100 then begin ii = findgen(ni) + chk_n2o[i]+1 n2o_all[ii] = n2o_all[chk_n2o[i]] + (n2o_all[chk_n2o[i+1]] - n2o_all[chk_n2o[i]]) * (findgen(ni)+1.)/(ni+1.) endif endfor ; mi = where(mission eq 6) ; npp = n_elements(oms_data[oms_dates[2]+'co2']) ; p = plot(indgen(2),/nodata,yrange=[11,19],xrange=[361.5,370.5]) ; p = plot(oms_data[oms_dates[5]+'co2',0:npp/2],oms_data[oms_dates[5]+'o3_alt',0:npp/2],symbol='o',/sym_filled,sym_size=0.5,color='blue',/overplot) ; p = plot(oms_data[oms_dates[5]+'co2',npp/2:-1],oms_data[oms_dates[5]+'o3_alt',npp/2:-1],symbol='o',/sym_filled,sym_size=0.5,color='orange',/overplot) ;; gd = where(finite(oms_data[oms_dates[2]+'co2'])) ;; p = plot(oms_data[oms_dates[2]+'co2',gd],oms_data[oms_dates[2]+'o3_alt',gd],symbol='o',/sym_filled,sym_size=0.5,color='blue',/overplot) ; gd = where(finite(oms_data[oms_dates[5]+'sf6'])) ; p = plot(oms_data[oms_dates[5]+'co2',gd],oms_data[oms_dates[5]+'o3_alt',gd],symbol='o',/sym_filled,color='red',linestyle=6,/overplot) ; p = plot(co2_all[mi[gd]-1],oms_data[oms_dates[5]+'o3_alt',gd],symbol='o',/sym_filled,color='red',linestyle=6,/overplot) ; p = plot(co2_adj_all[mi[gd]-1],oms_data[oms_dates[5]+'o3_alt',gd],symbol='s',color='red',linestyle=6,/overplot) ; p = plot([362.34,362.34],[10,25],linestyle=2,/overplot) ;; ;; p = plot(indgen(2),/nodata,yrange=[11,19]) ;; gd = where(finite(oms_data[oms_dates[5]+'ch4_all']),ngd) ;; p = plot(oms_data[oms_dates[5]+'ch4_all',gd[0:ngd/2]],oms_data[oms_dates[5]+'o3_alt',gd[0:ngd/2]],symbol='o',/sym_filled,color='blue',/overplot) ;; p = plot(oms_data[oms_dates[5]+'ch4_all',gd[ngd/2:-1]],oms_data[oms_dates[5]+'o3_alt',gd[ngd/2:-1]],symbol='o',/sym_filled,color='orange',/overplot) ;; p = plot(ch4_all_init,oms_data[oms_dates[5]+'o3_alt'],symbol='o',/sym_filled,color='red',/overplot) ;; p = plot(ch4_bin,alt_bin,symbol='o',/sym_filled,color='magenta',/overplot) ; ; p = plot(indgen(2),/nodata,yrange=[11,19],xrange=[3,4.1]) ; gd = where(finite(oms_data[oms_dates[5]+'sf6']),ngd) ; p = plot(oms_data[oms_dates[5]+'sf6',gd[0:ngd/2]],oms_data[oms_dates[5]+'o3_alt',gd[0:ngd/2]],symbol='o',/sym_filled,color='blue',/overplot) ; p = plot(oms_data[oms_dates[5]+'sf6',gd[ngd/2:-1]],oms_data[oms_dates[5]+'o3_alt',gd[ngd/2:-1]],symbol='o',/sym_filled,color='orange',/overplot) ; p = plot(oms_data[oms_dates[5]+'sf6',0:npp/2],oms_data[oms_dates[5]+'o3_alt',0:npp/2],symbol='o',/sym_filled,color='blue',/overplot) ; p = plot(oms_data[oms_dates[5]+'sf6',npp/2:-1],oms_data[oms_dates[5]+'o3_alt',npp/2:-1],symbol='o',/sym_filled,color='orange',/overplot) ; p = plot([3.52,3.52],[10,25],linestyle=2,/overplot) ; chk = where(oms_data[oms_dates[5]+'sf6'] eq 3.31,nchk) ; print,mi[chk] ; print,chk,oms_data[oms_dates[2]+'sf6',chk],oms_data[oms_dates[2]+'co2',chk],co2_all[mi[chk]],co2_adj_all[mi[chk]] endif else begin ; restore,dir+'Balloon/Aircore_n2o_common_new.sav' restore,dir+'Balloon/Aircore_n2o_common_test_v2024.sav' dates_frac = years_all nd = n_elements(vdt_all) print,vdt_all n2o_norm = 0. & ch4 = 0. & co2 = 0. & co2_adj = 0. & sf6 = 0. & sf6_e = 0. & elat_m = 0. & time_all = 0. & mission = 0 & dates_str = '' & theta = 0. & months_all = 0 & years_all = 0 days_all = 0 & alt = 0. & sf6_age = 0. & co2_age = 0. & co2_lag_age = 0. & n2o = 0. & co2_all = 0. & ch4_all = 0. & n2o_all = 0. & co2_adj_all = 0. & dates_str_all = '' & elat_m_all = 0. n2o_n_norm = 0. & pres = 0. & theta_all = 0. & lat = 0. & lat_all = 0. & time_all_n = 0. for d = 0, nd-1 do begin if ac_data.haskey(vdt_all[d]+'n2o') then nbp = n_elements(ac_data[vdt_all[d]+'n2o_norm']) else nbp = n_elements(ac_data[vdt_all[d]+'n2o_n_norm']) if ac_data.haskey(vdt_all[d]+'n2o') then n2o = [n2o,ac_data[vdt_all[d]+'n2o']] else n2o = [n2o,replicate(!values.f_nan,nbp)] if ac_data.haskey(vdt_all[d]+'n2o') then n2o_norm = [n2o_norm,ac_data[vdt_all[d]+'n2o_norm']] else n2o_norm = [n2o_norm,replicate(!values.f_nan,nbp)] if ac_data.haskey(vdt_all[d]+'alt') then alt = [alt,ac_data[vdt_all[d]+'alt']] else alt = [alt,ac_data[vdt_all[d]+'alt_n']] if ac_data.haskey(vdt_all[d]+'lat') then lat = [lat,ac_data[vdt_all[d]+'lat']] else lat = [lat,ac_data[vdt_all[d]+'lat_n']] if ac_data.haskey(vdt_all[d]+'pres') then pres = [pres,ac_data[vdt_all[d]+'pres']] else pres = [pres,ac_data[vdt_all[d]+'pres_n']] if ac_data.haskey(vdt_all[d]+'theta') then theta = [theta,ac_data[vdt_all[d]+'theta']] else theta = [theta,ac_data[vdt_all[d]+'theta_n']] ch4 = [ch4,ac_data[vdt_all[d]+'ch4']] ; ch4_all = ch4 co2 = [co2,ac_data[vdt_all[d]+'co2']] co2_adj = [co2_adj,ac_data[vdt_all[d]+'co2_adj']] if ac_data.haskey(vdt_all[d]+'co2_n') then co2_all = [co2_all,ac_data[vdt_all[d]+'co2_n']] else co2_all = [co2_all,ac_data[vdt_all[d]+'co2']] if ac_data.haskey(vdt_all[d]+'co2_n') then nbpa = n_elements(ac_data[vdt_all[d]+'co2_n']) else nbpa = nbp if ac_data.haskey(vdt_all[d]+'co2_adj_n') then co2_adj_all = [co2_adj_all,ac_data[vdt_all[d]+'co2_adj_n']] else co2_adj_all = [co2_adj_all,ac_data[vdt_all[d]+'co2_adj']] if ac_data.haskey(vdt_all[d]+'ch4_n') then ch4_all = [ch4_all,ac_data[vdt_all[d]+'ch4_n']] else ch4_all = [ch4_all,ac_data[vdt_all[d]+'ch4']] if ac_data.haskey(vdt_all[d]+'n2o_n') then n2o_all = [n2o_all,ac_data[vdt_all[d]+'n2o_n']] else n2o_all = [n2o_all,ac_data[vdt_all[d]+'n2o']] if ac_data.haskey(vdt_all[d]+'n2o_n_norm') then n2o_n_norm = [n2o_n_norm,ac_data[vdt_all[d]+'n2o_n_norm']] else n2o_n_norm = [n2o_n_norm,ac_data[vdt_all[d]+'n2o_norm']] if ac_data.haskey(vdt_all[d]+'sf6') then sf6 = [sf6,ac_data[vdt_all[d]+'sf6']] else sf6 = [sf6,replicate(!values.f_nan,nbp)] if ac_data.haskey(vdt_all[d]+'sf6') then sf6_e = [sf6_e,0.0025*ac_data[vdt_all[d]+'sf6']] else sf6_e = [sf6_e,replicate(!values.f_nan,nbp)] sf6_age = [sf6_age,replicate(!values.f_nan,nbp)] co2_age = [co2_age,replicate(!values.f_nan,nbp)] if ac_data.haskey(vdt_all[d]+'co2_lag_age') then co2_lag_age = [co2_lag_age,ac_data[vdt_all[d]+'co2_lag_age']] else co2_lag_age = [co2_lag_age,replicate(!values.f_nan,nbp)] if ac_data.haskey(vdt_all[d]+'elat_m') then elat_m = [elat_m,ac_data[vdt_all[d]+'elat_m']] else elat_m = [elat_m,ac_data[vdt_all[d]+'elat_m_n']] if ac_data.haskey(vdt_all[d]+'elat_m_n') then elat_m_all = [elat_m_all,ac_data[vdt_all[d]+'elat_m_n']] else elat_m_all = [elat_m_all,ac_data[vdt_all[d]+'elat_m']] if ac_data.haskey(vdt_all[d]+'theta_n') then theta_all = [theta_all,ac_data[vdt_all[d]+'theta_n']] else theta_all = [theta_all,ac_data[vdt_all[d]+'theta']] if ac_data.haskey(vdt_all[d]+'lat_n') then lat_all = [lat_all,ac_data[vdt_all[d]+'lat_n']] else lat_all = [lat_all,ac_data[vdt_all[d]+'lat']] time_all = [time_all,replicate(dates_frac[d],nbp)] time_all_n = [time_all_n,replicate(dates_frac[d],nbpa)] mission = [mission,replicate(d+1,nbp)] dates_str = [dates_str,replicate(strmid(vdt_all[d],0,8),nbp)] dates_str_all = [dates_str_all,replicate(strmid(vdt_all[d],0,8),nbpa)] months_all = [months_all,replicate(fix(strmid(vdt_all[d],4,2)),nbp)] years_all = [years_all,replicate(fix(strmid(vdt_all[d],0,4)),nbp)] days_all = [days_all,replicate(fix(strmid(vdt_all[d],6,2)),nbp)] print,d,nbp,nbpa endfor flight_dates = strmid(vdt_all,0,8) print,flight_dates time_all = time_all[1:-1] & alt = alt[1:-1] & pres = pres[1:-1] & co2_c = co2[1:-1] & co2_adj_c = co2_adj[1:-1] & co2_adj = co2_adj_all & ch4_c = ch4[1:-1] & n2o_all_norm = n2o_norm[1:-1] theta_all = theta_all[1:-1] & lat = lat[1:-1] & lat_all = lat_all[1:-1] & time_all_n = time_all_n[1:-1] tic = interpol(indgen(n_elements(ch4_time)),ch4_time,time_all_n) ch4_surface = interpolate(tropical_ch4_mbl_yrsm,tic) endelse n2o_norm = n2o_norm[1:-1] & ch4 = ch4[1:-1] & ch4_all = ch4_all[1:-1] & co2 = co2[1:-1] & co2_adj = co2_adj[1:-1] & sf6 = sf6[1:-1] & sf6_e = sf6_e[1:-1] & elat_m = elat_m[1:-1] mission = mission[1:-1] & dates_str = dates_str[1:-1] & theta = theta[1:-1] & months_all = months_all[1:-1] & days_all = days_all[1:-1] & years_all = years_all[1:-1] sf6_age = sf6_age[1:-1] & co2_age = co2_age[1:-1] & co2_lag_age = co2_lag_age[1:-1] & n2o = n2o[1:-1] & n2o_all = n2o_all[1:-1] & co2_adj_all = co2_adj_all[1:-1] & co2_all = co2_all[1:-1] dates_str_all = dates_str_all[1:-1] & elat_m_all = elat_m_all[1:-1] & n2o_n_norm = n2o_n_norm[1:-1] times_all = time_all date_frac = times_all di = uniq(date_frac,sort(date_frac)) ndates = n_elements(di) flight_year_frac = date_frac[di] print,flight_year_frac month_frac = fix(12 * (times_all - fix(times_all))) jday_all = julday(months_all,days_all,years_all,0,0) elat_strat_all = elat_m_all yi = interpol(findgen(ny_tp),lat_tp,elat_strat_all) tp_elat = interpolate(tpause_theta,yi) chk = where(theta_all lt tp_elat,nchk) elat_strat_all[chk] = lat_all[chk] chk = where(elat_strat_all ge lat_all+30,nchk) if nchk gt 0 then elat_strat_all[chk] = lat_all[chk] endelse chk = where(sf6_age gt 20,nchk) if nchk gt 0 then sf6_age[chk] = !values.f_nan np = n_elements(times_all) chk_n = where(finite(n2o_norm),nchk_n) tii = interpol(indgen(nte),time_entry,flight_year_frac) flight_sf6_gr = interpolate(sf6_gr,tii) flight_sf6 = interpolate(sf6_yrsm,tii) chk_c = where(finite(co2_adj_c) and finite(sf6),nchk_c) ;chk_c = where(finite(co2_adj_all) and finite(sf6) and sf6_age_calc_adj le 1,nchk_c) ;chk_l = where(abs(elat_m[chk_c]) le 50,nchkl) ;print,chk_c[0:10] print,'Both',nchk_c chk_cc = where(finite(co2_adj_all) and finite(sf6) and finite(ch4_all),nchk_cc) ;print,nchk_cc ;gd = where(finite(co2_age_calc_adj[chk_c]),ngd) ;print,ngd ico2 = where(finite(co2_adj),nco2) print,'CO2 ',nco2 gdc = where(finite(co2[chk_c]),ngd) isf6 = where(finite(sf6),nsf6) print,'SF6 ',nsf6 in2o = where(finite(n2o),nn2o) print,'N2O ',nn2o ;print,ngd ;ii = chk_c[3000] ;print,co2_all[ii],co2_adj_all[ii],co2_age_calc[ii],co2_age_calc_adj[ii],lat_origin_co2[ii],sf6[ii],sf6_e[ii],sf6_age_calc_adj[ii],lat_origin_sf6[ii],n2o_all_norm[ii],elat_m[ii],alt[ii], $ ;date_frac[ii] ;p = plot(indgen(2),/nodata,yrange=[350,370]) ;p = plot(co2,symbol='o',color='orange',/sym_filled,sym_size=0.5,linestyle=6,/overplot) ;p = plot(co2_adj,symbol='o',color='sky blue',/sym_filled,sym_size=0.5,linestyle=6,/overplot) ;p = plot(chk_c,co2_adj_all[chk_c],symbol='o',color='blue',/sym_filled,sym_size=0.5,linestyle=6,/overplot) ; ;p = plot(indgen(2),/nodata) ;p = plot(sf6,symbol='o',color='sky blue',/sym_filled,sym_size=0.5,linestyle=6,/overplot) ;p = plot(chk_c,sf6[chk_c],symbol='o',color='blue',/sym_filled,sym_size=0.5,linestyle=6,/overplot) restore,dir+'Aircraft/Missions/idlsave_files/aircraft_mean_ages_optimum_sf6_co2_'+ext[0]+'_bins.sav' bins_a0 = bins restore,dir+'Aircraft/Missions/idlsave_files/aircraft_mean_ages_co2_'+ext[0]+'_bins.sav' bins_co2_a0 = bins_co2 restore,dir+'Aircraft/Missions/idlsave_files/aircraft_mean_ages_optimum_sf6_co2_'+ext[2]+'_bins.sav' bins_a2 = bins restore,dir+'Aircraft/Missions/idlsave_files/aircraft_mean_ages_co2_'+ext[2]+'_bins.sav' bins_co2_a2 = bins_co2 restore,dir+'Aircraft/Missions/idlsave_files/aircraft_mean_ages_sf6_'+ext[2]+'_bins.sav' bins_sf6_a2 = bins_sf6 restore,dir+'Balloon/Balloon_mean_ages_optimum_sf6_co2_'+ext[0]+'_bins.sav' bins_b0 = bins restore,dir+'Balloon/Balloon_mean_ages_optimum_sf6_co2_'+ext[2]+'_bins.sav' bins_b2 = bins restore,dir+'Balloon/Balloon_mean_ages_co2_'+ext[2]+'_bins.sav' bins_co2_b2 = bins_co2 restore,dir+'Balloon/Balloon_mean_ages_co2_'+ext[2]+'_bins_v2024.sav' bins_co2_b2_v2024 = bins_co2 restore,dir+'Balloon/Balloon_mean_ages_co2_'+ext[0]+'_bins.sav' bins_co2_b0 = bins_co2 restore,dir+'Balloon/Balloon_mean_ages_sf6_'+ext[0]+'_bins.sav' bins_sf6_b0 = bins_sf6 restore,dir+'Aircraft/Missions/idlsave_files/aircraft_mean_age_grid_'+ext[0]+'.sav' grid_a0 = grid restore,dir+'Aircraft/Missions/idlsave_files/aircraft_mean_age_grid_'+ext[1]+'.sav' grid_a1 = grid restore,dir+'Aircraft/Missions/idlsave_files/aircraft_mean_age_grid_'+ext[2]+'.sav' grid_a2 = grid restore,dir+'Balloon/balloon_mean_age_grid_'+ext[0]+'.sav' grid_b0 = grid restore,dir+'Balloon/balloon_mean_age_grid_'+ext[2]+'.sav' grid_b2 = grid restore,dir+'Balloon/balloon_mean_age_grid_'+ext[2]+'_v2024.sav' grid_b2_v2024 = grid d_ratios_fine = 0.025 nr_fine = 2.5/d_ratios_fine-1 ratios_fine = findgen(nr_fine)*d_ratios_fine+0.1 rii = interpol(indgen(nr_trop),ratios_trop,ratios_fine) do_c = 0 ; Interpolate the surface convolutions in time and to a finer grid. if do_c then begin aa = replicate(!values.f_nan,n_ages_trop,ny,nr_trop,ndates) & cc = replicate(!values.f_nan,n_ages_trop_fine,ny,nr_trop,ndates) & ee = replicate(!values.f_nan,n_ages_trop_fine,ny,nr_fine,ndates) co2_e = aa & ch4_e = aa & sf6_et = aa & co2_e_fine = cc & ch4_e_fine = cc & sf6_e_fine = cc & lat_e_fine = cc & frac_extratr_e_fine = cc conv = {co2_e_fine2:ee, ch4_e_fine2:ee, sf6_e_fine2:ee, lat_e_fine2:ee, frac_extratr_e_fine2:ee} for r = 0, nr_trop-1 do for y = 0, ny-1 do for a = 0, n_ages_trop-1 do begin co2_e[a,y,r,*] = interpolate(co2_entry_trop[a,y,r,*],tii) ch4_e[a,y,r,*] = interpolate(ch4_entry_trop[a,y,r,*],tii) sf6_et[a,y,r,*] = interpolate(sf6_entry_trop[a,y,r,*],tii) endfor for i = 0, ndates-1 do begin for r = 0, nr_trop-1 do for y = 0, ny-1 do begin co2_e_fine[*,y,r,i] = interpolate(co2_e[*,y,r,i],ai) ch4_e_fine[*,y,r,i] = interpolate(ch4_e[*,y,r,i],ai) sf6_e_fine[*,y,r,i] = interpolate(sf6_et[*,y,r,i],ai) lat_e_fine[*,y,r,i] = interpolate(lat_entry_trop[*,y,r],ai) frac_extratr_e_fine[*,y,r,i] = interpolate(frac_extratropics_trop[*,r],ai) endfor for y = 0, ny-1 do for a = 0, n_ages_trop_fine-1 do begin conv.co2_e_fine2[a,y,*,i] = interpolate(co2_e_fine[a,y,*,i],rii) conv.ch4_e_fine2[a,y,*,i] = interpolate(ch4_e_fine[a,y,*,i],rii) conv.sf6_e_fine2[a,y,*,i] = interpolate(sf6_e_fine[a,y,*,i],rii) conv.lat_e_fine2[a,y,*,i] = interpolate(lat_e_fine[a,y,*,i],rii) conv.frac_extratr_e_fine2[a,y,*,i] = interpolate(frac_extratr_e_fine[a,y,*,i],rii) endfor endfor if aircraft then save,conv,filename=dir+'Aircraft/Missions/idlsave_files/aircraft_surface_convolutions_'+ext[fi]+'.sav' $ else save,conv,filename=dir+'Balloon/Balloon_surface_convolutions_'+ext[fi]+'.sav' endif else if aircraft then restore,dir+'Aircraft/Missions/idlsave_files/aircraft_surface_convolutions_'+ext[fi]+'.sav' else restore,dir+'Balloon/Balloon_surface_convolutions_'+ext[fi]+'.sav' ff = replicate(!values.f_nan,n_ages_trop,nr_trop,ndates) & co2_tr_e = ff & ch4_tr_e = ff & sf6_tr_et = ff for r = 0, nr_trop-1 do for a = 0, n_ages_trop-1 do begin co2_tr_e[a,r,*] = interpolate(co2_tropical_entry[a,r,*],tii) ch4_tr_e[a,r,*] = interpolate(ch4_tropical_entry[a,r,*],tii) sf6_tr_et[a,r,*] = interpolate(sf6_tropical_entry[a,r,*],tii) endfor if fi eq 2 then sf6_scale_inc = 0.015 else sf6_scale_inc = 0.03 if fi eq 2 then sf6_diffs_both_scale = 0.5 else sf6_diffs_both_scale = 1.0 co2_scale_inc = 0.02 ns = 41 nsc = 15 sf6_scale_all = dindgen(ns)*sf6_scale_inc-ns/2*sf6_scale_inc co2_scale_all = dindgen(nsc)*co2_scale_inc-nsc/2*co2_scale_inc sf6_scale_full = fltarr(ns,nsc) & co2_scale_full = sf6_scale_full for s = 0, nsc-1 do sf6_scale_full[*,s] = sf6_scale_all for s = 0, ns-1 do co2_scale_full[s,*] = co2_scale_all co2_err = 0.05 ; In ppm ch4_err = 0.05 ; In percent based on Weinheimer et al., 1998 ch4_conversion = 0.95 ; Conversion fraction of CH4 to CO2 ch4_conv_uncert = 0.05 ; Addition to adjusted CO2 uncertainty due to CH4 conversion uncertainty. ;ij = where(elat_m[chk_c] ge 25 and n2o_all_norm[chk_c] ge 0.1,nij) ;print,nij runit = 0 gogo = 0 gogo2 = 0 if runit then begin aa = replicate(!values.f_nan,n_ages_trop_fine,ny) & qq = replicate(!values.f_nan,2,n_ages_trop_fine,ny) & dd = replicate(!values.f_nan,ny) & ff = replicate(!values.f_nan,2,ny) gg = replicate(!values.f_nan,ns,nsc,nchk_c) & hh = replicate(!values.f_nan,2,ns,nsc,nchk_c) & ww = replicate(!values.f_nan,nr_trop,nchk_c) oo = replicate(!values.f_nan,n_ages_trop_fine,ny,nr_fine) & opt_ratio_min_diff = aa & pp = replicate(!values.f_nan,n_ages_trop_fine,ny) & rr = replicate(!values.f_nan,nchk_c) mm = replicate(!values.f_nan,n_ages_trop_fine,nchk_c) & range_ratio_both = qq & opt_ratio_both = aa & co2_adj_sc_all = mm & co2_err_sc_all = mm & ages_all = oo & diffs_both_min_tot_num = gg diffs_both_avg = gg & age_opt_all2 = rr & ratio_opt_all2 = rr & lat_source_opt_all2 = rr & sf6_scale_opt_all2 = rr & co2_scale_opt_all2 = rr & ch4_loss_opt_all2 = rr & sf6_opt_all2 = rr lat_source_c_opt_all2 = rr for r = 0, nr_fine-1 do for y = 0, ny-1 do ages_all[*,y,r] = grn_mean_ages_trop_fine dat = {opt_lat_source_range:hh, opt_lat_source:gg, diffs_min:rr, age_opt:rr, ratio_opt:rr, lat_source_opt:rr, scale_diffs:rr, opt_sf6_all:gg, sf6_opt_all:rr, opt_co2_adj_all:gg, $ opt_age_range:hh, opt_age_med:gg, opt_ratio_range:hh, diffs_both_min_tot:gg, opt_ratio_diffs_min:gg, opt_lat_source_diffs_min:gg, opt_age_diffs_min:gg, sf6_scale_opt:rr, co2_scale_opt:rr, $ opt_ratio_med:gg, opt_age_sf6_diffs_min:gg, opt_age_diffs_all:gg, opt_ratio_diffs_all:gg, opt_lat_source_diffs_all:gg, sf6_scale:gg, co2_scale:gg, elat:gg, opt_sf6_scale_diffs_all:gg, $ age_opt_all:rr, ratio_opt_all:rr, lat_source_opt_all:rr, lat_source_c_opt_all:rr, sf6_scale_opt_all:rr, co2_scale_opt_all:rr, ch4_e_opt:rr, opt_ch4_loss_diffs_all:gg, ch4_loss_opt_all:rr, $ diffs_smin:rr, age_opt_smin:rr, ratio_opt_smin:rr, lat_source_opt_smin:rr, sf6_scale_opt_smin:rr, co2_scale_opt_smin:rr, ch4_loss_opt_smin:rr, opt_lat_source_c_diffs_all:gg, $ age_opt_all2:rr, ratio_opt_all2:rr, lat_source_opt_all2:rr, sf6_scale_opt_all2:rr, co2_scale_opt_all2:rr, ch4_loss_opt_all2:rr, sf6_opt_all2:rr, lat_source_c_opt_smin:rr, $ lat_source_c_opt_all2:rr, co2_adj_opt_all:rr, opt_sf6_bias_all:gg, sf6_bias_opt_all:rr, co2_conv_tr_age:ww, sf6_conv_tr_age:ww} if aircraft eq 0 and fi eq 2 then co2_c = co2 else co2_c = co2_all ; for i = 1574, 1574 do begin ; for i = 0, 0 do begin ; for ik = 600, 600 do begin ; i = ij[ik] for i = 0, nchk_c-1 do begin ; if i mod 100 eq 0 then print,i print,i,systime(1)-t0 ii = chk_c[i] print,ch4_all[ii],co2_c[ii],co2_adj_c[ii],sf6[ii],sf6_e[ii],n2o_all_norm[ii],elat_m[ii],alt[ii],date_frac[ii] ti = where(flight_dates eq dates_str[ii],nti) bii = where(year_b eq fix(date_frac[ii])) sf6_bias_yr = sf6_bias_corr[*,bii] sf6_bias_trop_yr = sf6_bias_corr_trop[*,bii] sf6_adj_a = fltarr(n_ages_trop) for a = 0, n_ages_trop-1 do sf6_adj_a[a] = sf6[ii] + sf6_bias_trop_yr[a] * flight_sf6_gr[ti] xx = interpol(indgen(n_ages_trop_fine),grn_mean_ages_trop_fine+sf6_bias_yr,sf6_age[ii]) sf6_age_adj = sf6_age[ii] - interpolate(sf6_bias_yr,xx) ij = interpol(indgen(n_elements(sf6_time)),tropical_sf6_yrsm,sf6[ii]) jj = where(tropical_sf6_yrsm ge sf6[ii]) ij = jj[0] - (tropical_sf6_yrsm[jj[0]] - sf6[ii]) / (tropical_sf6_yrsm[jj[0]] - tropical_sf6_yrsm[jj[0]-1]) sf6_lag_age = date_frac[ii] - interpolate(sf6_time,ij) xx = interpol(indgen(n_ages_trop_fine),grn_mean_ages_trop_fine+sf6_bias_yr,sf6_lag_age) sf6_lag_age_adj = sf6_lag_age - interpolate(sf6_bias_yr,xx) for r = 0, nr_trop-1 do begin rii = interpol(findgen(n_ages_trop),co2_tr_e[*,r,0],co2_adj_all[ii]) dat.co2_conv_tr_age[r,i] = interpolate(grn_mean_ages_trop,rii) for a = 0, n_ages_trop-1 do begin if sf6_adj_a[a] ge sf6_tr_et[a,r,0] then begin if a gt 0 then begin dsf6_adj = sf6_adj_a[a] - sf6_adj_a[a-1] dsf6_tr = sf6_tr_et[a,r,0] - sf6_tr_et[a-1,r,0] for a1 = 0., 51 do begin sf6_adj1 = sf6_adj_a[a-1] + a1*dsf6_adj/50. sf6_tr1 = sf6_tr_et[a-1,r,0] + a1*dsf6_tr/50. if sf6_adj1 ge sf6_tr1 then begin dat.sf6_conv_tr_age[r,i] = grn_mean_ages_trop[a-1] + a1*d_age/50. a1 = 51 endif endfor endif a = n_ages_trop endif endfor endfor print,sf6_lag_age,sf6_lag_age_adj,co2_lag_age[ii] dat.scale_diffs[i] = co2_err / sf6_e[ii] yi1 = 0 yi2 = ny-1 if elat_m[ii] ge 20 then yi1 = 4 if elat_m[ii] le -20 then yi2 = ny-5 dat.elat[i] = elat_m[ii] if n2o_all_norm[ii] lt 0.5 then begin sb1 = 0 sbb1 = 0 sb2 = ns-1 sbb2 = nsc-1 endif else begin n2o_scale = n2o_norm_grid[-1] - 2. * (n2o_norm_grid[-1] - n2o_all_norm[ii]) sb1 = fix(n2o_scale*(ns/4.)) sbb1 = fix(n2o_scale*(nsc/3+1.)) sb2 = ns-1 - sb1 sbb2 = nsc-1 - sbb1 endelse ; print,sb1,sbb1,sb2,sbb2,sf6_scale_all[sb1:sb2] cutit = 0 for b = 0, ns-1 do begin ; for b = sb1, sb2 do begin ; print,b,systime(1)-t0 sf6_adj_s = sf6[ii] + sf6_scale_all[b] ; print,sf6_scale_all[b] ; for bb = nsc/2, nsc/2 do begin ; for bb = sbb1, sbb2 do begin for bb = 3, nsc-4 do begin co2_adj_s = co2_adj_c[ii] + co2_scale_all[bb] co2_diffs = oo & sf6_diffs = oo & range_ratio_trop_co2 = qq & range_ratio_trop_sf6 = qq & diffs_both_all = oo & diffs_both_min = pp & range_ratio_both = qq & opt_ratio_both = aa ages_full = oo & ages_full_sf6 = oo & source_lats_full = oo & ratios_full = oo & opt_lat_source_both = dd & diffs_both_min_lat = dd & opt_ratio_min_diff_lat = dd & opt_age_min_diff_lat = dd opt_age_sf6_min_diff_lat = dd & age_range_both = ff & ch4_loss = oo & ch4_loss_min = pp & opt_ch4_loss_min_diff_lat = dd & ch4_loss_full = oo & ages_full_co2 = oo co2_adj_full = oo & co2_err_full = oo & sf6_full = oo & sf6_e2 = oo & sf6_both = oo & co2_adj_both = oo & source_lats_c_full = oo & sf6_bias_all = oo & sf6_bias_both = oo ; if b eq 0 then print,bb,systime(1)-t0 for y = yi1, yi2 do begin for a = 0, n_ages_trop_fine-1 do begin sf6_bias = sf6_bias_yr[a] * flight_sf6_gr[ti] sf6_adj_b = sf6_adj_s + sf6_bias ; if b eq sb1 and bb eq sbb1 and y eq yi1 then print,sf6_bias ri1 = where(ratios_fine ge grn_mean_ages_trop_fine[a]/8.) ri1 = ri1[0] ; chk_co2 = where(dat.co2_e_fine2[a,y,ri1:-1,i] ge co2_adj_s-co2_err and dat.co2_e_fine2[a,y,ri1:-1,i] le co2_adj_s+co2_err,nchk_co2) ; if finite(ch4_all[ii]) then begin ; co2_adj_sc = co2_c[ii] + co2_scale_all[bb] - 1e-3 * 0.8 * abs(mean(dat.ch4_e_fine2[a,y,ri1:-1,i]) - ch4_all[ii]) ; co2_err_sc = co2_err + 1e-3 * 0.25 * abs(mean(dat.ch4_e_fine2[a,y,ri1:-1,i]) - ch4_all[ii]) ; endif else begin ; co2_adj_sc = co2_c[ii] - 1.1 * (1. - n2o_all_norm[ii]) ; co2_err_sc = co2_err ; endelse ;; if b eq sb1 and a eq 20 and y eq 8 then print,lat_grid_entry[y],grn_mean_ages_trop_fine[a],mean(dat.ch4_e_fine2[a,y,ri1:-1,i]),co2_scale_all[bb],co2_adj_sc,co2_err_sc ; chk_co2 = where(dat.co2_e_fine2[a,y,ri1:-1,i] ge co2_adj_sc-co2_err_sc and dat.co2_e_fine2[a,y,ri1:-1,i] le co2_adj_sc+co2_err_sc,nchk_co2) if finite(ch4_c[ii]) then begin co2_adj_sc = co2_c[ii] + co2_scale_all[bb] - 1e-3 * ch4_conversion * abs(mean(conv.ch4_e_fine2[a,y,ri1:-1,ti]) - ch4_c[ii]) co2_adj_full[a,y,*] = co2_c[ii] + co2_scale_all[bb] - 1e-3 * ch4_conversion * abs(conv.ch4_e_fine2[a,y,*,ti] - ch4_c[ii]) co2_err_sc = co2_err + 1e-3 * ch4_conv_uncert * abs(mean(conv.ch4_e_fine2[a,y,ri1:-1,ti]) - (ch4_c[ii]-ch4_err*ch4_c[ii])) co2_err_full[a,y,*] = co2_err + 1e-3 * ch4_conv_uncert * abs(conv.ch4_e_fine2[a,y,*,ti] - (ch4_c[ii]-ch4_err*ch4_c[ii])) endif else begin co2_adj_sc = co2_c[ii] + co2_scale_all[bb] - 1.1 * (1. - n2o_all_norm[ii]) co2_adj_full[a,y,*] = replicate(co2_adj_sc,nr_fine) co2_err_sc = co2_err co2_err_full[a,y,*] = replicate(co2_err_sc,nr_fine) endelse chk_co2 = where(conv.co2_e_fine2[a,y,ri1:-1,ti] ge co2_adj_sc-co2_err_sc and conv.co2_e_fine2[a,y,ri1:-1,ti] le co2_adj_sc+co2_err_sc,nchk_co2) if nchk_co2 gt 0 then begin range_ratio_trop_co2[*,a,y] = [ratios_fine[chk_co2[0]+ri1],ratios_fine[chk_co2[-1]+ri1]] ; co2_diffs[a,y,chk_co2+ri1] = abs(co2_adj_s - dat.co2_e_fine2[a,y,chk_co2+ri1,i]) co2_diffs[a,y,chk_co2+ri1] = abs(co2_adj_sc - conv.co2_e_fine2[a,y,chk_co2+ri1,ti]) if finite(ch4_c[ii]) then ch4_loss[a,y,chk_co2+ri1] = ch4_conversion * abs(conv.ch4_e_fine2[a,y,chk_co2+ri1,ti] - ch4_c[ii]) $ ; Assume 95% conversion of CH4 to CO2. else ch4_loss[a,y,chk_co2+ri1] = 1.1e3 * (1. - n2o_all_norm[ii]) ages_full_co2[a,y,chk_co2+ri1] = replicate(grn_mean_ages_trop_fine[a],nchk_co2) endif sf6_min = reform(sf6_adj_b-sf6_e[ii]) sf6_max = reform(sf6_adj_b+sf6_e[ii]) sf6_min = sf6_min[0] sf6_max = sf6_max[0] chk_sf6 = where(conv.sf6_e_fine2[a,y,ri1:-1,ti] ge sf6_min and conv.sf6_e_fine2[a,y,ri1:-1,ti] le sf6_max,nchk_sf6) if nchk_sf6 gt 0 then begin range_ratio_trop_sf6[*,a,y] = [ratios_fine[chk_sf6[0]+ri1],ratios_fine[chk_sf6[-1]+ri1]] sf6_diffs[a,y,chk_sf6+ri1] = replicate(sf6_adj_b,nchk_sf6) - reform(conv.sf6_e_fine2[a,y,chk_sf6+ri1,ti]) sf6_diffs[a,y,chk_sf6+ri1] = abs(sf6_diffs[a,y,chk_sf6+ri1]) ages_full_sf6[a,y,chk_sf6+ri1] = replicate(grn_mean_ages_trop_fine[a],nchk_sf6) sf6_full[a,y,chk_sf6+ri1] = replicate(sf6_adj_b,nchk_sf6) sf6_e2[a,y,chk_sf6+ri1] = reform(conv.sf6_e_fine2[a,y,chk_sf6+ri1,ti]) sf6_bias_all[a,y,chk_sf6+ri1] = replicate(sf6_bias,nchk_sf6) ; if b eq ns/2 and bb eq nsc/2 and a eq 42 and y eq 4 then print,sf6_adj_b,reform(conv.sf6_e_fine2[a,y,chk_sf6+ri1,ti]),reform(sf6_diffs[a,y,chk_sf6+ri1]) endif endfor for a = 0, n_ages_trop_fine-1 do begin ri1 = where(ratios_fine ge grn_mean_ages_trop_fine[a]/8.) ri1 = ri1[0] if finite(range_ratio_trop_co2[0,a,y]) then begin ; bias = sf6_bias_corr[a,bii] ; a_bias = round(bias / d_age_fine) if finite(range_ratio_trop_sf6[0,a,y]) then begin ; if finite(range_ratio_trop_sf6[0,a-a_bias,y]) then begin si = where(finite(co2_diffs[a,y,*]) and finite(sf6_diffs[a,y,*]),nsi) ; if finite(range_ratio_trop_sf6[0,a+a_bias,y]) then begin ; si = where(finite(co2_diffs[a,y,*]) and finite(sf6_diffs[a+a_bias,y,*]),nsi) ; si = where(dat.co2_e_fine2[a,y,ri1:-1,i] ge co2_adj_s-co2_err and dat.co2_e_fine2[a,y,ri1:-1,i] le co2_adj_s+co2_err and $ ; dat.sf6_e_fine2[a,y,ri1:-1,i] ge sf6_adj_s-sf6_e[ii] and dat.sf6_e_fine2[a,y,ri1:-1,i] le sf6_adj_s+sf6_e[ii],nsi) if nsi gt 0 then begin diffs_both_all[a,y,si] = 0.5 * (co2_diffs[a,y,si]/co2_err_full[a,y,si] + sf6_diffs[a,y,si]/sf6_e[ii]) ; diffs_both_all[a,y,si] = co2_diffs[a,y,si] + dat.scale_diffs[i] * sf6_diffs[a,y,si] ; diffs_both_all[a,y,si] = co2_diffs[a,y,si] + sf6_diffs_both_scale * sf6_diffs[a+a_bias,y,si] ; diffs_both_all[a,y,si+ri1] = abs(co2_adj_s - dat.co2_e_fine2[a,y,si+ri1,i]) + sf6_diffs_both_scale * abs(sf6_adj_s - dat.sf6_e_fine2[a,y,si+ri1,i]) si_min = where(diffs_both_all[a,y,si] eq min(diffs_both_all[a,y,si])) ; si_min = where(diffs_both_all[a,y,*] eq min(diffs_both_all[a,y,*])) diffs_both_min[a,y] = diffs_both_all[a,y,si[si_min[0]]] ; diffs_both_min[a,y] = diffs_both_all[a,y,si_min[0]] range_ratio_both[*,a,y] = [ratios_fine[si[0]],ratios_fine[si[-1]]] ; range_ratio_both[*,a,y] = [ratios_fine[si[0]+ri1],ratios_fine[si[-1]+ri1]] opt_ratio_both[a,y] = median(ratios_fine[si]) opt_ratio_min_diff[a,y] = ratios_fine[si[si_min[0]]] ratios_full[a,y,si] = ratios_fine[si] ages_full[a,y,si] = replicate(grn_mean_ages_trop_fine[a],nsi) source_lats_full[a,y,si] = replicate(lat_grid_entry[y],nsi) source_lats_c_full[a,y,si] = conv.lat_e_fine2[a,y,si,ti] ch4_loss_full[a,y,si] = ch4_loss[a,y,si] ch4_loss_min[a,y] = ch4_loss[a,y,si[si_min[0]]] sf6_both[a,y,si] = sf6_full[a,y,si] sf6_bias_both[a,y,si] = sf6_bias_all[a,y,si] co2_adj_both[a,y,si] = co2_adj_full[a,y,si] endif endif endif endfor chk = where(finite(opt_ratio_both[*,y]),nchk) if nchk gt 0 then begin age_range_both[*,y] = [grn_mean_ages_trop_fine[chk[0]],grn_mean_ages_trop_fine[chk[-1]]] opt_lat_source_both[y] = 1 dmin = min(diffs_both_min[chk,y],mi) diffs_both_min_lat[y] = dmin opt_ratio_min_diff_lat[y] = opt_ratio_min_diff[chk[mi],y] opt_age_min_diff_lat[y] = grn_mean_ages_trop_fine[chk[mi]] opt_age_sf6_min_diff_lat[y] = grn_mean_ages_trop_fine[chk[mi]] ; opt_age_sf6_min_diff_lat[y] = grn_mean_ages_trop_fine[chk[mi]+a_bias] opt_ch4_loss_min_diff_lat[y] = ch4_loss_min[chk[mi],y] endif endfor chk = where(finite(opt_lat_source_both),nchk) if nchk gt 0 then begin dat.opt_lat_source_range[*,b,bb,i] = [min(lat_grid_entry[chk]),max(lat_grid_entry[chk])] dat.opt_lat_source[b,bb,i] = median(lat_grid_entry[chk]) dat.opt_age_range[*,b,bb,i] = [min(age_range_both[0,chk]),max(age_range_both[1,chk])] all_ages = 0. & all_ratios = 0. for jj = 0, nchk-1 do begin gd = where(finite(opt_ratio_both[*,chk[jj]]),ngd) all_ages = [all_ages,grn_mean_ages_trop_fine[gd]] for a = 0, ngd-1 do begin ranges = range_ratio_both[*,gd[a],chk[jj]] ri = where(ratios_fine ge ranges[0] and ratios_fine le ranges[1]) all_ratios = [all_ratios,ratios_fine[ri]] endfor endfor all_ages = all_ages[1:-1] all_ratios = all_ratios[1:-1] all_ages = all_ages[sort(all_ages)] all_ratios = all_ratios[sort(all_ratios)] dat.opt_age_med[b,bb,i] = median(all_ages) dat.opt_ratio_range[*,b,bb,i] = [min(all_ratios),max(all_ratios)] dat.opt_ratio_med[b,bb,i] = median(all_ratios) dmin = min(diffs_both_min_lat[chk],mi) dat.diffs_both_min_tot[b,bb,i] = dmin dat.opt_ratio_diffs_min[b,bb,i] = opt_ratio_min_diff_lat[chk[mi]] dat.opt_lat_source_diffs_min[b,bb,i] = lat_grid_entry[chk[mi]] dat.opt_age_diffs_min[b,bb,i] = opt_age_min_diff_lat[chk[mi]] dat.opt_age_sf6_diffs_min[b,bb,i] = opt_age_sf6_min_diff_lat[chk[mi]] ; if bb eq ns/2 then print,dat.opt_age_diffs_min[i],dat.opt_ratio_diffs_min[i],dat.opt_lat_source_diffs_min[i],dat.diffs_both_min_tot[i] ; Check on size of diffs_both_min_tot for no CO2 scaling to see if the SF6 scaling can be stopped. if b ge ns/2+3 then begin chk = where(dat.diffs_both_min_tot[b-6:b,bb,i] le 0.5,nchk) if nchk eq 7 then cutit = 1 ; chk = where(dat.diffs_both_min_tot[0:ns/2,bb,i] le 0.1,nchk) ; chk2 = where(dat.diffs_both_min_tot[ns/2+2:b,bb,i] le 0.1,nchk2) ; if nchk2 ge nchk then cutit = 1 endif chk = where(finite(diffs_both_all) and diffs_both_all le 0.15,nchk) ; Number of low difference scaling. if nchk gt 0 then diffs_both_min_tot_num[b,bb,i] = nchk diffs_both_avg[b,bb,i] = mean(diffs_both_all,/nan) ; Calculate the optimal ages and ratios based on scaled diffs. zz = where(finite(ages_full),nzz) diffs_rev = max(diffs_both_all[zz])-diffs_both_all[zz] tot = total(diffs_rev) diffs_norm = diffs_rev / tot dat.opt_age_diffs_all[b,bb,i] = total(ages_full[zz] * diffs_norm) dat.opt_ratio_diffs_all[b,bb,i] = total(ratios_full[zz] * diffs_norm) dat.opt_lat_source_diffs_all[b,bb,i] = total(source_lats_full[zz] * diffs_norm) dat.opt_lat_source_c_diffs_all[b,bb,i] = total(source_lats_c_full[zz] * diffs_norm) dat.opt_ch4_loss_diffs_all[b,bb,i] = total(ch4_loss_full[zz] * diffs_norm) dat.opt_sf6_all[b,bb,i] = total(sf6_both[zz] * diffs_norm) dat.opt_sf6_bias_all[b,bb,i] = total(sf6_bias_both[zz] * diffs_norm) dat.opt_co2_adj_all[b,bb,i] = total(co2_adj_both[zz] * diffs_norm) ; if bb eq ns/2 then print,i,dat.opt_lat_source_range[*,b,bb,i],dat.opt_age_range[*,b,bb,i],dat.opt_ratio_range[*,b,bb,i],dat.diffs_both_min_tot[b,bb,i],dat.opt_age_diffs_min[b,bb,i], $ ; dat.opt_ratio_diffs_min[b,bb,i],dat.opt_lat_source_diffs_min[b,bb,i] endif if b eq ns/2 and bb eq nsc/2 then begin sdiffs = sf6_diffs cdiffs = co2_diffs sf6_full1 = sf6_full sf6_e21 = sf6_e2 ages_full1 = ages_full ages_full1_sf6 = ages_full_sf6 ages_full1_co2 = ages_full_co2 co2_adj_full1 = co2_adj_full co2_err_full1 = co2_err_full diffs_both_all1 = diffs_both_all ratios_full1 = ratios_full source_lats_full1 = source_lats_full for a = 0, n_ages_trop_fine-1 do begin co2_adj_sc_all[a,i] = mean(co2_adj_full[a,*,*],/nan) co2_err_sc_all[a,i] = mean(co2_err_full[a,*,*],/nan) endfor endif ; if b eq ns/2+2 and bb eq nsc/2-1 then begin if b eq ns/2-1 and bb eq nsc/2 then begin sf6_full2 = sf6_full sf6_e22 = sf6_e2 ages_full2 = ages_full ages_full2_sf6 = ages_full_sf6 ages_full2_co2 = ages_full_co2 co2_adj_full2 = co2_adj_full co2_err_full2 = co2_err_full diffs_both_all2 = diffs_both_all ratios_full2 = ratios_full source_lats_full2 = source_lats_full endif endfor if cutit then b = ns-1 endfor diffs = dat.diffs_both_min_tot[*,*,i] ages = dat.opt_age_diffs_min[*,*,i] ratios = dat.opt_ratio_diffs_min[*,*,i] lat_source = dat.opt_lat_source_diffs_min[*,*,i] dmin = min(diffs,mi) dat.diffs_min[i] = diffs[mi] dat.age_opt[i] = ages[mi] dat.ratio_opt[i] = ratios[mi] dat.lat_source_opt[i] = lat_source[mi] dat.sf6_scale_opt[i] = sf6_scale_full[mi] dat.co2_scale_opt[i] = co2_scale_full[mi] counts = diffs_both_min_tot_num[*,*,i] ages = dat.opt_age_diffs_all[*,*,i] ratios = dat.opt_ratio_diffs_all[*,*,i] lat_source = dat.opt_lat_source_diffs_all[*,*,i] lat_source_c = dat.opt_lat_source_c_diffs_all[*,*,i] ch4_l = dat.opt_ch4_loss_diffs_all[*,*,i] sf6_all = dat.opt_sf6_all[*,*,i] sf6_b_all = dat.opt_sf6_bias_all[*,*,i] co2_adj_l = dat.opt_co2_adj_all[*,*,i] ; Set the conditions for the scalings that are included in the optimization. if n2o_all_norm[ii] lt 0.8 then zz = where(finite(ages) and counts ge 5 and diffs le 0.1,nzz) if n2o_all_norm[ii] ge 0.8 then begin if diffs[ns/2,nsc/2] le 0.15 or diffs[ns/2-1,nsc/2] le 0.15 or diffs[ns/2+1,nsc/2] le 0.15 then begin diffs[0:16,*] = !values.f_nan diffs[-17:-1,*] = !values.f_nan zz = where(finite(ages) and counts ge 5 and diffs le 0.15,nzz) endif else zz = where(finite(ages) and counts ge 5 and diffs le 0.15,nzz) endif print,nzz diffs_rev = (max(diffs[zz])-diffs[zz])^2 tot = total(diffs_rev) diffs_norm = diffs_rev / tot dat.age_opt_all[i] = total(ages[zz] * diffs_norm) dat.ratio_opt_all[i] = total(ratios[zz] * diffs_norm) dat.lat_source_opt_all[i] = total(lat_source[zz] * diffs_norm) dat.lat_source_c_opt_all[i] = total(lat_source_c[zz] * diffs_norm) dat.sf6_scale_opt_all[i] = total(sf6_scale_full[zz] * diffs_norm) dat.co2_scale_opt_all[i] = total(co2_scale_full[zz] * diffs_norm) dat.ch4_loss_opt_all[i] = total(ch4_l[zz] * diffs_norm) dat.sf6_opt_all[i] = total(sf6_all[zz] * diffs_norm) dat.sf6_bias_opt_all[i] = total(sf6_b_all[zz] * diffs_norm) dat.co2_adj_opt_all[i] = total(co2_adj_l[zz] * diffs_norm) print,dat.age_opt_all[i],dat.sf6_opt_all[i],dat.sf6_bias_opt_all[i],dat.sf6_scale_opt_all[i],dat.co2_adj_opt_all[i],dat.co2_scale_opt_all[i],1e-3*dat.ch4_loss_opt_all[i], $ dat.lat_source_opt_all[i],dat.ratio_opt_all[i] ; endelse zz = where(finite(ages),nzz) diffs_rev = (max(diffs[zz])-diffs[zz])^2 tot = total(diffs_rev) diffs_norm = diffs_rev / tot age_opt_all2[i] = total(ages[zz] * diffs_norm) ratio_opt_all2[i] = total(ratios[zz] * diffs_norm) lat_source_opt_all2[i] = total(lat_source[zz] * diffs_norm) lat_source_c_opt_all2[i] = total(lat_source_c[zz] * diffs_norm) sf6_scale_opt_all2[i] = total(sf6_scale_full[zz] * diffs_norm) co2_scale_opt_all2[i] = total(co2_scale_full[zz] * diffs_norm) ch4_loss_opt_all2[i] = total(ch4_l[zz] * diffs_norm) sf6_opt_all2[i] = total(sf6_all[zz] * diffs_norm) dat.age_opt_all2[i] = total(ages[zz] * diffs_norm) dat.ratio_opt_all2[i] = total(ratios[zz] * diffs_norm) dat.lat_source_opt_all2[i] = total(lat_source[zz] * diffs_norm) dat.lat_source_c_opt_all2[i] = total(lat_source_c[zz] * diffs_norm) dat.sf6_scale_opt_all2[i] = total(sf6_scale_full[zz] * diffs_norm) dat.co2_scale_opt_all2[i] = total(co2_scale_full[zz] * diffs_norm) dat.ch4_loss_opt_all2[i] = total(ch4_l[zz] * diffs_norm) dat.sf6_opt_all2[i] = total(sf6_all[zz] * diffs_norm) zz1 = zz ; Optimize for the minimum scaling of SF6 and CO2. ; zz = where(finite(ages) and counts ge 5 and diffs le 0.1,nzz) zz = where(finite(ages) and diffs le 0.15,nzz) scale_tot = abs(sf6_scale_full[zz]) + abs(co2_scale_full[zz]) smin = min(scale_tot,si) dat.diffs_smin[i] = diffs[zz[si]] dat.age_opt_smin[i] = ages[zz[si]] dat.ratio_opt_smin[i] = ratios[zz[si]] dat.lat_source_opt_smin[i] = lat_source[zz[si]] dat.lat_source_c_opt_smin[i] = lat_source_c[zz[si]] dat.sf6_scale_opt_smin[i] = sf6_scale_full[zz[si]] dat.co2_scale_opt_smin[i] = co2_scale_full[zz[si]] dat.ch4_loss_opt_smin[i] = ch4_l[zz[si]] endfor ch4_loss_opt = dat.ch4_loss_opt_all age_opt_all = dat.age_opt_all ratio_opt_all = dat.ratio_opt_all sf6_scale_opt_all = dat.sf6_scale_opt_all co2_scale_opt_all = dat.co2_scale_opt_all diffs_both_min_tot = dat.diffs_both_min_tot age_opt_smin = dat.age_opt_smin sf6_scale_opt_smin = dat.sf6_scale_opt_smin co2_scale_opt_smin = dat.co2_scale_opt_smin ch4_loss_opt_smin = dat.ch4_loss_opt_smin scale_diffs = dat.scale_diffs sf6_opt_all = dat.sf6_opt_all opt_age_diffs_all = dat.opt_age_diffs_all opt_ratio_diffs_all = dat.opt_ratio_diffs_all opt_lat_source_diffs_all = dat.opt_lat_source_diffs_all opt_lat_source_c_diffs_all = dat.opt_lat_source_c_diffs_all opt_sf6_all = dat.opt_sf6_all opt_co2_adj_all = dat.opt_co2_adj_all co2_conv_tr_age = dat.co2_conv_tr_age sf6_conv_tr_age = dat.sf6_conv_tr_age if aircraft then save,dat,filename=dir+'Aircraft/Missions/idlsave_files/aircraft_mean_ages_sweep_sf6_co2_'+ext[fi]+'.sav' $ else save,dat,filename=dir+'Balloon/Balloon_mean_ages_sweep_sf6_co2_'+b_ext[fi]+'.sav' ; endif if aircraft then restore,dir+'Aircraft/Missions/idlsave_files/aircraft_mean_ages_sweep_sf6_co2_'+ext[fi]+'.sav' $ else restore,dir+'Balloon/Balloon_mean_ages_sweep_sf6_co2_'+b_ext[fi]+'.sav' do_adj = 0 if do_adj then begin oo = replicate(!values.f_nan,n_ages_trop_fine,ny,nr_fine,nchk_c) & co2_adj_full = oo & co2_err_full = oo ; for i = 174, 174 do begin for i = 0, nchk_c-1 do begin ii = chk_c[i] ti = where(flight_dates eq dates_str[ii],nti) yi1 = 0 yi2 = ny-1 if elat_m[ii] ge 20 then yi1 = 4 if elat_m[ii] le -20 then yi2 = ny-5 for y = yi1, yi2 do for a = 0, n_ages_trop_fine-1 do begin ri1 = where(ratios_fine ge grn_mean_ages_trop_fine[a]/8.) ri1 = ri1[0] if finite(ch4_all[ii]) then begin co2_adj_full[a,y,*,i] = co2_all[ii] - 1e-3 * ch4_conversion * abs(conv.ch4_e_fine2[a,y,*,ti] - ch4_all[ii]) co2_err_full[a,y,*,i] = co2_err + 1e-3 * ch4_conv_uncert * abs(conv.ch4_e_fine2[a,y,*,ti] - (ch4_all[ii]-ch4_err*ch4_all[ii])) endif else begin co2_adj_sc = co2_all[ii] - 1.1 * (1. - n2o_all_norm[ii]) co2_adj_full[a,y,*,i] = replicate(co2_adj_sc,nr_fine) co2_err_sc = co2_err co2_err_full[a,y,*,i] = replicate(co2_err_sc,nr_fine) endelse endfor endfor if aircraft then save,co2_adj_full,co2_err_full,filename=dir+'Aircraft/Missions/idlsave_files/aircraft_co2_adj_'+ext[fi]+'.sav' $ else save,co2_adj_full,co2_err_full,filename=dir+'Balloon/Balloon_co2_adj_'+ext[fi]+'.sav' endif if aircraft then restore,dir+'Aircraft/Missions/idlsave_files/aircraft_co2_adj_'+ext[fi]+'.sav' else restore,dir+'Balloon/Balloon_co2_adj_'+ext[fi]+'.sav' ; WACCM interannual anomalies. ;restore,dir+'Models/WACCM/FWSD_'+ext[fi]+'_aircraft_seas.sav' ;yi = interpol(indgen(n_elements(lat)),lat,elat_m[chk_c]) ;gi = interpol(indgen(n_elements(n2o_norm_grid_model)),n2o_norm_grid_model,n2o_all_norm[chk_c]) ;if fi eq 2 then model_years = [model_years,findgen(6)*(1./12.)+2023+1./24.] ;ti = interpol(indgen(n_elements(model_years)),model_years,times_all[chk_c]) ;model_anoms = interpolate(n2o_norm_aoa_anom,yi,gi,ti) ;age_opt_all_adj = dat.age_opt_all - model_anoms mission_names = ['aaoe','aase','aase2','ashoe','spade','strat','polaris','solve','accent','crystalf','pre_ave','ave_0506','cr_ave','tc4','glopac','attrex','seac4rs','dcotts1','dcotts2','sabre'] nm = n_elements(mission_names) nn = n_elements(n2o_norm_grid) dn2o = 1e-2 nt = 434 years = findgen(nt)*(1./12.)+1990.+1./24. kk = replicate(!values.f_nan,nn,2) & ll = replicate(!values.f_nan,nn,2,nm) & oo = replicate(!values.f_nan,nn,2,12) & mm = replicate(!values.f_nan,nn,2,nt) & pp = replicate(!values.f_nan,ns,nsc,nn,2) qq = replicate(!values.f_nan,ns,nsc,nn,2,nt) & rr = replicate(!values.f_nan,nm) dobin = 0 if dobin then begin ; N2O binning sf6_lag_age = replicate(!values.f_nan,nchk_c) & sf6_lag_age_bias_corr = sf6_lag_age & co2_lag_age = sf6_lag_age bins = {n2o_norm_age_nh:kk, n2o_norm_age_all_nh:kk, n2o_norm_age_tr:kk, n2o_norm_age_all_tr:kk, n2o_norm_diffs_nh:kk, n2o_norm_ratio_all_nh:kk, n2o_norm_age_nh_m:ll, n2o_norm_age_all_nh_m:ll, $ n2o_norm_age_tr_m:ll, n2o_norm_age_all_tr_m:ll, n2o_norm_ratio_all_tr:kk, n2o_norm_age_nh_seas:oo, n2o_norm_age_tr_seas:oo, n2o_norm_sf6_scale_nh:kk, n2o_norm_age_nh_years:mm, $ n2o_norm_age_all_nh_years:mm, n2o_norm_age_tr_years:mm, n2o_norm_age_all_tr_years:mm, n2o_norm_diffs_nh_years:mm, n2o_norm_ratio_all_nh_years:mm, n2o_norm_sf6_scale_nh_years:mm, $ n2o_norm_elat_nh_years:mm, n2o_norm_co2_scale_nh:kk, n2o_norm_co2_scale_nh_years:mm, n2o_norm_diffs_nh_sweep:pp, n2o_norm_diffs_nh_sweep_years:qq, n2o_norm_age_nh_sweep_years:qq, $ n2o_norm_ratio_nh_sweep_years:qq, n2o_norm_age_nh_sweep:pp, n2o_norm_lat_source_all_nh:kk, n2o_norm_lat_source_all_nh_years:mm, n2o_norm_elat_nh:kk, n2o_norm_sf6_nh:kk, n2o_norm_age_smin_nh:kk, $ n2o_norm_age_all_nh_adj:kk, n2o_norm_age_all_nh_early:kk, n2o_norm_age_all_nh_late:kk, n2o_norm_sf6_scale_smin_nh:kk, n2o_norm_sf6_scale_nh_m:ll, n2o_norm_sf6_scale_smin_nh_m:ll, $ n2o_norm_ratio_smin_nh:kk, n2o_norm_co2_scale_nh_m:ll, n2o_norm_sf6_nh_m:ll, n2o_norm_sf6_age_nh:kk, n2o_norm_co2_age_nh:kk, n2o_norm_sf6_age_tr:kk, n2o_norm_co2_age_tr:kk, n2o_norm_age:kk, $ n2o_norm_age_all:kk, n2o_norm_ratio_all:kk, n2o_norm_sf6_age:kk, n2o_norm_co2_age:kk, sf6_avg_m:rr, co2_avg_m:rr, n2o_norm_age_all_m:ll, n2o_norm_ratio_all_m:ll, n2o_norm_sf6_scale_m:ll, $ n2o_norm_co2_scale_m:ll, n2o_norm_sf6_scale_all:kk, n2o_norm_co2_scale_all:kk, n2o_norm_sf6_lag_age_m:ll, n2o_norm_sf6_lag_age_vx_m:ll, n2o_norm_sf6_lag_age_bias_corr_m:ll, $ n2o_norm_co2_lag_age:kk, n2o_norm_sf6_lag_age_bias_corr:kk} for i = 0, nn-1 do begin gd = where(n2o_all_norm[chk_c] ge n2o_norm_grid[i] - dn2o/2. and n2o_all_norm[chk_c] lt n2o_norm_grid[i] + dn2o/2.,ngd) if ngd ge 1 then begin chk = where(elat_m[chk_c[gd]] ge 25,ni_all) if ni_all ge 1 then begin stats = moment(dat.age_opt[gd[chk]],sdev=sdev,/nan) bins.n2o_norm_age_nh[i,*] = [stats[0],sdev] stats = moment(dat.age_opt_all[gd[chk]],sdev=sdev,/nan) bins.n2o_norm_age_all_nh[i,*] = [stats[0],sdev] stats = moment(dat.age_opt_smin[gd[chk]],sdev=sdev,/nan) bins.n2o_norm_age_smin_nh[i,*] = [stats[0],sdev] stats = moment(dat.diffs_min[gd[chk]],sdev=sdev,/nan) bins.n2o_norm_diffs_nh[i,*] = [stats[0],sdev] stats = moment(dat.ratio_opt_all[gd[chk]],sdev=sdev,/nan) bins.n2o_norm_ratio_all_nh[i,*] = [stats[0],sdev] stats = moment(dat.ratio_opt_smin[gd[chk]],sdev=sdev,/nan) bins.n2o_norm_ratio_smin_nh[i,*] = [stats[0],sdev] ; stats = moment(age_opt_all_adj[gd[chk]],sdev=sdev,/nan) ; bins.n2o_norm_age_all_nh_adj[i,*] = [stats[0],sdev] stats = moment(dat.lat_source_opt_all[gd[chk]],sdev=sdev,/nan) bins.n2o_norm_lat_source_all_nh[i,*] = [stats[0],sdev] stats = moment(dat.sf6_scale_opt_all[gd[chk]],sdev=sdev,/nan) bins.n2o_norm_sf6_scale_nh[i,*] = [stats[0],sdev] stats = moment(dat.sf6_scale_opt_smin[gd[chk]],sdev=sdev,/nan) bins.n2o_norm_sf6_scale_smin_nh[i,*] = [stats[0],sdev] stats = moment(dat.co2_scale_opt_all[gd[chk]],sdev=sdev,/nan) bins.n2o_norm_co2_scale_nh[i,*] = [stats[0],sdev] stats = moment(dat.elat[gd[chk]],sdev=sdev,/nan) bins.n2o_norm_elat_nh[i,*] = [stats[0],sdev] stats = moment(sf6[chk_c[gd[chk]]],sdev=sdev,/nan) bins.n2o_norm_sf6_nh[i,*] = [stats[0],sdev] stats = moment(sf6_age[chk_c[gd[chk]]],sdev=sdev,/nan) bins.n2o_norm_sf6_age_nh[i,*] = [stats[0],sdev] stats = moment(co2_age[chk_c[gd[chk]]],sdev=sdev,/nan) bins.n2o_norm_co2_age_nh[i,*] = [stats[0],sdev] for b = 0, ns-1 do for bb = 0, nsc-1 do begin stats = moment(dat.diffs_both_min_tot[b,bb,gd[chk]],sdev=sdev,/nan) bins.n2o_norm_diffs_nh_sweep[b,bb,i,*] = [stats[0],sdev] stats = moment(dat.opt_age_diffs_all[b,bb,gd[chk]],sdev=sdev,/nan) bins.n2o_norm_age_nh_sweep[b,bb,i,*] = [stats[0],sdev] endfor ; Divide up the 1990s binning into early and late periods. chk2 = where(times_all[chk_c[gd[chk]]] lt 1996.5,ni_all2) if ni_all2 ge 1 then begin stats = moment(dat.age_opt_all[gd[chk[chk2]]],sdev=sdev,/nan) bins.n2o_norm_age_all_nh_early[i,*] = [stats[0],sdev] endif chk2 = where(times_all[chk_c[gd[chk]]] ge 1996.5,ni_all2) if ni_all2 ge 1 then begin stats = moment(dat.age_opt_all[gd[chk[chk2]]],sdev=sdev,/nan) bins.n2o_norm_age_all_nh_late[i,*] = [stats[0],sdev] endif for t = 0, nt-1 do begin chk2 = where(times_all[chk_c[gd[chk]]] ge years[t]-(1./24.) and times_all[chk_c[gd[chk]]] lt years[t]+(1./24.),ni_all) if ni_all ge 1 then begin stats = moment(dat.age_opt[gd[chk[chk2]]],sdev=sdev,/nan) bins.n2o_norm_age_nh_years[i,*,t] = [stats[0],sdev] chk3 = where(dat.diffs_min[gd[chk[chk2]]] le 0.1,nchk3) if nchk3 ge 1 then begin stats = moment(dat.age_opt_all[gd[chk[chk2[chk3]]]],sdev=sdev,/nan) bins.n2o_norm_age_all_nh_years[i,*,t] = [stats[0],sdev] stats = moment(dat.diffs_min[gd[chk[chk2[chk3]]]],sdev=sdev,/nan) bins.n2o_norm_diffs_nh_years[i,*,t] = [stats[0],sdev] endif stats = moment(dat.ratio_opt_all[gd[chk[chk2]]],sdev=sdev,/nan) bins.n2o_norm_ratio_all_nh_years[i,*,t] = [stats[0],sdev] stats = moment(dat.lat_source_opt_all[gd[chk[chk2]]],sdev=sdev,/nan) bins.n2o_norm_lat_source_all_nh_years[i,*,t] = [stats[0],sdev] stats = moment(dat.sf6_scale_opt_all[gd[chk[chk2]]],sdev=sdev,/nan) bins.n2o_norm_sf6_scale_nh_years[i,*,t] = [stats[0],sdev] stats = moment(dat.co2_scale_opt_all[gd[chk[chk2]]],sdev=sdev,/nan) bins.n2o_norm_co2_scale_nh_years[i,*,t] = [stats[0],sdev] stats = moment(dat.elat[gd[chk[chk2]]],sdev=sdev,/nan) bins.n2o_norm_elat_nh_years[i,*,t] = [stats[0],sdev] for b = 0, ns-1 do for bb = 0, nsc-1 do begin stats = moment(dat.diffs_both_min_tot[b,bb,gd[chk[chk2]]],sdev=sdev,/nan) bins.n2o_norm_diffs_nh_sweep_years[b,bb,i,*,t] = [stats[0],sdev] stats = moment(dat.opt_age_diffs_all[b,bb,gd[chk[chk2]]],sdev=sdev,/nan) bins.n2o_norm_age_nh_sweep_years[b,bb,i,*,t] = [stats[0],sdev] stats = moment(dat.opt_ratio_diffs_all[b,bb,gd[chk[chk2]]],sdev=sdev,/nan) bins.n2o_norm_ratio_nh_sweep_years[b,bb,i,*,t] = [stats[0],sdev] endfor endif endfor for t = 0, 11 do begin chk2 = where(month_frac[chk_c[gd[chk]]] ge t and month_frac[chk_c[gd[chk]]] lt t+1,ni_all) if ni_all ge 1 then begin stats = moment(dat.age_opt[gd[chk[chk2]]],sdev=sdev,/nan) bins.n2o_norm_age_nh_seas[i,*,t] = [stats[0],sdev] endif endfor for m = 0, nm-1 do begin chk2 = where(mission[chk_c[gd[chk]]] eq m+1,nchk2) if nchk2 ge 1 then begin stats = moment(dat.age_opt[gd[chk[chk2]]],sdev=sdev,/nan) bins.n2o_norm_age_nh_m[i,*,m] = [stats[0],sdev] stats = moment(dat.age_opt_all[gd[chk[chk2]]],sdev=sdev,/nan) bins.n2o_norm_age_all_nh_m[i,*] = [stats[0],sdev] stats = moment(dat.sf6_scale_opt_all[gd[chk[chk2]]],sdev=sdev,/nan) bins.n2o_norm_sf6_scale_nh_m[i,*,m] = [stats[0],sdev] stats = moment(dat.sf6_scale_opt_smin[gd[chk[chk2]]],sdev=sdev,/nan) bins.n2o_norm_sf6_scale_smin_nh_m[i,*,m] = [stats[0],sdev] stats = moment(dat.co2_scale_opt_all[gd[chk[chk2]]],sdev=sdev,/nan) bins.n2o_norm_co2_scale_nh_m[i,*,m] = [stats[0],sdev] stats = moment(sf6[chk_c[gd[chk[chk2]]]],sdev=sdev,/nan) bins.n2o_norm_sf6_nh_m[i,*,m] = [stats[0],sdev] endif endfor endif chk = where(abs(elat_m[chk_c[gd]]) lt 25,ni_all) if ni_all ge 1 then begin stats = moment(dat.age_opt[gd[chk]],sdev=sdev,/nan) bins.n2o_norm_age_tr[i,*] = [stats[0],sdev] stats = moment(dat.age_opt_all[gd[chk]],sdev=sdev,/nan) bins.n2o_norm_age_all_tr[i,*] = [stats[0],sdev] stats = moment(dat.ratio_opt_all[gd[chk]],sdev=sdev,/nan) bins.n2o_norm_ratio_all_tr[i,*] = [stats[0],sdev] stats = moment(sf6_age[chk_c[gd[chk]]],sdev=sdev,/nan) bins.n2o_norm_sf6_age_tr[i,*] = [stats[0],sdev] stats = moment(co2_age[chk_c[gd[chk]]],sdev=sdev,/nan) bins.n2o_norm_co2_age_tr[i,*] = [stats[0],sdev] for t = 0, nt-1 do begin chk2 = where(times_all[chk_c[gd[chk]]] ge years[t]-(1./24.) and times_all[chk_c[gd[chk]]] lt years[t]+(1./24.),ni_all) if ni_all ge 1 then begin stats = moment(dat.age_opt[gd[chk[chk2]]],sdev=sdev) bins.n2o_norm_age_tr_years[i,*,t] = [stats[0],sdev] stats = moment(dat.age_opt_all[gd[chk[chk2]]],sdev=sdev) bins.n2o_norm_age_all_tr_years[i,*,t] = [stats[0],sdev] endif endfor for t = 0, 11 do begin chk2 = where(month_frac[chk_c[gd[chk]]] ge t and month_frac[chk_c[gd[chk]]] lt t+1,ni_all) if ni_all ge 1 then begin stats = moment(dat.age_opt[gd[chk[chk2]]],sdev=sdev) bins.n2o_norm_age_tr_seas[i,*,t] = [stats[0],sdev] endif endfor for m = 0, nm-1 do begin chk2 = where(mission[chk_c[gd[chk]]] eq m+1,nchk2) if nchk2 ge 1 then begin stats = moment(dat.age_opt[gd[chk[chk2]]],sdev=sdev,/nan) bins.n2o_norm_age_tr_m[i,*,m] = [stats[0],sdev] stats = moment(dat.age_opt_all[gd[chk[chk2]]],sdev=sdev,/nan) bins.n2o_norm_age_all_tr_m[i,*] = [stats[0],sdev] endif endfor endif ; All latitudes stats = moment(dat.age_opt[gd],sdev=sdev,/nan) bins.n2o_norm_age[i,*] = [stats[0],sdev] stats = moment(dat.age_opt_all[gd],sdev=sdev,/nan) bins.n2o_norm_age_all[i,*] = [stats[0],sdev] stats = moment(dat.ratio_opt_all[gd],sdev=sdev,/nan) bins.n2o_norm_ratio_all[i,*] = [stats[0],sdev] stats = moment(dat.sf6_scale_opt_all[gd],sdev=sdev,/nan) bins.n2o_norm_sf6_scale_all[i,*] = [stats[0],sdev] stats = moment(dat.co2_scale_opt_all[gd],sdev=sdev,/nan) bins.n2o_norm_co2_scale_all[i,*] = [stats[0],sdev] stats = moment(sf6_age[chk_c[gd]],sdev=sdev,/nan) bins.n2o_norm_sf6_age[i,*] = [stats[0],sdev] stats = moment(co2_age[chk_c[gd]],sdev=sdev,/nan) bins.n2o_norm_co2_age[i,*] = [stats[0],sdev] for m = 0, nm-1 do begin chk2 = where(mission[chk_c[gd]] eq m+1,nchk2) if nchk2 ge 1 then begin stats = moment(dat.age_opt_all[gd[chk2]],sdev=sdev,/nan) bins.n2o_norm_age_all_m[i,*,m] = [stats[0],sdev] stats = moment(dat.ratio_opt_all[gd[chk2]],sdev=sdev,/nan) bins.n2o_norm_ratio_all_m[i,*,m] = [stats[0],sdev] stats = moment(dat.sf6_scale_opt_all[gd[chk2]],sdev=sdev,/nan) bins.n2o_norm_sf6_scale_m[i,*,m] = [stats[0],sdev] stats = moment(dat.co2_scale_opt_all[gd[chk2]],sdev=sdev,/nan) bins.n2o_norm_co2_scale_m[i,*,m] = [stats[0],sdev] endif endfor endif endfor for m = 0, nm-1 do begin chk = where(mission[chk_c] eq m+1,nchk) if nchk gt 0 then begin date_frac_avg = mean(times_all[chk_c[chk]],/nan) tii = interpol(indgen(n_elements(sf6_time)),sf6_time,date_frac_avg) bins.sf6_avg_m[m] = interpolate(tropical_sf6,tii) tii = interpol(indgen(n_elements(tropical_co2_time)),tropical_co2_time,date_frac_avg) bins.co2_avg_m[m] = interpolate(tropical_co2,tii) endif endfor ; Compute lag ages. for i = 0, nchk_c-1 do begin ii = chk_c[i] bii = where(year_b eq fix(date_frac[ii])) sf6_bias_yr = sf6_bias_corr[*,bii] ij = interpol(indgen(n_elements(sf6_time)),tropical_sf6_yrsm,sf6[ii]) jj = where(tropical_sf6_yrsm ge sf6[ii]) ij = jj[0] - (tropical_sf6_yrsm[jj[0]] - sf6[ii]) / (tropical_sf6_yrsm[jj[0]] - tropical_sf6_yrsm[jj[0]-1]) sf6_lag_age[i] = date_frac[ii] - interpolate(sf6_time,ij) xx = interpol(indgen(n_ages_trop_fine),grn_mean_ages_trop_fine+sf6_bias_yr,sf6_lag_age[i]) sf6_lag_age_bias_corr[i] = sf6_lag_age[i] - interpolate(sf6_bias_yr,xx) ; ij = interpol(indgen(n_elements(tropical_co2_time)),tropical_co2_yrsm,dat.co2_adj_opt_all[i]) ; jj = where(tropical_co2_yrsm ge dat.co2_adj_opt_all[i]) ; ij = jj[0] - (tropical_co2_yrsm[jj[0]] - dat.co2_adj_opt_all[i]) / (tropical_co2_yrsm[jj[0]] - tropical_co2_yrsm[jj[0]-1]) ; co2_lag_age[i] = date_frac[ii] - interpolate(tropical_co2_time,ij) ij = interpol(indgen(n_elements(tropical_co2_time)),tropical_co2_yrsm,co2_adj_all[ii]) jj = where(tropical_co2_yrsm ge co2_adj_all[ii]) ij = jj[0] - (tropical_co2_yrsm[jj[0]] - co2_adj_all[ii]) / (tropical_co2_yrsm[jj[0]] - tropical_co2_yrsm[jj[0]-1]) co2_lag_age[i] = date_frac[ii] - interpolate(tropical_co2_time,ij) endfor for i = 0, nn-1 do begin gd = where(n2o_all_norm[chk_c] ge n2o_norm_grid[i] - dn2o/2. and n2o_all_norm[chk_c] lt n2o_norm_grid[i] + dn2o/2.,ngd) if ngd ge 1 then begin for m = 0, nm-1 do begin chk2 = where(mission[chk_c[gd]] eq m+1,nchk2) if nchk2 ge 1 then begin stats = moment(sf6_lag_age[gd[chk2]],sdev=sdev,/nan) bins.n2o_norm_sf6_lag_age_m[i,*,m] = [stats[0],sdev] stats = moment(sf6_lag_age_bias_corr[gd[chk2]],sdev=sdev,/nan) bins.n2o_norm_sf6_lag_age_bias_corr_m[i,*,m] = [stats[0],sdev] chk = where(abs(elat_m[chk_c[gd[chk2]]]) ge 70,ni_all) if ni_all ge 1 then begin stats = moment(sf6_lag_age[gd[chk2[chk]]],sdev=sdev,/nan) bins.n2o_norm_sf6_lag_age_vx_m[i,*,m] = [stats[0],sdev] endif endif endfor stats = moment(co2_lag_age[gd],sdev=sdev,/nan) bins.n2o_norm_co2_lag_age[i,*] = [stats[0],sdev] stats = moment(sf6_lag_age_bias_corr[gd],sdev=sdev,/nan) bins.n2o_norm_sf6_lag_age_bias_corr[i,*] = [stats[0],sdev] endif endfor n2o_years = years if aircraft then save,n2o_years,bins,filename=dir+'Aircraft/Missions/idlsave_files/aircraft_mean_ages_optimum_sf6_co2_'+ext[fi]+'_bins.sav' $ else save,n2o_years,bins,filename=dir+'Balloon/Balloon_mean_ages_optimum_sf6_co2_'+b_ext[fi]+'_bins.sav' endif if aircraft then restore,dir+'Aircraft/Missions/idlsave_files/aircraft_mean_ages_optimum_sf6_co2_'+ext[fi]+'_bins.sav' else $ restore,dir+'Balloon/Balloon_mean_ages_optimum_sf6_co2_'+b_ext[fi]+'_bins.sav' ; Calculate mean age from CO2 based on N2O optimum relationships for the ratio of moments. ;ico2 = where(finite(co2_adj),nco2) ;print,nco2 br_nh = bins_a0.n2o_norm_ratio_all_nh br_tr = bins_a0.n2o_norm_ratio_all_tr ba_nh = bins_a0.n2o_norm_age_all_nh gdb = where(finite(br_nh[*,0]),ngdb) if aircraft and fi eq 0 then begin bin_ratio = br_nh[*,0] bin_ratio[-10:-1] = findgen(10)*(-0.03)+1.3 bin_ratio_t = br_tr[*,0] bin_ratio_t[-4:-2] = [0.95,0.85,0.8] endif else begin bin_ratio = br_nh[*,0] bin_ratio_t = br_tr[*,0] endelse gdbt = where(finite(bin_ratio_t),ngdbt) chk = where(~finite(br_nh[gdb,1]),nchk) if nchk gt 0 then br_nh[gdb[chk],1] = 0.1 ; Fill in the SD values if missing. chk = where(~finite(br_tr[gdbt,1]),nchk) if nchk gt 0 then br_tr[gdbt[chk],1] = 0.1 ratios_sm = lowpass_cfc(bin_ratio[gdb], BOX=5, EDGE_PFCAST=1) if aircraft eq 0 and fi eq 2 then n2o_c_norm = n2o_n_norm else n2o_c_norm = n2o_all_norm ni = interpol(indgen(ngdb),n2o_norm_grid[gdb],n2o_c_norm[ico2]) ratios = interpolate(ratios_sm,ni) ratios_sd = interpolate(br_nh[gdb,1],ni) ratios_sd[where(~finite(ratios_sd) or ratios_sd lt 0.2)] = 0.2 if ngdbt gt 5 then begin ratios_tr_sm = lowpass_cfc(bin_ratio_t[gdbt], BOX=5, EDGE_PFCAST=1) ni_tr = interpol(indgen(ngdbt),n2o_norm_grid[gdbt],n2o_c_norm[ico2]) ratios_tr = interpolate(ratios_tr_sm,ni_tr) ratios_tr_sd = interpolate(br_tr[gdbt,1],ni_tr) endif else begin ratios_tr_sm = ratios_sm ratios_tr = interpolate(ratios_sm,ni) ratios_tr_sd = interpolate(br_nh[gdb,1],ni) endelse ratios_tr_sd[where(ratios_tr_sd lt 0.2)] = 0.2 if aircraft eq 0 and fi eq 0 then ba_nh[-2:-1,0] = 0. for i = 80., nn-1 do ba_nh[i,1] = 0.5 - (i-79)/1e2 if ngdb gt 12 then n2o_norm_age_sm = lowpass_cfc(ba_nh[gdb,0], BOX=box, EDGE_PFCAST=1) else n2o_norm_age_sm = ba_nh[gdb,0] ages = interpolate(n2o_norm_age_sm,ni) ages_sd = interpolate(ba_nh[gdb,1],ni) ages_sd[where(n2o_c_norm[ico2] lt 0.8 and (~finite(ages_sd) or ages_sd lt 0.5))] = 0.5 ;chk = where(ages ge 2.5,nchk) ;if nchk gt 0 then begin ; chk2 = where(ages_sd[chk] lt 0.2*ages[chk],nchk2) ; if nchk2 gt 0 then ages_sd[chk[chk2]] = 0.2*ages[chk[chk2]] ;endif if gogo then begin cc = replicate(!values.f_nan,nco2) & dd = replicate(!values.f_nan,2,n_ages_trop_fine,ny) & ee = replicate(!values.f_nan,n_ages_trop_fine,ny,nr_fine) oo = replicate(!values.f_nan,n_ages_trop_fine,ny,nr_fine) dat_co2 = {elat:cc, age_opt_all:cc, ratio_opt_all:cc, lat_source_opt_all:cc, lat_source_c_opt_all:cc, ch4_loss_opt_all:cc, ch4_entry_opt_all:cc, ch4_norm_opt_all:cc, ch4_norm_inst:cc} ; for i = 5e5, 5e5 do begin for i = 0, nco2-1 do begin if i mod 1000 eq 0 then print,i,systime(1)-t0 ii = ico2[i] ti = where(flight_dates eq dates_str_all[ii],nti) ; print,ti[0],nti,dates_str[ii],flight_dates[ti[0]] range_ratio_trop_co2 = dd & co2_diffs = ee & ch4_loss_full = ee & ages_full = ee & source_lats_full = ee & source_lats_c_full = ee & ratios_full = ee & co2_err_full = oo & co2_adj_full = oo ch4_entry_full = ee yi1 = 0 yi2 = ny-1 if elat_m_all[ii] ge 20 then yi1 = 4 if elat_m_all[ii] le -20 then yi2 = ny-5 dat_co2.elat[i] = elat_m_all[ii] ; Use tropical or extratropical range of ratio of moments. ratio = ratios[i] ratio_sd = ratios_sd[i] if abs(elat_m_all[ii]) le 25 then begin ratio = ratios_tr[i] ratio_sd = ratios_tr_sd[i] endif ri = where(ratios_fine ge ratio-2*ratio_sd and ratios_fine le ratio+2*ratio_sd,nri) ri1 = ri[0] xi = where(grn_mean_ages_trop_fine ge ages[i]-2*ages_sd[i] and grn_mean_ages_trop_fine le ages[i]+2*ages_sd[i]) for y = yi1, yi2 do begin for a = xi[0], xi[-1] do begin if finite(ch4_all[ii]) then begin co2_adj_sc = co2_all[ii] - 1e-3 * ch4_conversion * abs(mean(conv.ch4_e_fine2[a,y,ri,ti]) - ch4_all[ii]) co2_adj_full[a,y,ri] = co2_all[ii] - 1e-3 * ch4_conversion * abs(conv.ch4_e_fine2[a,y,ri,ti] - ch4_all[ii]) co2_err_sc = co2_err + 1e-3 * ch4_conv_uncert * abs(mean(conv.ch4_e_fine2[a,y,ri,ti]) - (ch4_all[ii]-ch4_err*ch4_all[ii])) co2_err_full[a,y,ri] = co2_err + 1e-3 * ch4_conv_uncert * abs(conv.ch4_e_fine2[a,y,ri,ti] - (ch4_all[ii]-ch4_err*ch4_all[ii])) endif else begin co2_adj_sc = co2_all[ii] - 1.1 * (1. - n2o_c_norm[ii]) co2_adj_full[a,y,*] = replicate(co2_adj_sc,nr_fine) co2_err_sc = co2_err co2_err_full[a,y,*] = replicate(co2_err_sc,nr_fine) endelse chk_co2 = where(conv.co2_e_fine2[a,y,ri,ti] ge co2_adj_sc-co2_err_sc and conv.co2_e_fine2[a,y,ri,ti] le co2_adj_sc+co2_err_sc,nchk_co2) ; chk_co2 = where(co2_e_fine2[a,y,ri] ge co2_adj[ii]-co2_err and co2_e_fine2[a,y,ri] le co2_adj[ii]+co2_err,nchk_co2) if nchk_co2 gt 0 then begin range_ratio_trop_co2[*,a,y] = [ratios_fine[chk_co2[0]+ri1],ratios_fine[chk_co2[-1]+ri1]] co2_diffs[a,y,chk_co2+ri1] = abs(co2_adj_sc - conv.co2_e_fine2[a,y,chk_co2+ri1,ti]) if finite(ch4_all[ii]) then begin ch4_loss_full[a,y,chk_co2+ri1] = ch4_conversion * abs(conv.ch4_e_fine2[a,y,chk_co2+ri1,ti] - ch4_all[ii]) ; Assume 95% conversion of CH4 to CO2. ch4_entry_full[a,y,chk_co2+ri1] = conv.ch4_e_fine2[a,y,chk_co2+ri1,ti] endif else begin ch4_loss_full[a,y,chk_co2+ri1] = 1.1e3 * (1. - n2o_c_norm[ii]) ch4_entry_full[a,y,chk_co2+ri1] = !values.f_nan endelse ratios_full[a,y,chk_co2+ri1] = ratios_fine[chk_co2+ri1] ages_full[a,y,chk_co2+ri1] = replicate(grn_mean_ages_trop_fine[a],nchk_co2) source_lats_full[a,y,chk_co2+ri1] = replicate(lat_grid_entry[y],nchk_co2) source_lats_c_full[a,y,chk_co2+ri1] = conv.lat_e_fine2[a,y,chk_co2+ri1,ti] endif endfor endfor zz = where(finite(ages_full),nzz) diffs_rev = max(co2_diffs[zz])-co2_diffs[zz] tot = total(diffs_rev) diffs_norm = diffs_rev / tot dat_co2.age_opt_all[i] = total(ages_full[zz] * diffs_norm) dat_co2.ratio_opt_all[i] = total(ratios_full[zz] * diffs_norm) dat_co2.lat_source_opt_all[i] = total(source_lats_full[zz] * diffs_norm) dat_co2.lat_source_c_opt_all[i] = total(source_lats_c_full[zz] * diffs_norm) dat_co2.ch4_loss_opt_all[i] = total(ch4_loss_full[zz] * diffs_norm) dat_co2.ch4_entry_opt_all[i] = total(ch4_entry_full[zz] * diffs_norm) dat_co2.ch4_norm_opt_all[i] = ch4_all[ii] / dat_co2.ch4_entry_opt_all[i] dat_co2.ch4_norm_inst[i] = ch4_all[ii] / ch4_surface[i] ; print,i,n2o_c_norm[ico2[i]],co2_all[ii],ratio,dat_co2.ratio_opt_all[i],ages[i],ages_sd[i],dat_co2.age_opt_all[i] endfor if aircraft then save,dat_co2,filename=dir+'Aircraft/Missions/idlsave_files/aircraft_mean_ages_co2_'+ext[fi]+'.sav' $ else save,dat_co2,filename=dir+'Balloon/Balloon_mean_ages_co2_'+b_ext[fi]+'.sav' endif if aircraft then restore,dir+'Aircraft/Missions/idlsave_files/aircraft_mean_ages_co2_'+ext[fi]+'.sav' $ else restore,dir+'Balloon/Balloon_mean_ages_co2_'+b_ext[fi]+'.sav' gd = where(~finite(dat_co2.ratio_opt_all),ngd) print,ngd ;yi = interpol(indgen(n_elements(lat)),lat,elat_m[ico2]) ;gi = interpol(indgen(n_elements(n2o_norm_grid_model)),n2o_norm_grid_model,n2o_all_norm[ico2]) ;ti = interpol(indgen(n_elements(model_years)),model_years,times_all[ico2]) ;model_anoms = interpolate(n2o_norm_aoa_anom,yi,gi,ti) ;age_opt_all_adj = dat_co2.age_opt_all - model_anoms oo = replicate(!values.f_nan,nn,2,12) & co2_lag_age = replicate(!values.f_nan,nco2) bins_co2 = {n2o_norm_age_all_nh:kk, n2o_norm_age_all_tr:kk, n2o_norm_ratio_all_nh:kk, n2o_norm_age_all_nh_m:ll, n2o_norm_age_all_tr_m:ll, n2o_norm_ratio_all_tr:kk, n2o_norm_age_all_nh_seas:oo, $ n2o_norm_age_all_tr_seas:oo, n2o_norm_age_all_nh_years:mm, n2o_norm_age_all_tr_years:mm, n2o_norm_ratio_all_nh_years:mm, n2o_norm_elat_nh_years:mm, n2o_norm_lat_source_all_nh:kk, $ n2o_norm_lat_source_all_nh_years:mm, n2o_norm_elat_nh:kk, n2o_norm_age_all_nh_adj:kk, n2o_norm_age_all_nh_early:kk, n2o_norm_age_all_nh_late:kk, n2o_norm_co2_adj:kk, n2o_norm_ch4_loss_nh:kk, $ n2o_norm_age_all:kk, n2o_norm_ratio_all:kk, n2o_norm_sf6_age:kk, n2o_norm_co2_age:kk, n2o_norm_co2_age_m:ll, n2o_norm_age_all_m:ll, n2o_norm_co2_lag_age:kk, n2o_norm_ch4_norm_nh:kk, $ n2o_norm_ch4_norm_m:ll, n2o_norm_ch4_norm_all:kk, n2o_norm_ch4_norm_inst:kk, n2o_norm_ch4_loss_tr:kk, n2o_norm_ch4_norm_tr:kk, n2o_norm_ch4_norm_vx:kk} for i = 0, nn-1 do begin gd = where(n2o_c_norm[ico2] ge n2o_norm_grid[i] - dn2o/2. and n2o_c_norm[ico2] lt n2o_norm_grid[i] + dn2o/2.,ngd) if ngd ge 1 then begin chk = where(elat_m_all[ico2[gd]] ge 25,ni_all) if ni_all gt 1 then begin stats = moment(dat_co2.age_opt_all[gd[chk]],sdev=sdev,/nan) bins_co2.n2o_norm_age_all_nh[i,*] = [stats[0],sdev] ; stats = moment(age_opt_all_adj[gd[chk]],sdev=sdev,/nan) ; bins_co2.n2o_norm_age_all_nh_adj[i,*] = [stats[0],sdev] stats = moment(dat_co2.ratio_opt_all[gd[chk]],sdev=sdev,/nan) bins_co2.n2o_norm_ratio_all_nh[i,*] = [stats[0],sdev] stats = moment(dat_co2.lat_source_opt_all[gd[chk]],sdev=sdev,/nan) bins_co2.n2o_norm_lat_source_all_nh[i,*] = [stats[0],sdev] stats = moment(dat_co2.elat[gd[chk]],sdev=sdev,/nan) bins_co2.n2o_norm_elat_nh[i,*] = [stats[0],sdev] stats = moment(co2[ico2[gd[chk]]]-co2_adj[ico2[gd[chk]]],sdev=sdev,/nan) bins_co2.n2o_norm_co2_adj[i,*] = [stats[0],sdev] stats = moment(dat_co2.ch4_loss_opt_all[gd[chk]],sdev=sdev,/nan) bins_co2.n2o_norm_ch4_loss_nh[i,*] = [stats[0],sdev] stats = moment(dat_co2.ch4_norm_opt_all[gd[chk]],sdev=sdev,/nan) bins_co2.n2o_norm_ch4_norm_nh[i,*] = [stats[0],sdev] ; Divide up the 1990s binning into early and late periods. chk2 = where(times_all[chk_c[gd[chk]]] lt 1996.5,ni_all2) if ni_all2 gt 1 then begin stats = moment(dat_co2.age_opt_all[gd[chk[chk2]]],sdev=sdev,/nan) bins_co2.n2o_norm_age_all_nh_early[i,*] = [stats[0],sdev] endif chk2 = where(times_all[chk_c[gd[chk]]] ge 1996.5,ni_all2) if ni_all2 gt 1 then begin stats = moment(dat_co2.age_opt_all[gd[chk[chk2]]],sdev=sdev,/nan) bins_co2.n2o_norm_age_all_nh_late[i,*] = [stats[0],sdev] endif for t = 0, nt-1 do begin chk2 = where(times_all[ico2[gd[chk]]] ge years[t]-(1./24.) and times_all[ico2[gd[chk]]] lt years[t]+(1./24.),ni_all) if ni_all ge 1 then begin stats = moment(dat_co2.age_opt_all[gd[chk[chk2]]],sdev=sdev,/nan) bins_co2.n2o_norm_age_all_nh_years[i,*,t] = [stats[0],sdev] stats = moment(dat_co2.ratio_opt_all[gd[chk[chk2]]],sdev=sdev,/nan) bins_co2.n2o_norm_ratio_all_nh_years[i,*,t] = [stats[0],sdev] stats = moment(dat_co2.lat_source_opt_all[gd[chk[chk2]]],sdev=sdev,/nan) bins_co2.n2o_norm_lat_source_all_nh_years[i,*,t] = [stats[0],sdev] stats = moment(dat_co2.elat[gd[chk[chk2]]],sdev=sdev,/nan) bins_co2.n2o_norm_elat_nh_years[i,*,t] = [stats[0],sdev] endif endfor for t = 0, 11 do begin chk2 = where(month_frac[ico2[gd[chk]]] ge t and month_frac[ico2[gd[chk]]] lt t+1 and finite(dat_co2.age_opt_all[gd[chk]]),ni_all) if ni_all gt 1 then begin stats = moment(dat_co2.age_opt_all[gd[chk[chk2]]],sdev=sdev,/nan) bins_co2.n2o_norm_age_all_nh_seas[i,*,t] = [stats[0],sdev] endif endfor for m = 0, nm-1 do begin chk2 = where(mission[ico2[gd[chk]]] eq m+1,nchk2) if nchk2 gt 1 then begin stats = moment(dat_co2.age_opt_all[gd[chk[chk2]]],sdev=sdev,/nan) bins_co2.n2o_norm_age_all_nh_m[i,*] = [stats[0],sdev] endif endfor endif chk = where(abs(elat_m_all[ico2[gd]]) lt 25,ni_all) if ni_all gt 1 then begin stats = moment(dat_co2.age_opt_all[gd[chk]],sdev=sdev,/nan) bins_co2.n2o_norm_age_all_tr[i,*] = [stats[0],sdev] stats = moment(dat_co2.ratio_opt_all[gd[chk]],sdev=sdev,/nan) bins_co2.n2o_norm_ratio_all_tr[i,*] = [stats[0],sdev] stats = moment(dat_co2.ch4_loss_opt_all[gd[chk]],sdev=sdev,/nan) bins_co2.n2o_norm_ch4_loss_tr[i,*] = [stats[0],sdev] stats = moment(dat_co2.ch4_norm_opt_all[gd[chk]],sdev=sdev,/nan) bins_co2.n2o_norm_ch4_norm_tr[i,*] = [stats[0],sdev] for t = 0, nt-1 do begin chk2 = where(times_all[ico2[gd[chk]]] ge years[t]-(1./24.) and times_all[ico2[gd[chk]]] lt years[t]+(1./24.),ni_all) if ni_all ge 1 then begin stats = moment(dat_co2.age_opt_all[gd[chk[chk2]]],sdev=sdev) bins_co2.n2o_norm_age_all_tr_years[i,*,t] = [stats[0],sdev] endif endfor for t = 0, 11 do begin chk2 = where(month_frac[ico2[gd[chk]]] ge t and month_frac[ico2[gd[chk]]] lt t+1,ni_all) if ni_all ge 1 then begin stats = moment(dat_co2.age_opt_all[gd[chk[chk2]]],sdev=sdev) bins_co2.n2o_norm_age_all_tr_seas[i,*,t] = [stats[0],sdev] endif endfor for m = 0, nm-1 do begin chk2 = where(mission[ico2[gd[chk]]] eq m+1,nchk2) if nchk2 ge 1 then begin stats = moment(dat_co2.age_opt_all[gd[chk[chk2]]],sdev=sdev,/nan) bins_co2.n2o_norm_age_all_tr_m[i,*] = [stats[0],sdev] endif endfor endif chk = where(abs(elat_m_all[ico2[gd]]) gt 65,ni_all) if ni_all gt 1 then begin stats = moment(dat_co2.ch4_norm_opt_all[gd[chk]],sdev=sdev,/nan) bins_co2.n2o_norm_ch4_norm_vx[i,*] = [stats[0],sdev] endif ; print,n2o_norm_grid[i],n2o_c_norm[ico2[gd]],dat_co2.age_opt_all[gd] stats = moment(dat_co2.age_opt_all[gd],sdev=sdev,/nan) bins_co2.n2o_norm_age_all[i,*] = [stats[0],sdev] stats = moment(dat_co2.ratio_opt_all[gd],sdev=sdev,/nan) bins_co2.n2o_norm_ratio_all[i,*] = [stats[0],sdev] stats = moment(co2_age[ico2[gd]],sdev=sdev,/nan) bins_co2.n2o_norm_co2_age[i,*] = [stats[0],sdev] stats = moment(dat_co2.ch4_norm_opt_all[gd],sdev=sdev,/nan) bins_co2.n2o_norm_ch4_norm_all[i,*] = [stats[0],sdev] stats = moment(dat_co2.ch4_norm_inst[gd],sdev=sdev,/nan) bins_co2.n2o_norm_ch4_norm_inst[i,*] = [stats[0],sdev] for m = 0, nm-1 do begin chk2 = where(mission[ico2[gd]] eq m+1,nchk2) if nchk2 ge 1 then begin stats = moment(dat_co2.age_opt_all[gd[chk2]],sdev=sdev,/nan) bins_co2.n2o_norm_age_all_m[i,*,m] = [stats[0],sdev] stats = moment(co2_age[ico2[gd[chk2]]],sdev=sdev,/nan) bins_co2.n2o_norm_co2_age_m[i,*,m] = [stats[0],sdev] stats = moment(dat_co2.ch4_norm_opt_all[gd[chk2]],sdev=sdev,/nan) bins_co2.n2o_norm_ch4_norm_m[i,*,m] = [stats[0],sdev] endif endfor endif endfor ;for i = 0, nco2-1 do begin ; ii = ico2[i] ; ij = interpol(indgen(n_elements(tropical_co2_time)),tropical_co2_yrsm,co2_adj_all[ii]) ; jj = where(tropical_co2_yrsm ge co2_adj_all[ii]) ; ij = jj[0] - (tropical_co2_yrsm[jj[0]] - co2_adj_all[ii]) / (tropical_co2_yrsm[jj[0]] - tropical_co2_yrsm[jj[0]-1]) ; co2_lag_age[i] = date_frac_all[ii] - interpolate(tropical_co2_time,ij) ;endfor ; ;for i = 0, nn-1 do begin ; gd = where(n2o_all_norm[ico2] ge n2o_norm_grid[i] - dn2o/2. and n2o_all_norm[ico2] lt n2o_norm_grid[i] + dn2o/2.,ngd) ; if ngd ge 1 then begin ; stats = moment(co2_lag_age[gd],sdev=sdev,/nan) ; bins_co2.n2o_norm_co2_lag_age[i,*] = [stats[0],sdev] ; endif ;endfor if aircraft then save,n2o_years,bins_co2,filename=dir+'Aircraft/Missions/idlsave_files/aircraft_mean_ages_co2_'+ext[fi]+'_bins.sav' $ else save,n2o_years,bins_co2,filename=dir+'Balloon/Balloon_mean_ages_co2_'+b_ext[fi]+'_bins.sav' ; Calculate mean age from SF6 based on N2O optimum relationships for the ratio of moments. ;ni = interpol(indgen(nn),n2o_norm_grid,n2o_all_norm[isf6]) ;bin_ratios = bins.n2o_norm_ratio_all_nh[*,0] ;bin_ratios[where(~finite(bin_ratios))] = 1.65 ;ratios = interpolate(bin_ratios,ni) ;bin_ratios_sd = bins.n2o_norm_ratio_all_nh[*,1] ;bin_ratios_sd[where(~finite(bin_ratios_sd))] = 0.2 ;ratios_sd = interpolate(bin_ratios_sd,ni) ;ratios_sd[where(ratios_sd lt 0.2)] = 0.2 ; Check for missing n2o and fill in based on n2o-sf6 mission binning. chk = where(~finite(n2o_all_norm[isf6]),nchk) n2o_all_norm_sf6 = n2o_all_norm[isf6] if nchk gt 0 then begin for m = 0, nm-1 do begin chk2 = where(mission[isf6[chk]] eq m+1,nchk2) if nchk2 gt 0 then begin gd = where(finite(bins.n2o_norm_sf6_nh_m[*,0,m]),ngd) if ngd gt 9 then begin n2o_sf6_bins_m = lowpass_cfc(bins.n2o_norm_sf6_nh_m[gd,0,m], BOX=9, EDGE_PFCAST=1) si = interpol(indgen(ngd),n2o_sf6_bins_m,sf6[isf6[chk[chk2]]]) n2o_all_norm_sf6[chk[chk2]] = interpolate(n2o_norm_grid[gd],si) endif endif endfor ; si = interpol(indgen(nn),bins.n2o_norm_sf6_nh[*,0],sf6[isf6[chk]]) ; n2o_all_norm_sf6[chk] = interpolate(n2o_norm_grid,si) ; print,mission[isf6[0:2]],n2o_all_norm_sf6[0:2],sf6[isf6[0:2]] endif ni = interpol(indgen(ngdb),n2o_norm_grid[gdb],n2o_all_norm_sf6) ratios = interpolate(ratios_sm,ni) ratios_sd = interpolate(br_nh[gdb,1],ni) ratios_sd[where(~finite(ratios_sd) or ratios_sd lt 0.25)] = 0.25 if ngdbt gt 5 then begin ni_tr = interpol(indgen(ngdbt),n2o_norm_grid[gdbt],n2o_all_norm_sf6) ratios_tr = interpolate(ratios_tr_sm,ni_tr) ratios_tr_sd = interpolate(br_tr[gdbt,1],ni_tr) endif else begin ni_tr = ni ratios_tr = ratios ratios_tr_sd = ratios_sd endelse ratios_tr_sd[where(ratios_tr_sd lt 0.25)] = 0.25 if aircraft eq 0 and fi eq 0 then ba_nh[-2:-1,0] = 0. bin_ages = ba_nh[*,0] ; Extend the age-N2O relationship to cover the range of SABRE. if aircraft and fi eq 2 then begin gd = where(finite(bin_ages)) del = deriv(bin_ages[gd]) for x = 1, 11 do bin_ages[gd[0]-x] = bin_ages[gd[0]-(x-1)] - mean(del[0:2]) endif gdb2 = where(finite(bin_ages)) if ngdb gt 12 then n2o_norm_age_sm = lowpass_cfc(ba_nh[gdb,0], BOX=box, EDGE_PFCAST=1) else n2o_norm_age_sm = ba_nh[gdb,0] ages = interpolate(n2o_norm_age_sm,ni) ages_sd = interpolate(ba_nh[gdb,1],ni) ages_sd[where(~finite(ages_sd) or ages_sd lt 1)] = 1 if gogo2 then begin aa = replicate(!values.f_nan,n_ages_trop_fine,ny,nr_trop) & bb = replicate(!values.f_nan,n_ages_trop_fine,ny,nr_fine) & cc = replicate(!values.f_nan,nsf6) dd = replicate(!values.f_nan,2,n_ages_trop_fine,ny) & ee = replicate(!values.f_nan,n_ages_trop_fine,ny,nr_fine) dat_sf6 = {elat:cc, age_opt_all:cc, ratio_opt_all:cc, lat_source_opt_all:cc, lat_source_c_opt_all:cc, frac_extratr_opt_all:cc, sf6_age_adj:cc, sf6_lag_age:cc, sf6_lag_age_bias_corr:cc, $ ch4_entry_opt_all:cc, ch4_norm_opt_all:cc, ch4_norm_inst:cc} for i = 0, nsf6-1 do begin ii = isf6[i] ti = where(flight_dates eq dates_str[ii],nti) bii = where(year_b eq fix(date_frac[ii])) sf6_bias_yr = sf6_bias_corr[*,bii] ; Adjust the old SF6 mean ages with the Garny correction. xx = interpol(indgen(n_ages_trop_fine),grn_mean_ages_trop_fine+sf6_bias_yr,sf6_age[ii]) dat_sf6.sf6_age_adj[i] = sf6_age[ii] - interpolate(sf6_bias_yr,xx) jj = where(tropical_sf6_yrsm ge sf6[ii]) ij = jj[0] - (tropical_sf6_yrsm[jj[0]] - sf6[ii]) / (tropical_sf6_yrsm[jj[0]] - tropical_sf6_yrsm[jj[0]-1]) dat_sf6.sf6_lag_age[i] = date_frac[ii] - interpolate(sf6_time,ij) xx = interpol(indgen(n_ages_trop_fine),grn_mean_ages_trop_fine+sf6_bias_yr,dat_sf6.sf6_lag_age[i]) dat_sf6.sf6_lag_age_bias_corr[i] = dat_sf6.sf6_lag_age[i] - interpolate(sf6_bias_yr,xx) sf6_e_fine = aa & sf6_e_fine2 = bb & range_ratio_trop_sf6 = dd & sf6_diffs = ee & ages_full = ee & source_lats_full = ee & source_lats_c_full = ee & ratios_full = ee & frac_extratr_full = ee ch4_entry_full = ee ; ti = where(time_entry ge date_frac[ii]) ; ti = ti[0] ; sf6_et = sf6_entry_trop[*,*,*,ti] ; for r = 0, nr_trop-1 do for y = 0, ny-1 do sf6_e_fine[*,y,r] = interpolate(sf6_et[*,y,r],ai) ; for y = 0, ny-1 do for a = 0, n_ages_trop_fine-1 do sf6_e_fine2[a,y,*] = interpolate(sf6_e_fine[a,y,*],rii) yi1 = 0 yi2 = ny-1 if elat_m[ii] ge 20 then yi1 = 4 if elat_m[ii] le -20 then yi2 = ny-5 dat_sf6.elat[i] = elat_m[ii] ; Use tropical or extratropical range of ratio of moments. ratio = ratios[i] ratio_sd = ratios_sd[i] if abs(elat_m[ii]) le 25 then begin ratio = ratios_tr[i] ratio_sd = ratios_tr_sd[i] endif ; if i eq 2911 then print,i,elat_m[ii],yi1,yi2,sf6[ii],n2o_all_norm_sf6[i],ratio,ratio_sd,ages[i],ages_sd[i] ri = where(ratios_fine ge ratio-2*ratio_sd and ratios_fine le ratio+2*ratio_sd,nri) ri1 = ri[0] xi = where(grn_mean_ages_trop_fine ge ages[i]-2*ages_sd[i] and grn_mean_ages_trop_fine le ages[i]+2*ages_sd[i],nxi) for y = yi1, yi2 do begin for a = xi[0], xi[-1] do begin sf6_bias = sf6_bias_yr[a] * flight_sf6_gr[ti] sf6_adj_b = sf6[ii] + sf6_bias ; bias = sf6_bias_corr[a,bii] ; a_bias = round(bias / d_age_fine) sf6_min = reform(sf6_adj_b-sf6_e[ii]) sf6_max = reform(sf6_adj_b+sf6_e[ii]) sf6_min = sf6_min[0] sf6_max = sf6_max[0] chk_sf6 = where(conv.sf6_e_fine2[a,y,ri,ti] ge sf6_min and conv.sf6_e_fine2[a,y,ri,ti] le sf6_max,nchk_sf6) ; if i eq 2911 and y eq yi2 then print,a,sf6_min,sf6_max,sf6[ii],sf6_adj_b,min(conv.sf6_e_fine2[a,y,ri,ti]),max(conv.sf6_e_fine2[a,y,ri,ti]),nchk_sf6 ; chk_sf6 = where(sf6_e_fine2[a+a_bias,y,ri] ge sf6[ii]-sf6_e[ii] and sf6_e_fine2[a+a_bias,y,ri] le sf6[ii]+sf6_e[ii],nchk_sf6) if nchk_sf6 gt 0 then begin range_ratio_trop_sf6[*,a,y] = [ratios_fine[chk_sf6[0]+ri1],ratios_fine[chk_sf6[-1]+ri1]] sf6_diffs[a,y,chk_sf6+ri1] = replicate(sf6_adj_b,nchk_sf6) - reform(conv.sf6_e_fine2[a,y,chk_sf6+ri1,ti]) sf6_diffs[a,y,chk_sf6+ri1] = abs(sf6_diffs[a,y,chk_sf6+ri1]) ; sf6_diffs[a,y,chk_sf6+ri1] = abs(sf6[ii] - sf6_e_fine2[a+a_bias,y,chk_sf6+ri1]) ratios_full[a,y,chk_sf6+ri1] = ratios_fine[chk_sf6+ri1] ages_full[a,y,chk_sf6+ri1] = replicate(grn_mean_ages_trop_fine[a],nchk_sf6) source_lats_full[a,y,chk_sf6+ri1] = replicate(lat_grid_entry[y],nchk_sf6) source_lats_c_full[a,y,chk_sf6+ri1] = conv.lat_e_fine2[a,y,chk_sf6+ri1,ti] frac_extratr_full[a,y,chk_sf6+ri1] = conv.frac_extratr_e_fine2[a,y,chk_sf6+ri1,ti] if finite(ch4_all[ii]) then ch4_entry_full[a,y,chk_sf6+ri1] = conv.ch4_e_fine2[a,y,chk_sf6+ri1,ti] else ch4_entry_full[a,y,chk_sf6+ri1] = !values.f_nan endif endfor endfor zz = where(finite(ages_full),nzz) diffs_rev = max(sf6_diffs[zz])-sf6_diffs[zz] tot = total(diffs_rev) diffs_norm = diffs_rev / tot dat_sf6.age_opt_all[i] = total(ages_full[zz] * diffs_norm) dat_sf6.ratio_opt_all[i] = total(ratios_full[zz] * diffs_norm) dat_sf6.lat_source_opt_all[i] = total(source_lats_full[zz] * diffs_norm) dat_sf6.lat_source_c_opt_all[i] = total(source_lats_c_full[zz] * diffs_norm) dat_sf6.frac_extratr_opt_all[i] = total(frac_extratr_full[zz] * diffs_norm) dat_sf6.ch4_entry_opt_all[i] = total(ch4_entry_full[zz] * diffs_norm) dat_sf6.ch4_norm_opt_all[i] = ch4_all[ii] / dat_sf6.ch4_entry_opt_all[i] dat_sf6.ch4_norm_inst[i] = ch4_all[ii] / ch4_surface[i] endfor if aircraft then save,dat_sf6,filename=dir+'Aircraft/Missions/idlsave_files/aircraft_mean_ages_sf6_'+ext[fi]+'.sav' $ else save,dat_sf6,filename=dir+'Balloon/Balloon_mean_ages_sf6_'+ext[fi]+'.sav' endif if aircraft then restore,dir+'Aircraft/Missions/idlsave_files/aircraft_mean_ages_sf6_'+ext[fi]+'.sav' $ else restore,dir+'Balloon/Balloon_mean_ages_sf6_'+ext[fi]+'.sav' gd = where(~finite(dat_sf6.ratio_opt_all) and finite(n2o_all_norm_sf6),ngd) print,ngd;,gd[0:5] ;yi = interpol(indgen(n_elements(lat)),lat,elat_m[isf6]) ;gi = interpol(indgen(n_elements(n2o_norm_grid_model)),n2o_norm_grid_model,n2o_all_norm[isf6]) ;ti = interpol(indgen(n_elements(model_years)),model_years,times_all[isf6]) ;model_anoms = interpolate(n2o_norm_aoa_anom,yi,gi,ti) ;age_opt_all_adj = dat_sf6.age_opt_all - model_anoms bins_sf6 = {n2o_norm_age_all_nh:kk, n2o_norm_age_all_tr:kk, n2o_norm_ratio_all_nh:kk, n2o_norm_age_all_nh_m:ll, n2o_norm_age_all_tr_m:ll, n2o_norm_ratio_all_tr:kk, n2o_norm_age_all_nh_seas:oo, $ n2o_norm_age_all_tr_seas:oo, n2o_norm_age_all_nh_years:mm, n2o_norm_age_all_tr_years:mm, n2o_norm_ratio_all_nh_years:mm, n2o_norm_elat_nh_years:mm, n2o_norm_lat_source_all_nh:kk, $ n2o_norm_lat_source_all_nh_years:mm, n2o_norm_age_opt_co2_nh_anoms_adj:kk, n2o_norm_elat_nh:kk, n2o_norm_age_all_nh_adj:kk, n2o_norm_sf6_age:kk, n2o_norm_sf6_age_vt:kk, n2o_norm_sf6_age_adj:kk, $ n2o_norm_ratio_all_nh_m:ll, n2o_norm_lat_source_all_nh_m:ll, n2o_norm_frac_extra_all_nh_m:ll, n2o_norm_ratio_all_tr_m:ll, n2o_norm_lat_source_all_tr_m:ll, n2o_norm_frac_extra_all_tr_m:ll, $ n2o_norm_age_all:kk, n2o_norm_sf6_age_m:ll, n2o_norm_sf6_age_adj_m:ll, n2o_norm_sf6_lag_age_m:ll, n2o_norm_sf6_lag_age_bias_corr_m:ll, n2o_norm_age_all_m:ll, n2o_norm_ratio_all_m:ll, $ n2o_norm_ratio_all:kk, n2o_norm_lat_source_all_m:ll, n2o_norm_ch4_norm_nh:kk, n2o_norm_ch4_norm_all:kk, n2o_norm_ch4_norm_vx:kk} for i = 0, nn-1 do begin gd = where(n2o_all_norm[isf6] ge n2o_norm_grid[i] - dn2o/2. and n2o_all_norm[isf6] lt n2o_norm_grid[i] + dn2o/2.,ngd) if ngd ge 1 then begin chk = where(elat_m[isf6[gd]] ge 25,ni_all) if ni_all ge 1 then begin stats = moment(dat_sf6.age_opt_all[gd[chk]],sdev=sdev,/nan) bins_sf6.n2o_norm_age_all_nh[i,*] = [stats[0],sdev] ; stats = moment(age_opt_all_adj[gd[chk]],sdev=sdev,/nan) ; bins_sf6.n2o_norm_age_all_nh_adj[i,*] = [stats[0],sdev] stats = moment(dat_sf6.ratio_opt_all[gd[chk]],sdev=sdev,/nan) bins_sf6.n2o_norm_ratio_all_nh[i,*] = [stats[0],sdev] stats = moment(dat_sf6.lat_source_opt_all[gd[chk]],sdev=sdev,/nan) bins_sf6.n2o_norm_lat_source_all_nh[i,*] = [stats[0],sdev] stats = moment(dat_sf6.elat[gd[chk]],sdev=sdev,/nan) bins_sf6.n2o_norm_elat_nh[i,*] = [stats[0],sdev] stats = moment(dat_sf6.ch4_norm_opt_all[gd[chk]],sdev=sdev,/nan) bins_sf6.n2o_norm_ch4_norm_nh[i,*] = [stats[0],sdev] for t = 0, nt-1 do begin chk2 = where(times_all[isf6[gd[chk]]] ge years[t]-(1./24.) and times_all[isf6[gd[chk]]] lt years[t]+(1./24.),ni_all) if ni_all ge 1 then begin stats = moment(dat_sf6.age_opt_all[gd[chk[chk2]]],sdev=sdev,/nan) bins_sf6.n2o_norm_age_all_nh_years[i,*,t] = [stats[0],sdev] stats = moment(dat_sf6.ratio_opt_all[gd[chk[chk2]]],sdev=sdev,/nan) bins_sf6.n2o_norm_ratio_all_nh_years[i,*,t] = [stats[0],sdev] stats = moment(dat_sf6.lat_source_opt_all[gd[chk[chk2]]],sdev=sdev,/nan) bins_sf6.n2o_norm_lat_source_all_nh_years[i,*,t] = [stats[0],sdev] stats = moment(dat_sf6.elat[gd[chk[chk2]]],sdev=sdev,/nan) bins_sf6.n2o_norm_elat_nh_years[i,*,t] = [stats[0],sdev] endif endfor for t = 0, 11 do begin chk2 = where(month_frac[isf6[gd[chk]]] ge t and month_frac[isf6[gd[chk]]] lt t+1,ni_all) if ni_all ge 1 then begin stats = moment(dat_sf6.age_opt_all[gd[chk[chk2]]],sdev=sdev,/nan) bins_sf6.n2o_norm_age_all_nh_seas[i,*,t] = [stats[0],sdev] endif endfor for m = 0, nm-1 do begin chk2 = where(mission[isf6[gd[chk]]] eq m+1,nchk2) if nchk2 ge 1 then begin stats = moment(dat_sf6.age_opt_all[gd[chk[chk2]]],sdev=sdev,/nan) bins_sf6.n2o_norm_age_all_nh_m[i,*,m] = [stats[0],sdev] stats = moment(dat_sf6.ratio_opt_all[gd[chk[chk2]]],sdev=sdev,/nan) bins_sf6.n2o_norm_ratio_all_nh_m[i,*,m] = [stats[0],sdev] stats = moment(dat_sf6.lat_source_opt_all[gd[chk[chk2]]],sdev=sdev,/nan) bins_sf6.n2o_norm_lat_source_all_nh_m[i,*,m] = [stats[0],sdev] stats = moment(dat_sf6.frac_extratr_opt_all[gd[chk[chk2]]],sdev=sdev,/nan) bins_sf6.n2o_norm_frac_extra_all_nh_m[i,*,m] = [stats[0],sdev] endif endfor endif ; Tropics chk = where(abs(elat_m[isf6[gd]]) lt 25,ni_all) if ni_all ge 1 then begin stats = moment(dat_sf6.age_opt_all[gd[chk]],sdev=sdev,/nan) bins_sf6.n2o_norm_age_all_tr[i,*] = [stats[0],sdev] stats = moment(dat_sf6.ratio_opt_all[gd[chk]],sdev=sdev,/nan) bins_sf6.n2o_norm_ratio_all_tr[i,*] = [stats[0],sdev] for t = 0, nt-1 do begin chk2 = where(times_all[isf6[gd[chk]]] ge years[t]-(1./24.) and times_all[isf6[gd[chk]]] lt years[t]+(1./24.),ni_all) if ni_all ge 1 then begin stats = moment(dat_sf6.age_opt_all[gd[chk[chk2]]],sdev=sdev) bins_sf6.n2o_norm_age_all_tr_years[i,*,t] = [stats[0],sdev] endif endfor for t = 0, 11 do begin chk2 = where(month_frac[isf6[gd[chk]]] ge t and month_frac[isf6[gd[chk]]] lt t+1,ni_all) if ni_all ge 1 then begin stats = moment(dat_sf6.age_opt_all[gd[chk[chk2]]],sdev=sdev) bins_sf6.n2o_norm_age_all_tr_seas[i,*,t] = [stats[0],sdev] endif endfor for m = 0, nm-1 do begin chk2 = where(mission[isf6[gd[chk]]] eq m+1,nchk2) if nchk2 ge 1 then begin stats = moment(dat_sf6.age_opt_all[gd[chk[chk2]]],sdev=sdev,/nan) bins_sf6.n2o_norm_age_all_tr_m[i,*,m] = [stats[0],sdev] stats = moment(dat_sf6.ratio_opt_all[gd[chk[chk2]]],sdev=sdev,/nan) bins_sf6.n2o_norm_ratio_all_tr_m[i,*,m] = [stats[0],sdev] stats = moment(dat_sf6.lat_source_opt_all[gd[chk[chk2]]],sdev=sdev,/nan) bins_sf6.n2o_norm_lat_source_all_tr_m[i,*,m] = [stats[0],sdev] stats = moment(dat_sf6.frac_extratr_opt_all[gd[chk[chk2]]],sdev=sdev,/nan) bins_sf6.n2o_norm_frac_extra_all_tr_m[i,*,m] = [stats[0],sdev] endif endfor endif chk = where(elat_m[isf6[gd]] ge 65,ni_all) if ni_all ge 1 then begin stats = moment(sf6_age[isf6[gd[chk]]],sdev=sdev,/nan) bins_sf6.n2o_norm_sf6_age_vt[i,*] = [stats[0],sdev] stats = moment(dat_sf6.ch4_norm_opt_all[gd[chk]],sdev=sdev,/nan) bins_sf6.n2o_norm_ch4_norm_vx[i,*] = [stats[0],sdev] endif stats = moment(dat_sf6.age_opt_all[gd],sdev=sdev,/nan) bins_sf6.n2o_norm_age_all[i,*] = [stats[0],sdev] stats = moment(dat_sf6.ratio_opt_all[gd],sdev=sdev,/nan) bins_sf6.n2o_norm_ratio_all[i,*] = [stats[0],sdev] stats = moment(sf6_age[isf6[gd]],sdev=sdev,/nan) bins_sf6.n2o_norm_sf6_age[i,*] = [stats[0],sdev] stats = moment(dat_sf6.sf6_age_adj[gd],sdev=sdev,/nan) bins_sf6.n2o_norm_sf6_age_adj[i,*] = [stats[0],sdev] stats = moment(dat_sf6.ch4_norm_opt_all[gd[chk]],sdev=sdev,/nan) bins_sf6.n2o_norm_ch4_norm_all[i,*] = [stats[0],sdev] for m = 0, nm-1 do begin chk2 = where(mission[isf6[gd]] eq m+1,nchk2) if nchk2 ge 1 then begin stats = moment(dat_sf6.age_opt_all[gd[chk2]],sdev=sdev,/nan) bins_sf6.n2o_norm_age_all_m[i,*,m] = [stats[0],sdev] stats = moment(dat_sf6.ratio_opt_all[gd[chk2]],sdev=sdev,/nan) bins_sf6.n2o_norm_ratio_all_m[i,*,m] = [stats[0],sdev] stats = moment(dat_sf6.lat_source_c_opt_all[gd[chk2]],sdev=sdev,/nan) bins_sf6.n2o_norm_lat_source_all_m[i,*,m] = [stats[0],sdev] stats = moment(sf6_age[isf6[gd[chk2]]],sdev=sdev,/nan) bins_sf6.n2o_norm_sf6_age_m[i,*,m] = [stats[0],sdev] stats = moment(dat_sf6.sf6_age_adj[gd[chk2]],sdev=sdev,/nan) bins_sf6.n2o_norm_sf6_age_adj_m[i,*,m] = [stats[0],sdev] stats = moment(dat_sf6.sf6_lag_age[gd[chk2]],sdev=sdev,/nan) bins_sf6.n2o_norm_sf6_lag_age_m[i,*,m] = [stats[0],sdev] stats = moment(dat_sf6.sf6_lag_age_bias_corr[gd[chk2]],sdev=sdev,/nan) bins_sf6.n2o_norm_sf6_lag_age_bias_corr_m[i,*,m] = [stats[0],sdev] endif endfor endif endfor if aircraft then save,n2o_years,n2o_norm_grid,bins_sf6,filename=dir+'Aircraft/Missions/idlsave_files/aircraft_mean_ages_sf6_'+ext[fi]+'_bins.sav' $ else save,n2o_years,n2o_norm_grid,bins_sf6,filename=dir+'Balloon/Balloon_mean_ages_sf6_'+ext[fi]+'_bins.sav' ;if aircraft then restore,dir+'Aircraft/Missions/idlsave_files/aircraft_mean_ages_sf6_'+ext[fi]+'_bins.sav' $ ; else restore,dir+'Balloon/Balloon_mean_ages_sf6_'+ext[fi]+'_bins.sav' ; Set up grid in elat, alt and month frac. nyg = 34 dy = 5. nz = 60 nth = 71 dz = 0.5 dth = 10. nt = 434 lat_grid = findgen(nyg)*dy-80. alt_grid = findgen(nz)*dz+6. theta_grid = findgen(nth)*dth+300. years = findgen(nt)*(1./12.)+1990.+1./24. d_age = 0.1 max_age = 7.0 help,theta_all,elat_m_all,dat_co2.age_opt_all,ico2 ;help,n2o_all_norm,elat_m,elat_m_all,dat.age_opt_all,chk_c,ico2,isf6 do_grid = 0 if do_grid then begin grid_num_thresh = 2 cc = replicate(!values.f_nan,3,nyg,nz,nt) & dd = replicate(!values.f_nan,3,nyg,nz) & ee = replicate(!values.f_nan,3,nyg,nz,12) & ff = replicate(!values.f_nan,3,nyg,nz,4) gg = replicate(!values.f_nan,3,nyg,nz,nm) & hh = replicate(!values.f_nan,3,nyg,nth) & kk = replicate(!values.f_nan,3,nyg,nth,12) & mm = replicate(!values.f_nan,3,nyg,nth,4) oo = replicate(!values.f_nan,3,nyg,nth,nm) grid = {age_opt_grid_avg:dd, ratio_opt_grid_avg:dd, age_opt_co2_grid_avg:dd, ratio_opt_co2_grid_avg:dd, age_opt_grid_mon_avg:ee, age_opt_co2_grid_mon_avg:ee, age_opt_grid_seas_avg:ff, $ age_opt_co2_grid_seas_avg:ff, age_opt_sf6_grid_avg:dd, ratio_opt_sf6_grid_avg:dd, age_opt_sf6_grid_mon_avg:ee, age_opt_sf6_grid_seas_avg:ff, age_opt_grid_mission_avg:gg, $ ratio_opt_grid_mission_avg:gg, age_opt_co2_grid_mission_avg:gg, ratio_opt_co2_grid_mission_avg:gg, age_opt_sf6_grid_mission_avg:gg, ratio_opt_sf6_grid_mission_avg:gg, $ age_opt_th_grid_avg:hh, age_opt_co2_th_grid_avg:hh, age_opt_sf6_th_grid_avg:hh, ratio_opt_th_grid_avg:hh, ratio_opt_co2_th_grid_avg:hh, ratio_opt_sf6_th_grid_avg:hh, $ age_opt_th_grid_mon_avg:kk, age_opt_co2_th_grid_mon_avg:kk, age_opt_sf6_th_grid_mon_avg:kk, age_opt_th_grid_seas_avg:mm, age_opt_co2_th_grid_seas_avg:mm, age_opt_sf6_th_grid_seas_avg:mm, $ ratio_opt_th_grid_mission_avg:oo, ratio_opt_co2_th_grid_mission_avg:oo, ratio_opt_sf6_th_grid_mission_avg:oo, age_opt_th_grid_mission_avg:oo, age_opt_co2_th_grid_mission_avg:oo, $ age_opt_sf6_th_grid_mission_avg:oo, lat_source_c_opt_grid_avg:dd, lat_source_c_opt_co2_grid_avg:dd, lat_source_c_opt_th_grid_avg:hh, lat_source_c_opt_co2_th_grid_avg:hh, $ ratio_opt_grid_mon_avg:ee, ratio_opt_co2_grid_mon_avg:ee, lat_source_c_opt_grid_mon_avg:ee, lat_source_c_opt_co2_grid_mon_avg:ee, ratio_opt_sf6_grid_mon_avg:ee, ratio_opt_th_grid_mon_avg:kk, $ lat_source_c_opt_th_grid_mon_avg:kk, ratio_opt_co2_th_grid_mon_avg:kk, lat_source_c_opt_co2_th_grid_mon_avg:kk, ratio_opt_sf6_th_grid_mon_avg:kk, lat_source_c_opt_sf6_th_grid_mon_avg:kk, $ ratio_opt_grid_seas_avg:ff, lat_source_c_opt_grid_seas_avg:ff, ratio_opt_co2_grid_seas_avg:ff, lat_source_c_opt_co2_grid_seas_avg:ff, ratio_opt_sf6_grid_seas_avg:ff, $ ratio_opt_th_grid_seas_avg:mm, lat_source_c_opt_th_grid_seas_avg:mm, ratio_opt_co2_th_grid_seas_avg:mm, lat_source_c_opt_co2_th_grid_seas_avg:mm, ratio_opt_sf6_th_grid_seas_avg:mm, $ lat_source_c_opt_sf6_grid_avg:dd, lat_source_c_opt_sf6_th_grid_avg:hh, lat_source_c_opt_sf6_grid_mon_avg:ee, lat_source_c_opt_sf6_grid_seas_avg:ff, lat_source_c_opt_sf6_th_grid_seas_avg:mm, $ age_co2_grid_avg:dd, age_sf6_grid_avg:dd, lat_source_opt_co2_grid_mon_avg:ee, lat_source_opt_co2_grid_seas_avg:ff, lat_source_opt_co2_th_grid_avg:hh, lat_source_opt_co2_th_grid_mon_avg:kk, $ lat_source_opt_co2_th_grid_seas_avg:mm, lat_source_c_opt_co2_th_grid_mission_avg:oo, lat_source_c_opt_th_grid_mission_avg:oo, lat_source_c_opt_sf6_th_grid_mission_avg:oo, $ frac_extratr_opt_sf6_th_grid_mission_avg:oo, lat_source_opt_sf6_th_grid_mission_avg:oo, age_co2_grid_mon_avg:ee, age_sf6_grid_mon_avg:ee, n2o_grid_avg:dd, n2o_grid_mission_avg:gg, $ n2o_norm_grid_avg:dd, n2o_norm_grid_mission_avg:gg, n2o_grid_time:cc, n2o_norm_grid_time:cc, pres_grid_avg:dd, mission_year:fltarr(nm), lat_grid:lat_grid, alt_grid:alt_grid, $ pres_grid_mission_avg:gg, pres_grid_time:cc, theta_grid:theta_grid, years:years} for z = 0, nz-1 do for y = 0, nyg-1 do begin ii_all = where(alt[chk_c] ge alt_grid[z]-dz/2. and alt[chk_c] lt alt_grid[z]+dz/2. and elat_strat_all[chk_c] ge lat_grid[y]-dy/2. and elat_strat_all[chk_c] lt lat_grid[y]+dy/2.,tot_i) if tot_i gt grid_num_thresh then begin stats = moment(dat.age_opt_all[ii_all],sd=sd,/nan) grid.age_opt_grid_avg[*,y,z] = [stats[0],sd,tot_i] stats = moment(dat.ratio_opt_all[ii_all],sd=sd,/nan) grid.ratio_opt_grid_avg[*,y,z] = [stats[0],sd,tot_i] stats = moment(dat.lat_source_c_opt_all[ii_all],sd=sd,/nan) grid.lat_source_c_opt_grid_avg[*,y,z] = [stats[0],sd,tot_i] endif ii_all = where(alt[ico2] ge alt_grid[z]-dz/2. and alt[ico2] lt alt_grid[z]+dz/2. and elat_strat_all[ico2] ge lat_grid[y]-dy/2. and elat_strat_all[ico2] lt lat_grid[y]+dy/2.,tot_i) if tot_i gt grid_num_thresh then begin stats = moment(dat_co2.age_opt_all[ii_all],sd=sd,/nan) grid.age_opt_co2_grid_avg[*,y,z] = [stats[0],sd,tot_i] stats = moment(dat_co2.ratio_opt_all[ii_all],sd=sd,/nan) grid.ratio_opt_co2_grid_avg[*,y,z] = [stats[0],sd,tot_i] stats = moment(dat_co2.lat_source_c_opt_all[ii_all],sd=sd,/nan) grid.lat_source_c_opt_co2_grid_avg[*,y,z] = [stats[0],sd,tot_i] stats = moment(co2_age[ico2[ii_all]],sd=sd,/nan) grid.age_co2_grid_avg[*,y,z] = [stats[0],sd,tot_i] endif ii_all = where(alt[isf6] ge alt_grid[z]-dz/2. and alt[isf6] lt alt_grid[z]+dz/2. and elat_strat_all[isf6] ge lat_grid[y]-dy/2. and elat_strat_all[isf6] lt lat_grid[y]+dy/2.,tot_i) if tot_i gt grid_num_thresh then begin stats = moment(dat_sf6.age_opt_all[ii_all],sd=sd,/nan) grid.age_opt_sf6_grid_avg[*,y,z] = [stats[0],sd,tot_i] stats = moment(dat_sf6.ratio_opt_all[ii_all],sd=sd,/nan) grid.ratio_opt_sf6_grid_avg[*,y,z] = [stats[0],sd,tot_i] stats = moment(dat_sf6.lat_source_c_opt_all[ii_all],sd=sd,/nan) grid.lat_source_c_opt_sf6_grid_avg[*,y,z] = [stats[0],sd,tot_i] ii2 = where(sf6_age[isf6[ii_all]] lt 20,nii2) if nii2 gt grid_num_thresh then begin stats = moment(sf6_age[isf6[ii_all[ii2]]],sd=sd,/nan) grid.age_sf6_grid_avg[*,y,z] = [stats[0],sd,tot_i] endif endif ii_all = where(alt[in2o] ge alt_grid[z]-dz/2. and alt[in2o] lt alt_grid[z]+dz/2. and elat_strat_all[in2o] ge lat_grid[y]-dy/2. and elat_strat_all[in2o] lt lat_grid[y]+dy/2.,tot_i) if tot_i gt grid_num_thresh then begin stats = moment(n2o[in2o[ii_all]],sd=sd,/nan) grid.n2o_grid_avg[*,y,z] = [stats[0],sd,tot_i] stats = moment(n2o_norm[in2o[ii_all]],sd=sd,/nan) grid.n2o_norm_grid_avg[*,y,z] = [stats[0],sd,tot_i] stats = moment(pres[in2o[ii_all]],sd=sd,/nan) grid.pres_grid_avg[*,y,z] = [stats[0],sd,tot_i] endif endfor for z = 0, nth-1 do for y = 0, nyg-1 do begin ii_all = where(theta[chk_c] ge theta_grid[z]-dth/2. and theta[chk_c] lt theta_grid[z]+dth/2. and elat_strat_all[chk_c] ge lat_grid[y]-dy/2. and elat_strat_all[chk_c] lt lat_grid[y]+dy/2.,tot_i) if tot_i gt grid_num_thresh then begin stats = moment(dat.age_opt_all[ii_all],sd=sd,/nan) grid.age_opt_th_grid_avg[*,y,z] = [stats[0],sd,tot_i] stats = moment(dat.ratio_opt_all[ii_all],sd=sd,/nan) grid.ratio_opt_th_grid_avg[*,y,z] = [stats[0],sd,tot_i] stats = moment(dat.lat_source_c_opt_all[ii_all],sd=sd,/nan) grid.lat_source_c_opt_th_grid_avg[*,y,z] = [stats[0],sd,tot_i] endif ii_all = where(theta_all[ico2] ge theta_grid[z]-dth/2. and theta_all[ico2] lt theta_grid[z]+dth/2. and elat_strat_all[ico2] ge lat_grid[y]-dy/2. and $ elat_strat_all[ico2] lt lat_grid[y]+dy/2.,tot_i) if tot_i gt grid_num_thresh then begin stats = moment(dat_co2.age_opt_all[ii_all],sd=sd,/nan) grid.age_opt_co2_th_grid_avg[*,y,z] = [stats[0],sd,tot_i] stats = moment(dat_co2.ratio_opt_all[ii_all],sd=sd,/nan) grid.ratio_opt_co2_th_grid_avg[*,y,z] = [stats[0],sd,tot_i] stats = moment(dat_co2.lat_source_opt_all[ii_all],sd=sd,/nan) grid.lat_source_opt_co2_th_grid_avg[*,y,z] = [stats[0],sd,tot_i] stats = moment(dat_co2.lat_source_c_opt_all[ii_all],sd=sd,/nan) grid.lat_source_c_opt_co2_th_grid_avg[*,y,z] = [stats[0],sd,tot_i] endif ii_all = where(theta[isf6] ge theta_grid[z]-dth/2. and theta[isf6] lt theta_grid[z]+dth/2. and elat_strat_all[isf6] ge lat_grid[y]-dy/2. and elat_strat_all[isf6] lt lat_grid[y]+dy/2.,tot_i) if tot_i gt grid_num_thresh then begin stats = moment(dat_sf6.age_opt_all[ii_all],sd=sd,/nan) grid.age_opt_sf6_th_grid_avg[*,y,z] = [stats[0],sd,tot_i] stats = moment(dat_sf6.ratio_opt_all[ii_all],sd=sd,/nan) grid.ratio_opt_sf6_th_grid_avg[*,y,z] = [stats[0],sd,tot_i] stats = moment(dat_sf6.lat_source_c_opt_all[ii_all],sd=sd,/nan) grid.lat_source_c_opt_sf6_th_grid_avg[*,y,z] = [stats[0],sd,tot_i] endif endfor ; Monthly climatological averages. for t = 0, 11 do for z = 0, nz-1 do for y = 0, nyg-1 do begin ii_all = where(months_all[chk_c] eq t+1 and alt[chk_c] ge alt_grid[z]-dz/2. and alt[chk_c] lt alt_grid[z]+dz/2. and elat_strat_all[chk_c] ge lat_grid[y]-dy/2. and $ elat_strat_all[chk_c] lt lat_grid[y]+dy/2.,tot_i) if tot_i gt grid_num_thresh then begin stats = moment(dat.age_opt_all[ii_all],sd=sd,/nan) grid.age_opt_grid_mon_avg[*,y,z,t] = [stats[0],sd,tot_i] stats = moment(dat.ratio_opt_all[ii_all],sd=sd,/nan) grid.ratio_opt_grid_mon_avg[*,y,z,t] = [stats[0],sd,tot_i] stats = moment(dat.lat_source_c_opt_all[ii_all],sd=sd,/nan) grid.lat_source_c_opt_grid_mon_avg[*,y,z,t] = [stats[0],sd,tot_i] endif ii_all = where(months_all[ico2] eq t+1 and alt[ico2] ge alt_grid[z]-dz/2. and alt[ico2] lt alt_grid[z]+dz/2. and elat_strat_all[ico2] ge lat_grid[y]-dy/2. and $ elat_strat_all[ico2] lt lat_grid[y]+dy/2.,tot_i) if tot_i gt 1 then begin gd = where(finite(dat_co2.age_opt_all[ii_all]),ngd) if ngd gt grid_num_thresh then begin stats = moment(dat_co2.age_opt_all[ii_all[gd]],sd=sd,/nan) grid.age_opt_co2_grid_mon_avg[*,y,z,t] = [stats[0],sd,tot_i] stats = moment(dat_co2.ratio_opt_all[ii_all[gd]],sd=sd,/nan) grid.ratio_opt_co2_grid_mon_avg[*,y,z,t] = [stats[0],sd,tot_i] stats = moment(dat_co2.lat_source_opt_all[ii_all],sd=sd,/nan) grid.lat_source_opt_co2_grid_mon_avg[*,y,z,t] = [stats[0],sd,tot_i] stats = moment(dat_co2.lat_source_c_opt_all[ii_all],sd=sd,/nan) grid.lat_source_c_opt_co2_grid_mon_avg[*,y,z,t] = [stats[0],sd,tot_i] stats = moment(co2_age[ico2[ii_all]],sd=sd,/nan) grid.age_co2_grid_mon_avg[*,y,z,t] = [stats[0],sd,tot_i] endif endif ii_all = where(months_all[isf6] eq t+1 and alt[isf6] ge alt_grid[z]-dz/2. and alt[isf6] lt alt_grid[z]+dz/2. and elat_strat_all[isf6] ge lat_grid[y]-dy/2. and $ elat_strat_all[isf6] lt lat_grid[y]+dy/2.,tot_i) if tot_i gt grid_num_thresh then begin gd = where(finite(dat_sf6.age_opt_all[ii_all]),ngd) if ngd gt 1 then begin stats = moment(dat_sf6.age_opt_all[ii_all[gd]],sd=sd,/nan) grid.age_opt_sf6_grid_mon_avg[*,y,z,t] = [stats[0],sd,tot_i] stats = moment(dat_sf6.ratio_opt_all[ii_all[gd]],sd=sd,/nan) grid.ratio_opt_sf6_grid_mon_avg[*,y,z,t] = [stats[0],sd,tot_i] stats = moment(dat_sf6.lat_source_c_opt_all[ii_all],sd=sd,/nan) grid.lat_source_c_opt_sf6_grid_mon_avg[*,y,z,t] = [stats[0],sd,tot_i] ii2 = where(sf6_age[isf6[ii_all]] lt 20,nii2) if nii2 gt grid_num_thresh then begin stats = moment(sf6_age[isf6[ii_all[ii2]]],sd=sd,/nan) grid.age_sf6_grid_mon_avg[*,y,z,t] = [stats[0],sd,tot_i] endif endif endif endfor for t = 0, 11 do for z = 0, nth-1 do for y = 0, nyg-1 do begin ii_all = where(months_all[chk_c] eq t+1 and theta[chk_c] ge theta_grid[z]-dth/2. and theta[chk_c] lt theta_grid[z]+dth/2. and elat_strat_all[chk_c] ge lat_grid[y]-dy/2. and $ elat_strat_all[chk_c] lt lat_grid[y]+dy/2.,tot_i) if tot_i gt grid_num_thresh then begin stats = moment(dat.age_opt_all[ii_all],sd=sd,/nan) grid.age_opt_th_grid_mon_avg[*,y,z,t] = [stats[0],sd,tot_i] stats = moment(dat.ratio_opt_all[ii_all],sd=sd,/nan) grid.ratio_opt_th_grid_mon_avg[*,y,z,t] = [stats[0],sd,tot_i] stats = moment(dat.lat_source_c_opt_all[ii_all],sd=sd,/nan) grid.lat_source_c_opt_th_grid_mon_avg[*,y,z,t] = [stats[0],sd,tot_i] endif ii_all = where(months_all[ico2] eq t+1 and theta[ico2] ge theta_grid[z]-dth/2. and theta[ico2] lt theta_grid[z]+dth/2. and elat_strat_all[ico2] ge lat_grid[y]-dy/2. and $ elat_strat_all[ico2] lt lat_grid[y]+dy/2.,tot_i) if tot_i gt grid_num_thresh then begin stats = moment(dat_co2.age_opt_all[ii_all],sd=sd,/nan) grid.age_opt_co2_th_grid_mon_avg[*,y,z,t] = [stats[0],sd,tot_i] stats = moment(dat_co2.ratio_opt_all[ii_all],sd=sd,/nan) grid.ratio_opt_co2_th_grid_mon_avg[*,y,z,t] = [stats[0],sd,tot_i] stats = moment(dat_co2.lat_source_opt_all[ii_all],sd=sd,/nan) grid.lat_source_opt_co2_th_grid_mon_avg[*,y,z,t] = [stats[0],sd,tot_i] stats = moment(dat_co2.lat_source_c_opt_all[ii_all],sd=sd,/nan) grid.lat_source_c_opt_co2_th_grid_mon_avg[*,y,z,t] = [stats[0],sd,tot_i] endif ii_all = where(months_all[isf6] eq t+1 and theta[isf6] ge theta_grid[z]-dth/2. and theta[isf6] lt theta_grid[z]+dth/2. and elat_strat_all[isf6] ge lat_grid[y]-dy/2. and $ elat_strat_all[isf6] lt lat_grid[y]+dy/2.,tot_i) if tot_i gt grid_num_thresh then begin stats = moment(dat_sf6.age_opt_all[ii_all],sd=sd,/nan) grid.age_opt_sf6_th_grid_mon_avg[*,y,z,t] = [stats[0],sd,tot_i] stats = moment(dat_sf6.ratio_opt_all[ii_all],sd=sd,/nan) grid.ratio_opt_sf6_th_grid_mon_avg[*,y,z,t] = [stats[0],sd,tot_i] stats = moment(dat_sf6.lat_source_c_opt_all[ii_all],sd=sd,/nan) grid.lat_source_c_opt_sf6_th_grid_mon_avg[*,y,z,t] = [stats[0],sd,tot_i] endif endfor ; Season averages. for t = 0, 3 do begin ti = indgen(3)-1+t*3 for z = 0, nz-1 do for y = 0, nyg-1 do begin for a = 0, 1 do begin grid.age_opt_grid_seas_avg[a,y,z,t] = mean(grid.age_opt_grid_mon_avg[a,y,z,ti],/nan) grid.ratio_opt_grid_seas_avg[a,y,z,t] = mean(grid.ratio_opt_grid_mon_avg[a,y,z,ti],/nan) grid.lat_source_c_opt_grid_seas_avg[a,y,z,t] = mean(grid.lat_source_c_opt_grid_mon_avg[a,y,z,ti],/nan) grid.age_opt_co2_grid_seas_avg[a,y,z,t] = mean(grid.age_opt_co2_grid_mon_avg[a,y,z,ti],/nan) grid.ratio_opt_co2_grid_seas_avg[a,y,z,t] = mean(grid.ratio_opt_co2_grid_mon_avg[a,y,z,ti],/nan) grid.lat_source_opt_co2_grid_seas_avg[a,y,z,t] = mean(grid.lat_source_opt_co2_grid_mon_avg[a,y,z,ti],/nan) grid.lat_source_c_opt_co2_grid_seas_avg[a,y,z,t] = mean(grid.lat_source_c_opt_co2_grid_mon_avg[a,y,z,ti],/nan) grid.age_opt_sf6_grid_seas_avg[a,y,z,t] = mean(grid.age_opt_sf6_grid_mon_avg[a,y,z,ti],/nan) grid.ratio_opt_sf6_grid_seas_avg[a,y,z,t] = mean(grid.ratio_opt_sf6_grid_mon_avg[a,y,z,ti],/nan) grid.lat_source_c_opt_sf6_grid_seas_avg[a,y,z,t] = mean(grid.lat_source_c_opt_sf6_grid_mon_avg[a,y,z,ti],/nan) endfor endfor for z = 0, nth-1 do for y = 0, nyg-1 do begin for a = 0, 1 do begin grid.age_opt_th_grid_seas_avg[a,y,z,t] = mean(grid.age_opt_th_grid_mon_avg[a,y,z,ti],/nan) grid.ratio_opt_th_grid_seas_avg[a,y,z,t] = mean(grid.ratio_opt_th_grid_mon_avg[a,y,z,ti],/nan) grid.lat_source_c_opt_th_grid_seas_avg[a,y,z,t] = mean(grid.lat_source_c_opt_th_grid_mon_avg[a,y,z,ti],/nan) grid.age_opt_co2_th_grid_seas_avg[a,y,z,t] = mean(grid.age_opt_co2_th_grid_mon_avg[a,y,z,ti],/nan) grid.ratio_opt_co2_th_grid_seas_avg[a,y,z,t] = mean(grid.ratio_opt_co2_th_grid_mon_avg[a,y,z,ti],/nan) grid.lat_source_opt_co2_th_grid_seas_avg[a,y,z,t] = mean(grid.lat_source_opt_co2_th_grid_mon_avg[a,y,z,ti],/nan) grid.lat_source_c_opt_co2_th_grid_seas_avg[a,y,z,t] = mean(grid.lat_source_c_opt_co2_th_grid_mon_avg[a,y,z,ti],/nan) grid.age_opt_sf6_th_grid_seas_avg[a,y,z,t] = mean(grid.age_opt_sf6_th_grid_mon_avg[a,y,z,ti],/nan) grid.ratio_opt_sf6_th_grid_seas_avg[a,y,z,t] = mean(grid.ratio_opt_sf6_th_grid_mon_avg[a,y,z,ti],/nan) grid.lat_source_c_opt_sf6_th_grid_seas_avg[a,y,z,t] = mean(grid.lat_source_c_opt_sf6_th_grid_mon_avg[a,y,z,ti],/nan) endfor endfor endfor ; Mission averages. for m = 0, nm-1 do for z = 0, nz-1 do for y = 0, nyg-1 do begin ii_all = where(mission[chk_c] eq m+1 and alt[chk_c] ge alt_grid[z]-dz/2. and alt[chk_c] lt alt_grid[z]+dz/2. and elat_strat_all[chk_c] ge lat_grid[y]-dy/2. and $ elat_strat_all[chk_c] lt lat_grid[y]+dy/2.,tot_i) if tot_i gt grid_num_thresh then begin stats = moment(dat.age_opt_all[ii_all],sd=sd,/nan) grid.age_opt_grid_mission_avg[*,y,z,m] = [stats[0],sd,tot_i] stats = moment(dat.ratio_opt_all[ii_all],sd=sd,/nan) grid.ratio_opt_grid_mission_avg[*,y,z,m] = [stats[0],sd,tot_i] endif ii_all = where(mission[ico2] eq m+1 and alt[ico2] ge alt_grid[z]-dz/2. and alt[ico2] lt alt_grid[z]+dz/2. and elat_strat_all[ico2] ge lat_grid[y]-dy/2. and $ elat_strat_all[ico2] lt lat_grid[y]+dy/2.,tot_i) if tot_i gt grid_num_thresh then begin stats = moment(dat_co2.age_opt_all[ii_all],sd=sd,/nan) grid.age_opt_co2_grid_mission_avg[*,y,z,m] = [stats[0],sd,tot_i] stats = moment(dat_co2.ratio_opt_all[ii_all],sd=sd,/nan) grid.ratio_opt_co2_grid_mission_avg[*,y,z,m] = [stats[0],sd,tot_i] endif ii_all = where(mission[isf6] eq m+1 and alt[isf6] ge alt_grid[z]-dz/2. and alt[isf6] lt alt_grid[z]+dz/2. and elat_strat_all[isf6] ge lat_grid[y]-dy/2. and $ elat_strat_all[isf6] lt lat_grid[y]+dy/2.,tot_i) if tot_i gt grid_num_thresh then begin stats = moment(dat_sf6.age_opt_all[ii_all],sd=sd,/nan) grid.age_opt_sf6_grid_mission_avg[*,y,z,m] = [stats[0],sd,tot_i] stats = moment(dat_sf6.ratio_opt_all[ii_all],sd=sd,/nan) grid.ratio_opt_sf6_grid_mission_avg[*,y,z,m] = [stats[0],sd,tot_i] endif ii_all = where(mission[in2o] eq m+1 and alt[in2o] ge alt_grid[z]-dz/2. and alt[in2o] lt alt_grid[z]+dz/2. and elat_strat_all[in2o] ge lat_grid[y]-dy/2. and $ elat_strat_all[in2o] lt lat_grid[y]+dy/2.,tot_i) if tot_i gt grid_num_thresh then begin stats = moment(pres[in2o[ii_all]],sd=sd,/nan) grid.pres_grid_mission_avg[*,y,z,m] = [stats[0],sd,tot_i] stats = moment(n2o[in2o[ii_all]],sd=sd,/nan) grid.n2o_grid_mission_avg[*,y,z,m] = [stats[0],sd,tot_i] stats = moment(n2o_norm[in2o[ii_all]],sd=sd,/nan) grid.n2o_norm_grid_mission_avg[*,y,z,m] = [stats[0],sd,tot_i] endif endfor for m = 0, nm-1 do for z = 0, nth-1 do for y = 0, nyg-1 do begin ii_all = where(mission[chk_c] eq m+1 and theta[chk_c] ge theta_grid[z]-dth/2. and theta[chk_c] lt theta_grid[z]+dth/2. and elat_m[chk_c] ge lat_grid[y]-dy/2. and $ elat_m[chk_c] lt lat_grid[y]+dy/2.,tot_i) if tot_i gt grid_num_thresh then begin stats = moment(dat.age_opt_all[ii_all],sd=sd,/nan) grid.age_opt_th_grid_mission_avg[*,y,z,m] = [stats[0],sd,tot_i] stats = moment(dat.ratio_opt_all[ii_all],sd=sd,/nan) grid.ratio_opt_th_grid_mission_avg[*,y,z,m] = [stats[0],sd,tot_i] stats = moment(dat.lat_source_c_opt_all[ii_all],sd=sd,/nan) grid.lat_source_c_opt_th_grid_mission_avg[*,y,z,m] = [stats[0],sd,tot_i] endif ii_all = where(mission[ico2] eq m+1 and theta[ico2] ge theta_grid[z]-dth/2. and theta[ico2] lt theta_grid[z]+dth/2. and elat_strat_all[ico2] ge lat_grid[y]-dy/2. and $ elat_strat_all[ico2] lt lat_grid[y]+dy/2.,tot_i) if tot_i gt grid_num_thresh then begin stats = moment(dat_co2.age_opt_all[ii_all],sd=sd,/nan) grid.age_opt_co2_th_grid_mission_avg[*,y,z,m] = [stats[0],sd,tot_i] stats = moment(dat_co2.ratio_opt_all[ii_all],sd=sd,/nan) grid.ratio_opt_co2_th_grid_mission_avg[*,y,z,m] = [stats[0],sd,tot_i] stats = moment(dat_co2.lat_source_c_opt_all[ii_all],sd=sd,/nan) grid.lat_source_c_opt_co2_th_grid_mission_avg[*,y,z,m] = [stats[0],sd,tot_i] endif ii_all = where(mission[isf6] eq m+1 and theta[isf6] ge theta_grid[z]-dth/2. and theta[isf6] lt theta_grid[z]+dth/2. and elat_m[isf6] ge lat_grid[y]-dy/2. and $ elat_m[isf6] lt lat_grid[y]+dy/2.,tot_i) if tot_i gt grid_num_thresh then begin stats = moment(dat_sf6.age_opt_all[ii_all],sd=sd,/nan) grid.age_opt_sf6_th_grid_mission_avg[*,y,z,m] = [stats[0],sd,tot_i] stats = moment(dat_sf6.ratio_opt_all[ii_all],sd=sd,/nan) grid.ratio_opt_sf6_th_grid_mission_avg[*,y,z,m] = [stats[0],sd,tot_i] stats = moment(dat_sf6.lat_source_opt_all[ii_all],sd=sd,/nan) grid.lat_source_opt_sf6_th_grid_mission_avg[*,y,z,m] = [stats[0],sd,tot_i] stats = moment(dat_sf6.lat_source_c_opt_all[ii_all],sd=sd,/nan) grid.lat_source_c_opt_sf6_th_grid_mission_avg[*,y,z,m] = [stats[0],sd,tot_i] stats = moment(dat_sf6.frac_extratr_opt_all[ii_all],sd=sd,/nan) grid.frac_extratr_opt_sf6_th_grid_mission_avg[*,y,z,m] = [stats[0],sd,tot_i] endif endfor ; Monthly averages. for t = 0, nt-1 do begin iit = where(times_all[in2o] ge years[t]-1./24. and times_all[in2o] le years[t]+1./24.,nit) if nit gt 0 then begin for z = 0, nz-1 do for y = 0, nyg-1 do begin ii_all = where(alt[in2o[iit]] ge alt_grid[z]-dz/2. and alt[in2o[iit]] lt alt_grid[z]+dz/2. and elat_m[in2o[iit]] ge lat_grid[y]-dy/2. and elat_m[in2o[iit]] lt lat_grid[y]+dy/2.,tot_i) if tot_i gt grid_num_thresh then begin stats = moment(pres[in2o[iit[ii_all]]],sd=sd,/nan) grid.pres_grid_time[*,y,z,t] = [stats[0],sd,tot_i] stats = moment(n2o[in2o[iit[ii_all]]],sd=sd,/nan) grid.n2o_grid_time[*,y,z,t] = [stats[0],sd,tot_i] stats = moment(n2o_norm[in2o[iit[ii_all]]],sd=sd,/nan) grid.n2o_norm_grid_time[*,y,z,t] = [stats[0],sd,tot_i] endif endfor endif endfor if aircraft eq 0 and fi eq 0 then grid.mission_year = flight_year_frac if aircraft then save,grid,filename=dir+'Aircraft/Missions/idlsave_files/aircraft_mean_age_grid_'+ext[fi]+'.sav' $ else save,grid,filename=dir+'Balloon/balloon_mean_age_grid_'+b_ext[fi]+'.sav' endif if aircraft then restore,dir+'Aircraft/Missions/idlsave_files/aircraft_mean_age_grid_'+ext[fi]+'.sav' else $ restore,dir+'Balloon/balloon_mean_age_grid_'+b_ext[fi]+'.sav' ; Averaging over lat and alt grids. lat_source_c_opt_co2_grid_mon_avg = replicate(!values.f_nan,2,2,3,12,2) & lat_source_c_opt_co2_grid_seas_avg = replicate(!values.f_nan,2,2,3,4,2) lat_source_opt_co2_grid_mon_avg = lat_source_c_opt_co2_grid_mon_avg & lat_source_opt_co2_grid_seas_avg = lat_source_c_opt_co2_grid_seas_avg for t = 0, 11 do begin for z = 0, 2 do for y = 0, 1 do begin yi = indgen(4)+4*y+12 zi = indgen(4)+4*z+16 stats = moment(grid_a0.lat_source_opt_co2_grid_mon_avg[0,yi,zi,t],sd=sd,/nan) lat_source_opt_co2_grid_mon_avg[*,y,z,t,0] = [stats[0],sd] stats = moment(grid_a0.lat_source_c_opt_co2_grid_mon_avg[0,yi,zi,t],sd=sd,/nan) lat_source_c_opt_co2_grid_mon_avg[*,y,z,t,0] = [stats[0],sd] stats = moment(grid_b0.lat_source_opt_co2_grid_mon_avg[0,yi,zi,t],sd=sd,/nan) lat_source_opt_co2_grid_mon_avg[*,y,z,t,1] = [stats[0],sd] stats = moment(grid_b0.lat_source_c_opt_co2_grid_mon_avg[0,yi,zi,t],sd=sd,/nan) lat_source_c_opt_co2_grid_mon_avg[*,y,z,t,1] = [stats[0],sd] endfor endfor for k = 0, 1 do for t = 0, 3 do for z = 0, 2 do for y = 0, 1 do for i = 0, 1 do begin ti = indgen(3)-1+t*3 lat_source_c_opt_co2_grid_seas_avg[i,y,z,t,k] = mean(lat_source_c_opt_co2_grid_mon_avg[i,y,z,ti,k],/nan) lat_source_opt_co2_grid_seas_avg[i,y,z,t,k] = mean(lat_source_opt_co2_grid_mon_avg[i,y,z,ti,k],/nan) endfor ; Time weighting of age spectra from equator and non-equator. ti1 = 0.4 ti2 = 0.6 t1 = where(age_spectra_years le ti1,nt1) t2 = where(age_spectra_years gt ti1 and age_spectra_years lt ti2,nt2) t3 = where(age_spectra_years ge ti2,nt3) linear1 = 1. - findgen(nt2)/nt2 gauss1 = exp(-(age_spectra_years[t2]-ti1)^2. / (ti2/30.*(ti2-ti1)*10.)) gauss1 -= gauss1[-1] ss = gauss1 weight_tr = [fltarr(nt1),reverse(ss),fltarr(nt3)+1] weight_nh = [fltarr(nt1)+1,ss,fltarr(nt3)] tot = weight_tr + weight_nh weight_tr /= tot weight_nh /= tot t_init = 26/dt_spectra ; Read in the tropical CH4 time series. restore,dir+'Surface_Trace_Gas/CH4_tropical_time_series.sav' co2_m = read_ascii(dir+'Surface_Trace_Gas/CO2/CO2_mlo_monthly.txt',data_start=70) yrs_m = reform(co2_m.field1[1,*]) mons_m = reform(co2_m.field1[2,*]) years_mlo = float(yrs_m) + float(mons_m-1)/12. + 1./24. co2_mlo = reform(co2_m.field1[3,*]) co2_s = read_ascii(dir+'Surface_Trace_Gas/CO2/CO2_smo_monthly.txt',data_start=70) yrs_s = reform(co2_s.field1[1,*]) mons_s = reform(co2_s.field1[2,*]) co2_smo = reform(co2_s.field1[3,*]) years_smo = float(yrs_s) + float(mons_s-1)/12. + 1./24. ti = where(years_smo ge years_mlo[0],nt_sm) years_sm = years_mlo co2_sm = 0.5 * (co2_mlo + co2_smo[ti]) co2_sm_smooth = lowpass_cfc(co2_sm, BOX=12, EDGE_PFCAST=1) ; Model output ;restore,dir+'Models/TLP/idealized_sweeps/TLP_w1.30_upper_strat_10km.sav' ;restore,dir+'Models/TLP/idealized_sweeps/TLP_0.80_lower_strat_4km_upper_strat_8km.sav' ;restore,dir+'Models/TLP/idealized_sweeps/TLP_lower_strat_3km.sav' restore,dir+'Models/TLP/idealized_sweeps/TLP_upper_strat_10km.sav' n2o_norm_mean_age_tlp_10km = n2o_norm_mean_age_tlp n2o_norm_h1211_tlp_10km = n2o_norm_h1211_tlp n2o_norm_f11_tlp_10km = n2o_norm_f11_tlp n2o_norm_wstar_tlp_10km = n2o_norm_wstar_tlp ;restore,dir+'Models/TLP/idealized_sweeps/TLP_upper_strat_15km.sav' restore,dir+'Models/TLP/idealized_sweeps/TLP_upper_strat_7km.sav' n2o_norm_mean_age_tlp_7km = n2o_norm_mean_age_tlp n2o_norm_h1211_tlp_7km = n2o_norm_h1211_tlp n2o_norm_f11_tlp_7km = n2o_norm_f11_tlp n2o_norm_wstar_tlp_7km = n2o_norm_wstar_tlp restore,dir+'Models/TLP/idealized_sweeps/TLP_upper_strat_5km.sav' n2o_norm_mean_age_tlp_5km = n2o_norm_mean_age_tlp n2o_norm_h1211_tlp_5km = n2o_norm_h1211_tlp n2o_norm_f11_tlp_5km = n2o_norm_f11_tlp n2o_norm_wstar_tlp_5km = n2o_norm_wstar_tlp ;restore,dir+'Models/TLP/idealized_sweeps/TLP_w1.20_upper_strat_7km_dtau0.20_lower_strat_5km.sav' restore,dir+'Models/TLP/idealized_sweeps/TLP_all.sav' ;restore,dir+'Models/TLP/idealized_sweeps/TLP_w1.00.sav' ntlp = n_elements(mean_age_avg[0,0,*]) ; Photolytic tracer - N2O bins. restore,dir+'Aircraft/Missions/idlsave_files/Photolytic_fits.sav' ;theta_tp_djf = tpause_seas_theta[*,0] ;save,lat_tp,theta_tp_djf,filename=dir+'Reanalysis/MERRA2/tp_theta_djf.sav' restore,dir+'Sondes/qbo_singapore.sav' nz_qbo_sing = n_elements(qbo_sing_p) nt_qbo_sing = n_elements(qbo_sing_years) qbo_year = fix(qbo_sing_years) qbo_yrs = fix(qbo_sing_years[uniq(fix(qbo_sing_years))]) nyrs_qbo = n_elements(uniq(qbo_yrs)) qbo_sing_yrsm = qbo_sing & qbo_sing_sm = qbo_sing & qbo_sing_anoms = qbo_sing for z = 0, nz_qbo_sing-1 do begin chk = where(~finite(reform(qbo_sing[z,*])),nchk) if chk[0] gt 0 and chk[0] lt nt_qbo_sing-1 then qbo_sing[z,chk[0]] = 0.5*qbo_sing[z,chk[0]-1] + 0.5*qbo_sing[z,chk[0]+1] gd = where(finite(reform(qbo_sing[z,*])),ngd) qbo_sing_yrsm[z,gd] = lowpass_cfc(reform(qbo_sing[z,gd]), BOX=12, EDGE_PFCAST=1) qbo_sing_sm[z,gd] = sg_smooth(reform(qbo_sing_yrsm[z,gd]), NLEFT=60/2, NRIGHT=60/2-1, EDGE_PFCAST=1) qbo_sing_anoms[z,*] = qbo_sing_yrsm[z,*] - qbo_sing_sm[z,*] endfor qbo_sing_alt = -7.*alog(qbo_sing_p/1e3) caldat,jday_all,months_all,days_all,years_all,hours_all,seconds_all np = n_elements(months_all) mons_days = strarr(np) mons_zero = replicate('',np) & days_zero = mons_zero chk = where(months_all lt 10,nchk) if nchk gt 0 then mons_zero[chk] = '0' chk = where(days_all lt 10,nchk) if nchk gt 0 then days_zero[chk] = '0' mons_days = strcompress(string(years_all),/r)+mons_zero+strcompress(string(months_all),/r)+days_zero+strcompress(string(days_all),/r) colors = ['sky blue','Blue','dark blue','Purple','Medium Purple','Magenta','Lime Green','Green','Orange','Red','Brown','Silver','Grey','Dark Grey','sky blue','Blue','dark blue', $ 'Purple','Medium Purple','Magenta'] LOADCT, 39, RGB_TABLE = rgb LOADCT, 3, RGB_TABLE = rgb_3 LOADCT, 33, RGB_TABLE = rgb_33 LOADCT, 56, RGB_TABLE = rgb_56 LOADCT, 68, RGB_TABLE = rgb_68 LOADCT, 69, RGB_TABLE = rgb_69 LOADCT, 70, RGB_TABLE = rgb_70 months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec','Jan','Feb'] seas = ['DJF','MAM','JJA','SON'] lat_grid_fine = findgen(10*ny)*(lat_grid_entry[1]-lat_grid_entry[0])/10.+lat_grid_entry[0] yi = interpol(indgen(ny),lat_grid_entry,lat_grid_fine) ;p = plot(indgen(2),/nodata,xrange=[1991,1995],yrange=[350,365]) ;p = plot(years_mlo,co2_mlo,color='sky blue',thick=2,/overplot) ;p = plot(years_smo,co2_smo,color='lime green',thick=2,/overplot) ;p = plot(years_sm,co2_sm,color='green',thick=2,linestyle=2,/overplot) ;p = plot(years_sm,co2_sm_smooth,color='green',thick=2,/overplot) ;p = plot(tropical_co2_time,tropical_co2_lat[*,8],thick=2,color='blue',/overplot) ;p = plot(tropical_co2_time,tropical_co2,thick=2,color='orange',/overplot) ;p = plot(indgen(2),/nodata,xrange=[0,5],yrange=[0,0.08],xtitle='Age (years)',ytitle='Probability',font_size=11,title='Inverse Gaussian Age Spectra'); with Different Ratio of Moments') ;p = plot(replicate(grn_mean_ages_trop[20],2),[0,0.08],linestyle=2,/overplot) ;p = plot(age_spectra_years,grn_trop[*,20,nr_trop/2],color=colors[nr_trop/2],thick=3,/overplot) ;;for r = 0, nr_trop-1 do p = plot(age_spectra_years,grn_trop[*,20,r],color=colors[r],thick=2,/overplot) ;;for r = 0, nr_trop-1 do t = text(0.8,0.8-0.04*r,strmid(strcompress(string(ratios_trop[r]),/r),0,3),color=colors[r],/norm) ;;p.save,dir+'Plots/Aircraft Mean Ages/Age_spectra_ratio_of_moments.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Age_spectra_ratio_of_moments1.png' ;p = plot(indgen(2),/nodata,xrange=[0,2.5],yrange=[0,0.05],xtitle='Age (years)',ytitle='Probability',font_size=11,title='Age Spectra with Equatorial and non-Equatorial Source Latitude Partitioning') ;p = plot(replicate(grn_mean_ages_trop[20],2),[0,0.08],linestyle=2,/overplot) ;p = plot(age_spectra_years,grn_trop[*,20,nr_trop/2+1],color='blue',thick=2,/overplot) ;p = plot(age_spectra_years,weight_tr*grn_trop[*,20,nr_trop/2+1],color='lime green',thick=2,/overplot) ;p = plot(age_spectra_years,weight_nh*grn_trop[*,20,nr_trop/2+1],color='magenta',thick=2,/overplot) ;t = text(0.45,0.8,'$\Delta$$^2$/$\Gamma$ = '+strmid(strcompress(string(ratios_trop[nr_trop/2+1]),/r),0,3),font_size=11,/norm) ;t = text(0.55,0.6,'Equatorial',color='lime green',font_size=11,/norm) ;t = text(0.33,0.28,'Non-Equatorial',color='magenta',font_size=11,/norm) ;p.save,dir+'Plots/Aircraft Mean Ages/Age_spectra_partitioning_example.png' ; Test of spectra with minus sign in exponent. ;test_spec = 1./(2.*sqrt(1.*2.)*sqrt(!pi*(age_spectra_years/2.)^3)) * exp((-(2.^2*(age_spectra_years/2.-1)^2)) / (4.*sqrt(1.*2.)^2*age_spectra_years/2.)) ;test_spec /= total(test_spec) ;test_spec2 = 1./(2.*sqrt(1.*2.)*sqrt(!pi*(age_spectra_years/2.)^3)) * exp(((2.^2*(age_spectra_years/2.-1)^2)) / (4.*sqrt(1.*2.)^2*age_spectra_years/2.)) ;test_spec2 /= total(test_spec2) ;p = plot(indgen(2),/nodata,xrange=[0,2.5],xtitle='Age (years)',ytitle='Probability',font_size=11,title='Age Spectra') ;p = plot(age_spectra_years,test_spec,color='blue',thick=2,/overplot) ;p = plot(age_spectra_years,test_spec,color='orange',thick=2,/overplot) ;p = plot(indgen(2),/nodata,xrange=[1992,2001],yrange=[1550,1860]) ;;for y = 0, ny-1 do p = plot(time_entry,ch4_entry_trop[4,y,3,*],color=colors[y],thick=2,/overplot) ;for r = 0, nr_trop-1 do p = plot(time_entry,ch4_entry_trop[4,8,r,*],color=colors[r],thick=2,/overplot) ;;;for t = 0, 60, 10 do p = plot(time_entry,ch4_entry_trop[t,ny/2,nr_trop/2,*],color=colors[t/10],thick=2,/overplot) ;p = plot(tropical_ch4_time,tropical_ch4,color='magenta',thick=2,/overplot) ;for y = 0, ny/2 do p = plot(tropical_ch4_time,tropical_ch4_lat[*,y],color='lime green',thick=1,/overplot) ;for y = ny/2+1, ny-1 do p = plot(tropical_ch4_time,tropical_ch4_lat[*,y],color='green',thick=1,/overplot) ij = where(elat_m[ico2] ge 25 and n2o_all_norm[ico2] ge 0.95) ;;p = plot(date_frac[ico2],ch4[ico2],color='red',symbol='o',/sym_filled,sym_size=0.5,linestyle=6,/overplot) ;p = plot(date_frac[ico2[ij]],ch4[ico2[ij]],color='orange',symbol='o',/sym_filled,sym_size=0.5,linestyle=6,/overplot) ;print,ij[0:5] ;p = plot(indgen(2),/nodata,xrange=[1992,2001]) ;p = plot([1992,2001],[0,0],linestyle=2,/overplot) ;p = plot(date_frac[ico2[ij]],ch4_entry[ico2[ij]]-ch4[ico2[ij]],color='sky blue',symbol='o',/sym_filled,sym_size=0.5,linestyle=6,/overplot) ;p = plot(date_frac[ico2[ij]],1e3*(co2[ico2[ij]]-co2_adj[ico2[ij]]),color='orange',symbol='o',/sym_filled,sym_size=0.5,linestyle=6,/overplot) ;av = mean(ch4_entry[ico2[ij]]-ch4[ico2[ij]],/nan) ;p = plot([1992,2001],[av,av],linestyle=2,/overplot) ;print,av ;av = mean(1e3*(co2[ico2[ij]]-co2_adj[ico2[ij]]),/nan) ;p = plot([1992,2001],[av,av],linestyle=2,/overplot) ;print,av ;p = plot(indgen(2),/nodata,yrange=[1.01,0.95]) ;p = plot(ch4_entry[ico2[ij]]-ch4[ico2[ij]],n2o_all_norm[ico2[ij]],color='sky blue',symbol='o',/sym_filled,sym_size=0.5,linestyle=6,/overplot) ;p = plot(1e3*(co2[ico2[ij]]-co2_adj[ico2[ij]]),n2o_all_norm[ico2[ij]],color='orange',symbol='o',/sym_filled,sym_size=0.5,linestyle=6,/overplot) ;p = plot(ch4_loss_opt[ij],n2o_all_norm[ico2[ij]],color='green',symbol='o',/sym_filled,sym_size=1,linestyle=6,/overplot) ;p = errorplot(1e3*bins_co2_a2.n2o_norm_co2_adj[*,0],n2o_norm_grid,bins_co2_a2.n2o_norm_co2_adj[*,1],replicate(0,nn),symbol='o',/sym_filled,color='red',linestyle=6,errorbar_capsize=0,/overplot) ;p = plot(indgen(2),/nodata,yrange=[1,0.1]) ;;;p = plot(co2_all-co2_adj_all,n2o_all_norm,symbol='o',color='orange',/sym_filled,sym_size=0.5,linestyle=6,/overplot) ;p = errorplot(bins_co2_a0.n2o_norm_co2_adj[*,0],n2o_norm_grid,bins_co2_a0.n2o_norm_co2_adj[*,1],replicate(0,nn),symbol='o',/sym_filled,color='blue',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(1e-3*bins_co2_a0.n2o_norm_ch4_loss_nh[*,0],n2o_norm_grid,1e-3*bins_co2_a0.n2o_norm_ch4_loss_nh[*,1],replicate(0,nn),symbol='o',/sym_filled,color='dodger blue',linestyle=6, $ ; errorbar_capsize=0,/overplot) ;p = errorplot(bins_co2_a2.n2o_norm_co2_adj[*,0],n2o_norm_grid,bins_co2_a2.n2o_norm_co2_adj[*,1],replicate(0,nn),symbol='o',/sym_filled,color='red',linestyle=6,errorbar_capsize=0,/overplot) y = 6 i = 50 ;ci = where(dat.sf6_scale_opt_all ge 0.2,nci) ;ci = where(n2o_all_norm[chk_c] ge 0.34 and n2o_all_norm[chk_c] le 0.36,nci) ;print,ci[0:10] ;i = ci[0] ni = 95 tt = 120 ti = [58,70,73,74,79,83,88,90,92,93,119,120,121,122] ;ij = where(opt_age_diffs_min lt 1 and n2o_all_norm[chk_c] lt 0.95,nij) ij = where(elat_m[chk_c] ge 25 and n2o_all_norm[chk_c] ge 0.8 and month_frac[chk_c] ge 10 and month_frac[chk_c] lt 11,nij) ;ij = where(sf6_age[chk_c] ge 5 and finite(co2_age[chk_c]),nij) ;print,nij,ij[0:5] ;ij = where(month_frac[chk_c] ge 11 and month_frac[chk_c] lt 12,nij) ; i = 1000 Good demo of SF6 scaling. i = 8 ;i = ij[0] ii = chk_c[i] ;ii = isf6[0] ;ii = chk_c[ij[i]] ti = where(tropical_co2_time le date_frac[ii]) ti2 = where(years_sm le date_frac[ii]) ti3 = where(years_mlo le date_frac[ii]) tii = where(flight_dates eq dates_str[ii],nti) ;print,ii,co2_all[ii],co2_adj_all[ii],ch4_all[ii],co2_age_calc_adj[ii],sf6[ii],sf6_e[ii],sf6_age_calc_adj[ii],n2o_all_norm[ii],elat_m[ii],years_all[ii],months_all[ii],days_all[ii],ut_secs_all[ii] ;print,ii,co2_all[ii],co2_adj_all[ii],ch4_all[ii],sf6[ii],sf6_e[ii],n2o_all_norm[ii],elat_m[ii],date_frac[ii],dates_str[ii],month_frac[ii],alt[ii] ;print,i,age_opt_all[i],ratio_opt_all[i],age_opt_all2[i],ratio_opt_all2[i],sf6_scale_opt_all[i] ;print,sf6[chk_c[ij]],alt[chk_c[ij]],n2o_all_norm[chk_c[ij]] ;print,alt[chk_c[ij[-1]:ij[-1]+5]],sf6[chk_c[ij[-1]:ij[-1]+5]],co2_all[chk_c[ij[-1]:ij[-1]+5]],date_frac[chk_c[ij[-1]:ij[-1]+5]] ;print,ii,co2_all[chk_c[i-55:i-40]],co2_adj_all[chk_c[i-55:i-40]],ch4_all[chk_c[i-55:i-40]],sf6[chk_c[i-55:i-40]],n2o_all_norm[chk_c[i-55:i-40]],elat_m[chk_c[i-55:i-40]],date_frac[chk_c[i-55:i-40]] ;print,dat.diffs_min[i-55:i-40],dat.age_opt_all[i-55:i-40],dat.ratio_opt_all[i-55:i-40],dat.lat_source_opt_all[i-55:i-40],dat.sf6_scale_opt_all[i-55:i-40] ;p = plot(indgen(2),/nodata,yrange=[1.01,0.1],xrange=[0,1],font_size=11,ytitle='Normalized N$_2$O',xtitle='CO$_2$ Production from CH$_4$ (ppm)') ;;p = plot(ch4_entry[chk_c[ij]]-ch4[chk_c[ij]],n2o_all_norm[chk_c[ij]],color='sky blue',symbol='o',/sym_filled,sym_size=0.5,linestyle=6,/overplot) ;;p = plot(1e3*(co2_all[chk_c[ij]]-co2_adj_all[chk_c[ij]]),n2o_all_norm[chk_c[ij]],color='orange',symbol='o',/sym_filled,sym_size=0.5,linestyle=6,/overplot) ;;p = plot(ch4_loss_opt[ij],n2o_all_norm[chk_c[ij]],color='green',symbol='o',/sym_filled,sym_size=1,linestyle=6,/overplot) ;;p = plot(ch4_loss_opt_smin[ij],n2o_all_norm[chk_c[ij]],color='lime green',symbol='o',/sym_filled,sym_size=1,linestyle=6,/overplot) ;;s = symbol(1e3*(co2_all[ii]-co2_adj_all[ii]),n2o_all_norm[ii],'s',sym_size=1.5,/sym_filled,/data,sym_color='purple') ;;s = symbol(ch4_entry[ii]-ch4_all[ii],n2o_all_norm[ii],'s',sym_size=1.5,/sym_filled,/data,sym_color='blue') ;p = errorplot(bins_co2_a2.n2o_norm_co2_adj[*,0],n2o_norm_grid,bins_co2_a2.n2o_norm_co2_adj[*,1],replicate(0,nn),symbol='o',/sym_filled,color='red',linestyle=6,errorbar_capsize=0,/overplot) ;p.save,dir+'Plots/Aircraft Mean Ages/CO2_production_from_CH4.png' tickname = strmid(strcompress(string(findgen(7)),/r),0,1) tickname_r = strmid(strcompress(string(findgen(6)*0.5),/r),0,3) tickname_r2 = strmid(strcompress(string(findgen(11)*0.25),/r),0,4) tickname_r3 = strmid(strcompress(string(findgen(9)*0.5-2),/r),0,4) tickname_r4 = strmid(strcompress(string(findgen(9)*0.3-1.2),/r),0,4) tickname_r5 = strmid(strcompress(string(findgen(6)*0.25+4),/r),0,4) tickname_r6 = strmid(strcompress(string(findgen(9)*5),/r),0,2) tickname_r7 = strmid(strcompress(string(findgen(6)*0.1+3.7),/r),0,4) tickname_l = strmid(strcompress(string(findgen(13)*10-30),/r),0,3) tickname_l2 = strmid(strcompress(string(indgen(ny/2+2)*10-20),/r),0,3) tickname_s = strmid(strcompress(string(findgen(6)*0.02),/r),0,4) tickname_s2 = strmid(strcompress(string(findgen(6)*0.04),/r),0,4) tickname_s3 = strmid(strcompress(string(findgen(6)*0.2),/r),0,3) tickname_n = strmid(strcompress(string(findgen(6)*15+5),/r),0,2) ;p = plot(indgen(2),/nodata) ;;p = plot(co2_adj_all[2.3e6:2.4e6],symbol='o',color='orange',/sym_filled,sym_size=0.5,linestyle=6,/overplot) ;p = plot(co2[ico2[0:2e3]],symbol='o',color='orange',/sym_filled,sym_size=0.5,linestyle=6,/overplot) ;p = plot(co2_adj[ico2[0:2e3]],symbol='o',color='blue',/sym_filled,sym_size=0.5,linestyle=6,/overplot) ;p = plot(indgen(2),/nodata,xrange=[0,3.5],yrange=[co2_adj_all[ii]-2.5,co2_adj_all[ii]+2.5],xtitle='Mean Age',ytitle='CO$_2$ (ppmv)', $ ; title='Convolution of Surface CO$_2$ with Age Spectra '+dates_str[ii]) ;for r = 0, nr_fine-1, 10 do for y = 4, ny-1 do p = plot(grn_mean_ages_trop_fine,dat.co2_e_fine2[*,y,r,i],rgb_table=39,vert_colors=(lat_grid_entry[y]-lat_grid_entry[0])*1.7, $ ; thick=float(r+40.)/float(nr_fine+1)*2.,/overplot) ;p = plot([0,6],replicate(co2_adj_all[ii],2),linestyle=2,/overplot) ;p = plot([0,6],replicate(co2_adj_all[ii]+co2_err,2),linestyle=1,/overplot) ;p = plot([0,6],replicate(co2_adj_all[ii]-co2_err,2),linestyle=1,/overplot) ;;p = plot([0,6],replicate(co2_all[ii],2),linestyle=2,color='magenta',/overplot) ;;p = plot([0,6],replicate(co2_all[ii]+co2_err,2),linestyle=1,color='magenta',/overplot) ;;p = plot([0,6],replicate(co2_all[ii]-co2_err,2),linestyle=1,color='magenta',/overplot) ;p = plot(replicate(dat.age_opt_all[i],2),[co2_adj_all[ii]-2.5,co2_adj_all[ii]+2.5],linestyle=2,color='pink',thick=2,/overplot) ;;p = plot(replicate(age_opt_all[i],2),[co2_adj_all[ii]-2.5,co2_adj_all[ii]+2.5],linestyle=2,color='purple',thick=2,/overplot) ;cb = COLORBAR(POSITION=[0.77,0.54,0.79,0.84],tickname=tickname_l2,tickvalues=findgen(ny/2+2)*165./(ny/2.+1.),RGB_TABLE=rgb[65:-21,*],BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10, $ ; title='Surface Latitude') ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_CO2_convolutions.png' ;p = plot(indgen(2),/nodata,xrange=[0,4.5],yrange=[sf6[ii]-0.25,sf6[ii]+0.55],xtitle='Mean Age',ytitle='SF$_6$ (pptv)',title='Convolution of Surface SF$_6$ with Age Spectra '+dates_str[ii]) ;for r = 0, nr_fine-1, 10 do for y = 4, ny-1 do p = plot(grn_mean_ages_trop_fine,conv.sf6_e_fine2[*,y,r,i],rgb_table=39,vert_colors=(lat_grid_entry[y]-lat_grid_entry[0])*1.7, $ ; thick=float(r+40.)/float(nr_fine+1)*2.,/overplot) ;p = plot([0,6],replicate(sf6[ii],2),linestyle=2,/overplot) ;p = plot([0,6],replicate(sf6[ii]+sf6_e[ii],2),linestyle=1,/overplot) ;p = plot([0,6],replicate(sf6[ii]-sf6_e[ii],2),linestyle=1,/overplot) ;;p = plot([0,6],replicate(sf6[ii]+sf6_scale_all[0],2),linestyle=2,/overplot) ;cb = COLORBAR(POSITION=[0.77,0.54,0.79,0.84],tickname=tickname_l2,tickvalues=findgen(ny/2+2)*165./(ny/2.+1.),RGB_TABLE=rgb[65:-21,*],BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10, $ ; title='Surface Latitude') ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_SF6_convolutions.png' ;p = plot(indgen(2),/nodata,xrange=[0,3.5],yrange=[ch4_all[ii]-100,ch4_all[ii]+150],xtitle='Mean Age',ytitle='CH$_4$ (ppb)', $ ; title='Convolution of Surface CH$_4$ with Age Spectra '+dates_str[ii]) ;for r = 0, nr_fine-1, 10 do for y = 4, ny-1 do p = plot(grn_mean_ages_trop_fine,ch4_e_fine2[*,y,r,i],rgb_table=39,vert_colors=(lat_grid_entry[y]-lat_grid_entry[0])*1.7, $ ; thick=float(r+40.)/float(nr_fine+1)*2.,/overplot) ;p = plot([0,6],replicate(ch4_all[ii],2),linestyle=2,/overplot) ;p = plot([0,6],replicate(ch4_all[ii]+co2_err,2),linestyle=1,/overplot) ;p = plot([0,6],replicate(ch4_all[ii]-co2_err,2),linestyle=1,/overplot) ;p = plot(indgen(2),/nodata,xrange=[0,6.5],yrange=[co2_adj_all[ii]-6,co2_adj_all[ii]+3.5],xtitle='Mean Age',ytitle='CO$_2$ (ppmv)',font_size=11, $ ;;p = plot(indgen(2),/nodata,xrange=[0,3.5],yrange=[co2_adj_all[ii]-2,co2_adj_all[ii]+2.5],xtitle='Mean Age',ytitle='CO$_2$ (ppmv)',font_size=11, $ ; title='Convolution of Surface CO$_2$ with Age Spectra '+dates_str[ii]) ;for r = 0, nr_fine-1, 5 do begin ; co2_ef = conv.co2_e_fine2[*,*,r,tii] ; co2_ef2 = fltarr(n_elements(co2_ef[*,0]),10*ny) ; for a = 0, n_elements(co2_ef[*,0])-1 do co2_ef2[a,*] = interpolate(co2_ef[a,*],yi) ; for y = 40, 10*ny-1, 5 do p = plot(grn_mean_ages_trop_fine[0:n_elements(co2_ef[*,0])-1],co2_ef2[*,y],rgb_table=39,vert_colors=(lat_grid_fine[y]-lat_grid_fine[0])*1.7,thick=1.5,/overplot) ;endfor ;p = plot([0,6],replicate(co2_adj_all[ii],2),linestyle=2,/overplot) ;p = plot([0,6],replicate(co2_adj_all[ii]+co2_err,2),linestyle=1,/overplot) ;p = plot([0,6],replicate(co2_adj_all[ii]-co2_err,2),linestyle=1,/overplot) ;p = plot(tropical_co2_time[ti[-1]]-tropical_co2_time[ti],tropical_co2[ti],thick=2,color='magenta',linestyle=2,/overplot) ;p = plot(tropical_co2_time[ti[-1]]-tropical_co2_time[ti],lowpass_cfc(tropical_co2[ti], BOX=12, EDGE_PFCAST=1),thick=2,color='magenta',linestyle=1,/overplot) ;;p = plot(tropical_co2_time[ti[-1]]-tropical_co2_time[ti],tropical_co2_lat[ti,8],thick=2,color='magenta',linestyle=1,/overplot) ;;p = plot(tropical_co2_time[ti[-1]]-tropical_co2_time[ti],tropical_co2_lat[ti,4],thick=2,color='purple',linestyle=1,/overplot) ;;p = plot(years_mlo[ti3[-1]]-years_mlo[ti3],co2_mlo[ti3],thick=2,color='pink',linestyle=1,/overplot) ;p = plot(years_sm[ti2[-1]]-years_sm[ti2],co2_sm[ti2],thick=2,color='pink',/overplot) ;p = plot(years_sm[ti2[-1]]-years_sm[ti2],co2_sm_smooth[ti2],thick=2,color='pink',linestyle=2,/overplot) ;cb = COLORBAR(POSITION=[0.77,0.54,0.79,0.84],tickname=tickname_l2,tickvalues=findgen(ny/2+2)*165./(ny/2.+1.),RGB_TABLE=rgb[65:-21,*],BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10, $ ; title='Surface Latitude') ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_CO2_convolutions_Nov.png' ;p = plot(indgen(2),/nodata,xrange=[0,2.5],yrange=[414,414.5],xtitle='Mean Age',ytitle='CO$_2$ (ppmv)',font_size=11, $ ; title='Convolution of Surface CO$_2$ with Age Spectra '+dates_str[ii]) ;minmax = fltarr(n_ages_trop_fine,2) ;for a = 0, n_ages_trop_fine-1 do begin ; minmax[a,0] = min(conv.co2_e_fine2[a,*,*,tii]) ; minmax[a,1] = max(conv.co2_e_fine2[a,*,*,tii]) ;endfor ;poly = polygon([grn_mean_ages_trop_fine,reverse(grn_mean_ages_trop_fine)],[minmax[*,0],reverse(minmax[*,1])],/fill_background,/data,fill_color='light grey',color='white') ;p = plot([0,6],replicate(co2_all[ii],2),linestyle=2,/overplot) ;p = plot([0,6],replicate(co2_all[ii]+co2_err,2),linestyle=1,/overplot) ;p = plot([0,6],replicate(co2_all[ii]-co2_err,2),linestyle=1,/overplot) ;minmax = fltarr(n_ages_trop_fine,2) & minmax_err = minmax & mean_adj = fltarr(n_ages_trop_fine) ;for a = 0, n_ages_trop_fine-1 do begin ; minmax[a,0] = min(co2_adj_full[a,*,*,i]) ; minmax[a,1] = max(co2_adj_full[a,*,*,i]) ; minmax_err[a,0] = min(co2_err_full[a,*,*,i]) ; minmax_err[a,1] = max(co2_err_full[a,*,*,i]) ; mean_adj[a] = mean(co2_adj_full[a,*,*,i],/nan) ;endfor ;;poly = polygon([grn_mean_ages_trop_fine,reverse(grn_mean_ages_trop_fine)],[minmax[*,0],reverse(minmax[*,1])],/fill_background,/data,fill_color='black',color='black') ;;p = plot(grn_mean_ages,co2_tr_e[*,8,tii],color='dark green',thick=2,linestyle=2,/overplot) ;p = plot(grn_mean_ages_trop_fine,mean_adj,linestyle=2,thick=2,color='blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,minmax[*,0]-minmax_err[*,0],linestyle=1,thick=2,color='blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,minmax[*,1]+minmax_err[*,1],linestyle=1,thick=2,color='blue',/overplot) ;p = plot(indgen(2),/nodata,xrange=[dat.age_opt_all[i]-0.7,dat.age_opt_all[i]+0.5],yrange=[co2_adj_sc_all[n_ages_trop_fine/2,i]-0.2,co2_adj_sc_all[n_ages_trop_fine/2,i]+0.25],xtitle='Mean Age', $ ; ytitle='$\chi$$_{CO2}$ (ppm)',font_size=11,title='Convolution of Surface CO$_2$ with Age Spectra '+dates_str[ii]) ;minmax = fltarr(n_ages_trop_fine,2) ;for a = 0, n_ages_trop_fine-1 do begin ; ri1 = where(ratios_fine ge grn_mean_ages_trop_fine[a]/8.) ; ri1 = ri1[0] ; minmax[a,0] = min(conv.co2_e_fine2[a,*,ri1:-1,tii]) ; minmax[a,1] = max(conv.co2_e_fine2[a,*,ri1:-1,tii]) ;endfor ;poly = polygon([grn_mean_ages_trop_fine,reverse(grn_mean_ages_trop_fine)],[minmax[*,0],reverse(minmax[*,1])],/fill_background,/data,fill_color='light grey',color='white') ;p = plot([replicate(age_opt_all[i],2)],[co2_adj_sc_all[n_ages_trop_fine/2,i]-0.2,co2_adj_sc_all[n_ages_trop_fine/2,i]+0.25],color='orange',thick=2,linestyle=3,/overplot) ;p = plot([replicate(co2_lag_age[ii],2)],[co2_adj_sc_all[n_ages_trop_fine/2,i]-0.2,co2_adj_sc_all[n_ages_trop_fine/2,i]+0.25],color='yellow',thick=2,linestyle=3,/overplot) ;for r = 0, 10, 2 do p = plot([replicate(co2_conv_tr_age[r,i],2)],[co2_adj_sc_all[n_ages_trop_fine/2,i]-0.2,co2_adj_sc_all[n_ages_trop_fine/2,i]+0.25],color='green',thick=1,linestyle=3,/overplot) ;for r = 0, 10, 2 do p = plot(grn_mean_ages,co2_tr_e[*,r,tii],color='dark green',thick=2,linestyle=3,/overplot) ;minmax = fltarr(n_ages_trop_fine,2) & minmax_err = minmax & mean_adj = fltarr(n_ages_trop_fine) ;for a = 0, n_ages_trop_fine-1 do begin ; minmax[a,0] = min(co2_adj_full[a,*,*,i]) ; minmax[a,1] = max(co2_adj_full[a,*,*,i]) ; minmax_err[a,0] = min(co2_err_full[a,*,*,i]) ; minmax_err[a,1] = max(co2_err_full[a,*,*,i]) ; mean_adj[a] = mean(co2_adj_full[a,*,*,i],/nan) ;endfor ;co2_e_fine2 = conv.co2_e_fine2[*,*,*,tii] ;zz = where(finite(ages_full2),nzz) ;p = plot(ages_full2[zz],co2_e_fine2[zz],symbol='o',sym_size=1,linestyle=6,rgb_table=39,vert_colors=diffs_both_all2[zz]*2.3e2,/sym_filled,/overplot) ;p = plot(grn_mean_ages_trop_fine,mean_adj+dat.co2_scale_opt_all[i],linestyle=2,thick=2,color='sky blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,minmax[*,0]+dat.co2_scale_opt_all[i]-minmax_err[*,0],linestyle=1,thick=2,color='sky blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,minmax[*,1]+dat.co2_scale_opt_all[i]+minmax_err[*,1],linestyle=1,thick=2,color='sky blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,mean_adj-0.02,linestyle=2,thick=2,color='blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,minmax[*,0]-minmax_err[*,0]-0.02,linestyle=1,thick=2,color='blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,minmax[*,1]+minmax_err[*,1]-0.02,linestyle=1,thick=2,color='blue',/overplot) ;cb = COLORBAR(POSITION=[0.77,0.54,0.79,0.84],tickname=tickname_s3,tickvalues=findgen(6)*46.,RGB_TABLE=rgb,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='$\delta\chi$$_{\cap}$') ;p = plot(indgen(2),/nodata,xrange=[dat.age_opt_all[i]-0.7,dat.age_opt_all[i]+0.5],yrange=[sf6[ii]-0.05,sf6[ii]+0.09],xtitle='Mean Age',ytitle='$\chi$$_{SF6}$ (ppt)',font_size=11, $ ; title='Convolution of Surface SF$_6$ with Age Spectra '+dates_str[ii]) ;minmax = fltarr(n_ages_trop_fine,2) ;for a = 0, n_ages_trop_fine-1 do begin ; ri1 = where(ratios_fine ge grn_mean_ages_trop_fine[a]/8.) ; ri1 = ri1[0] ; minmax[a,0] = min(conv.sf6_e_fine2[a,*,ri1:-1,tii]) ; minmax[a,1] = max(conv.sf6_e_fine2[a,*,ri1:-1,tii]) ;endfor ;poly = polygon([grn_mean_ages_trop_fine,reverse(grn_mean_ages_trop_fine)],[minmax[*,0],reverse(minmax[*,1])],/fill_background,/data,fill_color='light grey',color='white') ;p = plot([replicate(age_opt_all[i],2)],[sf6[ii]-0.2,sf6[ii]+0.2],color='orange',thick=2,linestyle=3,/overplot) ;p = plot([replicate(sf6_lag_age_adj,2)],[sf6[ii]-0.2,sf6[ii]+0.2],color='yellow',thick=2,linestyle=3,/overplot) ;for r = 0, 10, 2 do p = plot([replicate(sf6_conv_tr_age[r,i],2)],[sf6[ii]-0.2,sf6[ii]+0.2],color='green',thick=1,linestyle=3,/overplot) ;for r = 0, 10, 2 do p = plot(grn_mean_ages,sf6_tr_et[*,r,tii],color='dark green',thick=2,linestyle=3,/overplot) ;sf6_e_fine2 = conv.sf6_e_fine2[*,*,*,tii] ;;zz = where(finite(ages_full1),nzz) ;zz = where(finite(ages_full2),nzz) ;;p = plot(ages_full1[zz],sf6_e_fine2[zz],symbol='o',sym_size=0.5,linestyle=6,rgb_table=39,vert_colors=sdiffs[zz]*2.5e3,/sym_filled,/overplot) ;;p = plot(ages_full1[zz],sf6_e_fine2[zz],symbol='o',sym_size=1,linestyle=6,rgb_table=39,vert_colors=diffs_both_all1[zz]*2.3e2,/sym_filled,/overplot) ;p = plot(ages_full2[zz],sf6_e_fine2[zz],symbol='o',sym_size=1,linestyle=6,rgb_table=39,vert_colors=diffs_both_all2[zz]*2.3e2,/sym_filled,/overplot) ;p = plot(grn_mean_ages_trop_fine,sf6[ii]+sf6_bias_yr*flight_sf6_gr[tii[0]],linestyle=2,thick=2,color='blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,sf6[ii]+sf6_e[ii]+sf6_bias_yr*flight_sf6_gr[tii[0]],linestyle=1,thick=2,color='blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,sf6[ii]-sf6_e[ii]+sf6_bias_yr*flight_sf6_gr[tii[0]],linestyle=1,thick=2,color='blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,sf6[ii]+sf6_scale_opt_all[i]+sf6_bias_yr*flight_sf6_gr[tii[0]],linestyle=2,thick=2,color='sky blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,sf6[ii]+sf6_scale_opt_all[i]+sf6_e[ii]+sf6_bias_yr*flight_sf6_gr[tii[0]],linestyle=1,thick=2,color='sky blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,sf6[ii]+sf6_scale_opt_all[i]-sf6_e[ii]+sf6_bias_yr*flight_sf6_gr[tii[0]],linestyle=1,thick=2,color='sky blue',/overplot) ;;p = plot(grn_mean_ages_trop_fine,sf6[ii]+sf6_bias_yr*flight_sf6_gr[tii[0]]+0.06,linestyle=2,thick=2,color='blue',/overplot) ;;p = plot(grn_mean_ages_trop_fine,sf6[ii]+sf6_e[ii]+sf6_bias_yr*flight_sf6_gr[tii[0]]+0.06,linestyle=1,thick=2,color='blue',/overplot) ;;p = plot(grn_mean_ages_trop_fine,sf6[ii]-sf6_e[ii]+sf6_bias_yr*flight_sf6_gr[tii[0]]+0.06,linestyle=1,thick=2,color='blue',/overplot) ;cb = COLORBAR(POSITION=[0.8,0.54,0.82,0.84],tickname=tickname_s3,tickvalues=findgen(6)*46.,RGB_TABLE=rgb,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='$\delta\chi$$_{\cap}$') ;p = plot(indgen(2),/nodata,xrange=[0,2.5],yrange=[sf6[ii]-0.18,sf6[ii]+0.23],xtitle='Mean Age',ytitle='$\chi$$_{SF6}$ (ppt)',font_size=11) ;minmax = fltarr(n_ages_trop_fine,2) ;for a = 0, n_ages_trop_fine-1 do begin ; minmax[a,0] = min(conv.sf6_e_fine2[a,*,*,tii]) ; minmax[a,1] = max(conv.sf6_e_fine2[a,*,*,tii]) ;endfor ;poly = polygon([grn_mean_ages_trop_fine,reverse(grn_mean_ages_trop_fine)],[minmax[*,0],reverse(minmax[*,1])],/fill_background,/data,fill_color='light grey',color='white') ;p = plot([0,6],replicate(sf6[ii],2),linestyle=2,color='grey',/overplot) ;p = plot([0,6],replicate(sf6[ii]+sf6_e[ii],2),linestyle=1,color='grey',/overplot) ;p = plot([0,6],replicate(sf6[ii]-sf6_e[ii],2),linestyle=1,color='grey',/overplot) ;;p = plot(grn_mean_ages,sf6_tr_et[*,8,tii],color='dark green',thick=2,linestyle=2,/overplot) ;p = plot(grn_mean_ages_trop_fine,sf6[ii]+sf6_bias_yr*flight_sf6_gr[tii[0]],linestyle=2,thick=2,color='blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,sf6[ii]+sf6_e[ii]+sf6_bias_yr*flight_sf6_gr[tii[0]],linestyle=1,thick=2,color='blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,sf6[ii]-sf6_e[ii]+sf6_bias_yr*flight_sf6_gr[tii[0]],linestyle=1,thick=2,color='blue',/overplot) ;;p = plot(indgen(2),/nodata,xrange=[0,4],yrange=[co2_adj_sc_all[n_ages_trop_fine/2,i]-0.3,co2_adj_sc_all[n_ages_trop_fine/2,i]+0.3],xtitle='Mean Age',ytitle='CO$_2$ (ppmv)',font_size=11, $ ;;p = plot(indgen(2),/nodata,xrange=[1.5,2.8],yrange=[co2_adj_sc_all[n_ages_trop_fine/2,i]-0.6,co2_adj_sc_all[n_ages_trop_fine/2,i]+0.6],xtitle='Mean Age',ytitle='CO$_2$ (ppmv)',font_size=11, $ ;p = plot(indgen(2),/nodata,xrange=[2,3.2],yrange=[co2_adj_sc_all[n_ages_trop_fine/2,i]-0.5,co2_adj_sc_all[n_ages_trop_fine/2,i]+0.25],xtitle='Mean Age',ytitle='CO$_2$ (ppmv)',font_size=11, $ ; title='Convolution of Surface CO$_2$ with Age Spectra '+dates_str[ii]) ;;for r = 0, nr_fine-1, 5 do begin ;; co2_ef = conv.co2_e_fine2[*,*,r,tii] ;; co2_ef2 = fltarr(n_elements(co2_ef[*,0]),10*ny) ;; for a = 0, n_elements(co2_ef[*,0])-1 do co2_ef2[a,*] = interpolate(co2_ef[a,*],yi) ;;; for y = 40, 10*ny-1, 5 do p = plot(grn_mean_ages_trop_fine[0:n_elements(co2_ef[*,0])-1],co2_ef2[*,y],rgb_table=39,vert_colors=(lat_grid_fine[y]-lat_grid_fine[0])*1.7,transparency=70,/overplot) ;; for y = 40, 10*ny-1, 5 do p = plot(grn_mean_ages_trop_fine[0:n_elements(co2_ef[*,0])-1],co2_ef2[*,y],color='light grey',/overplot) ;;; for y = 40, 10*ny-1, 5 do p = plot(grn_mean_ages_trop_fine[0:n_elements(co2_ef[*,0])-1],co2_ef2[*,y],rgb_table=39,vert_colors=(lat_grid_fine[y]-lat_grid_fine[0])*1.7,symbol='o',sym_size=0.5, $ ;;; /sym_filled,/overplot) ;;endfor ;minmax = fltarr(n_ages_trop_fine,2) ;for a = 0, n_ages_trop_fine-1 do begin ; ri1 = where(ratios_fine ge grn_mean_ages_trop_fine[a]/8.) ; ri1 = ri1[0] ; minmax[a,0] = min(conv.co2_e_fine2[a,*,ri1:-1,tii]) ; minmax[a,1] = max(conv.co2_e_fine2[a,*,ri1:-1,tii]) ;endfor ;poly = polygon([grn_mean_ages_trop_fine,reverse(grn_mean_ages_trop_fine)],[minmax[*,0],reverse(minmax[*,1])],/fill_background,/data,fill_color='light grey',color='white') ;co2_e_fine2 = conv.co2_e_fine2[*,*,*,tii] ;zz = where(finite(ages_full1_co2),nzz) ;p = plot(ages_full1_co2[zz]-0.01,co2_e_fine2[zz],symbol='o',sym_size=0.4,linestyle=6,color='orange',transparency=50,/overplot) ;zz = where(finite(ages_full1_sf6),nzz) ;p = plot(ages_all[zz],co2_e_fine2[zz],symbol='o',sym_size=0.4,linestyle=6,color='magenta',transparency=75,/overplot) ;zz = where(finite(ages_full1),nzz) ;p = plot(ages_full1[zz]+0.01,co2_e_fine2[zz],symbol='o',sym_size=0.5,linestyle=6,color='lime green',/sym_filled,/overplot) ;;p = plot(ages_full1[zz],co2_e_fine2[zz],symbol='o',sym_size=0.5,linestyle=6,rgb_table=39,vert_colors=cdiffs[zz]*3e3,/sym_filled,/overplot) ;;p = plot(ages_full1[zz],co2_e_fine2[zz],symbol='o',sym_size=0.5,linestyle=6,rgb_table=39,vert_colors=diffs_both_all1[zz]*2.5e3,/sym_filled,/overplot) ;;p = plot(ages_full1[zz],co2_e_fine2[zz],symbol='o',sym_size=0.5,linestyle=6,rgb_table=68,vert_colors=ratios_full1[zz]*1e2,/sym_filled,/overplot) ;co2_f = replicate(co2_all[ii],n_ages_trop_fine) ;gdf = where(minmax[*,0] le co2_all[ii] and minmax[*,1] ge co2_all[ii])+1 ;p = plot(grn_mean_ages_trop_fine[gdf],co2_f[gdf],linestyle=2,/overplot) ;gdf = where(minmax[*,0] le co2_all[ii]+co2_err and minmax[*,1] ge co2_all[ii]+co2_err)+1 ;p = plot(grn_mean_ages_trop_fine[gdf],co2_f[gdf]+co2_err,linestyle=1,/overplot) ;gdf = where(minmax[*,0] le co2_all[ii]-co2_err and minmax[*,1] ge co2_all[ii]-co2_err) ;p = plot(grn_mean_ages_trop_fine[gdf]+0.02,co2_f[gdf]-co2_err,linestyle=1,/overplot) ;minmax2 = fltarr(n_ages_trop_fine,2) & minmax_err = minmax2 & mean_adj = fltarr(n_ages_trop_fine) ;for a = 0, n_ages_trop_fine-1 do begin ; minmax2[a,0] = min(co2_adj_full[a,*,*,i]) ; minmax2[a,1] = max(co2_adj_full[a,*,*,i]) ; minmax_err[a,0] = min(co2_err_full[a,*,*,i]) ; minmax_err[a,1] = max(co2_err_full[a,*,*,i]) ; mean_adj[a] = mean(co2_adj_full[a,*,*,i],/nan) ;endfor ;;poly = polygon([grn_mean_ages_trop_fine,reverse(grn_mean_ages_trop_fine)],[minmax2[*,0],reverse(minmax2[*,1])],/fill_background,/data,fill_color='black',color='black') ;p = plot([0,6],replicate(co2_all[ii],2),linestyle=2,/overplot) ;p = plot([0,6],replicate(co2_all[ii]+co2_err,2),linestyle=1,/overplot) ;p = plot([0,6],replicate(co2_all[ii]-co2_err,2),linestyle=1,/overplot) ;gdf = where(minmax[*,0] le mean(mean_adj) and minmax[*,1] ge mean(mean_adj))+1 ;p = plot(grn_mean_ages_trop_fine[gdf],mean_adj[gdf],linestyle=2,thick=2,color='blue',/overplot) ;gdf = where(minmax[*,0] le mean(minmax2[*,0]-minmax_err[*,0]) and minmax[*,1] ge mean(minmax2[*,0]-minmax_err[*,0]))+1 ;p = plot(grn_mean_ages_trop_fine[gdf],minmax2[gdf,0]-minmax_err[gdf,0],linestyle=1,thick=2,color='blue',/overplot) ;gdf = where(minmax[*,0] le mean(minmax2[*,1]+minmax_err[*,1]) and minmax[*,1] ge mean(minmax2[*,1]+minmax_err[*,1])) ;p = plot(grn_mean_ages_trop_fine[gdf],minmax2[gdf,1]+minmax_err[gdf,1],linestyle=1,thick=2,color='blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,mean_adj,linestyle=2,thick=2,color='blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,minmax2[*,0]-minmax_err[*,0],linestyle=1,thick=2,color='blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,minmax2[*,1]+minmax_err[*,1],linestyle=1,thick=2,color='blue',/overplot) ;;p = plot(grn_mean_ages_trop_fine,co2_adj_sc_all[*,i],linestyle=2,thick=2,/overplot) ;;p = plot(grn_mean_ages_trop_fine,co2_adj_sc_all[*,i]+co2_err_sc_all[*,i],linestyle=1,thick=2,/overplot) ;;p = plot(grn_mean_ages_trop_fine,co2_adj_sc_all[*,i]-co2_err_sc_all[*,i],linestyle=1,thick=2,/overplot) ;s = symbol(opt_age_diffs_all[ns/2,nsc/2,i],opt_co2_adj_all[ns/2,nsc/2,i],'s',sym_size=1.5,sym_color='purple',/sym_filled,/data) ;for r = 0, nr_fine-1, 5 do for y = 4, ny-1 do p = plot(grn_mean_ages_trop_fine,co2_adj_full1[*,y,r]+co2_err_full1[*,y,r],linestyle=1,/overplot) ;cb = COLORBAR(POSITION=[0.77,0.54,0.79,0.84],tickname=tickname_s,tickvalues=findgen(6)*50.,RGB_TABLE=rgb,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='$\delta\chi$') ;cb = COLORBAR(POSITION=[0.77,0.54,0.79,0.84],tickname=tickname_r,tickvalues=findgen(6)*50.,RGB_TABLE=rgb_68,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='Ratio of Moments') ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_CO2_convolutions_zoom_Nov.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_CO2_convolutions_zoom2_Nov.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_CO2_convolutions_zoom3_Nov.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_CO2_convolutions_zoom4_Nov.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_CO2_convolutions_zoom5_Nov.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_CO2_convolutions_zoom6_Nov.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_CO2_convolutions_zoom7_Nov.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_CO2_convolutions_zoom8_Nov.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_CO2_convolutions_zoom9_Nov.png' ;p = plot(indgen(2),/nodata,xrange=[2.15,2.8],yrange=[co2_adj_sc_all[n_ages_trop_fine/2,i]-0.2,co2_adj_sc_all[n_ages_trop_fine/2,i]+0.15],xtitle='Mean Age',ytitle='$\chi$$_{CO2}$ (ppm)', $ ; font_size=11,title='Convolution of Surface CO$_2$ with Age Spectra '+dates_str[ii]) ;minmax = fltarr(n_ages_trop_fine,2) ;for a = 0, n_ages_trop_fine-1 do begin ; ri1 = where(ratios_fine ge grn_mean_ages_trop_fine[a]/8.) ; ri1 = ri1[0] ; minmax[a,0] = min(conv.co2_e_fine2[a,*,ri1:-1,tii]) ; minmax[a,1] = max(conv.co2_e_fine2[a,*,ri1:-1,tii]) ;endfor ;poly = polygon([grn_mean_ages_trop_fine,reverse(grn_mean_ages_trop_fine)],[minmax[*,0],reverse(minmax[*,1])],/fill_background,/data,fill_color='light grey',color='white') ;minmax = fltarr(n_ages_trop_fine,2) & minmax_err = minmax & mean_adj = fltarr(n_ages_trop_fine) ;for a = 0, n_ages_trop_fine-1 do begin ; minmax[a,0] = min(co2_adj_full[a,*,*,i]) ; minmax[a,1] = max(co2_adj_full[a,*,*,i]) ; minmax_err[a,0] = min(co2_err_full[a,*,*,i]) ; minmax_err[a,1] = max(co2_err_full[a,*,*,i]) ; mean_adj[a] = mean(co2_adj_full[a,*,*,i],/nan) ;endfor ;co2_e_fine2 = conv.co2_e_fine2[*,*,*,tii] ;;zz = where(finite(ages_full1),nzz) ;zz = where(finite(ages_full2),nzz) ;;p = plot(ages_full1[zz],co2_e_fine2[zz],symbol='o',sym_size=0.5,linestyle=6,rgb_table=39,vert_colors=cdiffs[zz]*2.5e3,/sym_filled,/overplot) ;;p = plot(ages_full1[zz],co2_e_fine2[zz],symbol='o',sym_size=1,linestyle=6,rgb_table=39,vert_colors=diffs_both_all1[zz]*2.3e2,/sym_filled,/overplot) ;p = plot(ages_full2[zz],co2_e_fine2[zz],symbol='o',sym_size=1,linestyle=6,rgb_table=39,vert_colors=diffs_both_all2[zz]*2.3e2,/sym_filled,/overplot) ;;p = plot(grn_mean_ages_trop_fine,mean_adj,linestyle=2,thick=2,color='blue',/overplot) ;;p = plot(grn_mean_ages_trop_fine,minmax[*,0]-minmax_err[*,0],linestyle=1,thick=2,color='blue',/overplot) ;;p = plot(grn_mean_ages_trop_fine,minmax[*,1]+minmax_err[*,1],linestyle=1,thick=2,color='blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,mean_adj,linestyle=2,thick=2,color='sky blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,minmax[*,0]-minmax_err[*,0],linestyle=1,thick=2,color='sky blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,minmax[*,1]+minmax_err[*,1],linestyle=1,thick=2,color='sky blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,mean_adj-0.02,linestyle=2,thick=2,color='blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,minmax[*,0]-minmax_err[*,0]-0.02,linestyle=1,thick=2,color='blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,minmax[*,1]+minmax_err[*,1]-0.02,linestyle=1,thick=2,color='blue',/overplot) ;cb = COLORBAR(POSITION=[0.77,0.54,0.79,0.84],tickname=tickname_s3,tickvalues=findgen(6)*46.,RGB_TABLE=rgb,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='$\delta\chi$$_{\cap}$') ;;p.save,dir+'Plots/Aircraft Mean Ages/Surface_CO2_convolutions_zoom_diffs_Nov.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_CO2_convolutions_zoom_diffs_Nov_scale.png' ;p = plot(indgen(2),/nodata,xrange=[2.15,2.8],yrange=[co2_adj_sc_all[n_ages_trop_fine/2,i]-0.2,co2_adj_sc_all[n_ages_trop_fine/2,i]+0.15],xtitle='Mean Age',ytitle='$\chi$$_{CO2}$ (ppm)', $ ; font_size=11,title='Convolution of Surface CO$_2$ with Age Spectra '+dates_str[ii]) ;minmax = fltarr(n_ages_trop_fine,2) ;for a = 0, n_ages_trop_fine-1 do begin ; ri1 = where(ratios_fine ge grn_mean_ages_trop_fine[a]/8.) ; ri1 = ri1[0] ; minmax[a,0] = min(conv.co2_e_fine2[a,*,ri1:-1,tii]) ; minmax[a,1] = max(conv.co2_e_fine2[a,*,ri1:-1,tii]) ;endfor ;poly = polygon([grn_mean_ages_trop_fine,reverse(grn_mean_ages_trop_fine)],[minmax[*,0],reverse(minmax[*,1])],/fill_background,/data,fill_color='light grey',color='white') ;minmax = fltarr(n_ages_trop_fine,2) & minmax_err = minmax & mean_adj = fltarr(n_ages_trop_fine) ;for a = 0, n_ages_trop_fine-1 do begin ; minmax[a,0] = min(co2_adj_full[a,*,*,i]) ; minmax[a,1] = max(co2_adj_full[a,*,*,i]) ; minmax_err[a,0] = min(co2_err_full[a,*,*,i]) ; minmax_err[a,1] = max(co2_err_full[a,*,*,i]) ; mean_adj[a] = mean(co2_adj_full[a,*,*,i],/nan) ;endfor ;co2_e_fine2 = conv.co2_e_fine2[*,*,*,tii] ;zz = where(finite(ages_full1),nzz) ;dd1 = where(diffs_both_all1[zz] gt 0.25,ndd1) ;for zi = 0, ndd1-1 do p = plot(replicate(ages_full1[zz[dd1[zi]]],2),replicate(co2_e_fine2[zz[dd1[zi]]],2),symbol='o',sym_size=0.5,linestyle=6,rgb_table=68,vert_colors=ratios_full1[zz[dd1[zi]]]*95, $ ; /overplot) ;dd1 = where(diffs_both_all1[zz] gt 0.1 and diffs_both_all1[zz] le 0.25,ndd1) ;for zi = 0, ndd1-1 do p = plot(replicate(ages_full1[zz[dd1[zi]]],2),replicate(co2_e_fine2[zz[dd1[zi]]],2),symbol='o',sym_size=1.5,linestyle=6,rgb_table=68,vert_colors=ratios_full1[zz[dd1[zi]]]*95, $ ; /sym_filled,/overplot) ;dd1 = where(diffs_both_all1[zz] le 0.1,ndd1) ;for zi = 0, ndd1-1 do p = plot(replicate(ages_full1[zz[dd1[zi]]],2),replicate(co2_e_fine2[zz[dd1[zi]]],2),symbol='o',sym_size=3,linestyle=6,rgb_table=68,vert_colors=ratios_full1[zz[dd1[zi]]]*95, $ ; /sym_filled,/overplot) ;s = symbol(opt_age_diffs_all[ns/2,nsc/2,i],opt_co2_adj_all[ns/2,nsc/2,i],'s',sym_size=3,sym_color='white',/data) ;p = plot(replicate(opt_age_diffs_all[ns/2,nsc/2,i],2),replicate(opt_co2_adj_all[ns/2,nsc/2,i],2),symbol='s',sym_size=2.5,rgb_table=68,vert_colors=opt_ratio_diffs_all[ns/2,nsc/2,i]*95, $ ; /sym_filled,/overplot) ;p = plot(grn_mean_ages_trop_fine,mean_adj,linestyle=2,thick=2,color='blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,minmax[*,0]-minmax_err[*,0],linestyle=1,thick=2,color='blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,minmax[*,1]+minmax_err[*,1],linestyle=1,thick=2,color='blue',/overplot) ;cb = COLORBAR(POSITION=[0.79,0.54,0.81,0.84],tickname=tickname_r,tickvalues=findgen(6)*48.,RGB_TABLE=rgb_68,BORDER=1, ORIENTATION=1,/textpos,font_size=10,title='$\Delta$$^2$/$\Gamma$ (years)') ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_CO2_convolutions_zoom_ratios_Nov.png' ; ;p = plot(indgen(2),/nodata,xrange=[2.15,2.8],yrange=[co2_adj_sc_all[n_ages_trop_fine/2,i]-0.2,co2_adj_sc_all[n_ages_trop_fine/2,i]+0.15],xtitle='Mean Age',ytitle='$\chi$$_{CO2}$ (ppm)', $ ; font_size=11,title='Convolution of Surface CO$_2$ with Age Spectra '+dates_str[ii]) ;minmax = fltarr(n_ages_trop_fine,2) ;for a = 0, n_ages_trop_fine-1 do begin ; ri1 = where(ratios_fine ge grn_mean_ages_trop_fine[a]/8.) ; ri1 = ri1[0] ; minmax[a,0] = min(conv.co2_e_fine2[a,*,ri1:-1,tii]) ; minmax[a,1] = max(conv.co2_e_fine2[a,*,ri1:-1,tii]) ;endfor ;poly = polygon([grn_mean_ages_trop_fine,reverse(grn_mean_ages_trop_fine)],[minmax[*,0],reverse(minmax[*,1])],/fill_background,/data,fill_color='light grey',color='white') ;minmax = fltarr(n_ages_trop_fine,2) & minmax_err = minmax & mean_adj = fltarr(n_ages_trop_fine) ;for a = 0, n_ages_trop_fine-1 do begin ; minmax[a,0] = min(co2_adj_full[a,*,*,i]) ; minmax[a,1] = max(co2_adj_full[a,*,*,i]) ; minmax_err[a,0] = min(co2_err_full[a,*,*,i]) ; minmax_err[a,1] = max(co2_err_full[a,*,*,i]) ; mean_adj[a] = mean(co2_adj_full[a,*,*,i],/nan) ;endfor ;co2_e_fine2 = conv.co2_e_fine2[*,*,*,tii] ;zz = where(finite(ages_full2),nzz) ;dd1 = where(diffs_both_all2[zz] gt 0.25,ndd1) ;for zi = 0, ndd1-1 do p = plot(replicate(ages_full2[zz[dd1[zi]]],2),replicate(co2_e_fine2[zz[dd1[zi]]],2),symbol='o',sym_size=0.5,linestyle=6,rgb_table=68,vert_colors=ratios_full2[zz[dd1[zi]]]*95, $ ; /overplot) ;dd1 = where(diffs_both_all2[zz] gt 0.1 and diffs_both_all2[zz] le 0.25,ndd1) ;for zi = 0, ndd1-1 do p = plot(replicate(ages_full2[zz[dd1[zi]]],2),replicate(co2_e_fine2[zz[dd1[zi]]],2),symbol='o',sym_size=1.5,linestyle=6,rgb_table=68,vert_colors=ratios_full2[zz[dd1[zi]]]*95, $ ; /sym_filled,/overplot) ;dd1 = where(diffs_both_all2[zz] le 0.1,ndd1) ;for zi = 0, ndd1-1 do p = plot(replicate(ages_full2[zz[dd1[zi]]],2),replicate(co2_e_fine2[zz[dd1[zi]]],2),symbol='o',sym_size=3,linestyle=6,rgb_table=68,vert_colors=ratios_full2[zz[dd1[zi]]]*95, $ ; /sym_filled,/overplot) ;s = symbol(opt_age_diffs_all[ns/2+2,nsc/2-1,i],opt_co2_adj_all[ns/2+2,nsc/2-1,i],'s',sym_size=3,sym_color='white',/data) ;p = plot(replicate(opt_age_diffs_all[ns/2+2,nsc/2-1,i],2),replicate(opt_co2_adj_all[ns/2+2,nsc/2-1,i],2),symbol='s',sym_size=2.5,rgb_table=68,vert_colors=opt_ratio_diffs_all[ns/2+2,nsc/2-1,i]*95, $ ; /sym_filled,/overplot) ;p = plot(grn_mean_ages_trop_fine,mean_adj,linestyle=2,thick=2,color='sky blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,minmax[*,0]-minmax_err[*,0],linestyle=1,thick=2,color='sky blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,minmax[*,1]+minmax_err[*,1],linestyle=1,thick=2,color='sky blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,mean_adj-0.02,linestyle=2,thick=2,color='blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,minmax[*,0]-minmax_err[*,0]-0.02,linestyle=1,thick=2,color='blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,minmax[*,1]+minmax_err[*,1]-0.02,linestyle=1,thick=2,color='blue',/overplot) ;cb = COLORBAR(POSITION=[0.79,0.54,0.81,0.84],tickname=tickname_r,tickvalues=findgen(6)*48.,RGB_TABLE=rgb_68,BORDER=1, ORIENTATION=1,/textpos,font_size=10,title='$\Delta$$^2$/$\Gamma$ (years)') ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_CO2_convolutions_zoom_ratios_Nov_scale.png' ;p = plot(indgen(2),/nodata,xrange=[2.2,2.8],yrange=[co2_adj_sc_all[n_ages_trop_fine/2,i]-0.2,co2_adj_sc_all[n_ages_trop_fine/2,i]+0.15],xtitle='Mean Age',ytitle='CO$_2$ (ppmv)',font_size=11, $ ; title='Convolution of Surface CO$_2$ with Age Spectra '+dates_str[ii]) ;minmax = fltarr(n_ages_trop_fine,2) ;for a = 0, n_ages_trop_fine-1 do begin ; ri1 = where(ratios_fine ge grn_mean_ages_trop_fine[a]/8.) ; ri1 = ri1[0] ; minmax[a,0] = min(conv.co2_e_fine2[a,*,ri1:-1,tii]) ; minmax[a,1] = max(conv.co2_e_fine2[a,*,ri1:-1,tii]) ;endfor ;poly = polygon([grn_mean_ages_trop_fine,reverse(grn_mean_ages_trop_fine)],[minmax[*,0],reverse(minmax[*,1])],/fill_background,/data,fill_color='light grey',color='white') ;minmax = fltarr(n_ages_trop_fine,2) & minmax_err = minmax & mean_adj = fltarr(n_ages_trop_fine) ;for a = 0, n_ages_trop_fine-1 do begin ; minmax[a,0] = min(co2_adj_full[a,*,*,i]) ; minmax[a,1] = max(co2_adj_full[a,*,*,i]) ; minmax_err[a,0] = min(co2_err_full[a,*,*,i]) ; minmax_err[a,1] = max(co2_err_full[a,*,*,i]) ; mean_adj[a] = mean(co2_adj_full[a,*,*,i],/nan) ;endfor ;co2_e_fine2 = conv.co2_e_fine2[*,*,*,tii] ;;zz = where(finite(ages_full1),nzz) ;zz = where(finite(ages_full2),nzz) ;;p = plot(ages_full1[zz],co2_e_fine2[zz],symbol='o',sym_size=1,linestyle=6,rgb_table=39,vert_colors=ratios_full1[zz]*95,/sym_filled,/overplot) ;p = plot(ages_full2[zz],co2_e_fine2[zz],symbol='o',sym_size=1,linestyle=6,rgb_table=39,vert_colors=ratios_full2[zz]*95,/sym_filled,/overplot) ;p = plot(grn_mean_ages_trop_fine,mean_adj,linestyle=2,thick=2,color='sky blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,minmax[*,0]-minmax_err[*,0],linestyle=1,thick=2,color='sky blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,minmax[*,1]+minmax_err[*,1],linestyle=1,thick=2,color='sky blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,mean_adj-0.02,linestyle=2,thick=2,color='blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,minmax[*,0]-minmax_err[*,0]-0.02,linestyle=1,thick=2,color='blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,minmax[*,1]+minmax_err[*,1]-0.02,linestyle=1,thick=2,color='blue',/overplot) ;cb = COLORBAR(POSITION=[0.77,0.54,0.79,0.84],tickname=tickname_r,tickvalues=findgen(6)*48.,RGB_TABLE=rgb,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='$\Delta$$^2$/$\Gamma$') ;p = plot(indgen(2),/nodata,xrange=[0,3.5],yrange=[co2_adj_all[ii]-3,co2_adj_all[ii]+9],xtitle='Mean Age',ytitle='CO$_2$ (ppmv)',font_size=11, $ ; title='Convolution of Surface CO$_2$ with Age Spectra '+dates_str[ii]) ;co2_ef = dat.co2_e_fine2[*,*,nr_fine/2-25,i] ;co2_ef2 = fltarr(n_elements(co2_ef[*,0]),10*ny) ;lat_grid_fine = findgen(10*ny)*(lat_grid_entry[1]-lat_grid_entry[0])/10.+lat_grid_entry[0] ;yi = interpol(indgen(ny),lat_grid_entry,lat_grid_fine) ;for a = 0, n_elements(co2_ef[*,0])-1 do co2_ef2[a,*] = interpolate(co2_ef[a,*],yi) ;for y = 40, 10*ny-1 do p = plot(grn_mean_ages_trop_fine[0:n_elements(co2_ef[*,0])-1],co2_ef2[*,y],rgb_table=39,vert_colors=(lat_grid_fine[y]-lat_grid_fine[0])*1.7,thick=1.5,/overplot) ;;p = plot([0,6],replicate(co2_adj_all[ii],2),linestyle=2,/overplot) ;;p = plot([0,6],replicate(co2_adj_all[ii]+co2_err,2),linestyle=1,/overplot) ;;p = plot([0,6],replicate(co2_adj_all[ii]-co2_err,2),linestyle=1,/overplot) ;cb = COLORBAR(POSITION=[0.77,0.54,0.79,0.84],tickname=tickname_l2,tickvalues=findgen(ny/2+2)*165./(ny/2.+1.),RGB_TABLE=rgb[65:-21,*],BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10, $ ; title='Surface Latitude') ;t = text(0.45,0.8,'$\Delta$$^2$/$\Gamma$ = '+strmid(strcompress(string(ratios_fine[nr_fine/2-25]),/r),0,4),font_size=11,/norm) ;;p.save,dir+'Plots/Aircraft Mean Ages/Surface_CO2_convolutions_fine_0.7_base.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_CO2_convolutions_fine_0.7_Dec.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_CO2_convolutions_fine_0.7_Nov.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_CO2_convolutions_fine_0.7_Sep.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_CO2_convolutions_fine_0.7_Aug.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_CO2_convolutions_fine_0.7_Jul.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_CO2_convolutions_fine_0.7_Jun.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_CO2_convolutions_fine_0.7_May.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_CO2_convolutions_fine_0.7_Apr.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_CO2_convolutions_fine_0.7_Mar.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_CO2_convolutions_fine_0.7_Feb.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_CO2_convolutions_fine_0.7_Jan.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_CO2_convolutions_fine_0.7.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_CO2_convolutions_fine_1.5.png' ;p = plot(indgen(2),/nodata,xrange=[0,3.5],yrange=[sf6[ii]-0.27,sf6[ii]+0.65],xtitle='Mean Age',ytitle='SF$_6$ (pptv)',font_size=11, $ ; title='Convolution of Surface SF$_6$ with Age Spectra '+dates_str[ii]) ;sf6_ef = dat.sf6_e_fine2[*,*,nr_fine/2-25,i] ;sf6_ef2 = fltarr(n_elements(sf6_ef[*,0]),10*ny) ;lat_grid_fine = findgen(10*ny)*(lat_grid_entry[1]-lat_grid_entry[0])/10.+lat_grid_entry[0] ;yi = interpol(indgen(ny),lat_grid_entry,lat_grid_fine) ;for a = 0, n_elements(sf6_ef[*,0])-1 do sf6_ef2[a,*] = interpolate(sf6_ef[a,*],yi) ;for y = 40, 10*ny-1 do p = plot(grn_mean_ages_trop_fine[0:n_elements(sf6_ef[*,0])-1],sf6_ef2[*,y],rgb_table=39,vert_colors=(lat_grid_fine[y]-lat_grid_fine[0])*1.7,thick=1.5,/overplot) ;;p = plot([0,6],replicate(sf6[ii],2),linestyle=2,/overplot) ;;p = plot([0,6],replicate(sf6[ii]+sf6_e[ii],2),linestyle=1,/overplot) ;;p = plot([0,6],replicate(sf6[ii]-sf6_e[ii],2),linestyle=1,/overplot) ;cb = COLORBAR(POSITION=[0.77,0.54,0.79,0.84],tickname=tickname_l2,tickvalues=findgen(ny/2+2)*165./(ny/2.+1.),RGB_TABLE=rgb[65:-21,*],BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10, $ ; title='Surface Latitude') ;t = text(0.45,0.8,'$\Delta$$^2$/$\Gamma$ = '+strmid(strcompress(string(ratios_fine[nr_fine/2-25]),/r),0,4),font_size=11,/norm) ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_SF6_convolutions_fine_0.7_base.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_SF6_convolutions_fine_0.7_Dec.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_SF6_convolutions_fine_0.7_Nov.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_SF6_convolutions_fine_0.7_Sep.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_SF6_convolutions_fine_0.7_Aug.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_SF6_convolutions_fine_0.7_Jul.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_SF6_convolutions_fine_0.7_Jun.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_SF6_convolutions_fine_0.7_May.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_SF6_convolutions_fine_0.7_Apr.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_SF6_convolutions_fine_0.7_Mar.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_SF6_convolutions_fine_0.7_Feb.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_SF6_convolutions_fine_0.7_Jan.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_SF6_convolutions_fine_0.7.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_SF6_convolutions_fine_1.5.png' ;p = plot(indgen(2),/nodata,xrange=[0,3.5],yrange=[sf6[ii]-0.4,sf6[ii]+0.65],xtitle='Mean Age',ytitle='SF$_6$ (pptv)',font_size=11, $ ; title='Convolution of Surface SF$_6$ with Age Spectra '+dates_str[ii]) ;for r = 0, nr_fine-1, 5 do begin ; sf6_ef = dat.sf6_e_fine2[*,*,r,i] ; sf6_ef2 = fltarr(n_elements(sf6_ef[*,0]),10*ny) ; for a = 0, n_elements(sf6_ef[*,0])-1 do sf6_ef2[a,*] = interpolate(sf6_ef[a,*],yi) ; for y = 40, 10*ny-1, 5 do p = plot(grn_mean_ages_trop_fine[0:n_elements(sf6_ef[*,0])-1],sf6_ef2[*,y],rgb_table=39,vert_colors=(lat_grid_fine[y]-lat_grid_fine[0])*1.7,thick=1.5,/overplot) ;endfor ;p = plot([0,6],replicate(sf6[ii],2),linestyle=2,/overplot) ;p = plot([0,6],replicate(sf6[ii]+sf6_e[ii],2),linestyle=1,/overplot) ;p = plot([0,6],replicate(sf6[ii]-sf6_e[ii],2),linestyle=1,/overplot) ;cb = COLORBAR(POSITION=[0.77,0.54,0.79,0.84],tickname=tickname_l2,tickvalues=findgen(ny/2+2)*165./(ny/2.+1.),RGB_TABLE=rgb[65:-21,*],BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10, $ ; title='Surface Latitude') ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_SF6_convolutions_Nov.png' ;;p = plot(indgen(2),/nodata,xrange=[0,4],yrange=[sf6[ii]-0.35,sf6[ii]+0.75],xtitle='Mean Age',ytitle='$\chi$$_{SF6}$ (pptv)',font_size=11) ;p = plot(indgen(2),/nodata,xrange=[0,4],yrange=[sf6[ii]-0.4,sf6[ii]+0.8],xtitle='Mean Age',ytitle='$\chi$$_{SF6}$ (pptv)',font_size=11) ;minmax = fltarr(n_ages_trop_fine,2) ;for a = 0, n_ages_trop_fine-1 do begin ; minmax[a,0] = min(conv.sf6_e_fine2[a,*,*,tii]) ; minmax[a,1] = max(conv.sf6_e_fine2[a,*,*,tii]) ;endfor ;poly = polygon([grn_mean_ages_trop_fine,reverse(grn_mean_ages_trop_fine)],[minmax[*,0],reverse(minmax[*,1])],/fill_background,/data,fill_color='light grey',color='white') ;sf6_ef = conv.sf6_e_fine2[*,*,nr_fine/2-5,tii] ;sf6_ef2 = fltarr(n_elements(sf6_ef[*,0]),10*ny) ;for a = 0, n_elements(sf6_ef[*,0])-1 do sf6_ef2[a,*] = interpolate(sf6_ef[a,*],yi) ;for y = 40, 10*ny-1 do p = plot(grn_mean_ages_trop_fine[0:n_elements(sf6_ef[*,0])-1],sf6_ef2[*,y],rgb_table=39,vert_colors=(lat_grid_fine[y]-lat_grid_fine[0])*1.7,thick=1.5,/overplot) ;p = plot(grn_mean_ages,sf6_tr_et[*,8,tii],color='dark green',thick=2,linestyle=2,/overplot) ;t = text(0.45,0.8,'R = $\Delta$$^2$/$\Gamma$ = '+strmid(strcompress(string(ratios_fine[nr_fine/2-5]),/r),0,4),font_size=11,/norm) ;;t = text(0.68,0.45,'Dashed = 30$\deg$S-30$\deg$N',color='dark green',font_size=10,/norm) ;cb = COLORBAR(POSITION=[0.77,0.54,0.79,0.84],tickname=tickname_l2,tickvalues=findgen(ny/2+2)*165./(ny/2.+1.),RGB_TABLE=rgb[65:-21,*],BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10, $ ; title='Surface Lat, y$_{oV}$') ;;p.save,dir+'Plots/Aircraft Mean Ages/Surface_SF6_convolutions_fine_R=1.2.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_SF6_convolutions_fine_R=1.2_Apr.png' ;;p = plot(indgen(2),/nodata,xrange=[0,4],yrange=[co2_adj_all[ii]-2.4,co2_adj_all[ii]+3.1],xtitle='Mean Age',ytitle='$\chi$$_{CO2}$ (ppmv)',font_size=11) ;p = plot(indgen(2),/nodata,xrange=[0,4],yrange=[co2_adj_all[ii]-2.4,co2_adj_all[ii]+10.5],xtitle='Mean Age',ytitle='$\chi$$_{CO2}$ (ppmv)',font_size=11) ;minmax = fltarr(n_ages_trop_fine,2) ;for a = 0, n_ages_trop_fine-1 do begin ; minmax[a,0] = min(conv.co2_e_fine2[a,*,*,tii]) ; minmax[a,1] = max(conv.co2_e_fine2[a,*,*,tii]) ;endfor ;poly = polygon([grn_mean_ages_trop_fine,reverse(grn_mean_ages_trop_fine)],[minmax[*,0],reverse(minmax[*,1])],/fill_background,/data,fill_color='light grey',color='white') ;co2_ef = conv.co2_e_fine2[*,*,nr_fine/2-5,tii] ;co2_ef2 = fltarr(n_elements(co2_ef[*,0]),10*ny) ;for a = 0, n_elements(co2_ef[*,0])-1 do co2_ef2[a,*] = interpolate(co2_ef[a,*],yi) ;for y = 40, 10*ny-1 do p = plot(grn_mean_ages_trop_fine[0:n_elements(co2_ef[*,0])-1],co2_ef2[*,y],rgb_table=39,vert_colors=(lat_grid_fine[y]-lat_grid_fine[0])*1.7,thick=1.5,/overplot) ;p = plot(grn_mean_ages,co2_tr_e[*,8,tii],color='dark green',thick=2,linestyle=2,/overplot) ;t = text(0.45,0.8,'R = $\Delta$$^2$/$\Gamma$ = '+strmid(strcompress(string(ratios_fine[nr_fine/2-5]),/r),0,4),font_size=11,/norm) ;cb = COLORBAR(POSITION=[0.77,0.54,0.79,0.84],tickname=tickname_l2,tickvalues=findgen(ny/2+2)*165./(ny/2.+1.),RGB_TABLE=rgb[65:-21,*],BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10, $ ; title='Surface Lat, y$_{oV}$') ;;p.save,dir+'Plots/Aircraft Mean Ages/Surface_CO2_convolutions_fine_R=1.2.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_CO2_convolutions_fine_R=1.2_Apr.png' ;p = plot(indgen(2),/nodata,xrange=[0,4],yrange=[ch4_all[ii]-5,ch4_all[ii]+150],xtitle='Mean Age',ytitle='$\chi$$_{CH4}$ (ppbv)',title='Convolutions of surface CH$_4$ with age spectra Nov. 1994', $ ; font_size=11) ;minmax = fltarr(n_ages_trop_fine,2) ;for a = 0, n_ages_trop_fine-1 do begin ; minmax[a,0] = min(conv.ch4_e_fine2[a,*,*,tii]) ; minmax[a,1] = max(conv.ch4_e_fine2[a,*,*,tii]) ;endfor ;poly = polygon([grn_mean_ages_trop_fine,reverse(grn_mean_ages_trop_fine)],[minmax[*,0],reverse(minmax[*,1])],/fill_background,/data,fill_color='light grey',color='white') ;ch4_ef = conv.ch4_e_fine2[*,*,nr_fine/2-5,tii] ;ch4_ef2 = fltarr(n_elements(ch4_ef[*,0]),10*ny) ;for a = 0, n_elements(ch4_ef[*,0])-1 do ch4_ef2[a,*] = interpolate(ch4_ef[a,*],yi) ;for y = 40, 10*ny-1 do p = plot(grn_mean_ages_trop_fine[0:n_elements(ch4_ef[*,0])-1],ch4_ef2[*,y],rgb_table=39,vert_colors=(lat_grid_fine[y]-lat_grid_fine[0])*1.7,thick=1.5,/overplot) ;p = plot([0,4],replicate(tropical_ch4[ti[-1]],2),color='dark green',thick=2,linestyle=2,/overplot) ;t = text(0.45,0.8,'R = $\Delta$$^2$/$\Gamma$ = '+strmid(strcompress(string(ratios_fine[nr_fine/2-5]),/r),0,4),font_size=11,/norm) ; cb = COLORBAR(POSITION=[0.77,0.54,0.79,0.84],tickname=tickname_l2,tickvalues=findgen(ny/2+2)*165./(ny/2.+1.),RGB_TABLE=rgb[65:-21,*],BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10, $ ; title='Surface Lat, y$_{oV}$') ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_CH4_convolutions_fine_R=1.2.png' leftmargin = 0.08 & rightmargin = 0.02 & botmargin = 0.1 & topmargin = 0.08 & buffer = 0.05 ;pos = plot_position(2,1,1,leftmargin,botmargin,buffer,topmargin=topmargin,rightmargin=rightmargin,ytitle=leftcol,/newwin,windim=[650,350]) ;pos = plot_position(2,1,1,leftmargin,botmargin,buffer,topmargin=topmargin,rightmargin=rightmargin,toprow=toprow,ytitle=leftcol,xtitle=botrow) ;p1 = plot(indgen(2),/nodata,xrange=[0,4],yrange=[sf6[ii]-0.35,sf6[ii]+0.75],xtitle='Mean Age',ytitle='SF$_6$ (pptv)',font_size=10, $ ; title='Convolution of Surface SF$_6$ with Age Spectra '+dates_str[ii],position=pos,/current) ;minmax = fltarr(n_ages_trop_fine,2) ;for a = 0, n_ages_trop_fine-1 do begin ; minmax[a,0] = min(conv.sf6_e_fine2[a,*,*,tii]) ; minmax[a,1] = max(conv.sf6_e_fine2[a,*,*,tii]) ;endfor ;poly = polygon([grn_mean_ages_trop_fine,reverse(grn_mean_ages_trop_fine)],[minmax[*,0],reverse(minmax[*,1])],/fill_background,/data,fill_color='light grey',color='white') ;for r = 0, nr_fine-1, 5 do begin ; sf6_ef = conv.sf6_e_fine2[*,*,r,tii] ; sf6_ef2 = fltarr(n_elements(sf6_ef[*,0]),10*ny) ; for a = 0, n_elements(sf6_ef[*,0])-1 do sf6_ef2[a,*] = interpolate(sf6_ef[a,*],yi) ; for y = 40, 10*ny-1, 5 do p = plot(grn_mean_ages_trop_fine[0:n_elements(sf6_ef[*,0])-1],sf6_ef2[*,y],rgb_table=39,vert_colors=(lat_grid_fine[y]-lat_grid_fine[0])*1.7,thick=1.5,/overplot) ;endfor ;cb = COLORBAR(POSITION=[0.77,0.54,0.79,0.84],tickname=tickname_l2,tickvalues=findgen(ny/2+2)*165./(ny/2.+1.),RGB_TABLE=rgb[65:-21,*],BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10, $ ; title='Surface Lat') ;pos = plot_position(2,1,2,leftmargin,botmargin,buffer,topmargin=topmargin,rightmargin=rightmargin,toprow=toprow,ytitle=leftcol,xtitle=botrow) ;p = plot(indgen(2),/nodata,xrange=[0,4],yrange=[sf6[ii]-0.35,sf6[ii]+0.75],xtitle='Mean Age',font_size=10,position=pos,/current) ;poly = polygon([grn_mean_ages_trop_fine,reverse(grn_mean_ages_trop_fine)],[minmax[*,0],reverse(minmax[*,1])],/data,/fill_background,fill_color='light grey',color='white',position=pos) ;for r = 0, nr_fine-1 do p = plot(grn_mean_ages_trop_fine,conv.sf6_e_fine2[*,7,r,i],rgb_table=68,vert_colors=(ratios_fine[r])*100,thick=1,/overplot) bii = where(year_b eq fix(date_frac[ii])) sf6_bias_yr = sf6_bias_corr[*,bii] ;p = plot(indgen(2),/nodata,xrange=[2,3.2],yrange=[sf6[ii]-0.04,sf6[ii]+0.1],xtitle='Mean Age',ytitle='SF$_6$ (pptv)',font_size=11, $ ;;p = plot(indgen(2),/nodata,xrange=[0,4],yrange=[sf6[ii]-0.15,sf6[ii]+0.15],xtitle='Mean Age',ytitle='SF$_6$ (pptv)',font_size=11, $ ; title='Convolution of Surface SF$_6$ with Age Spectra '+dates_str[ii]) ;minmax = fltarr(n_ages_trop_fine,2) ;for a = 0, n_ages_trop_fine-1 do begin ; ri1 = where(ratios_fine ge grn_mean_ages_trop_fine[a]/8.) ; ri1 = ri1[0] ; minmax[a,0] = min(conv.sf6_e_fine2[a,*,ri1:-1,tii]) ; minmax[a,1] = max(conv.sf6_e_fine2[a,*,ri1:-1,tii]) ;endfor ;poly = polygon([grn_mean_ages_trop_fine,reverse(grn_mean_ages_trop_fine)],[minmax[*,0],reverse(minmax[*,1])],/fill_background,/data,fill_color='light grey',color='white') ;sf6_e_fine2 = conv.sf6_e_fine2[*,*,*,tii] ;zz = where(finite(ages_full1_co2),nzz) ;p = plot(ages_all[zz]-0.01,sf6_e_fine2[zz],symbol='o',sym_size=0.4,linestyle=6,color='orange',transparency=50,/overplot) ;zz = where(finite(ages_full1_sf6),nzz) ;p = plot(ages_full1_sf6[zz],sf6_e_fine2[zz],symbol='o',sym_size=0.4,linestyle=6,color='magenta',transparency=75,/overplot) ;zz = where(finite(ages_full1),nzz) ;p = plot(ages_full1[zz]+0.01,sf6_e_fine2[zz],symbol='o',sym_size=0.5,linestyle=6,color='lime green',/sym_filled,/overplot) ;;;p = plot(ages_full1[zz],sf6_e_fine2[zz],symbol='o',sym_size=0.5,linestyle=6,rgb_table=39,vert_colors=sdiffs[zz]*3e3,/sym_filled,/overplot) ;;;p = plot(ages_full1[zz],sf6_full1[zz],symbol='o',sym_size=0.5,linestyle=6,color='red',/sym_filled,/overplot) ;;;p = plot(ages_full1[zz],sf6_e_fine2[zz],symbol='o',sym_size=0.5,linestyle=6,rgb_table=39,vert_colors=diffs_both_all1[zz]*2.5e3,/sym_filled,/overplot) ;sf6_f = replicate(sf6[ii],n_ages_trop_fine) ;gdf = where(minmax[*,0] le sf6[ii] and minmax[*,1] ge sf6[ii]) ;p = plot(grn_mean_ages_trop_fine[gdf],sf6_f[gdf],linestyle=2,/overplot) ;gdf = where(minmax[*,0] le sf6[ii]+sf6_e[ii] and minmax[*,1] ge sf6[ii]+sf6_e[ii])+1 ;p = plot(grn_mean_ages_trop_fine[gdf],sf6_f[gdf]+sf6_e[ii],linestyle=1,/overplot) ;gdf = where(minmax[*,0] le sf6[ii]-sf6_e[ii] and minmax[*,1] ge sf6[ii]-sf6_e[ii]) ;p = plot(grn_mean_ages_trop_fine[gdf]+0.02,sf6_f[gdf]-sf6_e[ii],linestyle=1,/overplot) ;;p = plot([0,6],replicate(sf6[ii],2),linestyle=2,color='grey',/overplot) ;;p = plot([0,6],replicate(sf6[ii]+sf6_e[ii],2),linestyle=1,color='grey',/overplot) ;;p = plot([0,6],replicate(sf6[ii]-sf6_e[ii],2),linestyle=1,color='grey',/overplot) ;gdf = fltarr(n_ages_trop_fine) & gdf2 = gdf & gdf3 = gdf ;for a = 0, n_ages_trop_fine-1 do begin ; if sf6[ii]+sf6_bias_yr[a]*flight_sf6_gr[tii[0]] ge minmax[a,0] and sf6[ii]+sf6_bias_yr[a]*flight_sf6_gr[tii[0]] le minmax[a,1] then gdf[a] = 1 ; if sf6[ii]+sf6_e[ii]+sf6_bias_yr[a]*flight_sf6_gr[tii[0]] ge minmax[a,0] and sf6[ii]+sf6_e[ii]+sf6_bias_yr[a]*flight_sf6_gr[tii[0]] le minmax[a,1] then gdf2[a] = 1 ; if sf6[ii]-sf6_e[ii]+sf6_bias_yr[a]*flight_sf6_gr[tii[0]] ge minmax[a,0] and sf6[ii]-sf6_e[ii]+sf6_bias_yr[a]*flight_sf6_gr[tii[0]] le minmax[a,1] then gdf3[a] = 1 ;endfor ;gdf = where(gdf) ;gdf2 = where(gdf2) ;gdf3 = where(gdf3) ;p = plot(grn_mean_ages_trop_fine[gdf],sf6[ii]+sf6_bias_yr[gdf]*flight_sf6_gr[tii[0]],linestyle=2,thick=2,color='blue',/overplot) ;p = plot(grn_mean_ages_trop_fine[gdf2],sf6[ii]+sf6_e[ii]+sf6_bias_yr[gdf2]*flight_sf6_gr[tii[0]],linestyle=1,thick=2,color='blue',/overplot) ;p = plot(grn_mean_ages_trop_fine[gdf3],sf6[ii]-sf6_e[ii]+sf6_bias_yr[gdf3]*flight_sf6_gr[tii[0]],linestyle=1,thick=2,color='blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,sf6[ii]+sf6_bias_yr*flight_sf6_gr[tii[0]],linestyle=2,thick=2,color='blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,sf6[ii]+sf6_e[ii]+sf6_bias_yr*flight_sf6_gr[tii[0]],linestyle=1,thick=2,color='blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,sf6[ii]-sf6_e[ii]+sf6_bias_yr*flight_sf6_gr[tii[0]],linestyle=1,thick=2,color='blue',/overplot) ;s = symbol(opt_age_diffs_all[ns/2,nsc/2,i],opt_sf6_all[ns/2,nsc/2,i],'s',sym_size=1.5,sym_color='purple',/sym_filled,/data) ;cb = COLORBAR(POSITION=[0.77,0.54,0.79,0.84],tickname=tickname_s,tickvalues=findgen(6)*50.,RGB_TABLE=rgb,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='$\delta\chi$') ;;p.save,dir+'Plots/Aircraft Mean Ages/Surface_SF6_convolutions_zoom_Nov.png' ;;p.save,dir+'Plots/Aircraft Mean Ages/Surface_SF6_convolutions_zoom2_Nov.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_SF6_convolutions_zoom3_Nov.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_SF6_convolutions_zoom4_Nov.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_SF6_convolutions_zoom5_Nov.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_SF6_convolutions_zoom6_Nov.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_SF6_convolutions_zoom9_Nov.png' ;p = plot(indgen(2),/nodata,xrange=[2.15,2.8],yrange=[sf6[ii]-0.0,sf6[ii]+0.12],xtitle='Mean Age',ytitle='$\chi$$_{SF6}$ (ppt)',font_size=11, $ ; title='Convolution of Surface SF$_6$ with Age Spectra '+dates_str[ii]) ;minmax = fltarr(n_ages_trop_fine,2) ;for a = 0, n_ages_trop_fine-1 do begin ; ri1 = where(ratios_fine ge grn_mean_ages_trop_fine[a]/8.) ; ri1 = ri1[0] ; minmax[a,0] = min(conv.sf6_e_fine2[a,*,ri1:-1,tii]) ; minmax[a,1] = max(conv.sf6_e_fine2[a,*,ri1:-1,tii]) ;endfor ;poly = polygon([grn_mean_ages_trop_fine,reverse(grn_mean_ages_trop_fine)],[minmax[*,0],reverse(minmax[*,1])],/fill_background,/data,fill_color='light grey',color='white') ;sf6_e_fine2 = conv.sf6_e_fine2[*,*,*,tii] ;zz = where(finite(ages_full1),nzz) ;;zz = where(finite(ages_full2),nzz) ;;p = plot(ages_full1[zz],sf6_e_fine2[zz],symbol='o',sym_size=0.5,linestyle=6,rgb_table=39,vert_colors=sdiffs[zz]*2.5e3,/sym_filled,/overplot) ;p = plot(ages_full1[zz],sf6_e_fine2[zz],symbol='o',sym_size=1,linestyle=6,rgb_table=39,vert_colors=diffs_both_all1[zz]*2.3e2,/sym_filled,/overplot) ;;p = plot(ages_full2[zz],sf6_e_fine2[zz],symbol='o',sym_size=1,linestyle=6,rgb_table=39,vert_colors=diffs_both_all2[zz]*2.3e2,/sym_filled,/overplot) ;p = plot(grn_mean_ages_trop_fine,sf6[ii]+sf6_bias_yr*flight_sf6_gr[tii[0]],linestyle=2,thick=2,color='blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,sf6[ii]+sf6_e[ii]+sf6_bias_yr*flight_sf6_gr[tii[0]],linestyle=1,thick=2,color='blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,sf6[ii]-sf6_e[ii]+sf6_bias_yr*flight_sf6_gr[tii[0]],linestyle=1,thick=2,color='blue',/overplot) ;;p = plot(grn_mean_ages_trop_fine,sf6[ii]+sf6_bias_yr*flight_sf6_gr[tii[0]],linestyle=2,thick=2,color='sky blue',/overplot) ;;p = plot(grn_mean_ages_trop_fine,sf6[ii]+sf6_e[ii]+sf6_bias_yr*flight_sf6_gr[tii[0]],linestyle=1,thick=2,color='sky blue',/overplot) ;;p = plot(grn_mean_ages_trop_fine,sf6[ii]-sf6_e[ii]+sf6_bias_yr*flight_sf6_gr[tii[0]],linestyle=1,thick=2,color='sky blue',/overplot) ;;p = plot(grn_mean_ages_trop_fine,sf6[ii]+sf6_bias_yr*flight_sf6_gr[tii[0]]+0.06,linestyle=2,thick=2,color='blue',/overplot) ;;p = plot(grn_mean_ages_trop_fine,sf6[ii]+sf6_e[ii]+sf6_bias_yr*flight_sf6_gr[tii[0]]+0.06,linestyle=1,thick=2,color='blue',/overplot) ;;p = plot(grn_mean_ages_trop_fine,sf6[ii]-sf6_e[ii]+sf6_bias_yr*flight_sf6_gr[tii[0]]+0.06,linestyle=1,thick=2,color='blue',/overplot) ;cb = COLORBAR(POSITION=[0.8,0.54,0.82,0.84],tickname=tickname_s3,tickvalues=findgen(6)*46.,RGB_TABLE=rgb,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='$\delta\chi$$_{\cap}$') ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_SF6_convolutions_zoom_diffs_Nov.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_SF6_convolutions_zoom_diffs_Nov_scale.png' ;p = plot(indgen(2),/nodata,xrange=[2.15,2.8],yrange=[sf6[ii]-0.0,sf6[ii]+0.12],xtitle='Mean Age',ytitle='$\chi$$_{SF6}$ (ppt)',font_size=11, $ ; title='Convolution of Surface SF$_6$ with Age Spectra '+dates_str[ii]) ;minmax = fltarr(n_ages_trop_fine,2) ;for a = 0, n_ages_trop_fine-1 do begin ; ri1 = where(ratios_fine ge grn_mean_ages_trop_fine[a]/8.) ; ri1 = ri1[0] ; minmax[a,0] = min(conv.sf6_e_fine2[a,*,ri1:-1,tii]) ; minmax[a,1] = max(conv.sf6_e_fine2[a,*,ri1:-1,tii]) ;endfor ;poly = polygon([grn_mean_ages_trop_fine,reverse(grn_mean_ages_trop_fine)],[minmax[*,0],reverse(minmax[*,1])],/fill_background,/data,fill_color='light grey',color='white') ;sf6_e_fine2 = conv.sf6_e_fine2[*,*,*,tii] ;zz = where(finite(ages_full1),nzz) ;dd1 = where(diffs_both_all1[zz] gt 0.25,ndd1) ;for zi = 0, ndd1-1 do p = plot(replicate(ages_full1[zz[dd1[zi]]],2),replicate(sf6_e_fine2[zz[dd1[zi]]],2),symbol='o',sym_size=0.5,linestyle=6,rgb_table=68,vert_colors=ratios_full1[zz[dd1[zi]]]*95, $ ; /overplot) ;dd1 = where(diffs_both_all1[zz] gt 0.1 and diffs_both_all1[zz] le 0.25,ndd1) ;for zi = 0, ndd1-1 do p = plot(replicate(ages_full1[zz[dd1[zi]]],2),replicate(sf6_e_fine2[zz[dd1[zi]]],2),symbol='o',sym_size=1.5,linestyle=6,rgb_table=68,vert_colors=ratios_full1[zz[dd1[zi]]]*95, $ ; /sym_filled,/overplot) ;dd1 = where(diffs_both_all1[zz] le 0.1,ndd1) ;for zi = 0, ndd1-1 do p = plot(replicate(ages_full1[zz[dd1[zi]]],2),replicate(sf6_e_fine2[zz[dd1[zi]]],2),symbol='o',sym_size=3,linestyle=6,rgb_table=68,vert_colors=ratios_full1[zz[dd1[zi]]]*95, $ ; /sym_filled,/overplot) ;s = symbol(opt_age_diffs_all[ns/2,nsc/2,i],opt_sf6_all[ns/2,nsc/2,i],'s',sym_size=3,sym_color='white',/data) ;p = plot(replicate(opt_age_diffs_all[ns/2,nsc/2,i],2),replicate(opt_sf6_all[ns/2,nsc/2,i],2),symbol='s',sym_size=2.5,rgb_table=68,vert_colors=opt_ratio_diffs_all[ns/2,nsc/2,i]*95, $ ; /sym_filled,/overplot) ;p = plot(grn_mean_ages_trop_fine,sf6[ii]+sf6_bias_yr*flight_sf6_gr[tii[0]],linestyle=2,thick=2,color='blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,sf6[ii]+sf6_e[ii]+sf6_bias_yr*flight_sf6_gr[tii[0]],linestyle=1,thick=2,color='blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,sf6[ii]-sf6_e[ii]+sf6_bias_yr*flight_sf6_gr[tii[0]],linestyle=1,thick=2,color='blue',/overplot) ;cb = COLORBAR(POSITION=[0.79,0.54,0.81,0.84],tickname=tickname_r,tickvalues=findgen(6)*48.,RGB_TABLE=rgb_68,BORDER=1, ORIENTATION=1,/textpos,font_size=10,title='$\Delta$$^2$/$\Gamma$ (years)') ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_SF6_convolutions_zoom_ratios_Nov.png' ;p = plot(indgen(2),/nodata,xrange=[2.15,2.8],yrange=[sf6[ii]-0.0,sf6[ii]+0.12],xtitle='Mean Age',ytitle='$\chi$$_{SF6}$ (ppt)',font_size=11, $ ; title='Convolution of Surface SF$_6$ with Age Spectra '+dates_str[ii]) ;minmax = fltarr(n_ages_trop_fine,2) ;for a = 0, n_ages_trop_fine-1 do begin ; ri1 = where(ratios_fine ge grn_mean_ages_trop_fine[a]/8.) ; ri1 = ri1[0] ; minmax[a,0] = min(conv.sf6_e_fine2[a,*,ri1:-1,tii]) ; minmax[a,1] = max(conv.sf6_e_fine2[a,*,ri1:-1,tii]) ;endfor ;poly = polygon([grn_mean_ages_trop_fine,reverse(grn_mean_ages_trop_fine)],[minmax[*,0],reverse(minmax[*,1])],/fill_background,/data,fill_color='light grey',color='white') ;sf6_e_fine2 = conv.sf6_e_fine2[*,*,*,tii] ;zz = where(finite(ages_full2),nzz) ;dd1 = where(diffs_both_all2[zz] gt 0.25,ndd1) ;for zi = 0, ndd1-1 do p = plot(replicate(ages_full2[zz[dd1[zi]]],2),replicate(sf6_e_fine2[zz[dd1[zi]]],2),symbol='o',sym_size=0.5,linestyle=6,rgb_table=68,vert_colors=ratios_full2[zz[dd1[zi]]]*95, $ ; /overplot) ;dd1 = where(diffs_both_all2[zz] gt 0.1 and diffs_both_all2[zz] le 0.25,ndd1) ;for zi = 0, ndd1-1 do p = plot(replicate(ages_full2[zz[dd1[zi]]],2),replicate(sf6_e_fine2[zz[dd1[zi]]],2),symbol='o',sym_size=1.5,linestyle=6,rgb_table=68,vert_colors=ratios_full2[zz[dd1[zi]]]*95, $ ; /sym_filled,/overplot) ;dd1 = where(diffs_both_all2[zz] le 0.1,ndd1) ;for zi = 0, ndd1-1 do p = plot(replicate(ages_full2[zz[dd1[zi]]],2),replicate(sf6_e_fine2[zz[dd1[zi]]],2),symbol='o',sym_size=3,linestyle=6,rgb_table=68,vert_colors=ratios_full2[zz[dd1[zi]]]*95, $ ; /sym_filled,/overplot) ;s = symbol(opt_age_diffs_all[ns/2+2,nsc/2-1,i],opt_sf6_all[ns/2+2,nsc/2-1,i],'s',sym_size=3,sym_color='white',/data) ;p = plot(replicate(opt_age_diffs_all[ns/2+2,nsc/2-1,i],2),replicate(opt_sf6_all[ns/2+2,nsc/2-1,i],2),symbol='s',sym_size=2.5,rgb_table=68,vert_colors=opt_ratio_diffs_all[ns/2+2,nsc/2-1,i]*95, $ ; /sym_filled,/overplot) ;p = plot(grn_mean_ages_trop_fine,sf6[ii]+sf6_bias_yr*flight_sf6_gr[tii[0]],linestyle=2,thick=2,color='sky blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,sf6[ii]+sf6_e[ii]+sf6_bias_yr*flight_sf6_gr[tii[0]],linestyle=1,thick=2,color='sky blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,sf6[ii]-sf6_e[ii]+sf6_bias_yr*flight_sf6_gr[tii[0]],linestyle=1,thick=2,color='sky blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,sf6[ii]+sf6_bias_yr*flight_sf6_gr[tii[0]]+0.06,linestyle=2,thick=2,color='blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,sf6[ii]+sf6_e[ii]+sf6_bias_yr*flight_sf6_gr[tii[0]]+0.06,linestyle=1,thick=2,color='blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,sf6[ii]-sf6_e[ii]+sf6_bias_yr*flight_sf6_gr[tii[0]]+0.06,linestyle=1,thick=2,color='blue',/overplot) ;cb = COLORBAR(POSITION=[0.79,0.54,0.81,0.84],tickname=tickname_r,tickvalues=findgen(6)*48.,RGB_TABLE=rgb_68,BORDER=1, ORIENTATION=1,/textpos,font_size=10,title='$\Delta$$^2$/$\Gamma$ (years)') ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_SF6_convolutions_zoom_ratios_Nov_scale.png' ;p = plot(indgen(2),/nodata,xrange=[0,3.5],yrange=[co2_adj_all[ii]-1.5,co2_adj_all[ii]+7],xtitle='Mean Age',ytitle='CO$_2$ (ppmv)',font_size=11, $ ; title='Convolution of Surface CO$_2$ with Age Spectra '+dates_str[ii]) ;for r = 0, nr_fine-1 do p = plot(grn_mean_ages_trop_fine,dat.co2_e_fine2[*,7,r,i],rgb_table=68,vert_colors=(ratios_fine[r])*100,thick=1,/overplot) ;;p = plot([0,6],replicate(co2_adj_all[ii],2),linestyle=2,/overplot) ;;p = plot([0,6],replicate(co2_adj_all[ii]+co2_err,2),linestyle=1,/overplot) ;;p = plot([0,6],replicate(co2_adj_all[ii]-co2_err,2),linestyle=1,/overplot) ;cb = COLORBAR(POSITION=[0.77,0.54,0.79,0.84],tickname=tickname_r,tickvalues=findgen(6)*50.,RGB_TABLE=rgb_68,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='Ratio of Moments') ;t = text(0.4,0.8,'Surface Lat = '+strmid(strcompress(string(lat_grid_entry[7]),/r),0,2)+'$\deg$N',font_size=11,/norm) ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_CO2_convolutions_ratios_10N_Apr.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_CO2_convolutions_ratios_10N_Nov.png' ; ;p = plot(indgen(2),/nodata,xrange=[0,3.5],yrange=[sf6[ii]-0.35,sf6[ii]+0.65],xtitle='Mean Age',ytitle='SF$_6$ (pptv)',font_size=11, $ ; title='Convolution of Surface SF$_6$ with Age Spectra '+dates_str[ii]) ;for r = 0, nr_fine-1 do p = plot(grn_mean_ages_trop_fine,dat.sf6_e_fine2[*,7,r,i],rgb_table=68,vert_colors=(ratios_fine[r])*100,thick=1,/overplot) ;cb = COLORBAR(POSITION=[0.77,0.54,0.79,0.84],tickname=tickname_r,tickvalues=findgen(6)*50.,RGB_TABLE=rgb_68,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='Ratio of Moments') ;t = text(0.4,0.8,'Surface Lat = '+strmid(strcompress(string(lat_grid_entry[7]),/r),0,2)+'$\deg$N',font_size=11,/norm) ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_SF6_convolutions_ratios_10N_Apr.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_SF6_convolutions_ratios_10N_Nov.png' ;;p = plot(indgen(2),/nodata,xrange=[0,4],yrange=[co2_adj_all[ii]-2.4,co2_adj_all[ii]+3.1],xtitle='Mean Age',ytitle='$\chi$$_{CO2}$ (ppmv)',font_size=11) ;p = plot(indgen(2),/nodata,xrange=[0,4],yrange=[co2_adj_all[ii]-2.4,co2_adj_all[ii]+10.5],xtitle='Mean Age',ytitle='$\chi$$_{CO2}$ (ppmv)',font_size=11) ;minmax = fltarr(n_ages_trop_fine,2) ;for a = 0, n_ages_trop_fine-1 do begin ; minmax[a,0] = min(conv.co2_e_fine2[a,*,*,tii]) ; minmax[a,1] = max(conv.co2_e_fine2[a,*,*,tii]) ;endfor ;poly = polygon([grn_mean_ages_trop_fine,reverse(grn_mean_ages_trop_fine)],[minmax[*,0],reverse(minmax[*,1])],/fill_background,/data,fill_color='light grey',color='white') ;for r = 0, nr_fine-1 do p = plot(grn_mean_ages_trop_fine,conv.co2_e_fine2[*,7,r,tii],rgb_table=68,vert_colors=(ratios_fine[r])*100,thick=1,/overplot) ;p = plot(grn_mean_ages,co2_tr_e[*,8,tii],color='dark green',thick=2,linestyle=2,/overplot) ;cb = COLORBAR(POSITION=[0.77,0.54,0.79,0.84],tickname=tickname_r,tickvalues=findgen(6)*50.,RGB_TABLE=rgb_68,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='Ratio of Moments') ;t = text(0.45,0.8,'y$_{oV}$ = '+strmid(strcompress(string(lat_grid_entry[7]),/r),0,2)+'$\deg$N',font_size=11,/norm) ;;p.save,dir+'Plots/Aircraft Mean Ages/Surface_CO2_convolutions_fine_10N.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_CO2_convolutions_fine_10N_Apr.png' ;;p = plot(indgen(2),/nodata,xrange=[0,4],yrange=[sf6[ii]-0.35,sf6[ii]+0.75],xtitle='Mean Age',ytitle='$\chi$$_{SF6}$ (pptv)',font_size=11) ;p = plot(indgen(2),/nodata,xrange=[0,4],yrange=[sf6[ii]-0.4,sf6[ii]+0.8],xtitle='Mean Age',ytitle='$\chi$$_{SF6}$ (pptv)',font_size=11) ;minmax = fltarr(n_ages_trop_fine,2) ;for a = 0, n_ages_trop_fine-1 do begin ; minmax[a,0] = min(conv.sf6_e_fine2[a,*,*,tii]) ; minmax[a,1] = max(conv.sf6_e_fine2[a,*,*,tii]) ;endfor ;poly = polygon([grn_mean_ages_trop_fine,reverse(grn_mean_ages_trop_fine)],[minmax[*,0],reverse(minmax[*,1])],/fill_background,/data,fill_color='light grey',color='white') ;for r = 0, nr_fine-1 do p = plot(grn_mean_ages_trop_fine,conv.sf6_e_fine2[*,7,r,tii],rgb_table=68,vert_colors=(ratios_fine[r])*100,thick=1,/overplot) ;p = plot(grn_mean_ages,sf6_tr_et[*,8,tii],color='dark green',thick=2,linestyle=2,/overplot) ;cb = COLORBAR(POSITION=[0.77,0.54,0.79,0.84],tickname=tickname_r,tickvalues=findgen(6)*50.,RGB_TABLE=rgb_68,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='Ratio of Moments') ;t = text(0.45,0.8,'y$_{oV}$ = '+strmid(strcompress(string(lat_grid_entry[7]),/r),0,2)+'$\deg$N',font_size=11,/norm) ;;p.save,dir+'Plots/Aircraft Mean Ages/Surface_SF6_convolutions_fine_10N.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_SF6_convolutions_fine_10N_Apr.png' ;p = plot(indgen(2),/nodata,xrange=[0,3.5],yrange=[co2_all[ii]-0.7,co2_all[ii]+0.5],xtitle='Mean Age',ytitle='$\chi$$_{CO2}$ (ppm)',font_size=11) ;minmax = fltarr(n_ages_trop_fine,2) ;for a = 0, n_ages_trop_fine-1 do begin ; minmax[a,0] = min(conv.co2_e_fine2[a,*,*,tii]) ; minmax[a,1] = max(conv.co2_e_fine2[a,*,*,tii]) ;endfor ;poly = polygon([grn_mean_ages_trop_fine,reverse(grn_mean_ages_trop_fine)],[minmax[*,0],reverse(minmax[*,1])],/fill_background,/data,fill_color='light grey',color='white') ;p = plot([0,6],replicate(co2_all[ii],2),linestyle=2,/overplot) ;p = plot([0,6],replicate(co2_all[ii]+co2_err,2),linestyle=1,/overplot) ;p = plot([0,6],replicate(co2_all[ii]-co2_err,2),linestyle=1,/overplot) ;minmax = fltarr(n_ages_trop_fine,2) & minmax_err = minmax & mean_adj = fltarr(n_ages_trop_fine) ;for a = 0, n_ages_trop_fine-1 do begin ; minmax[a,0] = min(co2_adj_full[a,*,*,i]) ; minmax[a,1] = max(co2_adj_full[a,*,*,i]) ; minmax_err[a,0] = min(co2_err_full[a,*,*,i]) ; minmax_err[a,1] = max(co2_err_full[a,*,*,i]) ; mean_adj[a] = mean(co2_adj_full[a,*,*,i],/nan) ;endfor ;;poly = polygon([grn_mean_ages_trop_fine,reverse(grn_mean_ages_trop_fine)],[minmax[*,0],reverse(minmax[*,1])],/fill_background,/data,fill_color='black',color='black') ;;p = plot(grn_mean_ages,co2_tr_e[*,8,tii],color='dark green',thick=2,linestyle=2,/overplot) ;p = plot(grn_mean_ages_trop_fine,mean_adj,linestyle=2,thick=2,color='blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,minmax[*,0]-minmax_err[*,0],linestyle=1,thick=2,color='blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,minmax[*,1]+minmax_err[*,1],linestyle=1,thick=2,color='blue',/overplot) ;;p = plot([0,6],replicate(co2_adj_all[ii],2),linestyle=2,thick=2,/overplot) ;;p = plot([0,6],replicate(co2_adj_all[ii]+co2_err,2),linestyle=1,thick=2,/overplot) ;;p = plot([0,6],replicate(co2_adj_all[ii]-co2_err,2),linestyle=1,thick=2,/overplot) ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_CO2_convolutions_Nov_zoom1.png' ; ;p = plot(indgen(2),/nodata,xrange=[0,3.1],yrange=[co2_adj_sc_all[n_ages_trop_fine/2,i]-0.25,co2_adj_sc_all[n_ages_trop_fine/2,i]+0.17],xtitle='Mean Age',ytitle='$\chi$$_{CO2}$ (ppm)',font_size=11) ;co2_e_fine2 = conv.co2_e_fine2[*,*,*,tii] ;minmax = fltarr(n_ages_trop_fine,2) ;for a = 0, n_ages_trop_fine-1 do begin ; minmax[a,0] = min(co2_e_fine2[a,*,*]) ; minmax[a,1] = max(co2_e_fine2[a,*,*]) ;endfor ;poly = polygon([grn_mean_ages_trop_fine,reverse(grn_mean_ages_trop_fine)],[minmax[*,0],reverse(minmax[*,1])],/fill_background,/data,fill_color='light grey',color='white') ;minmax = replicate(!values.f_nan,n_ages_trop_fine,2) & minmax_err = minmax & mean_adj = replicate(!values.f_nan,n_ages_trop_fine) ;for a = 0, n_ages_trop_fine-1 do begin ; co2a = reform(co2_adj_full[a,*,*,i]) & co2e = reform(co2_err_full[a,*,*,i]) & co2ef = reform(co2_e_fine2[a,*,*]) & cdf = reform(cdiffs[a,*,*]) ; ages_c = reform(ages_full1_co2[a,*,*]) ; gd = where(finite(ages_c),ngd) ; if ngd gt 0 then begin ; minmax[a,0] = min(co2a[gd]) ; minmax[a,1] = max(co2a[gd]) ; minmax_err[a,0] = min(co2a[gd]-co2e[gd]) ; minmax_err[a,1] = max(co2a[gd]+co2e[gd]) ; mean_adj[a] = mean(co2a[gd],/nan) ;; p = plot(ages_c[gd],co2ef[gd],symbol='o',sym_size=0.5,linestyle=6,rgb_table=39,vert_colors=cdf[gd]*2.5e3,/sym_filled,/overplot) ; endif ;; if a le 5 then print,a,co2a[gd]-co2e[gd],reform(minmax_err[a,*]) ;endfor ;p = plot(grn_mean_ages_trop_fine,mean_adj,linestyle=2,thick=3,color='blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,minmax_err[*,0],linestyle=1,thick=3,color='blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,minmax_err[*,1],linestyle=1,thick=3,color='blue',/overplot) ;co2e = co2_err_full[*,*,*,i] ;zz = where(finite(ages_full1_co2),nzz) ;chk = where(cdiffs[zz]/co2e[zz] le 0.1,nchk) ;print,nzz,nchk ;p = plot(ages_full1_co2[zz],co2_e_fine2[zz],symbol='o',sym_size=0.5,linestyle=6,rgb_table=39,vert_colors=cdiffs[zz]/co2e[zz]*2.3e2,/sym_filled,/overplot) ;cb = COLORBAR(POSITION=[0.81,0.54,0.83,0.84],tickname=tickname_s3,tickvalues=findgen(6)*46.,RGB_TABLE=rgb,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='$\delta\chi$$_{CO2}$') ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_CO2_convolutions_Nov_zoom2.png' ; ;p = plot(indgen(2),/nodata,xrange=[0,3.5],yrange=[sf6[ii]-0.18,sf6[ii]+0.23],xtitle='Mean Age',ytitle='$\chi$$_{SF6}$ (ppt)',font_size=11) ;minmax = fltarr(n_ages_trop_fine,2) ;for a = 0, n_ages_trop_fine-1 do begin ; minmax[a,0] = min(conv.sf6_e_fine2[a,*,*,tii]) ; minmax[a,1] = max(conv.sf6_e_fine2[a,*,*,tii]) ;endfor ;poly = polygon([grn_mean_ages_trop_fine,reverse(grn_mean_ages_trop_fine)],[minmax[*,0],reverse(minmax[*,1])],/fill_background,/data,fill_color='light grey',color='white') ;p = plot([0,6],replicate(sf6[ii],2),linestyle=2,color='grey',/overplot) ;p = plot([0,6],replicate(sf6[ii]+sf6_e[ii],2),linestyle=1,color='grey',/overplot) ;p = plot([0,6],replicate(sf6[ii]-sf6_e[ii],2),linestyle=1,color='grey',/overplot) ;;p = plot(grn_mean_ages,sf6_tr_et[*,8,tii],color='dark green',thick=2,linestyle=2,/overplot) ;p = plot(grn_mean_ages_trop_fine,sf6[ii]+sf6_bias_yr*flight_sf6_gr[tii[0]],linestyle=2,thick=2,color='blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,sf6[ii]+sf6_e[ii]+sf6_bias_yr*flight_sf6_gr[tii[0]],linestyle=1,thick=2,color='blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,sf6[ii]-sf6_e[ii]+sf6_bias_yr*flight_sf6_gr[tii[0]],linestyle=1,thick=2,color='blue',/overplot) ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_SF6_convolutions_Nov_zoom1.png' ;p = plot(indgen(2),/nodata,xrange=[0,3.1],yrange=[sf6[ii]-0.005,sf6[ii]+0.06],xtitle='Mean Age',ytitle='$\chi$$_{SF6}$ (ppt)',font_size=11) ;minmax = fltarr(n_ages_trop_fine,2) ;for a = 0, n_ages_trop_fine-1 do begin ; minmax[a,0] = min(conv.sf6_e_fine2[a,*,*,tii]) ; minmax[a,1] = max(conv.sf6_e_fine2[a,*,*,tii]) ;endfor ;poly = polygon([grn_mean_ages_trop_fine,reverse(grn_mean_ages_trop_fine)],[minmax[*,0],reverse(minmax[*,1])],/fill_background,/data,fill_color='light grey',color='white') ;sf6_e_fine2 = conv.sf6_e_fine2[*,*,*,tii] ;zz = where(finite(ages_full1_sf6),nzz) ;chk = where(sdiffs[zz]/sf6_e[ii] le 0.1,nchk) ;print,nzz,nchk ;p = plot(ages_full1_sf6[zz],sf6_e_fine2[zz],symbol='o',sym_size=0.5,linestyle=6,rgb_table=39,vert_colors=sdiffs[zz]/sf6_e[ii]*2.3e2,/sym_filled,/overplot) ;p = plot(grn_mean_ages_trop_fine,sf6[ii]+sf6_bias_yr*flight_sf6_gr[tii[0]],linestyle=2,thick=2,color='blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,sf6[ii]+sf6_e[ii]+sf6_bias_yr*flight_sf6_gr[tii[0]],linestyle=1,thick=2,color='blue',/overplot) ;p = plot(grn_mean_ages_trop_fine,sf6[ii]-sf6_e[ii]+sf6_bias_yr*flight_sf6_gr[tii[0]],linestyle=1,thick=2,color='blue',/overplot) ;cb = COLORBAR(POSITION=[0.2,0.54,0.22,0.84],tickname=tickname_s3,tickvalues=findgen(6)*46.,RGB_TABLE=rgb,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='$\delta\chi$$_{SF6}$') ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_SF6_convolutions_Nov_zoom2.png' ;p = plot(indgen(2),/nodata,xrange=[-0.05,3],yrange=[350,365],ytitle='CO$_2$ (ppmv)',xtitle='Mean Age (yrs)',title='Convolution of Surface CO$_2$ with Age Spectra',margin=0.11,font_size=11, $ ; dimensions=[650,400]) ;p = plot([0,4],replicate(co2_adj[ii],2),linestyle=2,/overplot) ;vcols = (lat_grid_entry[ny/2:-1]-lat_grid_entry[ny/2])*2.75 ;vcols[where(vcols gt 250)] = 250 ;for y = ny/2, ny/2-1 do p = plot(grn_mean_ages_trop_fine,co2_entry_ti_fine[*,y,1,di],rgb_table=69,vert_colors=replicate(vcols[y],n_ages),symbol='s',sym_size=1,/sym_filled,linestyle=6,/overplot) ;p = plot(indgen(2),/nodata) ;p = plot(n2o_norm,symbol='o',color='blue',/sym_filled,sym_size=0.5,linestyle=6,/overplot) ;p = plot(n2o_all_norm,symbol='o',color='orange',/sym_filled,sym_size=0.5,linestyle=6,/overplot) ;p = plot(indgen(2),/nodata,yrange=[1,0.1],xtitle='Bias',ytitle='Normalized N2O') ;p = plot([0,0],[1,0.1],linestyle=2,/overplot) ;;;p = errorplot(bins.n2o_norm_sf6_scale_nh[*,0],n2o_norm_grid,bins.n2o_norm_sf6_scale_nh[*,1],replicate(0,nn),symbol='o',color='blue',linestyle=6,errorbar_capsize=0,/overplot) ;for t = 2, 12, 10 do p = errorplot(bins.n2o_norm_sf6_scale_nh_years[*,0,ti[t]],n2o_norm_grid,bins.n2o_norm_sf6_scale_nh_years[*,1,ti[t]],replicate(0,nn),symbol='o',/sym_filled,color=colors[t], $ ; linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins.n2o_norm_co2_scale_nh[*,0],n2o_norm_grid,bins.n2o_norm_co2_scale_nh[*,1],replicate(0,nn),symbol='o',color='orange',linestyle=6,errorbar_capsize=0,/overplot) ;p = plot(indgen(2),/nodata,yrange=[1,0],font_size=11,xtitle='CO$_2$ Bias',ytitle='Normalized N$_2$O',title='CO$_2$ bias based on optimized mean age') ;p = plot([0,0],[1,0],linestyle=2,/overplot) ;p = errorplot(bins_b0.n2o_norm_co2_scale_nh[*,0],n2o_norm_grid,bins_b0.n2o_norm_co2_scale_nh[*,1],replicate(0,nn),symbol='o',/sym_filled,color='sky blue',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins_a0.n2o_norm_co2_scale_nh[*,0],n2o_norm_grid,bins_a0.n2o_norm_co2_scale_nh[*,1],replicate(0,nn),symbol='o',/sym_filled,color='blue',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins.n2o_norm_co2_scale_nh[*,0],n2o_norm_grid,bins.n2o_norm_co2_scale_nh[*,1],replicate(0,nn),symbol='o',/sym_filled,color='orange',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins_a.n2o_norm_co2_scale_nh[*,0],n2o_norm_grid,bins_a.n2o_norm_co2_scale_nh[*,1],replicate(0,nn),symbol='o',/sym_filled,color='red',linestyle=6,errorbar_capsize=0,/overplot) ;t = text(0.8,0.8,'1990s',color='blue',/norm) ;t = text(0.8,0.76,'2020s',color='red',/norm) ;p = plot(indgen(2),/nodata,yrange=[1.03,0],font_size=11,xtitle='SF$_6$ Bias (Fraction of Annual Growth Rate (or Years))',ytitle='Normalized N$_2$O',title='SF$_6$ bias based on optimized mean age') ;p = plot([0,0],[1,0],linestyle=2,/overplot) ;;p = errorplot(bins_b0.n2o_norm_sf6_scale_smin_nh[*,0]/0.2,n2o_norm_grid,bins_b0.n2o_norm_sf6_scale_smin_nh[*,1]/0.2,replicate(0,nn),symbol='o',/sym_filled,color='sky blue',linestyle=6, $ ;; errorbar_capsize=0,/overplot) ;p = errorplot(bins_b0.n2o_norm_sf6_scale_nh[*,0]/0.2,n2o_norm_grid,bins_b0.n2o_norm_sf6_scale_nh[*,1]/0.2,replicate(0,nn),symbol='o',/sym_filled,color='sky blue',linestyle=6,errorbar_capsize=0, $ ; /overplot) ;;p = errorplot(bins_b0.n2o_norm_sf6_scale_nh_coarse[*,0]/0.2,n2o_norm_grid_coarse,bins_b0.n2o_norm_sf6_scale_nh_coarse[*,1]/0.2,replicate(0,nnm),symbol='o',/sym_filled,color='sky blue',linestyle=6, $ ;; errorbar_capsize=0,/overplot) ;;p = errorplot(bins_a0.n2o_norm_sf6_scale_smin_nh[*,0]/0.2,n2o_norm_grid,bins_a0.n2o_norm_sf6_scale_smin_nh[*,1]/0.2,replicate(0,nn),symbol='o',/sym_filled,color='dodger blue',linestyle=6, $ ;; errorbar_capsize=0,/overplot) ;p = errorplot(bins_a0.n2o_norm_sf6_scale_nh[*,0]/0.2,n2o_norm_grid+1e-2,bins_a0.n2o_norm_sf6_scale_nh[*,1]/0.2,replicate(0,nn),symbol='o',/sym_filled,color='blue',linestyle=6,errorbar_capsize=0, $ ; /overplot) ;;p = errorplot(1e2*bins.n2o_norm_sf6_scale_nh[*,0]/11.0,n2o_norm_grid,1e2*bins.n2o_norm_sf6_scale_nh[*,1]/11.0,replicate(0,nn),symbol='o',/sym_filled, $ ;; color='orange',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins_a2.n2o_norm_sf6_scale_nh[*,0]/0.4,n2o_norm_grid,bins_a2.n2o_norm_sf6_scale_nh[*,1]/0.4,replicate(0,nn),symbol='o',/sym_filled,color='red',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins_b2.n2o_norm_sf6_scale_nh[*,0]/0.4,n2o_norm_grid,bins_b2.n2o_norm_sf6_scale_nh[*,1]/0.4,replicate(0,nn),symbol='o',/sym_filled,color='orange',linestyle=6,errorbar_capsize=0, $ ; /overplot) ;;p = errorplot(bins_b2.n2o_norm_sf6_scale_nh_coarse[*,0]/0.4,n2o_norm_grid_coarse,bins_b2.n2o_norm_sf6_scale_nh_coarse[*,1]/0.4,replicate(0,nnm),symbol='o',/sym_filled,color='orange',linestyle=6, $ ;; errorbar_capsize=0,/overplot) ;t = text(0.7,0.7,'1990s Aircraft',font_size=11,color='blue',/norm) ;t = text(0.7,0.66,'1990s Balloon',font_size=11,color='sky blue',/norm) ;t = text(0.7,0.62,'2020s Aircraft',font_size=11,color='red',/norm) ;t = text(0.7,0.58,'2020s Balloon',font_size=11,color='dark orange',/norm) ;p.save,dir+'Plots/Aircraft Mean Ages/SF6_scale_vs_N2O_norm.png' ;p.save,dir+'Plots/Aircraft Mean Ages/SF6_scale_vs_N2O_norm2.png' ;p = plot(indgen(2),/nodata,yrange=[1.01,0.1],font_size=11,xtitle='SF$_6$ Bias (Fraction of Annual Growth Rate (or Years))',ytitle='Normalized N$_2$O',title='SF$_6$ bias based on optimized mean age') ;p = plot([0,0],[1,0],linestyle=2,/overplot) ;p = errorplot(bins_a0.n2o_norm_sf6_scale_nh[*,0]/0.2,n2o_norm_grid,bins_a0.n2o_norm_sf6_scale_nh[*,1]/0.2,replicate(0,nn),symbol='o',/sym_filled,color='sky blue',linestyle=6, $ ; errorbar_capsize=0,/overplot) ;p = errorplot(bins_a0.n2o_norm_sf6_scale_smin_nh[*,0]/0.2,n2o_norm_grid,bins_a0.n2o_norm_sf6_scale_smin_nh[*,1]/0.2,replicate(0,nn),symbol='o',/sym_filled,color='blue',linestyle=6, $ ; errorbar_capsize=0,/overplot) ;p = plot(dat.sf6_scale_opt_all/0.2,n2o_all_norm[chk_c],color='sky blue',symbol='o',/sym_filled,sym_size=0.5,linestyle=6,/overplot) ;s = symbol(dat.sf6_scale_opt_all[i]/0.2,n2o_all_norm[ii],sym_color='pink','s',/sym_filled,sym_size=1.5,/data) ;s = symbol(sf6_scale_opt_all[i]/0.2,n2o_all_norm[ii],sym_color='purple','s',/sym_filled,sym_size=1.5,/data) ;s = symbol(sf6_scale_opt_smin[i]/0.2,n2o_all_norm[ii],sym_color='magenta','s',/sym_filled,sym_size=1.5,/data) ;p = plot(indgen(2),/nodata,yrange=[1.03,0],font_size=11,xtitle='SF$_6$ Scale (Fraction of Annual Growth Rate (or Years))',ytitle='Normalized N$_2$O', $ ; title='ER-2 Missions SF$_6$ scale based on optimized mean age') ;p = plot([0,0],[1,0],linestyle=2,/overplot) ;;for m = 3, 7 do p = errorplot(bins_a0.n2o_norm_sf6_scale_smin_nh_m[*,0,m]/0.2,n2o_norm_grid,bins_a0.n2o_norm_sf6_scale_smin_nh_m[*,1,m]/0.2,replicate(0,nn),symbol='o',/sym_filled, $ ;; color=colors[m],linestyle=6,errorbar_capsize=0,/overplot) ;for m = 3, 7 do p = errorplot(bins_a0.n2o_norm_sf6_scale_nh_m[*,0,m]/0.2,n2o_norm_grid,bins_a0.n2o_norm_sf6_scale_nh_m[*,1,m]/0.2,replicate(0,nn),symbol='o',/sym_filled,color=colors[m], $ ; linestyle=6,errorbar_capsize=0,/overplot) ;for m = 3, 7 do t = text(0.18,0.5-0.04*m,mission_names[m],color=colors[m],font_size=11,/norm) ;p.save,dir+'Plots/Aircraft Mean Ages/SF6_scale_vs_N2O_norm_aircraft_early.png' ;p = plot(indgen(2),/nodata,yrange=[1.03,0],xrange=[-11,11],font_size=12,xtitle='SF$_6$ Offset (% of surface avg)',ytitle='Normalized N$_2$O', $ ; title='Aircraft Mission Avg SF$_6$ Offsets '+ext_yrs[0],xticklen=0.04,yticklen=0.03,dimensions=[470,550]) ;p = plot([0,0],[1,0],linestyle=2,/overplot) ;for m = 3, 3 do p = errorplot(1e2*bins_a0.n2o_norm_sf6_scale_m[*,0,m]/bins_a0.sf6_avg_m[m],n2o_norm_grid,1e2*bins_a0.n2o_norm_sf6_scale_m[*,1,m]/bins_a0.sf6_avg_m[m],replicate(0,nn), $ ; symbol='o',/sym_filled,color=colors[m],linestyle=6,errorbar_capsize=0,/overplot) ;for m = 5, 7 do p = errorplot(1e2*bins_a0.n2o_norm_sf6_scale_m[*,0,m]/bins_a0.sf6_avg_m[m],n2o_norm_grid,1e2*bins_a0.n2o_norm_sf6_scale_m[*,1,m]/bins_a0.sf6_avg_m[m],replicate(0,nn), $ ; symbol='o',/sym_filled,color=colors[m],linestyle=6,errorbar_capsize=0,/overplot) ;for m = 3, 3 do t = text(0.75,0.9-0.035*m,mission_names[m],color=colors[m],font_size=11,/norm) ;for m = 5, 7 do t = text(0.75,0.935-0.035*m,mission_names[m],color=colors[m],font_size=11,/norm) ;p.save,dir+'Plots/Aircraft Mean Ages/SF6_scale_vs_N2O_norm_aircraft_mission_avg_early.png' ;p = plot(indgen(2),/nodata,yrange=[1.03,0],xrange=[-11,11],font_size=12,xtitle='SF$_6$ Offset (% of surface avg)',ytitle='Normalized N$_2$O', $ ; title='Aircraft Mission Avg SF$_6$ Offsets 2021-22',xticklen=0.04,yticklen=0.03,dimensions=[470,550]) ;p = plot([0,0],[1,0],linestyle=2,/overplot) ;for m = 17, 18 do p = errorplot(1e2*bins_a2.n2o_norm_sf6_scale_m[*,0,m]/bins_a2.sf6_avg_m[m],n2o_norm_grid,1e2*bins_a2.n2o_norm_sf6_scale_m[*,1,m]/bins_a2.sf6_avg_m[m],replicate(0,nn), $ ; symbol='o',/sym_filled,color=colors[m-14],linestyle=6,errorbar_capsize=0,/overplot) ;for m = 17, 18 do t = text(0.75,0.8-0.035*(m-17),mission_names[m],color=colors[m-14],font_size=11,/norm) ;p.save,dir+'Plots/Aircraft Mean Ages/SF6_scale_vs_N2O_norm_aircraft_mission_avg_late.png' ;p = plot(indgen(2),/nodata,yrange=[1.03,0],xrange=[-0.02,0.02],font_size=12,xtitle='CO$_2$ Offset (% of surface avg)',ytitle='Normalized N$_2$O', $ ; title='Aircraft Mission Avg CO$_2$ Offsets '+ext_yrs[0],xticklen=0.04,yticklen=0.03,dimensions=[470,550]) ;p = plot([0,0],[1,0],linestyle=2,/overplot) ;for m = 3, 3 do p = errorplot(1e2*bins_a0.n2o_norm_co2_scale_m[*,0,m]/bins_a0.co2_avg_m[m],n2o_norm_grid,1e2*bins_a0.n2o_norm_co2_scale_m[*,1,m]/bins_a0.co2_avg_m[m],replicate(0,nn), $ ; symbol='o',/sym_filled,color=colors[m],linestyle=6,errorbar_capsize=0,/overplot) ;for m = 5, 7 do p = errorplot(1e2*bins_a0.n2o_norm_co2_scale_m[*,0,m]/bins_a0.co2_avg_m[m],n2o_norm_grid,1e2*bins_a0.n2o_norm_co2_scale_m[*,1,m]/bins_a0.co2_avg_m[m],replicate(0,nn), $ ; symbol='o',/sym_filled,color=colors[m],linestyle=6,errorbar_capsize=0,/overplot) ;for m = 3, 3 do t = text(0.75,0.9-0.035*m,mission_names[m],color=colors[m],font_size=11,/norm) ;for m = 5, 7 do t = text(0.75,0.935-0.035*m,mission_names[m],color=colors[m],font_size=11,/norm) ;p.save,dir+'Plots/Aircraft Mean Ages/CO2_scale_vs_N2O_norm_aircraft_mission_avg_early.png' ;p = plot(indgen(2),/nodata,yrange=[1.03,0],xrange=[-0.02,0.02],font_size=12,xtitle='CO$_2$ Offset (% of surface avg)',ytitle='Normalized N$_2$O', $ ; title='Aircraft Mission Avg CO$_2$ Offsets 2021-22',xticklen=0.04,yticklen=0.03,dimensions=[470,550]) ;p = plot([0,0],[1,0],linestyle=2,/overplot) ;for m = 17, 18 do p = errorplot(1e2*bins_a2.n2o_norm_co2_scale_m[*,0,m]/bins_a2.co2_avg_m[m],n2o_norm_grid,1e2*bins_a2.n2o_norm_co2_scale_m[*,1,m]/bins_a2.co2_avg_m[m],replicate(0,nn), $ ; symbol='o',/sym_filled,color=colors[m-14],linestyle=6,errorbar_capsize=0,/overplot) ;for m = 17, 18 do t = text(0.75,0.8-0.035*(m-17),mission_names[m],color=colors[m-14],font_size=11,/norm) ;p.save,dir+'Plots/Aircraft Mean Ages/CO2_scale_vs_N2O_norm_aircraft_mission_avg_late.png' ;p = plot(indgen(2),/nodata,yrange=[1.03,0],xrange=[-11,11],font_size=12,xtitle='SF$_6$ Offset (% of surface avg)',ytitle='Normalized N$_2$O',title='Balloon SF$_6$ Offsets 1996-2000', $ ; xticklen=0.04,yticklen=0.03,dimensions=[470,550]) ;p = plot([0,0],[1,0],linestyle=2,/overplot) ;for m = 0, 7 do p = errorplot(1e2*bins_b0.n2o_norm_sf6_scale_m[*,0,m]/bins_b0.sf6_avg_m[m],n2o_norm_grid,1e2*bins_b0.n2o_norm_sf6_scale_m[*,1,m]/bins_b0.sf6_avg_m[m],replicate(0,nn), $ ; symbol='o',/sym_filled,color=colors[m],linestyle=6,errorbar_capsize=0,/overplot) ;p.save,dir+'Plots/Balloon Mean Ages/SF6_scale_vs_N2O_norm_balloon_mission_avg_early.png' ;p = plot(indgen(2),/nodata,yrange=[1.03,0],xrange=[-11,11],font_size=12,xtitle='SF$_6$ Offset (% of surface avg)',ytitle='Normalized N$_2$O',title='Balloon SF$_6$ Offsets 1996-2000', $ ; xticklen=0.04,yticklen=0.03,dimensions=[470,550]) ;p = plot([0,0],[1,0],linestyle=2,/overplot) ;p = errorplot(1e2*bins_b0.n2o_norm_sf6_scale_all[*,0]/bins_b0.sf6_avg_m[2],n2o_norm_grid,1e2*bins_b0.n2o_norm_sf6_scale_all[*,1]/bins_b0.sf6_avg_m[2],replicate(0,nn), $ ; symbol='o',/sym_filled,color='blue',linestyle=6,errorbar_capsize=0,/overplot) ;p.save,dir+'Plots/Balloon Mean Ages/SF6_scale_vs_N2O_norm_balloon_avg_early.png' ;p = plot(indgen(2),/nodata,yrange=[1.03,0],xrange=[-11,11],font_size=12,xtitle='SF$_6$ Offset (% of surface avg)',ytitle='Normalized N$_2$O',title='AirCore SF$_6$ Offsets 2021-23', $ ; xticklen=0.04,yticklen=0.03,dimensions=[470,550]) ;p = plot([0,0],[1,0],linestyle=2,/overplot) ;p = errorplot(1e2*bins_b2.n2o_norm_sf6_scale_all[*,0]/bins_b2.sf6_avg_m[4],n2o_norm_grid,1e2*bins_b2.n2o_norm_sf6_scale_all[*,1]/bins_b2.sf6_avg_m[4],replicate(0,nn), $ ; symbol='o',/sym_filled,color='blue',linestyle=6,errorbar_capsize=0,/overplot) ;p.save,dir+'Plots/Balloon Mean Ages/SF6_scale_vs_N2O_norm_balloon_mission_avg_late.png' ;p = plot(indgen(2),/nodata,yrange=[1.03,0],xrange=[-0.02,0.02],font_size=12,xtitle='CO$_2$ Offset (% of surface avg)',ytitle='Normalized N$_2$O',title='Balloon CO$_2$ Offsets 1996-2000', $ ; xticklen=0.04,yticklen=0.03,dimensions=[470,550]) ;p = plot([0,0],[1,0],linestyle=2,/overplot) ;for m = 0, 2 do p = errorplot(1e2*bins_b0.n2o_norm_co2_scale_m[*,0,m]/bins_b0.co2_avg_m[m],n2o_norm_grid,1e2*bins_b0.n2o_norm_co2_scale_m[*,1,m]/bins_b0.co2_avg_m[m],replicate(0,nn), $ ; symbol='o',/sym_filled,color=colors[m],linestyle=6,errorbar_capsize=0,/overplot) ;for m = 5, 7 do p = errorplot(1e2*bins_b0.n2o_norm_co2_scale_m[*,0,m]/bins_b0.co2_avg_m[m],n2o_norm_grid,1e2*bins_b0.n2o_norm_co2_scale_m[*,1,m]/bins_b0.co2_avg_m[m],replicate(0,nn), $ ; symbol='o',/sym_filled,color=colors[m],linestyle=6,errorbar_capsize=0,/overplot) ;for m = 0, 2 do t = text(0.7,0.8-0.035*m,oms_dates[m],color=colors[m],font_size=11,/norm) ;for m = 5, 7 do t = text(0.7,0.87-0.035*m,oms_dates[m],color=colors[m],font_size=11,/norm) ;p.save,dir+'Plots/Balloon Mean Ages/CO2_scale_vs_N2O_norm_balloon_mission_avg_early.png' ;p = plot(indgen(2),/nodata,yrange=[1.03,0],xrange=[-0.02,0.02],font_size=12,xtitle='CO$_2$ Offset (% of surface avg)',ytitle='Normalized N$_2$O',title='Balloon CO$_2$ Offsets 1996-2000', $ ; xticklen=0.04,yticklen=0.03,dimensions=[470,550]) ;p = plot([0,0],[1,0],linestyle=2,/overplot) ;p = errorplot(1e2*bins_b0.n2o_norm_co2_scale_all[*,0]/bins_b0.co2_avg_m[2],n2o_norm_grid,1e2*bins_b0.n2o_norm_co2_scale_all[*,1]/bins_b0.co2_avg_m[2],replicate(0,nn), $ ; symbol='o',/sym_filled,color='blue',linestyle=6,errorbar_capsize=0,/overplot) ;p.save,dir+'Plots/Balloon Mean Ages/CO2_scale_vs_N2O_norm_balloon_mission_avg_early.png' ;p = plot(indgen(2),/nodata,yrange=[1.03,0],xrange=[-0.02,0.02],font_size=12,xtitle='CO$_2$ Offset (% of surface avg)',ytitle='Normalized N$_2$O',title='AirCore CO$_2$ Offsets 2021-23', $ ; xticklen=0.04,yticklen=0.03,dimensions=[470,550]) ;p = plot([0,0],[1,0],linestyle=2,/overplot) ;p = errorplot(1e2*bins_b2.n2o_norm_co2_scale_all[*,0]/bins_b2.co2_avg_m[4],n2o_norm_grid,1e2*bins_b2.n2o_norm_co2_scale_all[*,1]/bins_b2.co2_avg_m[4],replicate(0,nn), $ ; symbol='o',/sym_filled,color='blue',linestyle=6,errorbar_capsize=0,/overplot) ;p.save,dir+'Plots/Balloon Mean Ages/CO2_scale_vs_N2O_norm_balloon_mission_avg_late.png' ;p = plot(indgen(2),/nodata,yrange=[1.03,0],xrange=[-0.5,0.3],font_size=11,xtitle='SF$_6$ Scale (ppt)',ytitle='Normalized N$_2$O',title='ER-2 Missions SF$_6$ scale based on optimized mean age') ;p = plot([0,0],[1,0],linestyle=2,/overplot) ;for m = 3, 7 do p = errorplot(bins_a0.n2o_norm_sf6_scale_nh_m[*,0,m],n2o_norm_grid,bins_a0.n2o_norm_sf6_scale_nh_m[*,1,m],replicate(0,nn),symbol='o',/sym_filled,color=colors[m], $ ; linestyle=6,errorbar_capsize=0,/overplot) ;for m = 3, 7 do t = text(0.18,0.5-0.04*m,mission_names[m],color=colors[m],font_size=11,/norm) ;p = plot(indgen(2),/nodata,yrange=[1.03,0],font_size=11,xtitle='SF$_6$ Scale (Fraction of Annual Growth Rate (or Years))',ytitle='Normalized N$_2$O', $ ; title='Balloon SF$_6$ scale based on optimized mean age') ;p = plot([0,0],[1,0],linestyle=2,/overplot) ;for m = 0, 7 do p = errorplot(bins_b0.n2o_norm_sf6_scale_nh_m[*,0,m]/0.2,n2o_norm_grid,bins_b0.n2o_norm_sf6_scale_nh_m[*,1,m]/0.2,replicate(0,nn),symbol='o',/sym_filled,color=colors[m], $ ; linestyle=6,errorbar_capsize=0,/overplot) ;for m = 0, 7 do t = text(0.18,0.5-0.04*m,oms_dates[m],color=colors[m],font_size=11,/norm) ;p.save,dir+'Plots/Aircraft Mean Ages/SF6_scale_vs_N2O_norm_balloon_early.png' ;p = plot(indgen(2),/nodata,yrange=[1.03,0],xrange=[-0.05,0.03],font_size=11,xtitle='CO$_2$ Scale (ppm)',ytitle='Normalized N$_2$O',title='ER-2 Missions CO$_2$ scale based on optimized mean age') ;p = plot([0,0],[1,0],linestyle=2,/overplot) ;for m = 3, 7 do p = errorplot(bins_a0.n2o_norm_co2_scale_nh_m[*,0,m],n2o_norm_grid,bins_a0.n2o_norm_co2_scale_nh_m[*,1,m],replicate(0,nn),symbol='o',/sym_filled,color=colors[m], $ ; linestyle=6,errorbar_capsize=0,/overplot) ;for m = 3, 7 do t = text(0.18,0.5-0.04*m,mission_names[m],color=colors[m],font_size=11,/norm) ;p = plot(indgen(2),/nodata,yrange=[1.03,0.1],xtitle='Mean Age',ytitle='Normalized N2O') ;gd = where(bins_co2_a0.n2o_norm_age_all_nh[*,0] le 3.6 and bins_co2_a0.n2o_norm_age_all_nh[*,0] ge 2.75) ;print,n2o_norm_grid[gd],bins_co2_a0.n2o_norm_age_all_nh[gd,*] ;gd = where(bins_sf6_a2.n2o_norm_age_all_nh[*,0] le 3.6 and bins_sf6_a2.n2o_norm_age_all_nh[*,0] ge 2.75) ;print,n2o_norm_grid[gd],bins_sf6_a2.n2o_norm_age_all_nh[gd,*] n2o_a = 313. * n2o_norm_grid n2o_age_engel = 6.03 - 0.0136*n2o_a + 8.5892e-5*n2o_a^2 - 3.38e-7*n2o_a^3 gd = where(n2o_age_engel le 3.6 and n2o_age_engel ge 2.75) ;print,n2o_norm_grid[gd],n2o_age_engel[gd] ;print,6.03 - 0.0136*223. + 8.5892e-5*223.^2 - 3.38e-7*223.^3 ;p = plot(indgen(2),/nodata,xrange=[1985,2025],yrange=[210,270],font_size=11,xtitle='Year',ytitle='N$_2$O (ppb)',title='N$_2$O at 3 year old mean age') ;gd = where(n2o_date ge 1995 and n2o_date le 2000.5,ngd) ;p = errorplot(n2o_date[gd[indgen(ngd/4)*4]],0.815*n2o_global[gd[indgen(ngd/4)*4]],replicate(0,ngd/4),0.02*n2o_global[gd[indgen(ngd/4)*4]],thick=3,color='blue',errorbar_capsize=0,/overplot) ;p = errorplot(n2o_date[gd[indgen(ngd/5)*5]],0.79*n2o_global[gd[indgen(ngd/5)*5]],replicate(0,ngd/5),0.02*n2o_global[gd[indgen(ngd/5)*5]],thick=3,color='sky blue',errorbar_capsize=0,/overplot) ;gd = where(n2o_date ge 2020,ngd) ;p = errorplot(n2o_date[gd[indgen(ngd/4)*4]],0.745*n2o_global[gd[indgen(ngd/4)*4]],replicate(0,ngd/4),0.015*n2o_global[gd[indgen(ngd/4)*4]],thick=3,color='red',errorbar_capsize=0,/overplot) ;p = errorplot(n2o_date[gd[indgen(ngd/5)*5]],0.72*n2o_global[gd[indgen(ngd/5)*5]],replicate(0,ngd/5),0.015*n2o_global[gd[indgen(ngd/5)*5]],thick=3,color='orange',errorbar_capsize=0,/overplot) ;p = plot(n2o_date,0.77*n2o_global,thick=3,color='magenta',/overplot) ;p = plot(n2o_date,0.715*n2o_global,thick=3,color='pink',/overplot) ;t = text(0.48,0.8,'ER-2 1990s',color='blue',font_size=11,/norm) ;t = text(0.48,0.76,'0.815+/-0.02 N$_2$O',color='blue',font_size=11,/norm) ;t = text(0.48,0.72,'-3 months',color='sky blue',font_size=11,/norm) ;t = text(0.48,0.68,'0.79+/-0.02 N$_2$O',color='sky blue',font_size=11,/norm) ;t = text(0.68,0.32,'ER-2 2020s',color='red',font_size=11,/norm) ;t = text(0.68,0.28,'0.745+/-0.015 N$_2$O',color='red',font_size=11,/norm) ;t = text(0.68,0.24,'-3 months',color='orange',font_size=11,/norm) ;t = text(0.68,0.2,'0.72+/-0.015 N$_2$O',color='orange',font_size=11,/norm) ;t = text(0.18,0.41,'Engel 3yr (0.77 N$_2$O)',color='magenta',font_size=11,/norm) ;t = text(0.18,0.35,'Engel 3.5yr (0.715 N$_2$O)',color='pink',font_size=11,/norm) ;p.save,dir+'Plots/Aircraft Mean Ages/N2O_time_series_from_age.png' ;p = plot(indgen(2),/nodata,yrange=[1.03,0],xtitle='Mean Age',ytitle='Normalized N2O') ;p = errorplot(bins.n2o_norm_age_all_nh[*,0],n2o_norm_grid,bins.n2o_norm_age_all_nh[*,1],replicate(0,nn),symbol='o',/sym_filled,color='dodger blue',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins_a0.n2o_norm_age_all_nh[*,0],n2o_norm_grid,bins_a0.n2o_norm_age_all_nh[*,1],replicate(0,nn),symbol='o',/sym_filled,color='blue',linestyle=6,errorbar_capsize=0,/overplot) ;p = plot(dat.age_opt_all,n2o_all_norm[chk_c],color='sky blue',symbol='o',/sym_filled,sym_size=0.5,linestyle=6,/overplot) ;s = symbol(dat.age_opt_all[i],n2o_all_norm[ii],sym_color='pink','s',/sym_filled,sym_size=1.5,/data) ;s = symbol(age_opt_all[i],n2o_all_norm[ii],sym_color='purple','s',/sym_filled,sym_size=1.5,/data) ;s = symbol(age_opt_smin[i],n2o_all_norm[ii],sym_color='magenta','s',/sym_filled,sym_size=1.5,/data) ;p = errorplot(bins_co2.n2o_norm_age_all_nh[*,0],n2o_norm_grid,bins_co2.n2o_norm_age_all_nh[*,1],replicate(0,nn),symbol='o',/sym_filled,color='orange',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins_co2a.n2o_norm_age_all_nh[*,0],n2o_norm_grid,bins_co2a.n2o_norm_age_all_nh[*,1],replicate(0,nn),symbol='o',/sym_filled,color='dark orange',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(ages[0:5e3],n2o_norm[ico2[0:5e3]],ages_sd[0:5e3],replicate(0,5e3+1),symbol='o',/sym_filled,color='blue',linestyle=6,errorbar_capsize=0,/overplot) ;for t = 13, 13 do p = errorplot(bins.n2o_norm_age_all_nh_years[*,0,ti[t]],n2o_norm_grid,bins.n2o_norm_age_all_nh_years[*,1,ti[t]],replicate(0,nn),symbol='o',/sym_filled,color=colors[t], $ ; linestyle=6,errorbar_capsize=0,/overplot) ;for t = 13, 13 do p = errorplot(bins_co2.n2o_norm_age_all_nh_years[*,0,ti[t]],n2o_norm_grid,bins_co2.n2o_norm_age_all_nh_years[*,1,ti[t]],replicate(0,nn),symbol='s',/sym_filled,color=colors[t], $ ; linestyle=6,errorbar_capsize=0,/overplot) ;p = plot(dat_co2.age_opt_all,n2o_norm[ico2],symbol='o',color='sky blue',linestyle=6,sym_size=0.5,/overplot) ;;p = errorplot(bins.n2o_norm_age_all_tr[*,0],n2o_norm_grid,bins.n2o_norm_age_all_tr[*,1],replicate(0,nn),symbol='o',color='sky blue',linestyle=6,errorbar_capsize=0,/overplot) ;for m = 0, 8 do p = errorplot(bins_sf6.n2o_norm_age_all_nh_m[*,0,m],n2o_norm_grid,bins_sf6.n2o_norm_age_all_nh_m[*,1,m],replicate(0,nn),symbol='o',/sym_filled,color=colors[m], $ ; linestyle=6,errorbar_capsize=0,/overplot) ;p = plot(indgen(2),/nodata,yrange=[1.03,0],xrange=[0,7],font_size=11,xtitle='Mean Age',ytitle='Normalized N$_2$O',title='Optimized Mean Ages') ;p = errorplot(bins_a0.n2o_norm_age_all_nh[*,0],n2o_norm_grid,bins_a0.n2o_norm_age_all_nh[*,1],replicate(0,nn),symbol='o',/sym_filled,color='sky blue',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins_a0.n2o_norm_age_smin_nh[*,0],n2o_norm_grid,bins_a0.n2o_norm_age_smin_nh[*,1],replicate(0,nn),symbol='o',/sym_filled,color='dodger blue',linestyle=6,errorbar_capsize=0,/overplot) ;;p = errorplot(bins_co2.n2o_norm_age_all_nh[*,0],n2o_norm_grid,bins_co2.n2o_norm_age_all_nh[*,1],replicate(0,nn),symbol='o',/sym_filled,color='sky blue',linestyle=6,errorbar_capsize=0,/overplot) ;;p = errorplot(bins_co2.n2o_norm_age_all_nh_adj[*,0],n2o_norm_grid,bins_co2.n2o_norm_age_all_nh_adj[*,1],replicate(0,nn),symbol='o',color='lime green',linestyle=6,errorbar_capsize=0, $ ;; /overplot) ;p = errorplot(bins_b0.n2o_norm_age_all_nh[*,0],n2o_norm_grid,bins_b0.n2o_norm_age_all_nh[*,1],replicate(0,nn),symbol='o',/sym_filled,color='sky blue',linestyle=6,errorbar_capsize=0,/overplot) ;;p = errorplot(bins_b0.n2o_norm_age_smin_nh[*,0],n2o_norm_grid,bins_b0.n2o_norm_age_smin_nh[*,1],replicate(0,nn),symbol='o',/sym_filled,color='lime green',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins_co2_b0.n2o_norm_age_all_nh[*,0],n2o_norm_grid,bins_co2_b0.n2o_norm_age_all_nh[*,1],replicate(0,nn),symbol='o',/sym_filled,color='sky blue',linestyle=6,errorbar_capsize=0, $ ; /overplot) ;p = errorplot(bins_co2_a0.n2o_norm_age_all_nh[*,0],n2o_norm_grid,bins_co2_a0.n2o_norm_age_all_nh[*,1],replicate(0,nn),symbol='o',/sym_filled,color='blue',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins_co2_a0.n2o_norm_age_all_nh_early[*,0],n2o_norm_grid,bins_co2_a0.n2o_norm_age_all_nh_early[*,1],replicate(0,nn),symbol='o',/sym_filled,color='green',linestyle=6, $ ; errorbar_capsize=0,/overplot) ;p = errorplot(bins_co2_a0.n2o_norm_age_all_nh_late[*,0],n2o_norm_grid,bins_co2_a0.n2o_norm_age_all_nh_late[*,1],replicate(0,nn),symbol='o',/sym_filled,color='lime green',linestyle=6, $ ; errorbar_capsize=0,/overplot) ;p = errorplot(bins_co2_a0.n2o_norm_age_all_nh_adj[*,0],n2o_norm_grid,bins_co2_a0.n2o_norm_age_all_nh_adj[*,1],replicate(0,nn),symbol='o',color='green',linestyle=6,errorbar_capsize=0,/overplot) ;p = plot(aoa_mean_aircraft_sample,n2o_norm_grid_model,symbol='o',color='blue',/overplot) ;p = plot(aoa_mean_balloon_sample,n2o_norm_grid_model,symbol='o',color='sky blue',/overplot) ;p = errorplot(bins_a2.n2o_norm_age_all_nh[*,0],n2o_norm_grid,bins_a2.n2o_norm_age_all_nh[*,1],replicate(0,nn),symbol='o',/sym_filled,color='orange',linestyle=6,errorbar_capsize=0,/overplot) ;p = plot(n2o_norm_age_sm,n2o_norm_grid[gdb],thick=2,color='dark orange',/overplot) ;p = errorplot(bins_b2.n2o_norm_age_all_nh[*,0],n2o_norm_grid,bins_b2.n2o_norm_age_all_nh[*,1],replicate(0,nn),symbol='o',/sym_filled,color='orange',linestyle=6,errorbar_capsize=0,/overplot) ;p = plot(dat.age_opt_all,n2o_norm[chk_c],symbol='o',color='magenta',linestyle=6,/sym_filled,sym_size=0.5,/overplot) ;p = errorplot(bins_co2_b2.n2o_norm_age_all_nh[*,0],n2o_norm_grid,bins_co2_b2.n2o_norm_age_all_nh[*,1],replicate(0,nn),symbol='o',/sym_filled,color='orange',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins_co2_b2.n2o_norm_age_all_nh_adj[*,0],n2o_norm_grid,bins_co2_b2.n2o_norm_age_all_nh_adj[*,1],replicate(0,nn),symbol='o',color='dark orange',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(ages,n2o_norm[isf6],ages_sd,replicate(0,nsf6),symbol='o',/sym_filled,color='blue',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins_co2.n2o_norm_age_opt_co2_nh_anoms_adj[*,0],n2o_norm_grid,bins_co2.n2o_norm_age_opt_co2_nh_anoms_adj[*,1],replicate(0,nn),symbol='o',/sym_filled,color='lime green',linestyle=6, $ ;;; errorbar_capsize=0,/overplot) ;p = errorplot(bins.n2o_norm_age_all_nh[*,0],n2o_norm_grid,bins.n2o_norm_age_all_nh[*,1],replicate(0,nn),symbol='o',/sym_filled,color='orange',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bin_ages,n2o_norm_grid,bins.n2o_norm_age_all_nh[*,1],replicate(0,nn),symbol='o',/sym_filled,color='lime green',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins_sf6_a2.n2o_norm_age_all_nh[*,0],n2o_norm_grid,bins_sf6_a2.n2o_norm_age_all_nh[*,1],replicate(0,nn),symbol='o',/sym_filled,color='red',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins_sf6_a2.n2o_norm_age_all_nh_adj[*,0],n2o_norm_grid,bins_sf6_a2.n2o_norm_age_all_nh_adj[*,1],replicate(0,nn),symbol='o',color='purple',linestyle=6,errorbar_capsize=0, $ ; /overplot) ;p = plot(n2o_age_a,n2o_norm_grid,thick=2,color='sky blue',/overplot) ;p = plot(n2o_age_engel,n2o_norm_grid,thick=2,color='magenta',/overplot) ;t = text(0.22,0.8,'ER-2 1990s Ray',color='blue',font_size=11,/norm) ;t = text(0.22,0.76,'ER-2 2020s Ray',color='red',font_size=11,/norm) ;;t = text(0.22,0.8,'ER-2 1990s Ray -3 months',color='blue',font_size=11,/norm) ;;t = text(0.22,0.76,'ER-2 2020s Ray -3 months',color='red',font_size=11,/norm) ;t = text(0.22,0.72,'Engel 2002',color='magenta',font_size=11,/norm) ;t = text(0.22,0.68,'Andrews 2001',color='sky blue',font_size=11,/norm) ;;p.save,dir+'Plots/Aircraft Mean Ages/Mean_age_vs_N2O_norm.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Mean_age_vs_N2O_norm2.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Mean_age_vs_N2O_norm_shift.png' ;p = plot(indgen(2),/nodata,yrange=[1.03,0],xrange=[0,7.5],font_size=11,xtitle='Mean Age',ytitle='Normalized N$_2$O',title='Aircraft Mean Ages vs. N$_2$O '+ext_yrs[0]) ;;p = errorplot(bins_co2_a0.n2o_norm_age_all_tr[*,0],n2o_norm_grid,bins_co2_a0.n2o_norm_age_all_tr[*,1],replicate(0,nn),symbol='o',/sym_filled,color='sky blue',linestyle=6,errorbar_capsize=0, $ ;; /overplot) ;p = errorplot(bins_sf6.n2o_norm_sf6_age[*,0],n2o_norm_grid,bins_sf6.n2o_norm_sf6_age[*,1],replicate(0,nn),symbol='o',/sym_filled,color='lime green',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins_sf6.n2o_norm_sf6_age_adj[*,0],n2o_norm_grid,bins_sf6.n2o_norm_sf6_age_adj[*,1],replicate(0,nn),symbol='o',/sym_filled,color='green',linestyle=6,errorbar_capsize=0,/overplot) ;;p = errorplot(bins_sf6.n2o_norm_sf6_age_vt[*,0],n2o_norm_grid,bins_sf6.n2o_norm_sf6_age_vt[*,1],replicate(0,nn),symbol='o',/sym_filled,color='lime green',linestyle=6,errorbar_capsize=0,/overplot) ;;p = errorplot(bins.n2o_norm_sf6_age_tr[*,0],n2o_norm_grid,bins.n2o_norm_sf6_age_tr[*,1],replicate(0,nn),symbol='o',/sym_filled,color='lime green',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins_co2_a0.n2o_norm_co2_age[*,0],n2o_norm_grid,bins_co2_a0.n2o_norm_co2_age[*,1],replicate(0,nn),symbol='o',/sym_filled,color='orange',linestyle=6,errorbar_capsize=0,/overplot) ;p = plot(n2o_age_a,n2o_norm_grid,thick=2,color='dark orange',/overplot) ;p = errorplot(bins_co2_a0.n2o_norm_age_all[*,0],n2o_norm_grid,bins_co2_a0.n2o_norm_age_all[*,1],replicate(0,nn),symbol='o',/sym_filled,color='blue',linestyle=6,errorbar_capsize=0,/overplot) ;t = text(0.22,0.8,'This study',color='blue',font_size=11,/norm) ;t = text(0.22,0.76,'from CO$_2$ (Andrews et al.)',color='orange',font_size=11,/norm) ;t = text(0.22,0.72,'from SF$_6$ (Volk et al.)',color='lime green',font_size=11,/norm) ;t = text(0.22,0.68,'from SF$_6$ Adjusted',color='green',font_size=11,/norm) ;p.save,dir+'Plots/Aircraft Mean Ages/Mean_age_vs_N2O_norm_old_vs_new.png' ;p = plot(indgen(2),/nodata,yrange=[1.03,0],xrange=[0,8],font_size=11,xtitle='Mean Age',ytitle='Normalized N$_2$O',title='Aircraft Mean Ages vs. N$_2$O '+ext_yrs[0]) ;;for m = 0, 7 do p = errorplot(bins_co2_a0.n2o_norm_age_all_m[*,0,m],n2o_norm_grid,bins_co2_a0.n2o_norm_age_all_m[*,1,m],replicate(0,nn),symbol='o',/sym_filled,color=colors[m],linestyle=6, $ ;; errorbar_capsize=0,/overplot) ;;for m = 0, 7 do p = errorplot(bins_co2.n2o_norm_co2_age_m[*,0,m],n2o_norm_grid,bins_co2.n2o_norm_co2_age_m[*,1,m],replicate(0,nn),symbol='o',/sym_filled,color=colors[m],linestyle=6, $ ;; errorbar_capsize=0,/overplot) ;for m = 0, 8 do p = errorplot(bins_sf6.n2o_norm_sf6_age_m[*,0,m],n2o_norm_grid,bins_sf6.n2o_norm_sf6_age_m[*,1,m],replicate(0,nn),symbol='o',/sym_filled,color=colors[m],linestyle=6, $ ; errorbar_capsize=0,/overplot) ;for m = 0, 8 do p = errorplot(bins_sf6.n2o_norm_sf6_lag_age_m[*,0,m],n2o_norm_grid,bins_sf6.n2o_norm_sf6_lag_age_m[*,1,m],replicate(0,nn),symbol='o',color=colors[m],linestyle=6, $ ; errorbar_capsize=0,/overplot) ;;for m = 0, 7 do p = errorplot(bins.n2o_norm_sf6_lag_age_vx_m[*,0,m],n2o_norm_grid,bins.n2o_norm_sf6_lag_age_vx_m[*,1,m],replicate(0,nn),symbol='o',/sym_filled,color=colors[m],linestyle=6, $ ;; errorbar_capsize=0,/overplot) ;;for m = 0, 7 do p = errorplot(bins_sf6.n2o_norm_sf6_lag_age_bias_corr_m[*,0,m],n2o_norm_grid,bins_sf6.n2o_norm_sf6_lag_age_bias_corr_m[*,1,m],replicate(0,nn),symbol='o',color=colors[m],linestyle=6, $ ;; errorbar_capsize=0,/overplot) ;;for m = 0, 7 do p = errorplot(bins_sf6.n2o_norm_sf6_age_adj_m[*,0,m],n2o_norm_grid,bins_sf6.n2o_norm_sf6_age_adj_m[*,1,m],replicate(0,nn),symbol='o',color=colors[m],linestyle=6, $ ;; errorbar_capsize=0,/overplot) ;for m = 3, 3 do t = text(0.18,0.9-0.035*m,mission_names[m],color=colors[m],font_size=11,/norm) ;for m = 5, 7 do t = text(0.18,0.935-0.035*m,mission_names[m],color=colors[m],font_size=11,/norm) ;t = text(0.35,0.8,'SF6 Orig Calc (filled circ)',color='black',font_size=11,/norm) ;t = text(0.35,0.76,'SF6 Simple lag (open circ)',color='black',font_size=11,/norm) ;;t = text(0.28,0.8,'CO2 orig Calc (filled circ)',color='black',font_size=11,/norm) ;;t = text(0.28,0.8,'New opt age (filled circ)',color='black',font_size=11,/norm) ;;t = text(0.28,0.76,'SF6 lag bias corr (open circ)',color='black',font_size=11,/norm) ;;p.save,dir+'Plots/Aircraft Mean Ages/Mean_age_vs_N2O_norm_SF6_orig.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Mean_age_vs_N2O_norm_SF6_orig2.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Mean_age_vs_N2O_norm_CO2_orig.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Mean_age_vs_N2O_norm_CO2_orig_SF6_lag_bias_corr.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Mean_age_vs_N2O_norm_Opt_and_SF6_lag_bias_corr.png' ;p = plot(indgen(2),/nodata,yrange=[1.03,0],xrange=[0,7],font_size=11,xtitle='Mean Age',ytitle='Normalized N$_2$O',title='Aircraft Mean Ages vs. N$_2$O') ;p = errorplot(bins_co2_a0.n2o_norm_co2_lag_age[*,0],n2o_norm_grid,bins_co2_a0.n2o_norm_co2_lag_age[*,1],replicate(0,nn),symbol='tu',color='sky blue',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins_a0.n2o_norm_co2_lag_age[*,0],n2o_norm_grid,bins_a0.n2o_norm_co2_lag_age[*,1],replicate(0,nn),symbol='o',color='blue',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins_a0.n2o_norm_age_all[*,0],n2o_norm_grid,bins_a0.n2o_norm_age_all[*,1],replicate(0,nn),symbol='o',/sym_filled,color='blue',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins_co2_a2.n2o_norm_co2_lag_age[*,0],n2o_norm_grid,bins_co2_a2.n2o_norm_co2_lag_age[*,1],replicate(0,nn),symbol='tu',color='orange',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins_a2.n2o_norm_co2_lag_age[*,0],n2o_norm_grid,bins_a2.n2o_norm_co2_lag_age[*,1],replicate(0,nn),symbol='o',color='red',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins_a2.n2o_norm_age_all[*,0],n2o_norm_grid,bins_a2.n2o_norm_age_all[*,1],replicate(0,nn),symbol='o',/sym_filled,color='red',linestyle=6,errorbar_capsize=0,/overplot) ;t = text(0.2,0.8,'1990s',color='blue',font_size=11,/norm) ;t = text(0.2,0.76,'opt age (fill)',color='blue',font_size=11,/norm) ;t = text(0.2,0.72,'CO2 lag age (open)',color='blue',font_size=11,/norm) ;t = text(0.2,0.68,'CO2 lag age all',color='sky blue',font_size=11,/norm) ;t = text(0.2,0.64,'2020s',color='red',font_size=11,/norm) ;t = text(0.2,0.6,'opt age (fill)',color='red',font_size=11,/norm) ;t = text(0.2,0.56,'CO2 lag age (open)',color='red',font_size=11,/norm) ;t = text(0.2,0.52,'CO2 lag age all',color='orange',font_size=11,/norm) ;p.save,dir+'Plots/Aircraft Mean Ages/Mean_age_vs_N2O_norm_compare_old_new_with_lag.png' ;p = plot(indgen(2),/nodata,yrange=[1.03,0],xrange=[0,7],font_size=11,xtitle='Mean Age',ytitle='Normalized N$_2$O',title='Balloon Mean Ages vs. N$_2$O') ;p = plot(bins_co2_b0.n2o_norm_co2_lag_age[*,0],n2o_norm_grid,symbol='tu',color='sky blue',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins_b0.n2o_norm_co2_lag_age[*,0],n2o_norm_grid,bins_b0.n2o_norm_co2_lag_age[*,1],replicate(0,nn),symbol='o',color='blue',linestyle=6,errorbar_capsize=0,/overplot) ;;p = errorplot(bins_b0.n2o_norm_age_all[*,0],n2o_norm_grid,bins_b0.n2o_norm_age_all[*,1],replicate(0,nn),symbol='o',/sym_filled,color='blue',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins_co2_b0.n2o_norm_age_all[*,0],n2o_norm_grid,bins_co2_b0.n2o_norm_age_all[*,1],replicate(0,nn),symbol='o',/sym_filled,color='blue',linestyle=6,errorbar_capsize=0,/overplot) ;p = plot(bins_co2_b2.n2o_norm_co2_lag_age[*,0],n2o_norm_grid,symbol='tu',color='orange',linestyle=6,errorbar_capsize=0,/overplot) ;p = plot(bins_b2.n2o_norm_co2_lag_age[*,0],n2o_norm_grid,symbol='o',color='red',linestyle=6,errorbar_capsize=0,/overplot) ;;p = errorplot(bins_b2.n2o_norm_age_all[*,0],n2o_norm_grid,bins_b2.n2o_norm_age_all[*,1],replicate(0,nn),symbol='o',/sym_filled,color='red',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins_co2_b2.n2o_norm_age_all[*,0],n2o_norm_grid,bins_co2_b2.n2o_norm_age_all[*,1],replicate(0,nn),symbol='o',/sym_filled,color='red',linestyle=6,errorbar_capsize=0,/overplot) ;t = text(0.2,0.8,'1990s',color='blue',font_size=11,/norm) ;t = text(0.2,0.76,'opt age (fill)',color='blue',font_size=11,/norm) ;t = text(0.2,0.72,'CO2 lag age (open)',color='blue',font_size=11,/norm) ;t = text(0.2,0.68,'CO2 lag age all',color='sky blue',font_size=11,/norm) ;t = text(0.2,0.64,'2020s',color='red',font_size=11,/norm) ;t = text(0.2,0.6,'opt age (fill)',color='red',font_size=11,/norm) ;t = text(0.2,0.56,'CO2 lag age (open)',color='red',font_size=11,/norm) ;t = text(0.2,0.52,'CO2 lag age all',color='orange',font_size=11,/norm) ;p.save,dir+'Plots/Balloon Mean Ages/Mean_age_vs_N2O_norm_compare_old_new_with_lag.png' ;p = plot(indgen(2),/nodata,yrange=[1.03,0],xrange=[0,8],font_size=11,xtitle='Mean Age',ytitle='Normalized N$_2$O',title='Mean Ages vs. N$_2$O') ;p = errorplot(bins_b0.n2o_norm_sf6_lag_age_bias_corr[*,0],n2o_norm_grid,bins_b0.n2o_norm_sf6_lag_age_bias_corr[*,1],replicate(0,nn),symbol='o',/sym_filled,color='lime green',linestyle=6, $ ; errorbar_capsize=0,/overplot) ;p = errorplot(bins_a0.n2o_norm_sf6_lag_age_bias_corr[*,0],n2o_norm_grid,bins_a0.n2o_norm_sf6_lag_age_bias_corr[*,1],replicate(0,nn),symbol='o',/sym_filled,color='blue',linestyle=6, $ ; errorbar_capsize=0,/overplot) ;p = errorplot(bins_b2.n2o_norm_sf6_lag_age_bias_corr[*,0],n2o_norm_grid,bins_b2.n2o_norm_sf6_lag_age_bias_corr[*,1],replicate(0,nn),symbol='o',/sym_filled,color='magenta',linestyle=6, $ ; errorbar_capsize=0,/overplot) ;p = errorplot(bins_a2.n2o_norm_sf6_lag_age_bias_corr[*,0],n2o_norm_grid,bins_a2.n2o_norm_sf6_lag_age_bias_corr[*,1],replicate(0,nn),symbol='o',/sym_filled,color='orange',linestyle=6, $ ; errorbar_capsize=0,/overplot) ;p = plot(indgen(2),/nodata,yrange=[1.03,0],xrange=[0,8],font_size=11,xtitle='Mean Age',ytitle='Normalized N$_2$O',title='Balloon Mean Ages vs. N$_2$O '+ext_yrs[0]) ;p = errorplot(bins_co2_b0.n2o_norm_co2_age[*,0],n2o_norm_grid,bins_co2_b0.n2o_norm_co2_age[*,1],replicate(0,nn),symbol='o',/sym_filled,color='dark orange',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins_b0.n2o_norm_co2_age[*,0],n2o_norm_grid,bins_b0.n2o_norm_co2_age[*,1],replicate(0,nn),symbol='o',/sym_filled,color='orange',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins_b0.n2o_norm_co2_lag_age[*,0],n2o_norm_grid,bins_b0.n2o_norm_co2_lag_age[*,1],replicate(0,nn),symbol='o',/sym_filled,color='pink',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins_b0.n2o_norm_sf6_lag_age_bias_corr[*,0],n2o_norm_grid,bins_b0.n2o_norm_sf6_lag_age_bias_corr[*,1],replicate(0,nn),symbol='o',/sym_filled,color='green',linestyle=6, $ ; errorbar_capsize=0,/overplot) ;p = errorplot(bins_b0.n2o_norm_age_all[*,0],n2o_norm_grid,bins_b0.n2o_norm_age_all[*,1],replicate(0,nn),symbol='o',/sym_filled,color='sky blue',linestyle=6,errorbar_capsize=0,/overplot) ;t = text(0.2,0.8,'CO2 lag age',color='pink',font_size=11,/norm) ;t = text(0.2,0.76,'CO2 archive age',color='orange',font_size=11,/norm) ;t = text(0.2,0.72,'SF6 lag age bias corr',color='green',font_size=11,/norm) ;t = text(0.2,0.68,'Opt age',color='sky blue',font_size=11,/norm) ;p.save,dir+'Plots/Balloon Mean Ages/Mean_age_vs_N2O_norm_with_lag_'+ext[0]+'.png' ;p = plot(indgen(2),/nodata,yrange=[1.03,0],xrange=[0,8],font_size=11,xtitle='Mean Age',ytitle='Normalized N$_2$O',title='Balloon Mean Ages vs. N$_2$O '+ext_yrs[2]) ;p = errorplot(bins_b2.n2o_norm_co2_lag_age[*,0],n2o_norm_grid,bins_b2.n2o_norm_co2_lag_age[*,1],replicate(0,nn),symbol='o',/sym_filled,color='pink',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins_b2.n2o_norm_sf6_lag_age_bias_corr[*,0],n2o_norm_grid,bins_b2.n2o_norm_sf6_lag_age_bias_corr[*,1],replicate(0,nn),symbol='o',/sym_filled,color='green',linestyle=6, $ ; errorbar_capsize=0,/overplot) ;p = errorplot(bins_b2.n2o_norm_age_all[*,0],n2o_norm_grid,bins_b2.n2o_norm_age_all[*,1],replicate(0,nn),symbol='o',/sym_filled,color='sky blue',linestyle=6,errorbar_capsize=0,/overplot) ;t = text(0.2,0.8,'CO2 lag age',color='pink',font_size=11,/norm) ;t = text(0.2,0.76,'SF6 lag age bias corr',color='green',font_size=11,/norm) ;t = text(0.2,0.72,'Opt age',color='sky blue',font_size=11,/norm) ;p.save,dir+'Plots/Balloon Mean Ages/Mean_age_vs_N2O_norm_with_lag_'+ext[2]+'.png' ;p = plot(indgen(2),/nodata,yrange=[1.03,0],xrange=[0,8],font_size=11,xtitle='Mean Age',ytitle='Normalized N$_2$O',title='Aircraft Mean Ages vs. N$_2$O '+ext_yrs[0]) ;p = errorplot(bins_co2_a0.n2o_norm_co2_age[*,0],n2o_norm_grid,bins_co2_a0.n2o_norm_co2_age[*,1],replicate(0,nn),symbol='o',/sym_filled,color='dark orange',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins_a0.n2o_norm_co2_age[*,0],n2o_norm_grid,bins_a0.n2o_norm_co2_age[*,1],replicate(0,nn),symbol='o',/sym_filled,color='orange',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins_a0.n2o_norm_co2_lag_age[*,0],n2o_norm_grid,bins_a0.n2o_norm_co2_lag_age[*,1],replicate(0,nn),symbol='o',/sym_filled,color='pink',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins_a0.n2o_norm_sf6_lag_age_bias_corr[*,0],n2o_norm_grid,bins_a0.n2o_norm_sf6_lag_age_bias_corr[*,1],replicate(0,nn),symbol='o',/sym_filled,color='green',linestyle=6, $ ; errorbar_capsize=0,/overplot) ;p = errorplot(bins_a0.n2o_norm_age_all[*,0],n2o_norm_grid,bins_a0.n2o_norm_age_all[*,1],replicate(0,nn),symbol='o',/sym_filled,color='sky blue',linestyle=6,errorbar_capsize=0,/overplot) ;t = text(0.2,0.8,'CO2 lag age',color='pink',font_size=11,/norm) ;t = text(0.2,0.76,'CO2 archive age',color='orange',font_size=11,/norm) ;t = text(0.2,0.72,'SF6 lag age bias corr',color='green',font_size=11,/norm) ;t = text(0.2,0.68,'Opt age',color='sky blue',font_size=11,/norm) ;p.save,dir+'Plots/Aircraft Mean Ages/Mean_age_vs_N2O_norm_with_lag_'+ext[0]+'.png' ;p = plot(indgen(2),/nodata,yrange=[1.03,0],xrange=[0,8],font_size=11,xtitle='Mean Age',ytitle='Normalized N$_2$O',title='Aircraft Mean Ages vs. N$_2$O '+ext_yrs[2]) ;p = errorplot(bins_a2.n2o_norm_co2_lag_age[*,0],n2o_norm_grid,bins_a2.n2o_norm_co2_lag_age[*,1],replicate(0,nn),symbol='o',/sym_filled,color='pink',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins_a2.n2o_norm_sf6_lag_age_bias_corr[*,0],n2o_norm_grid,bins_a2.n2o_norm_sf6_lag_age_bias_corr[*,1],replicate(0,nn),symbol='o',/sym_filled,color='green',linestyle=6, $ ; errorbar_capsize=0,/overplot) ;p = errorplot(bins_a2.n2o_norm_age_all[*,0],n2o_norm_grid,bins_a2.n2o_norm_age_all[*,1],replicate(0,nn),symbol='o',/sym_filled,color='sky blue',linestyle=6,errorbar_capsize=0,/overplot) ;t = text(0.2,0.8,'CO2 lag age',color='pink',font_size=11,/norm) ;t = text(0.2,0.76,'SF6 lag age bias corr',color='green',font_size=11,/norm) ;t = text(0.2,0.72,'Opt age',color='sky blue',font_size=11,/norm) ;p.save,dir+'Plots/Aircraft Mean Ages/Mean_age_vs_N2O_norm_with_lag_'+ext[2]+'.png' i_summer = [0,4,10,11,12] i_winter = [6,7,17,18,19] b2_n2o_norm_age_summer = bins_co2_b2_v2024.n2o_norm_age_all b2_n2o_norm_age_winter = b2_n2o_norm_age_summer for o = 0, 1 do for n = 0, nn-1 do begin b2_n2o_norm_age_summer[n,o] = mean(bins_co2_b2_v2024.n2o_norm_age_all_m[n,o,i_summer],/nan) b2_n2o_norm_age_winter[n,o] = mean(bins_co2_b2_v2024.n2o_norm_age_all_m[n,o,i_winter],/nan) endfor ;p = plot(indgen(2),/nodata,yrange=[1.03,0.25],xrange=[0,6],font_size=12,xtitle='Mean Age (years)',ytitle='Normalized N$_2$O',title='Mean Ages vs. N$_2$O 2021-24',xticklen=0.04,yticklen=0.03) ;p = errorplot(bins_co2_a0.n2o_norm_age_all[*,0],n2o_norm_grid,bins_co2_a0.n2o_norm_age_all[*,1],replicate(0,nn),symbol='o',/sym_filled,color='sky blue',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins_co2_b2_v2024.n2o_norm_age_all[0:-3,0],n2o_norm_grid[0:-3],bins_co2_b2_v2024.n2o_norm_age_all[0:-3,1],replicate(0,nn-2),symbol='tu',sym_size=1.5,/sym_filled,color='orange', $ ; linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins_sf6_a2.n2o_norm_age_all_m[*,0,19],n2o_norm_grid,bins_sf6_a2.n2o_norm_age_all_m[*,1,19],replicate(0,nn),symbol='o',/sym_filled,color='lime green',linestyle=6, $ ; errorbar_capsize=0,/overplot) ;p = errorplot(bins_co2_a2.n2o_norm_age_all[*,0],n2o_norm_grid,bins_co2_a2.n2o_norm_age_all[*,1],replicate(0,nn),symbol='o',/sym_filled,color='blue',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(b2_n2o_norm_age_summer[0:-3,0],n2o_norm_grid[0:-3],b2_n2o_norm_age_summer[0:-3,1],replicate(0,nn-2),symbol='tu',/sym_filled,color='red',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(b2_n2o_norm_age_winter[0:-3,0],n2o_norm_grid[0:-3],b2_n2o_norm_age_winter[0:-3,1],replicate(0,nn-2),symbol='tu',/sym_filled,color='purple',linestyle=6,errorbar_capsize=0,/overplot) ;t = text(0.2,0.8,'DCOTSS',color='blue',font_size=11,/norm) ;t = text(0.2,0.76,'SABRE',color='lime green',font_size=11,/norm) ;t = text(0.2,0.72,'AirCore All',color='orange',font_size=11,/norm) ;t = text(0.2,0.68,'AirCore Summer',color='red',font_size=11,/norm) ;t = text(0.2,0.64,'AirCore Winter',color='purple',font_size=11,/norm) ;p.save,dir+'Plots/Aircraft Mean Ages/Mean_age_vs_N2O_norm_mission_late.png' ;p = plot(indgen(2),/nodata,yrange=[1.03,0],xrange=[1.03,0.2],font_size=12,xtitle='Normalized CH$_4$',ytitle='Normalized N$_2$O',title='CH$_4$ vs. N$_2$O',xticklen=0.04,yticklen=0.03) ;p = errorplot(bins_co2_a0.n2o_norm_ch4_norm_inst[*,0],n2o_norm_grid,bins_co2_a0.n2o_norm_ch4_norm_inst[*,1],replicate(0,nn),symbol='o',/sym_filled,color='sky blue',linestyle=6,errorbar_capsize=0, $ ; /overplot) ;p = errorplot(bins_co2_a0.n2o_norm_ch4_norm_all[*,0],n2o_norm_grid,bins_co2_a0.n2o_norm_ch4_norm_all[*,1],replicate(0,nn),symbol='o',/sym_filled,color='blue',linestyle=6,errorbar_capsize=0, $ ; /overplot) ;p = errorplot(bins_co2_a0.n2o_norm_ch4_norm_vx[*,0],n2o_norm_grid,bins_co2_a0.n2o_norm_ch4_norm_vx[*,1],replicate(0,nn),symbol='o',/sym_filled,color='magenta',linestyle=6,errorbar_capsize=0, $ ; /overplot) ;p = errorplot(bins_co2_b0.n2o_norm_ch4_norm_all[*,0],n2o_norm_grid,bins_co2_b0.n2o_norm_ch4_norm_all[*,1],replicate(0,nn),symbol='o',/sym_filled,color='red',linestyle=6,errorbar_capsize=0, $ ; /overplot) ;p = errorplot(bins_co2_b0.n2o_norm_ch4_norm_nh[*,0],n2o_norm_grid,bins_co2_b0.n2o_norm_ch4_norm_nh[*,1],replicate(0,nn),symbol='o',/sym_filled,color='orange',linestyle=6,errorbar_capsize=0, $ ; /overplot) ;p = errorplot(bins_co2_b0.n2o_norm_ch4_norm_tr[*,0],n2o_norm_grid,bins_co2_b0.n2o_norm_ch4_norm_tr[*,1],replicate(0,nn),symbol='o',/sym_filled,color='yellow',linestyle=6,errorbar_capsize=0, $ ; /overplot) ;p = errorplot(bins_sf6_b0.n2o_norm_ch4_norm_nh[*,0],n2o_norm_grid,bins_sf6_b0.n2o_norm_ch4_norm_nh[*,1],replicate(0,nn),symbol='o',/sym_filled,color='lime green',linestyle=6,errorbar_capsize=0, $ ; /overplot) ;p = errorplot(bins_sf6_b0.n2o_norm_ch4_norm_vx[*,0],n2o_norm_grid,bins_sf6_b0.n2o_norm_ch4_norm_vx[*,1],replicate(0,nn),symbol='o',/sym_filled,color='pink',linestyle=6,errorbar_capsize=0, $ ; /overplot) ;p = errorplot(bins_co2_a2.n2o_norm_ch4_norm_all[*,0],n2o_norm_grid,bins_co2_a2.n2o_norm_ch4_norm_all[*,1],replicate(0,nn),symbol='o',/sym_filled,color='brown',linestyle=6,errorbar_capsize=0, $ ; /overplot) ;p = errorplot(bins_sf6_a2.n2o_norm_ch4_norm_all[*,0],n2o_norm_grid,bins_sf6_a2.n2o_norm_ch4_norm_all[*,1],replicate(0,nn),symbol='o',/sym_filled,color='purple',linestyle=6,errorbar_capsize=0, $ ; /overplot) ;p = errorplot(bins_co2_b2_v2024.n2o_norm_ch4_norm_all[*,0],n2o_norm_grid,bins_co2_b2_v2024.n2o_norm_ch4_norm_all[*,1],replicate(0,nn),symbol='o',/sym_filled,color='dodger blue',linestyle=6, $ ; errorbar_capsize=0,/overplot) p = plot(indgen(2),/nodata,yrange=[1.03,0],xrange=[1.03,0.2],font_size=12,xtitle='Normalized CH$_4$',ytitle='Normalized N$_2$O',title='CH$_4$ vs. N$_2$O',xticklen=0.04,yticklen=0.03) for m = 0, 7 do p = errorplot(bins_co2_b0.n2o_norm_ch4_norm_m[*,0,m],n2o_norm_grid,bins_co2_b0.n2o_norm_ch4_norm_m[*,1,m],replicate(0,nn),symbol='o',/sym_filled,color=colors[m],linestyle=6, $ errorbar_capsize=0,/overplot) for m = 0, 7 do t = text(0.19,0.8-0.035*m,oms_dates[m],color=colors[m],font_size=11,/norm) ;p = plot(indgen(2),/nodata,yrange=[1.03,0],font_size=11,xtitle='Mean Age Diffs',ytitle='Normalized N$_2$O',title='Aircraft SF6 Orig - Lag Mean Age Diffs vs. N$_2$O '+ext_yrs[0]) ;p = plot([0,0],[1.03,0],linestyle=2,/overplot) ;for m = 0, 7 do p = errorplot(bins_sf6.n2o_norm_sf6_age_m[*,0,m]-bins.n2o_norm_sf6_lag_age_m[*,0,m],n2o_norm_grid,bins_sf6.n2o_norm_sf6_age_m[*,1,m],replicate(0,nn),symbol='o',/sym_filled, $ ; color=colors[m],linestyle=6,errorbar_capsize=0,/overplot) ;for m = 3, 3 do t = text(0.19,0.9-0.035*m,mission_names[m],color=colors[m],font_size=11,/norm) ;for m = 5, 7 do t = text(0.19,0.935-0.035*m,mission_names[m],color=colors[m],font_size=11,/norm) ;p.save,dir+'Plots/Aircraft Mean Ages/Mean_age_vs_N2O_norm_SF6_orig-lag_diffs.png' ;p = plot(indgen(2),/nodata,yrange=[1.03,0],xrange=[0,8.5],font_size=11,xtitle='Mean Age',ytitle='Normalized N$_2$O',title='Balloon Mean Ages vs. N$_2$O '+ext_yrs[0]) ;for m = 0, 7 do p = errorplot(bins_co2_b0.n2o_norm_age_all_m[*,0,m],n2o_norm_grid,bins_co2_b0.n2o_norm_age_all_m[*,1,m],replicate(0,nn),symbol='o',/sym_filled,color=colors[m],linestyle=6, $ ; errorbar_capsize=0,/overplot) ;;for m = 0, 7 do p = errorplot(bins_co2.n2o_norm_co2_age_m[*,0,m],n2o_norm_grid,bins_co2.n2o_norm_co2_age_m[*,1,m],replicate(0,nn),symbol='o',/sym_filled,color=colors[m],linestyle=6, $ ;; errorbar_capsize=0,/overplot) ;;for m = 0, 7 do p = errorplot(bins_sf6.n2o_norm_sf6_age_m[*,0,m],n2o_norm_grid,bins_sf6.n2o_norm_sf6_age_m[*,1,m],replicate(0,nn),symbol='o',/sym_filled,color=colors[m],linestyle=6, $ ;; errorbar_capsize=0,/overplot) ;;for m = 0, 7 do p = errorplot(bins_sf6.n2o_norm_sf6_lag_age_m[*,0,m],n2o_norm_grid,bins_sf6.n2o_norm_sf6_lag_age_m[*,1,m],replicate(0,nn),symbol='o',color=colors[m],linestyle=6, $ ;; errorbar_capsize=0,/overplot) ;for m = 0, 7 do p = errorplot(bins_sf6.n2o_norm_sf6_lag_age_bias_corr_m[*,0,m],n2o_norm_grid,bins_sf6.n2o_norm_sf6_lag_age_bias_corr_m[*,1,m],replicate(0,nn),symbol='o',color=colors[m],linestyle=6, $ ; errorbar_capsize=0,/overplot) ;for m = 0, 3 do t = text(0.17,0.8-0.035*m,oms_dates[m],color=colors[m],font_size=11,/norm) ;for m = 5, 7 do t = text(0.17,0.835-0.035*m,oms_dates[m],color=colors[m],font_size=11,/norm) ;;t = text(0.32,0.8,'SF6 Orig Calc (filled circ)',color='black',font_size=11,/norm) ;;t = text(0.32,0.76,'SF6 Simple lag (open circ)',color='black',font_size=11,/norm) ;;t = text(0.32,0.8,'CO2 orig Calc (filled)',color='black',font_size=11,/norm) ;t = text(0.32,0.8,'New opt age (filled)',color='black',font_size=11,/norm) ;t = text(0.32,0.76,'SF6 lag bias corr (open)',color='black',font_size=11,/norm) ;;p.save,dir+'Plots/Balloon Mean Ages/Mean_age_vs_N2O_norm_SF6_orig.png' ;p.save,dir+'Plots/Balloon Mean Ages/Mean_age_vs_N2O_norm_SF6_orig2.png' ;p.save,dir+'Plots/Balloon Mean Ages/Mean_age_vs_N2O_norm_CO2_orig.png' ;p.save,dir+'Plots/Balloon Mean Ages/Mean_age_vs_N2O_norm_CO2_orig_SF6_lag_bias_corr.png' ;p = plot(indgen(2),/nodata,yrange=[1.03,0],font_size=11,xtitle='Mean Age Diffs',ytitle='Normalized N$_2$O',title='Balloon SF6 Orig - Lag Mean Age Diffs vs. N$_2$O '+ext_yrs[0]) ;p = plot([0,0],[1.03,0],linestyle=2,/overplot) ;for m = 0, 8 do p = errorplot(bins_sf6.n2o_norm_sf6_age_m[*,0,m]-bins.n2o_norm_sf6_lag_age_m[*,0,m],n2o_norm_grid,bins_sf6.n2o_norm_sf6_age_m[*,1,m],replicate(0,nn),symbol='o',/sym_filled, $ ; color=colors[m],linestyle=6,errorbar_capsize=0,/overplot) ;for m = 0, 3 do t = text(0.17,0.8-0.035*m,oms_dates[m],color=colors[m],font_size=11,/norm) ;for m = 5, 8 do t = text(0.17,0.835-0.035*m,oms_dates[m],color=colors[m],font_size=11,/norm) ;p.save,dir+'Plots/Balloon Mean Ages/Mean_age_vs_N2O_norm_SF6_orig-lag_diffs.png' ;p = plot(indgen(2),/nodata,yrange=[1.03,0],xrange=[0,8.5],font_size=11,xtitle='Mean Age',ytitle='Normalized N$_2$O',title='Balloon Mean Ages vs. N$_2$O '+ext_yrs[0]) ;p = errorplot(bins_sf6.n2o_norm_sf6_age[*,0],n2o_norm_grid,bins_sf6.n2o_norm_sf6_age[*,1],replicate(0,nn),symbol='o',/sym_filled,color='lime green',linestyle=6,errorbar_capsize=0,/overplot) ;;p = errorplot(bins_sf6.n2o_norm_sf6_age_vt[*,0],n2o_norm_grid,bins_sf6.n2o_norm_sf6_age_vt[*,1],replicate(0,nn),symbol='o',/sym_filled,color='green',linestyle=6,errorbar_capsize=0,/overplot) ;;p = errorplot(bins.n2o_norm_sf6_age_tr[*,0],n2o_norm_grid,bins.n2o_norm_sf6_age_tr[*,1],replicate(0,nn),symbol='o',/sym_filled,color='green',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins_co2_b0.n2o_norm_co2_age[*,0],n2o_norm_grid,bins_co2_b0.n2o_norm_co2_age[*,1],replicate(0,nn),symbol='o',/sym_filled,color='orange',linestyle=6,errorbar_capsize=0,/overplot) ;p = plot(n2o_age_a,n2o_norm_grid,thick=2,color='dark orange',/overplot) ;p = errorplot(bins_co2_b0.n2o_norm_age_all[*,0],n2o_norm_grid,bins_co2_b0.n2o_norm_age_all[*,1],replicate(0,nn),symbol='o',/sym_filled,color='blue',linestyle=6,errorbar_capsize=0,/overplot) ;;p = errorplot(bins_co2_a0.n2o_norm_age_all_tr[*,0],n2o_norm_grid,bins_co2_a0.n2o_norm_age_all_tr[*,1],replicate(0,nn),symbol='o',/sym_filled,color='sky blue',linestyle=6,errorbar_capsize=0, $ ; /overplot) ;t = text(0.22,0.8,'This study',color='blue',font_size=11,/norm) ;t = text(0.22,0.76,'from CO$_2$ (Andrews et al.)',color='orange',font_size=11,/norm) ;t = text(0.22,0.72,'from SF$_6$ (Volk et al.)',color='lime green',font_size=11,/norm) ;p.save,dir+'Plots/Balloon Mean Ages/Mean_age_vs_N2O_norm_old_vs_new.png' ;p = plot(indgen(2),/nodata,yrange=[1.03,0],xrange=[0,7.2],font_size=11,xtitle='Mean Age',ytitle='Normalized N$_2$O',title='Aircraft Mean Ages vs. N$_2$O '+ext_yrs[0]) ;gd = where(finite(bins_a0.n2o_norm_age_all[*,0]),ngd) ;poly = polygon([bins_a0.n2o_norm_age_all[gd,0]-1,reverse(bins_a0.n2o_norm_age_all[gd,0]+1)],[n2o_norm_grid[gd],reverse(n2o_norm_grid[gd])],/fill_background,/data,fill_color='sky blue', $ ; transparency=50,color='white') ;p = errorplot(bins_a0.n2o_norm_age_all[*,0],n2o_norm_grid,bins_a0.n2o_norm_age_all[*,1],replicate(0,nn),symbol='s',/sym_filled,color='blue',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins_co2_a0.n2o_norm_age_all[*,0],n2o_norm_grid,bins_co2_a0.n2o_norm_age_all[*,1],replicate(0,nn),symbol='o',color='red',linestyle=6,errorbar_capsize=0,/overplot) ;t = text(0.22,0.8,'Both tracers optimization',color='blue',font_size=11,/norm) ;t = text(0.22,0.76,'Constrained range',color='sky blue',font_size=11,/norm) ;t = text(0.22,0.72,'CO$_2$ only',color='red',font_size=11,/norm) ;p.save,dir+'Plots/Aircraft Mean Ages/Mean_age_vs_N2O_norm_both_vs_CO2_only.png' ;p = plot(indgen(2),/nodata,yrange=[1.03,0],xrange=[0,7],font_size=11,xtitle='Mean Age (years)',ytitle='Normalized N$_2$O',title='Optimized Mean Ages') ;p = plot(n2o_age_a,n2o_norm_grid,thick=2,color='green',/overplot) ;p = errorplot(bins_co2_a0.n2o_norm_age_all_nh[*,0],n2o_norm_grid,bins_co2_a0.n2o_norm_age_all_nh[*,1],replicate(0,nn),symbol='o',/sym_filled,color='blue',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins_co2_a0.n2o_norm_age_all_tr[*,0],n2o_norm_grid,bins_co2_a0.n2o_norm_age_all_tr[*,1],replicate(0,nn),symbol='o',/sym_filled,color='sky blue',linestyle=6,errorbar_capsize=0, $ ; /overplot) ;p = plot(indgen(2),/nodata,yrange=[1.03,0],xrange=[0,7],font_size=11,xtitle='Mean Age (Years)',ytitle='Normalized N$_2$O',title='Optimized In Situ Mean Ages') ;;p = errorplot(bins_b0.n2o_norm_age_all_nh[*,0],n2o_norm_grid,bins_b0.n2o_norm_age_all_nh[*,1],replicate(0,nn),symbol='o',/sym_filled,color='lime green',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins_a0.n2o_norm_age_all_nh[*,0],n2o_norm_grid,bins_a0.n2o_norm_age_all_nh[*,1],replicate(0,nn),symbol='o',/sym_filled,color='sky blue',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins_co2_a0.n2o_norm_age_all_nh[*,0],n2o_norm_grid,bins_co2_a0.n2o_norm_age_all_nh[*,1],replicate(0,nn),symbol='o',/sym_filled,color='blue',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins_sf6_a2.n2o_norm_age_all_nh[*,0],n2o_norm_grid,bins_sf6_a2.n2o_norm_age_all_nh[*,1],replicate(0,nn),symbol='o',/sym_filled,color='red',linestyle=6,errorbar_capsize=0,/overplot) ;t = text(0.8,0.5,'1990s',font_size=11,color='blue',/norm) ;t = text(0.5,0.5,'2020s',font_size=11,color='red',/norm) ;p.save,dir+'Plots/Aircraft Mean Ages/Mean_age_vs_N2O_norm_in_situ_base2.png' vc = indgen(ntlp)*(250./(ntlp-1)) ;p = plot(indgen(2),/nodata,yrange=[1,0.2],xrange=[-1.5,0.8],font_size=12,xtitle='Years',ytitle='Normalized N$_2$O',title='Mean Age Differences',dimensions=[440,600]) ;;for tii = 1, ntlp-1 do p = plot(n2o_norm_mean_age_tlp[2,*,tii]-n2o_norm_mean_age_tlp[2,*,0],n2o_norm_grid_tlp,thick=4,rgb_table=67,vert_colors=vc[tii],/overplot) ;;for tii = 1, ntlp-1 do p = plot(n2o_norm_mean_age_tlp[2,*,tii]-n2o_norm_mean_age_tlp[2,*,0],n2o_norm_grid_tlp,thick=4,rgb_table=69,vert_colors=vc[tii],/overplot) ;diff = n2o_norm_mean_age_tlp_10km[2,*,4]-n2o_norm_mean_age_tlp_10km[2,*,0] ;diff[-1] = 0. ;diff[-2] = 0.5*diff[-3] + 0.5*diff[-1] ;p = plot(diff,n2o_norm_grid_tlp,thick=3,color='sky blue',/overplot) ;diff = n2o_norm_mean_age_tlp_7km[2,*,4]-n2o_norm_mean_age_tlp_7km[2,*,0] ;diff[-1] = 0. ;diff[-2] = 0.5*diff[-3] + 0.5*diff[-1] ;p = plot(diff,n2o_norm_grid_tlp,thick=4,color='blue',/overplot) ;diff = n2o_norm_mean_age_tlp_5km[2,*,4]-n2o_norm_mean_age_tlp_5km[2,*,0] ;diff[-1] = 0. ;diff[-2] = 0.5*diff[-3] + 0.5*diff[-1] ;p = plot(diff,n2o_norm_grid_tlp,thick=3,color='lime green',/overplot) ;diff = n2o_norm_mean_age_tlp[2,*,4]-n2o_norm_mean_age_tlp[2,*,0] ;diff[-1] = 0. ;diff[-2] = 0.5*diff[-3] + 0.5*diff[-1] ;p = plot(diff,n2o_norm_grid_tlp,thick=3,color='green',/overplot) ;;diff = (n2o_norm_wstar_tlp_7km[1,*,4]/n2o_norm_wstar_tlp_7km[1,*,0]-1.) ;;diff[-2:-1] = diff[-3] ;;p = plot(diff,n2o_norm_grid_tlp,thick=2,linestyle=2,color='blue',/overplot) ;;diff = (n2o_norm_wstar_tlp_5km[1,*,4]/n2o_norm_wstar_tlp_5km[1,*,0]-1.) ;;diff[-2:-1] = diff[-3] ;;p = plot(diff,n2o_norm_grid_tlp,thick=2,linestyle=2,color='lime green',/overplot) ;;diff = (n2o_norm_wstar_tlp[1,*,4]/n2o_norm_wstar_tlp[1,*,0]-1.) ;;diff[-2:-1] = diff[-3] ;;p = plot(diff,n2o_norm_grid_tlp,thick=2,linestyle=2,color='green',/overplot) ;p = plot(bins_sf6_a2.n2o_norm_age_all_nh[0:45,0]-bins_co2_a0.n2o_norm_age_all_nh[0:45,0],n2o_norm_grid[0:45],symbol='o',/sym_filled,color='purple',linestyle=6,errorbar_capsize=0,/overplot) ;p = plot(bins_a2.n2o_norm_age_all_nh[*,0]-bins_a0.n2o_norm_age_all_nh[*,0],n2o_norm_grid,symbol='o',/sym_filled,color='purple',linestyle=6,errorbar_capsize=0,/overplot) ;p = plot([0,0],[1.03,0],linestyle=2,/overplot) ;;t = text(0.19,0.2,'In situ 2020s-1990s',font_size=11,color='purple',/norm) ;t = text(0.7,0.81,'TLP model',font_size=12,color='black',/norm) ;t = text(0.7,0.77,'30% w$^*$',font_size=12,color='black',/norm) ;t = text(0.7,0.73,'increase',font_size=12,color='black',/norm) ;t = text(0.7,0.69,'above',font_size=12,color='black',/norm) ;t = text(0.7,0.65,'26 km',font_size=12,color='sky blue',/norm) ;t = text(0.7,0.61,'23 km',font_size=12,color='blue',/norm) ;t = text(0.7,0.56,'21 km',font_size=12,color='lime green',/norm) ;t = text(0.7,0.52,'All strat',font_size=11,color='green',/norm) ;;p.save,dir+'Plots/Aircraft Mean Ages/Mean_age_diffs_vs_N2O_norm_TLP_all.png' ;;p.save,dir+'Plots/Aircraft Mean Ages/Mean_age_diffs_vs_N2O_norm_TLP_upper_strat_10km.png' ;;p.save,dir+'Plots/Aircraft Mean Ages/Mean_age_diffs_vs_N2O_norm_TLP_w1.00.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Mean_age_diffs_vs_N2O_norm_TLP_w1.30.png' sc = ['0.7','0.8','0.9','1.0','1.1','1.2','1.3'] ;p = plot(indgen(2),/nodata,yrange=[1,0.5],xrange=[-0.1,0.1],font_size=12,xtitle='Normalized h1211',ytitle='Normalized N$_2$O',title='halon 1211 Differences',dimensions=[440,600]) ;;for tii = 1, ntlp-1 do p = plot(n2o_norm_h1211_tlp[2,*,tii]-n2o_norm_h1211_tlp[2,*,0],n2o_norm_grid_tlp,thick=4,rgb_table=67,vert_colors=vc[tii],/overplot) ;;for tii = 1, ntlp-1 do p = plot(n2o_norm_h1211_tlp[2,*,tii]-n2o_norm_h1211_tlp[2,*,0],n2o_norm_grid_tlp,thick=4,rgb_table=69,vert_colors=vc[tii],/overplot) ;p = plot(n2o_norm_h1211_tlp_10km[2,*,4]-n2o_norm_h1211_tlp_10km[2,*,0],n2o_norm_grid_tlp,thick=4,color='sky blue',/overplot) ;p = plot(n2o_norm_h1211_tlp_7km[2,*,4]-n2o_norm_h1211_tlp_7km[2,*,0],n2o_norm_grid_tlp,thick=4,color='blue',/overplot) ;p = plot(n2o_norm_h1211_tlp_5km[2,*,4]-n2o_norm_h1211_tlp_5km[2,*,0],n2o_norm_grid_tlp,thick=4,color='lime green',/overplot) ;p = plot(n2o_norm_h1211_tlp[2,*,4]-n2o_norm_h1211_tlp[2,*,0],n2o_norm_grid_tlp,thick=4,color='green',/overplot) ;;for tii = 1, ntlp-1 do p = plot(n2o_norm_h1211_tlp[1,*,tii]-n2o_norm_h1211_tlp[1,*,0],n2o_norm_grid_tlp,thick=4,rgb_table=67,vert_colors=vc[tii],linestyle=2,/overplot) ;p = plot(n2o_norm_h1211_norm_midlat[57:-1,0]-n2o_norm_h1211_norm_midlat_early[57:-1,0],n2o_norm_grid[57:-1],symbol='o',/sym_filled,color='purple',linestyle=6,/overplot) ;p = plot([0,0],[1.03,0],linestyle=2,/overplot) ;t = text(0.19,0.8,'In situ',font_size=12,color='purple',/norm) ;t = text(0.19,0.76,'2020s-1990s',font_size=12,color='purple',/norm) ;;p.save,dir+'Plots/Aircraft Mean Ages/H1211_diffs_vs_N2O_norm_TLP_all.png' ;;p.save,dir+'Plots/Aircraft Mean Ages/H1211_diffs_vs_N2O_norm_TLP_upper_strat_10km.png' ;;p.save,dir+'Plots/Aircraft Mean Ages/H1211_diffs_vs_N2O_norm_TLP_w1.00.png' ;p.save,dir+'Plots/Aircraft Mean Ages/H1211_diffs_vs_N2O_norm_TLP_w1.30.png' ;p = plot(indgen(2),/nodata,yrange=[1.03,0.6],xrange=[1,0],font_size=11,xtitle='Normalized h1211',ytitle='Normalized N$_2$O',title='N$_2$O vs. halon 1211',dimensions=[400,600]) ;for tii = 1, ntlp-1 do p = plot(h1211_mean[2,*,tii],n2o_mean[2,*,tii],thick=2,rgb_table=69,vert_colors=vc[tii],/overplot) ;for tii = 1, ntlp-1 do p = plot(h1211_mean[1,*,tii],n2o_mean[1,*,tii],thick=2,rgb_table=69,vert_colors=vc[tii],linestyle=2,/overplot) ;p = plot(indgen(2),/nodata,yrange=[1,0.5],xrange=[-0.1,0.1],font_size=12,xtitle='Normalized CFC-11',ytitle='Normalized N$_2$O',title='CFC-11 Differences',dimensions=[440,600]) ;;for tii = 1, ntlp-1 do p = plot(n2o_norm_f11_tlp[2,*,tii]-n2o_norm_f11_tlp[2,*,0],n2o_norm_grid_tlp,thick=4,rgb_table=67,vert_colors=vc[tii],/overplot) ;;for tii = 1, ntlp-1 do p = plot(n2o_norm_f11_tlp[2,*,tii]-n2o_norm_f11_tlp[2,*,0],n2o_norm_grid_tlp,thick=4,rgb_table=69,vert_colors=vc[tii],/overplot) ;p = plot(n2o_norm_f11_tlp_10km[2,*,4]-n2o_norm_f11_tlp_10km[2,*,0],n2o_norm_grid_tlp,thick=4,color='sky blue',/overplot) ;p = plot(n2o_norm_f11_tlp_7km[2,*,4]-n2o_norm_f11_tlp_7km[2,*,0],n2o_norm_grid_tlp,thick=4,color='blue',/overplot) ;p = plot(n2o_norm_f11_tlp_5km[2,*,4]-n2o_norm_f11_tlp_5km[2,*,0],n2o_norm_grid_tlp,thick=4,color='lime green',/overplot) ;p = plot(n2o_norm_f11_tlp[2,*,4]-n2o_norm_f11_tlp[2,*,0],n2o_norm_grid_tlp,thick=4,color='green',/overplot) ;p = plot(n2o_norm_f11_norm_midlat[59:-1,0]-n2o_norm_f11_norm_midlat_early[59:-1,0],n2o_norm_grid[59:-1],symbol='o',/sym_filled,color='purple',linestyle=6,/overplot) ;p = plot([0,0],[1.03,0],linestyle=2,/overplot) ;;p.save,dir+'Plots/Aircraft Mean Ages/F11_diffs_vs_N2O_norm_TLP_all.png' ;;p.save,dir+'Plots/Aircraft Mean Ages/F11_diffs_vs_N2O_norm_TLP_upper_strat_10km.png' ;;p.save,dir+'Plots/Aircraft Mean Ages/F11_diffs_vs_N2O_norm_TLP_w1.00.png' ;p.save,dir+'Plots/Aircraft Mean Ages/F11_diffs_vs_N2O_norm_TLP_w1.30.png' ;p = plot(indgen(2),/nodata,xrange=[0,50],yrange=[0,30],font_size=11,xtitle='% Difference',ytitle='Altitude above tpause (km)',title='N$_2$O Differences',dimensions=[460,550]) ;p = plot([0,0],[0,30],linestyle=2,/overplot) ;for tii = 1, ntlp-1 do p = plot(0.5*1e2*(n2o_mean[2,*,tii]-n2o_mean[2,*,0])/n2o_mean[2,*,0],z_spec,thick=2,color=colors[tii],/overplot) ;for tii = 1, ntlp-1 do p = plot(0.5*1e2*(n2o_mean[1,*,tii]-n2o_mean[1,*,0])/n2o_mean[1,*,0],z_spec,thick=2,color=colors[tii],linestyle=2,/overplot) ; ;p = plot(indgen(2),/nodata,yrange=[0,20],xrange=[0,1],font_size=11,xtitle='Normalized Mixing Ratio',ytitle='Altitude above tpause (km)',title='N$_2$O',dimensions=[460,550]) ;for tii = 0, ntlp-1 do p = plot(n2o_mean[2,*,tii],z_spec,thick=2,rgb_table=69,vert_colors=vc[tii],/overplot) ;for tii = 0, ntlp-1 do p = plot(n2o_mean[1,*,tii],z_spec,thick=2,rgb_table=69,vert_colors=vc[tii],linestyle=2,/overplot) ; ;p = plot(indgen(2),/nodata,yrange=[3,4],xrange=[0.2,0.4],font_size=11,xtitle='Normalized Mixing Ratio',ytitle='Altitude above tpause (km)',title='H1211 Differences',dimensions=[460,550]) ;for tii = 1, ntlp-1 do p = plot(h1211_mean[2,*,tii],z_spec,thick=2,rgb_table=69,vert_colors=vc[tii],/overplot) ;for tii = 1, ntlp-1 do p = plot(h1211_mean[1,*,tii],z_spec,thick=2,rgb_table=69,vert_colors=vc[tii],linestyle=2,/overplot) ;p = plot(indgen(2),/nodata,yrange=[0,10],font_size=11,xtitle='Normalized Mixing Ratio',ytitle='Altitude above tpause (km)',title='H1211 Differences',dimensions=[460,550]) ;p = plot([0,0],[0,15],linestyle=2,/overplot) ;for tii = 1, ntlp-1 do p = plot(h1211_mean[2,*,tii]-h1211_mean[2,*,0],z_spec,thick=2,rgb_table=69,vert_colors=vc[tii],/overplot) ;for tii = 1, ntlp-1 do p = plot(h1211_mean[1,*,tii]-h1211_mean[1,*,0],z_spec,thick=2,rgb_table=69,vert_colors=vc[tii],linestyle=2,/overplot) ; ;p = plot(indgen(2),/nodata,yrange=[0,10],font_size=11,xtitle='Normalized Mixing Ratio Difference',ytitle='Altitude above tpause (km)',title='N$_2$O Differences',dimensions=[460,550]) ;p = plot([0,0],[0,15],linestyle=2,/overplot) ;for tii = 1, ntlp-1 do p = plot(n2o_mean[2,*,tii]-n2o_mean[2,*,0],z_spec,thick=2,rgb_table=69,vert_colors=vc[tii],/overplot) ;for tii = 1, ntlp-1 do p = plot(n2o_mean[1,*,tii]-n2o_mean[1,*,0],z_spec,thick=2,rgb_table=69,vert_colors=vc[tii],linestyle=2,/overplot) ; ;p = plot(indgen(2),/nodata,yrange=[0,15],font_size=11,xtitle='Normalized Mixing Ratio',ytitle='Altitude above tpause (km)',title='H1211',dimensions=[460,550]) ;for tii = 0, ntlp-1 do p = plot(h1211_mean[2,*,tii],z_spec,thick=2,color=colors[tii],/overplot) ;for tii = 0, ntlp-1 do p = plot(h1211_mean[1,*,tii],z_spec,thick=2,color=colors[tii],linestyle=2,/overplot) ; ;p = plot(indgen(2),/nodata,yrange=[0,30],font_size=11,xtitle='%',ytitle='Altitude above tpause (km)',title='w$^*$ Differences',dimensions=[340,600]) ;for tii = 1, ntlp-1 do p = plot(1e2*(W_mean_tlp[1,*,tii]-W_mean_tlp[1,*,0])/W_mean_tlp[1,*,0],z_spec,thick=3,rgb_table=67,vert_colors=vc[tii],/overplot) ;p = plot([0,0],[0,30],linestyle=2,/overplot) ;p.save,dir+'Plots/Aircraft Mean Ages/Wstar_diffs_TLP_all.png' ;p = plot(indgen(2),/nodata,yrange=[0,20],font_size=11,xtitle='Years',ytitle='Altitude above tpause (km)',title='Mixing Time Scale Differences',dimensions=[450,550]) ;for tii = 1, ntlp-1 do p = plot((tau_tlp_avg[1,*,tii]-tau_tlp_avg[1,*,0])/3.1536e7,z_spec,thick=3,rgb_table=69,vert_colors=vc[tii],/overplot) ;p = plot([0,0],[0,30],linestyle=2,/overplot) ;p = plot(indgen(2),/nodata,xrange=[1.02,-0.02],yrange=[1.02,0.2],xtitle='Normalized H1211',ytitle='Normalized N$_2$O',title='N$_2$O vs. H1211',xticklen=0.02,yticklen=0.02,font_size=11, $ ; dimensions=[700,450]) ;p = errorplot(n2o_norm_h1211_norm_midlat_early[50:-1,0],n2o_norm_grid[50:-1],n2o_norm_h1211_norm_midlat_early[50:-1,1],replicate(0,nn-50),symbol='o',linestyle=6,/sym_filled,color='magenta', $ ; errorbar_capsize=0,/overplot) ;p = errorplot(n2o_norm_h1211_norm_midlat[50:-1,0],n2o_norm_grid[50:-1],n2o_norm_h1211_norm_midlat[50:-1,1],replicate(0,nn-50),symbol='o',linestyle=6,/sym_filled,color='purple',errorbar_capsize=0, $ ; /overplot) ;p = plot(h1211_norm_all,n2o_norm_b1_all,symbol='o',sym_size=1.0,color='green',linestyle=6,/overplot) ;p = errorplot(n2o_norm_h1211_norm_bal[*,0],n2o_norm_grid_bal,n2o_norm_h1211_norm_bal[*,1],replicate(0,nnb),symbol='s',sym_size=1.5,color='green',/sym_filled,linestyle=6,errorbar_capsize=0,/overplot) ;p = plot(oms_h1211_norm_midlat,oms_n2o_norm_midlat,symbol='s',sym_size=1.5,color='lime green',/sym_filled,linestyle=6,/overplot) ;p = plot([0,1],n2o_h1211_oms[0] + n2o_h1211_oms[1]*findgen(2),color='lime green',/overplot) ;p = plot([0,1],n2o_h1211_bal[0] + n2o_h1211_bal[1]*findgen(2),color='green',/overplot) ;p = plot([0,1],n2o_h1211_aircraft_early[0] + n2o_h1211_aircraft_early[1]*findgen(2),color='magenta',/overplot) ;p = plot([0,1],n2o_h1211_aircraft[0] + n2o_h1211_aircraft[1]*findgen(2),color='purple',/overplot) ;t = text(0.2,0.8,'Aircraft 1990s',color='magenta',font_size=11,/norm) ;t = text(0.2,0.76,'Aircraft 2020s',color='purple',font_size=11,/norm) ;t = text(0.2,0.72,'OMS 1990s',color='lime green',font_size=11,/norm) ;t = text(0.2,0.68,'StratCore 2020s',color='green',font_size=11,/norm) ;p = plot(indgen(2),/nodata,yrange=[1.03,0],xrange=[0,0.5],font_size=11,xtitle='Mean Age SD (years)',ytitle='Normalized N$_2$O',title='Optimized Mean Age SD') ;p = plot(bins_co2_a0.n2o_norm_age_all_nh[*,1],n2o_norm_grid,symbol='o',color='blue',/sym_filled,linestyle=6,/overplot) ;p = plot(bins_co2_a0.n2o_norm_age_all_nh_adj[*,1],n2o_norm_grid,symbol='o',color='sky blue',/sym_filled,linestyle=6,/overplot) ;p = plot(indgen(2),/nodata,yrange=[1.03,0],xrange=[0.7,1.9],font_size=12,xtitle='Ratio of Moments',ytitle='Normalized N$_2$O',title='Age Spectra Ratio of Moments',xticklen=0.04,yticklen=0.03) ;;p = errorplot(bins_b0.n2o_norm_ratio_smin_nh[*,0],n2o_norm_grid,bins_b0.n2o_norm_ratio_smin_nh[*,1],replicate(0,nn),symbol='o',color='lime green',/sym_filled,linestyle=6,errorbar_capsize=0, $ ;; /overplot) ;p = errorplot(bins_b0.n2o_norm_ratio_all_nh[*,0],n2o_norm_grid+2e-3,bins_b0.n2o_norm_ratio_all_nh[*,1],replicate(0,nn),symbol='o',color='red',linestyle=6,/sym_filled,errorbar_capsize=0,/overplot) ;p = errorplot(bins_co2_b0.n2o_norm_ratio_all_nh[*,0],n2o_norm_grid,bins_co2_b0.n2o_norm_ratio_all_nh[*,1],replicate(0,nn),symbol='o',/sym_filled,color='sky blue',linestyle=6,errorbar_capsize=0, $ ; /overplot) ;p = errorplot(bins_a0.n2o_norm_ratio_all_nh[*,0],n2o_norm_grid,bins_a0.n2o_norm_ratio_all_nh[*,1],replicate(0,nn),symbol='o',color='blue',linestyle=6,/sym_filled,errorbar_capsize=0,/overplot) ;p = errorplot(bins.n2o_norm_ratio_all_nh[*,0],n2o_norm_grid,bins.n2o_norm_ratio_all_nh[*,1],replicate(0,nn),symbol='o',color='blue',linestyle=6,/sym_filled,errorbar_capsize=0,/overplot) ;p = errorplot(bins.n2o_norm_ratio_all_tr[*,0],n2o_norm_grid,bins.n2o_norm_ratio_all_tr[*,1],replicate(0,nn),symbol='o',color='sky blue',linestyle=6,/sym_filled,errorbar_capsize=0,/overplot) ;p = errorplot(ratios_sm,n2o_norm_grid[gdb],bins_a0.n2o_norm_ratio_all_nh[gdb,1],replicate(0,ngdb),color='blue',thick=2,errorbar_capsize=0,/overplot) ;p = errorplot(ratios_tr_sm,n2o_norm_grid[gdbt],bins.n2o_norm_ratio_all_tr[gdbt,1],replicate(0,ngdbt),color='sky blue',thick=2,errorbar_capsize=0,/overplot) ;p = errorplot(bins_a0.n2o_norm_ratio_all_tr[*,0],n2o_norm_grid,bins_a0.n2o_norm_ratio_all_tr[*,1],replicate(0,nn),symbol='o',color='sky blue',linestyle=6,/sym_filled,errorbar_capsize=0,/overplot) ;p = errorplot(bins_b0.n2o_norm_ratio_all_tr[*,0],n2o_norm_grid,bins_b0.n2o_norm_ratio_all_tr[*,1],replicate(0,nn),symbol='o',color='orange',linestyle=6,/sym_filled,errorbar_capsize=0,/overplot) ;;p = errorplot(bins_a0.n2o_norm_ratio_smin_nh[*,0],n2o_norm_grid,bins_a0.n2o_norm_ratio_smin_nh[*,1],replicate(0,nn),symbol='o',color='dodger blue',linestyle=6,/sym_filled,errorbar_capsize=0, $ ;; /overplot) ;p = errorplot(bins_co2_a0.n2o_norm_ratio_all_nh[*,0],n2o_norm_grid,bins_co2_a0.n2o_norm_ratio_all_nh[*,1],replicate(0,nn),symbol='o',color='blue',linestyle=6,/sym_filled,errorbar_capsize=0, $ ; /overplot) ;;;p = errorplot(ratios,n2o_norm[isf6],ratios_sd,replicate(0,nsf6),symbol='o',/sym_filled,color='blue',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins_sf6_a2.n2o_norm_ratio_all_nh[*,0],n2o_norm_grid,bins_sf6_a2.n2o_norm_ratio_all_nh[*,1],replicate(0,nn),symbol='o',/sym_filled,color='red',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins_co2_b2.n2o_norm_ratio_all_nh[*,0],n2o_norm_grid,bins_co2_b2.n2o_norm_ratio_all_nh[*,1],replicate(0,nn),symbol='o',/sym_filled,color='dark orange',linestyle=6, $ ; errorbar_capsize=0,/overplot) ;;;for t = 0, 13 do p = errorplot(bins.n2o_norm_ratio_all_nh_years[*,0,ti[t]],n2o_norm_grid,bins.n2o_norm_ratio_all_nh_years[*,1,ti[t]],replicate(0,nn),symbol='o',sym_size=0.75,/sym_filled, $ ;;; color=colors[t],linestyle=6,errorbar_capsize=0,/overplot) ;t = text(0.22,0.8,'1990s Aircraft (ER-2)',font_size=11,color='blue',/norm) ;t = text(0.22,0.76,'1990s Balloon (OMS)',font_size=11,color='sky blue',/norm) ;t = text(0.22,0.72,'2020s Aircraft (ER-2, WB-57)',font_size=11,color='red',/norm) ;t = text(0.22,0.68,'2020s Balloon (AirCore)',font_size=11,color='dark orange',/norm) ;;p.save,dir+'Plots/Aircraft Mean Ages/Ratio_of_moments_vs_N2O_norm.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Ratio_of_moments_vs_N2O_norm2.png' ;p = plot(indgen(2),/nodata,yrange=[1.03,0],xrange=[0.7,1.9],font_size=12,xtitle='$\Delta$$^2$/$\Gamma$ (years)',ytitle='Normalized N$_2$O',title='Age Spectra Ratio of Moments',xticklen=0.04, $ ; yticklen=0.03) ;p = errorplot(bins_b0.n2o_norm_ratio_all_nh[*,0],n2o_norm_grid+2e-3,bins_b0.n2o_norm_ratio_all_nh[*,1],replicate(0,nn),symbol='o',color='red',linestyle=6,/sym_filled,errorbar_capsize=0,/overplot) ;p = errorplot(bins_a0.n2o_norm_ratio_all_nh[*,0],n2o_norm_grid,bins_a0.n2o_norm_ratio_all_nh[*,1],replicate(0,nn),symbol='o',color='blue',linestyle=6,/sym_filled,errorbar_capsize=0,/overplot) ;p = errorplot(bins_a0.n2o_norm_ratio_all_tr[*,0],n2o_norm_grid,bins_a0.n2o_norm_ratio_all_tr[*,1],replicate(0,nn),symbol='o',color='sky blue',linestyle=6,/sym_filled,errorbar_capsize=0,/overplot) ;p = errorplot(bins_b0.n2o_norm_ratio_all_tr[*,0],n2o_norm_grid,bins_b0.n2o_norm_ratio_all_tr[*,1],replicate(0,nn),symbol='o',color='orange',linestyle=6,/sym_filled,errorbar_capsize=0,/overplot) ;t = text(0.22,0.8,'Aircraft NH',font_size=11,color='blue',/norm) ;t = text(0.22,0.76,'Balloon NH',font_size=11,color='red',/norm) ;t = text(0.22,0.72,'Aircraft Tropics',font_size=11,color='sky blue',/norm) ;t = text(0.22,0.68,'Balloon Tropics',font_size=11,color='orange',/norm) ;p.save,dir+'Plots/Aircraft Mean Ages/Ratio_of_moments_vs_N2O_norm_early.png' ;p = plot(indgen(2),/nodata,yrange=[1.03,0],xrange=[0.7,1.9],font_size=12,xtitle='$\Delta$$^2$/$\Gamma$ (years)',ytitle='Normalized N$_2$O',title='Age Spectra Ratio of Moments',xticklen=0.04, $ ; yticklen=0.03) ;p = errorplot(bins_co2_a2.n2o_norm_ratio_all[*,0],n2o_norm_grid,bins_co2_a2.n2o_norm_ratio_all[*,1],replicate(0,nn),symbol='o',/sym_filled,color='blue',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins_co2_b2.n2o_norm_ratio_all[*,0],n2o_norm_grid,bins_co2_b2.n2o_norm_ratio_all[*,1],replicate(0,nn),symbol='o',/sym_filled,color='orange',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins_sf6_a2.n2o_norm_ratio_all_m[*,0,19],n2o_norm_grid,bins_sf6_a2.n2o_norm_ratio_all_m[*,1,19],replicate(0,nn),symbol='o',/sym_filled,color='lime green',linestyle=6, $ ; errorbar_capsize=0,/overplot) ;t = text(0.2,0.8,'DCOTSS',color='blue',font_size=11,/norm) ;t = text(0.2,0.76,'SABRE',color='lime green',font_size=11,/norm) ;t = text(0.2,0.72,'StratoCore',color='orange',font_size=11,/norm) ;p = plot(indgen(2),/nodata,yrange=[1.03,0],xrange=[0.7,1.9],font_size=12,xtitle='$\Delta$$^2$/$\Gamma$ (years)',ytitle='Normalized N$_2$O',title='Age Spectra Ratio of Moments from CO2', $ ; xticklen=0.04,yticklen=0.03) ;p = errorplot(bins_co2_b0.n2o_norm_ratio_all_nh[*,0],n2o_norm_grid+2e-3,bins_co2_b0.n2o_norm_ratio_all_nh[*,1],replicate(0,nn),symbol='o',color='red',linestyle=6,/sym_filled,errorbar_capsize=0, $ ; /overplot) ;p = errorplot(bins_co2_a0.n2o_norm_ratio_all_nh[*,0],n2o_norm_grid,bins_co2_a0.n2o_norm_ratio_all_nh[*,1],replicate(0,nn),symbol='o',color='blue',linestyle=6,/sym_filled,errorbar_capsize=0,/overplot) ;p = errorplot(bins_co2_a0.n2o_norm_ratio_all_tr[*,0],n2o_norm_grid,bins_co2_a0.n2o_norm_ratio_all_tr[*,1],replicate(0,nn),symbol='o',color='sky blue',linestyle=6,/sym_filled,errorbar_capsize=0, $ ; /overplot) ;p = errorplot(bins_co2_b0.n2o_norm_ratio_all_tr[*,0],n2o_norm_grid,bins_co2_b0.n2o_norm_ratio_all_tr[*,1],replicate(0,nn),symbol='o',color='orange',linestyle=6,/sym_filled,errorbar_capsize=0, $ ; /overplot) ;t = text(0.22,0.8,'Aircraft NH',font_size=11,color='blue',/norm) ;t = text(0.22,0.76,'Balloon NH',font_size=11,color='red',/norm) ;t = text(0.22,0.72,'Aircraft Tropics',font_size=11,color='sky blue',/norm) ;t = text(0.22,0.68,'Balloon Tropics',font_size=11,color='orange',/norm) ;p = plot(indgen(2),/nodata,yrange=[1.03,0.1],xrange=[0.3,2],font_size=11,xtitle='Ratio of Moments',ytitle='Normalized N$_2$O',title='Age Spectra Ratio of Moments',dimensions=[450,550]) ;;p = errorplot(bins_b0.n2o_norm_ratio_all_nh[*,0],n2o_norm_grid,bins_b0.n2o_norm_ratio_all_nh[*,1],replicate(0,nn),symbol='o',/sym_filled,color='sky blue',linestyle=6,errorbar_capsize=0, $ ;; /overplot) ;p = errorplot(bins_co2_b0.n2o_norm_ratio_all_nh[*,0],n2o_norm_grid,bins_co2_b0.n2o_norm_ratio_all_nh[*,1],replicate(0,nn),symbol='o',/sym_filled,color='sky blue',linestyle=6,errorbar_capsize=0, $ ; /overplot) ;p = errorplot(bins_a0.n2o_norm_ratio_all_nh[*,0],n2o_norm_grid,bins_a0.n2o_norm_ratio_all_nh[*,1],replicate(0,nn),symbol='o',color='blue',linestyle=6,/sym_filled,errorbar_capsize=0,/overplot) ;;p = errorplot(bins_a0.n2o_norm_ratio_smin_nh[*,0],n2o_norm_grid,bins_a0.n2o_norm_ratio_smin_nh[*,1],replicate(0,nn),symbol='o',color='dodger blue',linestyle=6,/sym_filled,errorbar_capsize=0, $ ;; /overplot) ;p = errorplot(bins_co2_a0.n2o_norm_ratio_all_nh[*,0],n2o_norm_grid,bins_co2_a0.n2o_norm_ratio_all_nh[*,1],replicate(0,nn),symbol='o',color='blue',linestyle=6,/sym_filled,errorbar_capsize=0, $ ; /overplot) ;;;p = errorplot(ratios,n2o_norm[isf6],ratios_sd,replicate(0,nsf6),symbol='o',/sym_filled,color='blue',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins.n2o_norm_ratio_all_nh[*,0],n2o_norm_grid,bins.n2o_norm_ratio_all_nh[*,1],replicate(0,nn),symbol='o',color='dodger blue',linestyle=6,/sym_filled,errorbar_capsize=0,/overplot) ;p = errorplot(bins_sf6_a2.n2o_norm_ratio_all_nh[*,0],n2o_norm_grid,bins_sf6_a2.n2o_norm_ratio_all_nh[*,1],replicate(0,nn),symbol='o',/sym_filled,color='red',linestyle=6,errorbar_capsize=0,/overplot) ;;;for t = 0, 13 do p = errorplot(bins.n2o_norm_ratio_all_nh_years[*,0,ti[t]],n2o_norm_grid,bins.n2o_norm_ratio_all_nh_years[*,1,ti[t]],replicate(0,nn),symbol='o',sym_size=0.75,/sym_filled, $ ;;; color=colors[t],linestyle=6,errorbar_capsize=0,/overplot) ;t = text(0.4,0.6,'1990s',color='blue',font_size=11,/norm) ;t = text(0.4,0.56,'2020s',color='red',font_size=11,/norm) ;p.save,dir+'Plots/Aircraft Mean Ages/Ratio_of_moments_vs_N2O_norm_aircraft.png' ;p = plot(indgen(2),/nodata,yrange=[1.03,0],xrange=[0.5,2.2],font_size=11,xtitle='Ratio of Moments',ytitle='Normalized N$_2$O',title='Aircraft Age Spectra Ratio of Moments vs. N$_2$O') ;gd = where(finite(bins_a0.n2o_norm_ratio_all[*,0]),ngd) ;poly = polygon([bins_a0.n2o_norm_ratio_all[gd,0]-0.4,reverse(bins_a0.n2o_norm_ratio_all[gd,0]+0.4)],[n2o_norm_grid[gd],reverse(n2o_norm_grid[gd])],/fill_background,/data,fill_color='sky blue', $ ; transparency=50,color='white') ;p = errorplot(bins_a0.n2o_norm_ratio_all[*,0],n2o_norm_grid,bins_a0.n2o_norm_ratio_all[*,1],replicate(0,nn),symbol='o',/sym_filled,color='blue',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins_co2_a0.n2o_norm_ratio_all[*,0],n2o_norm_grid,bins_co2_a0.n2o_norm_ratio_all[*,1],replicate(0,nn),symbol='o',color='red',linestyle=6,errorbar_capsize=0,/overplot) ;t = text(0.22,0.8,'Both tracers optimization',color='blue',font_size=11,/norm) ;t = text(0.22,0.76,'Constrained range',color='sky blue',font_size=11,/norm) ;t = text(0.22,0.72,'CO$_2$ only',color='red',font_size=11,/norm) ;p.save,dir+'Plots/Aircraft Mean Ages/Ratios_vs_N2O_norm_both_vs_CO2_only.png' ;p = plot(indgen(2),/nodata,yrange=[1.03,0.6],font_size=12,xtitle='Lat Source',ytitle='Normalized N$_2$O',title='Surface Source Latitudes vs. N$_2$O '+mission_names[19],dimensions=[470,550]) ;;p = errorplot(bins_sf6.n2o_norm_lat_source_all_nh[*,0],n2o_norm_grid,bins_sf6.n2o_norm_lat_source_all_nh[*,1],replicate(0,nn),symbol='o',color='blue',linestyle=6,errorbar_capsize=0,/overplot) ;for m = 19, 19 do p = errorplot(bins_sf6.n2o_norm_lat_source_all_nh_m[*,0,m],n2o_norm_grid,bins_sf6.n2o_norm_lat_source_all_nh_m[*,1,m],replicate(0,nn),symbol='o',color='blue',linestyle=6, $ ; /sym_filled,sym_size=1.5,errorbar_capsize=0,/overplot) ;for m = 19, 19 do p = errorplot(bins_sf6.n2o_norm_lat_source_all_tr_m[*,0,m],n2o_norm_grid,bins_sf6.n2o_norm_lat_source_all_tr_m[*,1,m],replicate(0,nn),symbol='o',color='orange',linestyle=6, $ ; /sym_filled,sym_size=1.5,errorbar_capsize=0,/overplot) ;;for t = 0, 13 do p = errorplot(bins.n2o_norm_lat_source_all_nh_years[*,0,ti[t]],n2o_norm_grid,bins.n2o_norm_lat_source_all_nh_years[*,1,ti[t]],replicate(0,nn),symbol='o',/sym_filled, $ ;; color=colors[t],linestyle=6,errorbar_capsize=0,/overplot) ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_lat_vs_N2O_norm_SF6_'+mission_names[19]+'.png' ; ;p = plot(indgen(2),/nodata,yrange=[1.03,0.6],font_size=12,xtitle='Fraction',ytitle='Normalized N$_2$O',title='Extratropical Surface Source Fraction vs. N$_2$O '+mission_names[19], $ ; dimensions=[470,550]) ;for m = 19, 19 do p = errorplot(bins_sf6.n2o_norm_frac_extra_all_nh_m[*,0,m],n2o_norm_grid,bins_sf6.n2o_norm_frac_extra_all_nh_m[*,1,m],replicate(0,nn),symbol='o',color='blue',linestyle=6, $ ; /sym_filled,sym_size=1.5,errorbar_capsize=0,/overplot) ;for m = 19, 19 do p = errorplot(bins_sf6.n2o_norm_frac_extra_all_tr_m[*,0,m],n2o_norm_grid,bins_sf6.n2o_norm_frac_extra_all_tr_m[*,1,m],replicate(0,nn),symbol='o',color='orange',linestyle=6, $ ; /sym_filled,sym_size=1.5,errorbar_capsize=0,/overplot) ;p.save,dir+'Plots/Aircraft Mean Ages/Extra_frac_vs_N2O_norm_SF6_'+mission_names[19]+'.png' ;p = plot(indgen(2),/nodata,xrange=[20,90],yrange=[1.03,0.1],font_size=11,xtitle='Equivalent Latitude',ytitle='Normalized N$_2$O',title='Sampled Equivalent Latitudes') ;p = errorplot(bins_co2_b0.n2o_norm_elat_nh[*,0],n2o_norm_grid,bins_co2_b0.n2o_norm_elat_nh[*,1],replicate(0,nn),symbol='o',/sym_filled,color='sky blue',linestyle=6,errorbar_capsize=0,/overplot) ;p = errorplot(bins_a0.n2o_norm_elat_nh[*,0],n2o_norm_grid,bins_a0.n2o_norm_elat_nh[*,1],replicate(0,nn),symbol='o',color='blue',linestyle=6,/sym_filled,errorbar_capsize=0,/overplot) ;p = errorplot(bins.n2o_norm_elat_nh[*,0],n2o_norm_grid,bins.n2o_norm_elat_nh[*,1],replicate(0,nn),symbol='o',color='orange',linestyle=6,/sym_filled,errorbar_capsize=0,/overplot) ;p = errorplot(bins_sf6.n2o_norm_elat_nh[*,0],n2o_norm_grid,bins_sf6.n2o_norm_elat_nh[*,1],replicate(0,nn),symbol='o',color='red',linestyle=6,/sym_filled,errorbar_capsize=0,/overplot) ;t = text(0.22,0.8,'1990s',color='blue',/norm) ;t = text(0.22,0.76,'2020s',color='red',/norm) ;p = plot(indgen(2),/nodata,yrange=[1.03,0],font_size=11,xtitle='SF6',ytitle='Normalized N$_2$O',title='SF6 Binning') ;;p = errorplot(bins.n2o_norm_sf6_nh[*,0],n2o_norm_grid,bins.n2o_norm_sf6_nh[*,1],replicate(0,nn),symbol='o',/sym_filled,color='blue',linestyle=6,errorbar_capsize=0,/overplot) ;for m = 17, 18 do begin ; p = errorplot(bins.n2o_norm_sf6_nh_m[*,0,m],n2o_norm_grid,bins.n2o_norm_sf6_nh_m[*,1,m],replicate(0,nn),symbol='o',/sym_filled,color=colors[m],linestyle=6,errorbar_capsize=0,/overplot) ; gd = where(finite(bins.n2o_norm_sf6_nh_m[*,0,m]),ngd) ; print,m,ngd ; if ngd gt 9 then p = plot(lowpass_cfc(bins.n2o_norm_sf6_nh_m[gd,0,m], BOX=9, EDGE_PFCAST=1),n2o_norm_grid[gd],color=colors[m],thick=2,/overplot) ;endfor ;p = plot(indgen(2),/nodata,xrange=[sf6_scale_all[0]-.01,sf6_scale_all[-1]+.01],yrange=[co2_scale_all[0]-.01,co2_scale_all[-1]+.01],xtitle='SF$_6$ Scale',ytitle='CO$_2$ Scale', $ ; title='Total Differences') ;for bb = 0, ns-1 do begin ; gd = where(finite(bins.n2o_norm_diffs_nh_sweep[*,bb,i,0]),ngd) ; if ngd gt 0 then begin ; vcols = 2500 * bins.n2o_norm_diffs_nh_sweep[gd,bb,i,0] ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(sf6_scale_all[gd],replicate(co2_scale_all[bb],ngd),symbol='s',sym_size=1.2,/sym_filled,rgb_table=39,vert_colors=vcols,linestyle=6,/overplot) ; endif ;endfor ;s = symbol(bins.n2o_norm_sf6_scale_nh[ni,0],bins.n2o_norm_co2_scale_nh[ni,0],'s',sym_size=1.5,/sym_filled,/data,sym_color='magenta') ;p = plot([sf6_scale_all[0]-.01,sf6_scale_all[-1]+.01],[0,0],linestyle=2,/overplot) ;p = plot([0,0],[co2_scale_all[0]-.01,co2_scale_all[-1]+.01],linestyle=2,/overplot) ;p = plot(indgen(2),/nodata,xrange=[sf6_scale_all[0]-.01,sf6_scale_all[-1]+.01],yrange=[co2_scale_all[0]-.01,co2_scale_all[-1]+.01],xtitle='SF$_6$ Scale',ytitle='CO$_2$ Scale',title='Mean Ages') ;for bb = 0, ns-1 do begin ; gd = where(finite(bins.n2o_norm_age_nh_sweep[*,bb,ni,0]),ngd) ; if ngd gt 0 then begin ; vcols = 40 * bins.n2o_norm_age_nh_sweep[gd,bb,ni,0] ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(sf6_scale_all[gd],replicate(co2_scale_all[bb],ngd),symbol='s',sym_size=1.2,/sym_filled,rgb_table=39,vert_colors=vcols,linestyle=6,/overplot) ; endif ;endfor ;s = symbol(bins.n2o_norm_sf6_scale_nh[ni,0],bins.n2o_norm_co2_scale_nh[ni,0],'s',sym_size=1.5,/sym_filled,/data,sym_color='magenta') ;p = plot([sf6_scale_all[0]-.01,sf6_scale_all[-1]+.01],[0,0],linestyle=2,/overplot) ;p = plot([0,0],[co2_scale_all[0]-.01,co2_scale_all[-1]+.01],linestyle=2,/overplot) ; ;test = where(finite(bins.n2o_norm_diffs_nh_sweep_years[ns/2-5,ns/2,ni,0,*])) ;print,test ; ;p = plot(indgen(2),/nodata,xrange=[sf6_scale_all[0]-.01,sf6_scale_all[-1]+.01],yrange=[co2_scale_all[0]-.01,co2_scale_all[-1]+.01],xtitle='SF$_6$ Scale',ytitle='CO$_2$ Scale', $ ; title='Total Differences') ;for bb = 0, ns-1 do begin ; gd = where(finite(bins.n2o_norm_diffs_nh_sweep_years[*,bb,ni,0,tt]),ngd) ; if ngd gt 0 then begin ; vcols = 2500 * bins.n2o_norm_diffs_nh_sweep_years[gd,bb,ni,0,tt] ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(sf6_scale_all[gd],replicate(co2_scale_all[bb],ngd),symbol='s',sym_size=1.2,/sym_filled,rgb_table=39,vert_colors=vcols,linestyle=6,/overplot) ; endif ;endfor ;s = symbol(bins.n2o_norm_sf6_scale_nh_years[ni,0,tt],bins.n2o_norm_co2_scale_nh_years[ni,0,tt],'s',sym_size=1.5,/sym_filled,/data,sym_color='magenta') ;p = plot([sf6_scale_all[0]-.01,sf6_scale_all[-1]+.01],[0,0],linestyle=2,/overplot) ;p = plot([0,0],[co2_scale_all[0]-.01,co2_scale_all[-1]+.01],linestyle=2,/overplot) ; ;p = plot(indgen(2),/nodata,xrange=[sf6_scale_all[0]-.01,sf6_scale_all[-1]+.01],yrange=[co2_scale_all[0]-.01,co2_scale_all[-1]+.01],xtitle='SF$_6$ Scale',ytitle='CO$_2$ Scale',title='Mean Ages') ;for bb = 0, ns-1 do begin ; gd = where(finite(bins.n2o_norm_age_nh_sweep_years[*,bb,ni,0,tt]),ngd) ; if ngd gt 0 then begin ; vcols = 40 * bins.n2o_norm_age_nh_sweep_years[gd,bb,ni,0,tt] ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(sf6_scale_all[gd],replicate(co2_scale_all[bb],ngd),symbol='s',sym_size=1.2,/sym_filled,rgb_table=39,vert_colors=vcols,linestyle=6,/overplot) ; endif ;endfor ;s = symbol(bins.n2o_norm_sf6_scale_nh_years[ni,0,tt],bins.n2o_norm_co2_scale_nh_years[ni,0,tt],'s',sym_size=1.5,/sym_filled,/data,sym_color='magenta') ;p = plot([sf6_scale_all[0]-.01,sf6_scale_all[-1]+.01],[0,0],linestyle=2,/overplot) ;p = plot([0,0],[co2_scale_all[0]-.01,co2_scale_all[-1]+.01],linestyle=2,/overplot) ; ;p = plot(indgen(2),/nodata,xrange=[sf6_scale_all[0]-.01,sf6_scale_all[-1]+.01],yrange=[co2_scale_all[0]-.01,co2_scale_all[-1]+.01],xtitle='SF$_6$ Scale',ytitle='CO$_2$ Scale', $ ;title='Ratio of Moments') ;for bb = 0, ns-1 do begin ; gd = where(finite(bins.n2o_norm_ratio_nh_sweep_years[*,bb,ni,0,tt]),ngd) ; if ngd gt 0 then begin ; vcols = 100 * bins.n2o_norm_ratio_nh_sweep_years[gd,bb,ni,0,tt] ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(sf6_scale_all[gd],replicate(co2_scale_all[bb],ngd),symbol='s',sym_size=1.2,/sym_filled,rgb_table=39,vert_colors=vcols,linestyle=6,/overplot) ; endif ;endfor ;s = symbol(bins.n2o_norm_sf6_scale_nh_years[ni,0,tt],bins.n2o_norm_co2_scale_nh_years[ni,0,tt],'s',sym_size=1.5,/sym_filled,/data,sym_color='magenta') ;p = plot([sf6_scale_all[0]-.01,sf6_scale_all[-1]+.01],[0,0],linestyle=2,/overplot) ;p = plot([0,0],[co2_scale_all[0]-.01,co2_scale_all[-1]+.01],linestyle=2,/overplot) ;p = plot(indgen(2),/nodata,xrange=[sf6_scale_all[0]+0.1,sf6_scale_all[-1]-0.1],yrange=[co2_scale_all[2]-.01,co2_scale_all[-3]+.01],xtitle='SF$_6$ Scale',ytitle='CO$_2$ Scale', $ ; title='Total Differences',font_size=11,margin=0.12,dimensions=[700,450]) ;for bb = 0, nsc-1 do begin ;; gd = where(finite(dat.diffs_both_min_tot[*,bb,i]),ngd) ; gd = where(finite(diffs_both_min_tot[*,bb,i]),ngd) ; if ngd gt 0 then begin ; vcols = 400 * diffs_both_min_tot[gd,bb,i] + 100 ;; vcols = 100 * diffs_both_avg[gd,bb,i] + 100 ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(sf6_scale_all[gd],replicate(co2_scale_all[bb],ngd),symbol='s',sym_size=5,/sym_filled,rgb_table=3,vert_colors=vcols,linestyle=6,/overplot) ;; chk = where(diffs_both_min_tot[gd,bb,i] le 0.1,nchk) ;; if nchk gt 0 then p = plot(sf6_scale_all[gd[chk]],replicate(co2_scale_all[bb],nchk),symbol='s',sym_size=1.5,/sym_filled,color='blue',linestyle=6,/overplot) ;; c = contour(dat.diffs_both_min_tot[*,*,i],sf6_scale_all,co2_scale_all,c_value=[0.05,0.05],c_color=replicate('magenta',2),c_thick=2,c_label_show=0,/overplot) ; endif ;endfor ;s = symbol(sf6_scale_opt_all[i],co2_scale_opt_all[i],'s',sym_size=1.5,/sym_filled,/data,sym_color='pink') ;s = symbol(sf6_scale_opt_smin[i],co2_scale_opt_smin[i],'s',sym_size=1.5,/sym_filled,/data,sym_color='magenta') ;;s = symbol(sf6_scale_opt_all2[i],co2_scale_opt_all2[i],'s',sym_size=1.5,/sym_filled,/data,sym_color='orange') ;p = plot([sf6_scale_all[0]-.01,sf6_scale_all[-1]+.01],[0,0],linestyle=2,/overplot) ;p = plot([0,0],[co2_scale_all[0]-.01,co2_scale_all[-1]+.01],linestyle=2,/overplot) ;rgb_3_d = rgb_3[100 + 30*INDGEN(6), *] ;cb = COLORBAR(POSITION=[0.9,0.25,0.92,0.8],tickname=tickname_s3,RGB_TABLE=rgb_3_d,BORDER=1, ORIENTATION=1,/textpos,font_size=10,title='min($\delta\chi$$_{\cap}$)') ;;;p.save,dir+'Plots/Aircraft Mean Ages/Scaling_min_diffs_19970506.png' ;;p.save,dir+'Plots/Aircraft Mean Ages/Scaling_min_diffs_19941104.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Scaling_min_diffs_20000114.png' ;p = plot(indgen(2),/nodata,xrange=[sf6_scale_all[0]+0.1,sf6_scale_all[-1]-0.1],yrange=[co2_scale_all[2]-.01,co2_scale_all[-3]+.01],xtitle='SF$_6$ Scale',ytitle='CO$_2$ Scale', $ ; title='Differences',font_size=11,margin=0.12,dimensions=[700,450]) ;for bb = 0, nsc-1 do begin ; gd = where(finite(diffs_both_min_tot_num[*,bb,i]),ngd) ; if ngd gt 0 then begin ; vcols = 3*diffs_both_min_tot_num[gd,bb,i]+20 ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; p = plot(sf6_scale_all[gd],replicate(co2_scale_all[bb],ngd),symbol='s',sym_size=5,/sym_filled,rgb_table=56,vert_colors=vcols,linestyle=6,/overplot) ; endif ; gd = where(diffs_both_min_tot_num[16:-17,bb,i] ge 4,ngd) ; if ngd gt 0 then p = plot(sf6_scale_all[gd+16],replicate(co2_scale_all[bb],ngd),symbol='s',sym_size=3,color='sky blue',linestyle=6,/overplot) ;endfor ;s = symbol(sf6_scale_opt_all[i],co2_scale_opt_all[i],'s',sym_size=1.5,/sym_filled,/data,sym_color='pink') ;;s = symbol(sf6_scale_opt_all2[i],co2_scale_opt_all2[i],'s',sym_size=1.5,/sym_filled,/data,sym_color='orange') ;p = plot([sf6_scale_all[0]-.01,sf6_scale_all[-1]+.01],[0,0],linestyle=2,/overplot) ;p = plot([0,0],[co2_scale_all[0]-.01,co2_scale_all[-1]+.01],linestyle=2,/overplot) ;rgb_56_d = rgb_56[20 + 45*INDGEN(6), *] ;cb = COLORBAR(POSITION=[0.9,0.25,0.92,0.8],tickname=tickname_n,RGB_TABLE=rgb_56_d,BORDER=1, ORIENTATION=1,/textpos,font_size=10,title='Count with $\delta\chi$$_{\cap}$<0.1') ;;;p.save,dir+'Plots/Aircraft Mean Ages/Scaling_min_diff_count_19970506.png' ;;p.save,dir+'Plots/Aircraft Mean Ages/Scaling_min_diff_count_19941104.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Scaling_min_diff_count_20000114.png' ;p = plot(indgen(2),/nodata,xrange=[sf6_scale_all[0]-.01,sf6_scale_all[-1]+.01],yrange=[co2_scale_all[0]-.01,co2_scale_all[-1]+.01],xtitle='SF$_6$ Scale',ytitle='CO$_2$ Scale', $ ; title='Optimal Mean Age Differences From No Shift',font_size=11,margin=0.12,dimensions=[700,450]) ;oage = opt_age_diffs_all[ns/2,nsc/2,i] ;for bb = 0, nsc-1 do begin ; gd = where(finite(diffs_both_min_tot[*,bb,i]),ngd) ; oages = opt_age_diffs_all[gd,bb,i] ; vcols = 60 * (oages - oage + 2) ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(sf6_scale_all[gd],replicate(co2_scale_all[bb],ngd),symbol='s',sym_size=2.75,/sym_filled,rgb_table=68,vert_colors=vcols,linestyle=6,/overplot) ;endfor ;c = contour(opt_age_diffs_all[*,*,i]-oage,sf6_scale_all,co2_scale_all,c_value=findgen(9)*0.5-2,c_color=replicate('dark orange',9),c_thick=1,c_label_show=1,/overplot) ;p = plot([sf6_scale_all[0]-.01,sf6_scale_all[-1]+.01],[0,0],linestyle=2,/overplot) ;p = plot([0,0],[co2_scale_all[0]-.01,co2_scale_all[-1]+.01],linestyle=2,/overplot) ;rgb_68_d = rgb_68[31*INDGEN(9), *] ;cb = COLORBAR(POSITION=[0.9,0.25,0.92,0.8],tickname=tickname_r3,RGB_TABLE=rgb_68_d,BORDER=1, ORIENTATION=1,/textpos,font_size=10,title='Years') ;p = plot(indgen(2),/nodata,xrange=[sf6_scale_all[0]+0.1,sf6_scale_all[-1]-0.3],yrange=[co2_scale_all[3]-.01,co2_scale_all[-4]+.01],xtitle='SF$_6$ Scale',ytitle='CO$_2$ Scale', $ ; title='Optimal Mean Ages With Shifts',font_size=11,margin=0.12,dimensions=[700,450]) ;for bb = 0, nsc-1 do begin ; gd = where(finite(diffs_both_min_tot[*,bb,i]) and finite(opt_age_diffs_all[*,bb,i]),ngd) ; if ngd gt 1 then begin ; print,opt_age_diffs_all[gd,bb,i] ; vcols = 200 * (opt_age_diffs_all[gd,bb,i]-1) ;; vcols = 500 * (opt_age_diffs_all[gd,bb,i]-3.7) ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(sf6_scale_all[gd],replicate(co2_scale_all[bb],ngd),symbol='s',sym_size=5,/sym_filled,rgb_table=68,vert_colors=vcols,linestyle=6,/overplot) ; endif ;endfor ;c = contour(opt_age_diffs_all[*,*,i],sf6_scale_all,co2_scale_all,c_value=findgen(6)*0.25+1,c_color=replicate('dark orange',9),c_thick=1,c_label_show=1,/overplot) ;;c = contour(opt_age_diffs_all[*,*,i],sf6_scale_all,co2_scale_all,c_value=findgen(6)*0.1+3.7,c_color=replicate('dark orange',9),c_thick=1,c_label_show=1,/overplot) ;s = symbol(sf6_scale_opt_all[i],co2_scale_opt_all[i],'s',sym_size=1.5,/sym_filled,/data,sym_color='pink') ;p = plot([sf6_scale_all[0]-.01,sf6_scale_all[-1]+.01],[0,0],linestyle=2,/overplot) ;p = plot([0,0],[co2_scale_all[0]-.01,co2_scale_all[-1]+.01],linestyle=2,/overplot) ;;rgb_68_d = rgb_68[31*INDGEN(9), *] ;rgb_68_d = rgb_68[50*INDGEN(6), *] ;cb = COLORBAR(POSITION=[0.895,0.25,0.915,0.8],tickname=tickname_r5,RGB_TABLE=rgb_68_d,BORDER=1, ORIENTATION=1,/textpos,font_size=10,title='$\Gamma$ (years)') ;p.save,dir+'Plots/Aircraft Mean Ages/Scaling_opt_ages_19970506.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Scaling_opt_ages_19941104.png' ;p = plot(indgen(2),/nodata,xrange=[sf6_scale_all[0]+0.1,sf6_scale_all[-1]-0.3],yrange=[co2_scale_all[3]-.01,co2_scale_all[-4]+.01],xtitle='SF$_6$ Scale',ytitle='CO$_2$ Scale', $ ; title='Optimal Ratio of Moments With Shifts',font_size=11,margin=0.12,dimensions=[700,450]) ;;oratio = opt_ratio_diffs_all[ns/2,nsc/2,i] ;for bb = 0, nsc-1 do begin ; gd = where(finite(diffs_both_min_tot[*,bb,i]) and finite(opt_age_diffs_all[*,bb,i]),ngd) ;; oratios = opt_ratio_diffs_all[gd,bb,i] ;; vcols = 100 * (oratios - oratio + 1.2) ; if ngd gt 1 then begin ; vcols = 100 * opt_ratio_diffs_all[gd,bb,i] ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(sf6_scale_all[gd],replicate(co2_scale_all[bb],ngd),symbol='s',sym_size=5,/sym_filled,rgb_table=68,vert_colors=vcols,linestyle=6,/overplot) ; endif ;endfor ;;c = contour(opt_ratio_diffs_all[*,*,i]-oratio,sf6_scale_all,co2_scale_all,c_value=findgen(9)*0.3-1.2,c_color=replicate('dark orange',9),c_thick=1,c_label_show=1,/overplot) ;c = contour(opt_ratio_diffs_all[*,*,i],sf6_scale_all,co2_scale_all,c_value=findgen(6)*0.5,c_color=replicate('dark orange',9),c_thick=1,c_label_show=1,/overplot) ;s = symbol(sf6_scale_opt_all[i],co2_scale_opt_all[i],'s',sym_size=1.5,/sym_filled,/data,sym_color='pink') ;p = plot([sf6_scale_all[0]-.01,sf6_scale_all[-1]+.01],[0,0],linestyle=2,/overplot) ;p = plot([0,0],[co2_scale_all[0]-.01,co2_scale_all[-1]+.01],linestyle=2,/overplot) ;;rgb_68_d = rgb_68[31*INDGEN(9), *] ;rgb_68_d = rgb_68[50*INDGEN(6), *] ;;cb = COLORBAR(POSITION=[0.9,0.25,0.92,0.8],tickname=tickname_r4,RGB_TABLE=rgb_68_d,BORDER=1, ORIENTATION=1,/textpos,font_size=10,title='Years') ;cb = COLORBAR(POSITION=[0.9,0.25,0.92,0.8],tickname=tickname_r,RGB_TABLE=rgb_68_d,BORDER=1, ORIENTATION=1,/textpos,font_size=10,title='$\Delta$$^2$/$\Gamma$ (years)') ;;p.save,dir+'Plots/Aircraft Mean Ages/Scaling_opt_ratios_19970506.png' ;;p.save,dir+'Plots/Aircraft Mean Ages/Scaling_opt_ratios_19941104.png' ;p.save,dir+'Plots/Aircraft Mean Ages/Scaling_opt_ratios_20000114.png' ;p = plot(indgen(2),/nodata,xrange=[sf6_scale_all[0]-.01,sf6_scale_all[-1]+.01],yrange=[co2_scale_all[2]-.01,co2_scale_all[-3]+.01],xtitle='SF$_6$ Scale',ytitle='CO$_2$ Scale', $ ; title='Optimal Latitude Source With Shifts',font_size=11,margin=0.12,dimensions=[700,450]) ;for bb = 0, nsc-1 do begin ; gd = where(finite(diffs_both_min_tot[*,bb,i]),ngd) ; if ngd gt 1 then begin ; vcols = 5 * (opt_lat_source_c_diffs_all[gd,bb,i]) ; ; vcols = 5 * (opt_lat_source_diffs_all[gd,bb,i]) ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(sf6_scale_all[gd],replicate(co2_scale_all[bb],ngd),symbol='s',sym_size=2.75,/sym_filled,rgb_table=68,vert_colors=vcols,linestyle=6,/overplot) ; endif ;endfor ;c = contour(opt_lat_source_c_diffs_all[*,*,i],sf6_scale_all,co2_scale_all,c_value=findgen(9)*5,c_color=replicate('dark orange',9),c_thick=1,c_label_show=1,/overplot) ;p = plot([sf6_scale_all[0]-.01,sf6_scale_all[-1]+.01],[0,0],linestyle=2,/overplot) ;p = plot([0,0],[co2_scale_all[0]-.01,co2_scale_all[-1]+.01],linestyle=2,/overplot) ;rgb_68_d = rgb_68[31*INDGEN(9), *] ;cb = COLORBAR(POSITION=[0.9,0.25,0.92,0.8],tickname=tickname_r6,RGB_TABLE=rgb_68_d,BORDER=1, ORIENTATION=1,/textpos,font_size=10,title='Lat (degrees)') ;p = plot(indgen(2),/nodata,xrange=[sf6_scale_all[9],sf6_scale_all[-10]],xtitle='SF$_6$ Scale',ytitle='Total Differences') ;p = plot([0,0],[0,0.05],linestyle=1,/overplot) ;p = plot(replicate(sf6_scale_opt_all[i],2),[0,0.05],linestyle=2,/overplot) ;p = plot(sf6_scale_all,diffs_both_min_tot[*,nsc/2,i],symbol='s',sym_size=1.5,/sym_filled,color='blue',/overplot) ; ;p = plot(indgen(2),/nodata,xrange=[sf6_scale_all[9],sf6_scale_all[-10]],xtitle='SF$_6$ Scale',ytitle='Mean Age') ;p = plot([0,0],[0,2],linestyle=1,/overplot) ;p = plot(replicate(sf6_scale_opt_all[i],2),[0,2],linestyle=2,/overplot) ;p = plot(sf6_scale_all,opt_age_diffs_all[*,nsc/2,i],symbol='s',sym_size=1.5,/sym_filled,color='blue',/overplot) ; ;p = plot(indgen(2),/nodata,xrange=[sf6_scale_all[9],sf6_scale_all[-10]],xtitle='SF$_6$ Scale',ytitle='Ratio of Moments') ;p = plot([0,0],[0,2],linestyle=1,/overplot) ;p = plot(replicate(sf6_scale_opt_all[i],2),[0,2],linestyle=2,/overplot) ;p = plot(sf6_scale_all,opt_ratio_diffs_all[*,nsc/2,i],symbol='s',sym_size=1.5,/sym_filled,color='blue',/overplot) ; ;p = plot(indgen(2),/nodata,xrange=[sf6_scale_all[9],sf6_scale_all[-10]],xtitle='SF$_6$ Scale',ytitle='Lat Source') ;p = plot([0,0],[0,50],linestyle=1,/overplot) ;p = plot(replicate(sf6_scale_opt_all[i],2),[0,50],linestyle=2,/overplot) ;p = plot(sf6_scale_all,opt_lat_source_diffs_all[*,nsc/2,i],symbol='s',sym_size=1.5,/sym_filled,color='blue',/overplot) ;diffs = dat.diffs_both_min_tot[*,*,i] ;ages = dat.opt_age_diffs_all[*,*,i] ;ages2 = dat.opt_age_diffs_min[*,*,i] ;ratios2 = dat.opt_ratio_diffs_min[*,*,i] ;ratios = dat.opt_ratio_diffs_all[*,*,i] ;zz = where(finite(ages),nzz) ;diffs_rev = max(diffs[zz])-diffs[zz] ;tot = total(diffs_rev) ;diffs_norm = diffs_rev / tot ;print,total(ages[zz] * diffs_norm),total(ages2[zz] * diffs_norm),total(ratios[zz] * diffs_norm),total(ratios2[zz] * diffs_norm) ;p = plot(indgen(2),/nodata,xrange=[sf6_scale_all[0]-.01,sf6_scale_all[-1]+.01],yrange=[co2_scale_all[0]-.01,co2_scale_all[-1]+.01],xtitle='SF$_6$ Scale',ytitle='CO$_2$ Scale',title='Mean Ages') ;for bb = 0, nsc-1 do begin ; gd = where(finite(dat.opt_age_diffs_all[*,bb,i]),ngd) ; if ngd gt 0 then begin ; vcols = 40 * dat.opt_age_diffs_all[gd,bb,i] ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(sf6_scale_all[gd],replicate(co2_scale_all[bb],ngd),symbol='s',sym_size=1.5,/sym_filled,rgb_table=39,vert_colors=vcols,linestyle=6,/overplot) ; endif ;endfor ;;s = symbol(dat.sf6_scale_opt[i],dat.co2_scale_opt[i],'s',sym_size=1.5,/sym_filled,/data,sym_color='red') ;s = symbol(dat.sf6_scale_opt_all[i],dat.co2_scale_opt_all[i],'s',sym_size=1.5,/sym_filled,/data,sym_color='magenta') ;p = plot([sf6_scale_all[0]-.01,sf6_scale_all[-1]+.01],[0,0],linestyle=2,/overplot) ;p = plot([0,0],[co2_scale_all[0]-.01,co2_scale_all[-1]+.01],linestyle=2,/overplot) ;p = plot(indgen(2),/nodata,xrange=[sf6_scale_all[0]-.01,sf6_scale_all[-1]+.01],yrange=[co2_scale_all[0]-.01,co2_scale_all[-1]+.01],xtitle='SF$_6$ Scale',ytitle='CO$_2$ Scale', $ ;title='Ratio of Moments') ;for bb = 0, ns-1 do begin ; gd = where(finite(dat.opt_ratio_diffs_all[*,bb,i]),ngd) ; if ngd gt 0 then begin ; print,dat.opt_ratio_diffs_all[gd,bb,i] ; vcols = 100 * dat.opt_ratio_diffs_all[gd,bb,i] ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(sf6_scale_all[gd],replicate(co2_scale_all[bb],ngd),symbol='s',sym_size=1.2,/sym_filled,rgb_table=39,vert_colors=vcols,linestyle=6,/overplot) ; endif ;endfor ;;s = symbol(dat.sf6_scale_opt[i],dat.co2_scale_opt[i],'s',sym_size=1.5,/sym_filled,/data,sym_color='red') ;s = symbol(dat.sf6_scale_opt_all[i],dat.co2_scale_opt_all[i],'s',sym_size=1.5,/sym_filled,/data,sym_color='magenta') ;p = plot([sf6_scale_all[0]-.01,sf6_scale_all[-1]+.01],[0,0],linestyle=2,/overplot) ;p = plot([0,0],[co2_scale_all[0]-.01,co2_scale_all[-1]+.01],linestyle=2,/overplot) mi = 9 ii = 39 ;p = plot(indgen(2),/nodata,xrange=[2018,2024],yrange=[3.8,5.4],ytitle='Mean Age (years)',title='Mean Age on Normalized N$_2$O = '+strmid(strcompress(string(n2o_norm_grid_model[mi]),/r),0,4)) ;for y = 60, 95, 5 do p = plot(model_years,n2o_norm_aoa[y,mi,*],rgb_table=55,vert_colors=(lat[y]-10)*3,/overplot) ;for y = 60, 95, 5 do p = plot(model_years,n2o_norm_aoa_sm[y,mi,*],rgb_table=55,vert_colors=(lat[y]-10)*3,/overplot) ;p = plot(model_years,aoa_mean_aircraft_sample_years[mi,*],color='lime green',symbol='o',/sym_filled,linestyle=6,/overplot) ;p = plot(model_years,aoa_mean_balloon_sample_years[mi,*],color='dodger blue',symbol='s',/sym_filled,linestyle=6,/overplot) ;;p = plot(model_years,aoa_opt_mean_aircraft_sample_years[mi,*],color='pink',symbol='o',/sym_filled,linestyle=6,/overplot) ;;p = errorplot(n2o_years,n2o_norm2_age_opt_nh_years[mi,0,*],replicate(0,nt),n2o_norm2_age_opt_nh_years[mi,1,*],symbol='o',linestyle=6,/sym_filled,color='magenta',errorbar_capsize=0,/overplot) ;;p = plot(n2o_years,n2o_norm2_age_opt_nh_years_anoms_adj[mi,0,*],symbol='o',linestyle=6,/sym_filled,color='pink',/overplot) ;p = errorplot(n2o_years,n2o_norm2_age_opt_sf6_nh_years[mi,0,*],replicate(0,nt),n2o_norm2_age_opt_sf6_nh_years[mi,1,*],symbol='o',linestyle=6,/sym_filled,color='green',errorbar_capsize=0,/overplot) ;p = errorplot(n2o_years,n2o_norm2_age_opt_sf6_nh_years_anoms_adj[mi,0,*],replicate(0,nt),n2o_norm2_age_opt_sf6_nh_years_anoms_adj[mi,1,*],symbol='o',linestyle=6,/sym_filled,color='lime green', $ ; errorbar_capsize=0,/overplot) ;;p = errorplot(n2o_years,n2o_norm2_age_opt_co2_nh_years[mi,0,*],replicate(0,nt),n2o_norm2_age_opt_co2_nh_years[mi,1,*],symbol='o',linestyle=6,/sym_filled,color='green',errorbar_capsize=0,/overplot) ;;p = errorplot(n2o_years,n2o_norm2_age_opt_co2_nh_years_anoms_adj[mi,0,*],replicate(0,nt),n2o_norm2_age_opt_co2_nh_years_anoms_adj[mi,1,*],symbol='o',linestyle=6,/sym_filled,color='lime green', $ ;; errorbar_capsize=0,/overplot) ;p = errorplot(n2o_years,n2o_norm2_bal_age_opt_co2_nh_years[mi,0,*],replicate(0,nt),n2o_norm2_bal_age_opt_co2_nh_years[mi,1,*],symbol='s',linestyle=6,/sym_filled,color='blue',errorbar_capsize=0, $ ; /overplot) ;p = errorplot(n2o_years,n2o_norm2_bal_age_opt_co2_nh_years_anoms_adj[mi,0,*],replicate(0,nt),n2o_norm2_bal_age_opt_co2_nh_years_anoms_adj[mi,1,*],symbol='s',linestyle=6,/sym_filled, $ ; color='sky blue',errorbar_capsize=0,/overplot) ;p = errorplot(n2o_years,bins_co2_b2.n2o_norm_age_all_nh_years[ii,0,*],replicate(0,nt),bins_co2_b2.n2o_norm_age_all_nh_years[ii,1,*],symbol='s',linestyle=6,/sym_filled,color='purple', $ ; errorbar_capsize=0,/overplot) tickname = strmid(strcompress(string(findgen(12)*0.5),/r),0,3) tickname0 = strmid(strcompress(string(findgen(10)*0.5),/r),0,3) tickname1 = strmid(strcompress(string(findgen(8)),/r),0,1) tickname2 = strmid(strcompress(string(findgen(9)*0.1+1),/r),0,3) tickname22 = strmid(strcompress(string(findgen(8)*0.1+1),/r),0,3) tickname3 = strmid(strcompress(string(findgen(7)*10-30),/r),0,3) tickname33 = strmid(strcompress(string(findgen(9)*10-40),/r),0,3) tickname4 = strmid(strcompress(string(findgen(11)*0.2-1),/r),0,4) tickname5 = strmid(strcompress(string(findgen(11)*0.3-1.5),/r),0,4) tickname6 = strmid(strcompress(string(findgen(11)*0.05),/r),0,4) tickname7 = strmid(strcompress(string(findgen(11)*33),/r),0,3) tickname8 = strmid(strcompress(string(findgen(11)*4),/r),0,2) ;p = plot(indgen(2),/nodata,xrange=[-30,90],xtickinterval=20,xminor=1,yrange=[7,35],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Altitude (km)',font_size=11,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Balloon N$_2$O '+ext_yrs[fi]) ;for z = 0, nz-1 do begin ; ii = where(finite(grid_b0.n2o_grid_avg[0,*,z]),nii) ; if nii gt 0 then begin ; vcols = grid_b0.n2o_grid_avg[0,ii,z]*0.72 ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; p = plot(lat_grid[ii],replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=1,/overplot) ; p = plot(lat_grid[ii]-1.67,replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=1,/overplot) ; p = plot(lat_grid[ii]+1.67,replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=1,/overplot) ; endif ;endfor ;p = plot(lat_tp,tpause_alt,thick=2,color='magenta',/overplot) ;cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname7,tickvalues=findgen(11)*24.,RGB_TABLE=rgb,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='N$_2$O (ppb)') ;p = plot(indgen(2),/nodata,xrange=[-90,90],xtickinterval=20,xminor=1,yrange=[7,22],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Altitude (km)',font_size=11,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Aircraft N$_2$O '+ext_yrs[2]) ;for z = 0, nz-1 do begin ; ii = where(finite(grid_a2.n2o_grid_avg[0,*,z]),nii) ; if nii gt 0 then begin ; vcols = grid_a2.n2o_grid_avg[0,ii,z]*0.72 ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; p = plot(lat_grid[ii],replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=2.2,/overplot) ; endif ;endfor ;p = plot(lat_tp,tpause_alt,thick=2,color='magenta',/overplot) ;cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname7,tickvalues=findgen(11)*24.,RGB_TABLE=rgb,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='N$_2$O (ppb)') ;p = plot(indgen(2),/nodata,xrange=[-30,90],xtickinterval=20,xminor=1,yrange=[7,35],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Altitude (km)',font_size=11,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Balloon N$_2$O SD '+ext_yrs[fi]) ;for z = 0, nz-1 do begin ; ii = where(finite(grid_b0.n2o_grid_avg[1,*,z]),nii) ; if nii gt 0 then begin ; vcols = grid_b0.n2o_grid_avg[1,ii,z]*6 ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; p = plot(lat_grid[ii],replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=1,/overplot) ; p = plot(lat_grid[ii]-1.67,replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=1,/overplot) ; p = plot(lat_grid[ii]+1.67,replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=1,/overplot) ; endif ;endfor ;p = plot(lat_tp,tpause_alt,thick=2,color='magenta',/overplot) ;cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname8,tickvalues=findgen(11)*24.,RGB_TABLE=rgb,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='N$_2$O SD (ppb)') ;p = plot(indgen(2),/nodata,xrange=[-90,90],xtickinterval=20,xminor=1,yrange=[7,22],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Altitude (km)',font_size=11,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Aircraft Optimal Mean Ages '+ext_yrs[fi]) ;for z = 0, nz-1 do begin ; ii = where(finite(grid.age_opt_grid_avg[0,*,z]),nii) ; if nii gt 0 then begin ; vcols = grid.age_opt_grid_avg[0,ii,z]*45. ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; p = plot(lat_grid[ii],replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=2.2,/overplot) ; endif ;endfor ;p = plot(lat_tp,tpause_alt,thick=2,color='magenta',/overplot) ;cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname,tickvalues=findgen(12)*22.,RGB_TABLE=rgb,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='$\Gamma$ (years)') ;p.save,dir+'Plots/Aircraft Mean Ages/Age_opt_grid_'+ext[fi]+'.png' ;p = plot(indgen(2),/nodata,xrange=[-30,90],xtickinterval=20,xminor=1,yrange=[7,35],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Altitude (km)',font_size=11,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Balloon Optimal Mean Ages '+ext_yrs[fi]) ;for z = 0, nz-1 do begin ; ii = where(finite(grid.age_opt_grid_avg[0,*,z]),nii) ; if nii gt 0 then begin ; vcols = grid.age_opt_grid_avg[0,ii,z]*35. ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; p = plot(lat_grid[ii],replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=1,/overplot) ; p = plot(lat_grid[ii]-1.67,replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=1,/overplot) ; p = plot(lat_grid[ii]+1.67,replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=1,/overplot) ; endif ;endfor ;p = plot(lat_tp,tpause_alt,thick=2,color='magenta',/overplot) ;cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname1,tickvalues=findgen(7)*40.,RGB_TABLE=rgb,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='$\Gamma$ (years)') ;p.save,dir+'Plots/Balloon Mean Ages/Age_opt_grid_'+ext[fi]+'.png' ;p = plot(indgen(2),/nodata,xrange=[-90,90],xtickinterval=20,xminor=1,yrange=[300,550],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Theta (K)',font_size=11, $ ; dimensions=[700,450],title='Aircraft Optimal Mean Ages') ;for z = 0, nth-1 do begin ; ii = where(finite(grid.age_opt_th_grid_avg[0,*,z]),nii) ; if nii gt 0 then begin ; vcols = grid.age_opt_th_grid_avg[0,ii,z]*40. ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; p = plot(lat_grid[ii],replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=2.2,/overplot) ; endif ;endfor ;p = plot(lat_tp,tpause_theta,thick=2,color='magenta',/overplot) ;cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname,tickvalues=findgen(7)*40.,RGB_TABLE=rgb,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='$\Gamma$ (years)') ;p = plot(indgen(2),/nodata,xrange=[0,90],xtickinterval=20,xminor=1,yrange=[300,550],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Theta (K)',font_size=12,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Aircraft Optimal Mean Ages 2021-22') ;for z = 0, nth-1 do begin ; ii = where(finite(grid_a2.age_opt_th_grid_avg[0,*,z]),nii) ; if nii gt 0 then begin ; vcols = grid_a2.age_opt_th_grid_avg[0,ii,z]*55. ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; p = plot(lat_grid[ii],replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=2,/overplot) ; p = plot(lat_grid[ii]-1.4,replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=2,/overplot) ; p = plot(lat_grid[ii]+1.4,replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=2,/overplot) ; endif ;endfor ;p = plot(lat_tp,tpause_seas_theta[*,2],thick=2,color='magenta',/overplot) ;cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname0,tickvalues=findgen(10)*28.,RGB_TABLE=rgb,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='$\Gamma$ (years)') ;p.save,dir+'Plots/Aircraft Mean Ages/Age_opt_th_grid_'+ext[2]+'.png' ;p = plot(indgen(2),/nodata,xrange=[-90,90],xtickinterval=20,xminor=1,yrange=[7,22],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Altitude (km)',font_size=11,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Optimal Ratios of Moments '+ext_yrs[fi]) ;for z = 0, nz-1 do begin ; ii = where(finite(grid.ratio_opt_grid_avg[0,*,z]),nii) ; if nii gt 0 then begin ; vcols = (grid.ratio_opt_grid_avg[0,ii,z]-1)*310. ; test = where(vcols ge 250.,ntest) ; if ntest gt 0 then vcols[test] = 250. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(lat_grid[ii],replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=33,vert_colors=vcols,sym_size=2.2,/overplot) ; endif ;endfor ;p = plot(lat_tp,tpause_alt,thick=2,color='magenta',/overplot) ;cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname2,tickvalues=findgen(9)*31.,RGB_TABLE=rgb_33,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10, $ ; title='$\Delta$$^2$/$\Gamma$ (years)') ;p.save,dir+'Plots/Aircraft Mean Ages/Ratio_of_moments_opt_grid_'+ext[fi]+'.png' ;p = plot(indgen(2),/nodata,xrange=[-30,90],xtickinterval=20,xminor=1,yrange=[7,35],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Altitude (km)',font_size=11,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Balloon Optimal Ratios of Moments '+ext_yrs[fi]) ;for z = 0, nz-1 do begin ; ii = where(finite(grid.ratio_opt_grid_avg[0,*,z]),nii) ; if nii gt 0 then begin ; vcols = (grid.ratio_opt_grid_avg[0,ii,z]-1)*310. ; test = where(vcols ge 250.,ntest) ; if ntest gt 0 then vcols[test] = 250. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(lat_grid[ii],replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=1,/overplot) ; p = plot(lat_grid[ii]-1.67,replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=1,/overplot) ; p = plot(lat_grid[ii]+1.67,replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=1,/overplot) ; endif ;endfor ;p = plot(lat_tp,tpause_alt,thick=2,color='magenta',/overplot) ;cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname2,tickvalues=findgen(9)*31.,RGB_TABLE=rgb_33,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10, $ ; title='$\Delta$$^2$/$\Gamma$ (years)') ;p.save,dir+'Plots/Balloon Mean Ages/Ratio_of_moments_opt_grid_'+ext[fi]+'.png' ;p = plot(indgen(2),/nodata,xrange=[-90,90],xtickinterval=20,xminor=1,yrange=[7,22],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Altitude (km)',font_size=11,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Optimal Surface Source Latitudes '+ext_yrs[fi]) ;for z = 0, nz-1 do begin ; ii = where(finite(grid.lat_source_c_opt_grid_avg[0,*,z]),nii) ; if nii gt 0 then begin ; vcols = (grid.lat_source_c_opt_grid_avg[0,ii,z]+30)*4. ; test = where(vcols ge 250.,ntest) ; if ntest gt 0 then vcols[test] = 250. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(lat_grid[ii],replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=69,vert_colors=vcols,sym_size=2.2,/overplot) ; endif ;endfor ;p = plot(lat_tp,tpause_alt,thick=2,color='magenta',/overplot) ;cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname3,tickvalues=findgen(7)*40.,RGB_TABLE=rgb_69,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10, $ ; title='Surface Lat (deg)') ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_lats_opt_grid_'+ext[fi]+'.png' ;p = plot(indgen(2),/nodata,xrange=[-30,90],xtickinterval=20,xminor=1,yrange=[7,35],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Altitude (km)',font_size=11,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Balloon Optimal Surface Source Latitudes '+ext_yrs[fi]) ;for z = 0, nz-1 do begin ; ii = where(finite(grid.lat_source_c_opt_grid_avg[0,*,z]),nii) ; if nii gt 0 then begin ; vcols = (grid.lat_source_c_opt_grid_avg[0,ii,z]+30)*4. ; test = where(vcols ge 250.,ntest) ; if ntest gt 0 then vcols[test] = 250. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(lat_grid[ii],replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=69,vert_colors=vcols,sym_size=1,/overplot) ; p = plot(lat_grid[ii]-1.67,replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=69,vert_colors=vcols,sym_size=1,/overplot) ; p = plot(lat_grid[ii]+1.67,replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=69,vert_colors=vcols,sym_size=1,/overplot) ; endif ;endfor ;p = plot(lat_tp,tpause_alt,thick=2,color='magenta',/overplot) ;cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname3,tickvalues=findgen(7)*40.,RGB_TABLE=rgb_69,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10, $ ; title='Surface Lat (deg)') ;p.save,dir+'Plots/Balloon Mean Ages/Surface_lats_opt_grid_'+ext[fi]+'.png' ;p = plot(indgen(2),/nodata,xrange=[-90,90],xtickinterval=20,xminor=1,yrange=[300,550],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Theta (K)',font_size=11, $ ; dimensions=[700,450],title='Optimal Ratios of Moments') ;for z = 0, nth-1 do begin ; ii = where(finite(grid.ratio_opt_th_grid_avg[0,*,z]),nii) ; if nii gt 0 then begin ; vcols = (grid.ratio_opt_th_grid_avg[0,ii,z]-1)*310. ; test = where(vcols ge 250.,ntest) ; if ntest gt 0 then vcols[test] = 250. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(lat_grid[ii],replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=33,vert_colors=vcols,sym_size=2.2,/overplot) ; endif ;endfor ;;p = plot(lat_tp,tpause_alt,thick=2,color='magenta',/overplot) ;cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname2,tickvalues=findgen(9)*31.,RGB_TABLE=rgb_33,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10, $ ; title='$\Delta$$^2$/$\Gamma$ (years)') ;p = plot(indgen(2),/nodata,xrange=[-90,90],xtickinterval=20,xminor=1,yrange=[8,22],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Altitude (km)',font_size=11,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Aircraft Optimal CO$_2$ Mean Ages '+ext_yrs[fi]) ;for z = 0, nz-1 do begin ; ii = where(finite(grid.age_opt_co2_grid_avg[0,*,z]),nii) ; if nii gt 0 then begin ; vcols = grid.age_opt_co2_grid_avg[0,ii,z]*45. ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; p = plot(lat_grid[ii],replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=2.2,/overplot) ; endif ;endfor ;p = plot(lat_tp,tpause_alt,thick=2,color='magenta',/overplot) ;cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname,tickvalues=findgen(12)*22.,RGB_TABLE=rgb,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='$\Gamma$ (years)') ;p.save,dir+'Plots/Aircraft Mean Ages/Age_CO2_opt_grid_'+ext[fi]+'.png' ;p = plot(indgen(2),/nodata,xrange=[-90,90],xtickinterval=20,xminor=1,yrange=[7,22],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Altitude (km)',font_size=11,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Aircraft Old CO$_2$ - Optimal CO$_2$ Mean Ages '+ext_yrs[0]) ;for z = 0, nz-1 do begin ; ii = where(finite(grid_a0.age_opt_co2_grid_avg[0,*,z]) and finite(grid_a0.age_co2_grid_avg[0,*,z]),nii) ; if nii gt 0 then begin ; vcols = (grid_a0.age_opt_co2_grid_avg[0,ii,z]-grid_a0.age_co2_grid_avg[0,ii,z] + 1.5)*83. ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(lat_grid[ii],replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=70,vert_colors=vcols,sym_size=2.2,/overplot) ; endif ;endfor ;p = plot(lat_tp,tpause_alt,thick=2,color='magenta',/overplot) ;cb = COLORBAR(POSITION=[0.9,0.2,0.92,0.75],tickname=tickname5,tickvalues=findgen(11)*25.,RGB_TABLE=reverse(rgb_70),BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='d$\Gamma$ (years)') ;p.save,dir+'Plots/Aircraft Mean Ages/Age_CO2_old_minus_opt_CO2_grid_'+ext[fi]+'.png' ;p = plot(indgen(2),/nodata,xrange=[-90,90],xtickinterval=20,xminor=1,yrange=[7,22],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Altitude (km)',font_size=11,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Aircraft Old SF$_6$ - Optimal SF$_6$ Mean Ages '+ext_yrs[0]) ;for z = 0, nz-1 do begin ; ii = where(finite(grid_a0.age_opt_sf6_grid_avg[0,*,z]) and finite(grid_a0.age_sf6_grid_avg[0,*,z]),nii) ; if nii gt 0 then begin ; vcols = (grid_a0.age_opt_sf6_grid_avg[0,ii,z]-grid_a0.age_sf6_grid_avg[0,ii,z] + 1.5)*83. ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(lat_grid[ii],replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=70,vert_colors=vcols,sym_size=2.2,/overplot) ; endif ;endfor ;p = plot(lat_tp,tpause_alt,thick=2,color='magenta',/overplot) ;cb = COLORBAR(POSITION=[0.9,0.2,0.92,0.75],tickname=tickname5,tickvalues=findgen(11)*25.,RGB_TABLE=reverse(rgb_70),BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='d$\Gamma$ (years)') ;p.save,dir+'Plots/Aircraft Mean Ages/Age_SF6_opt_minus_old_SF6_grid_'+ext[0]+'.png' ;p = plot(indgen(2),/nodata,xrange=[-30,90],xtickinterval=20,xminor=1,yrange=[7,35],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Altitude (km)',font_size=11,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Balloon Optimal CO$_2$ Mean Ages '+ext_yrs[fi]) ;for z = 0, nz-1 do begin ; ii = where(finite(grid_b0.age_opt_sf6_grid_avg[0,*,z]) and finite(grid_b0.age_sf6_grid_avg[0,*,z]),nii) ; if nii gt 0 then begin ; vcols = (grid_b0.age_opt_sf6_grid_avg[0,ii,z]-grid_b0.age_sf6_grid_avg[0,ii,z] + 1.5)*83. ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(lat_grid[ii],replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=1,/overplot) ; p = plot(lat_grid[ii]-1.67,replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=1,/overplot) ; p = plot(lat_grid[ii]+1.67,replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=1,/overplot) ; endif ;endfor ;p = plot(lat_tp,tpause_alt,thick=2,color='magenta',/overplot) ;cb = COLORBAR(POSITION=[0.9,0.2,0.92,0.75],tickname=tickname5,tickvalues=findgen(11)*25.,RGB_TABLE=rgb_70,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='d$\Gamma$ (years)') ;p = plot(indgen(2),/nodata,xrange=[-30,90],xtickinterval=20,xminor=1,yrange=[300,970],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Theta (K)',font_size=12,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Balloon Optimal CO$_2$ Mean Ages 1996-2000') ;for z = 0, nth-1 do begin ; ii = where(finite(grid_b0.age_opt_co2_th_grid_avg[0,*,z]),nii) ; if nii gt 0 then begin ; vcols = grid_b0.age_opt_co2_th_grid_avg[0,ii,z]*35. ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; p = plot(lat_grid[ii],replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=1,/overplot) ; p = plot(lat_grid[ii]-1.67,replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=1,/overplot) ; p = plot(lat_grid[ii]+1.67,replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=1,/overplot) ; endif ;endfor ;p = plot(lat_tp,tpause_theta,thick=2,color='magenta',/overplot) ;cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname1,tickvalues=findgen(7)*40.,RGB_TABLE=rgb,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='$\Gamma$ (years)') ;p.save,dir+'Plots/Balloon Mean Ages/Age_CO2_opt_th_grid_'+ext[0]+'.png' ; ;p = plot(indgen(2),/nodata,xrange=[0,90],xtickinterval=20,xminor=1,yrange=[7,22],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Altitude (km)',font_size=11,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Aircraft Optimal CO$_2$ Mean Ages DCOTSS 2021-22') ;for z = 0, nz-1 do begin ; ii = where(finite(grid_a2.age_opt_co2_grid_avg[0,*,z]),nii) ; if nii gt 0 then begin ; vcols = grid_a2.age_opt_co2_grid_avg[0,ii,z]*55. ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; p = plot(lat_grid[ii],replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=1.6,/overplot) ; p = plot(lat_grid[ii]-1.67,replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=1.6,/overplot) ; p = plot(lat_grid[ii]+1.67,replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=1.6,/overplot) ; endif ;endfor ;p = plot(lat_tp,tpause_alt,thick=2,color='magenta',/overplot) ;cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname0,tickvalues=findgen(10)*28.,RGB_TABLE=rgb,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='$\Gamma$ (years)') ;p = plot(indgen(2),/nodata,xrange=[0,90],xtickinterval=20,xminor=1,yrange=[300,550],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Theta (K)',font_size=11, $ ; dimensions=[700,450],title='Aircraft Optimal CO$_2$ Mean Ages DCOTSS 2021-22') ;for z = 0, nth-1 do begin ; ii = where(finite(grid_a2.age_opt_co2_th_grid_avg[0,*,z]),nii) ; if nii gt 0 then begin ; vcols = grid_a2.age_opt_co2_th_grid_avg[0,ii,z]*55. ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; p = plot(lat_grid[ii],replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=2,/overplot) ; p = plot(lat_grid[ii]-1.4,replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=2,/overplot) ; p = plot(lat_grid[ii]+1.4,replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=2,/overplot) ; endif ;endfor ;p = plot(lat_tp,tpause_theta,thick=2,color='magenta',/overplot) ;cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname0,tickvalues=findgen(10)*28.,RGB_TABLE=rgb,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='$\Gamma$ (years)') ; ;p = plot(indgen(2),/nodata,xrange=[0,90],xtickinterval=10,xminor=1,yrange=[300,630],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Theta (K)',font_size=12,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Balloon Optimal CO$_2$ Mean Ages 2021-24') ;for z = 0, nth-1 do begin ; ii = where(finite(grid_b2_v2024.age_opt_co2_th_grid_avg[0,*,z]),nii) ;; ii = where(finite(grid_b2.age_opt_co2_th_grid_avg[0,*,z]),nii) ; if nii gt 0 then begin ;; vcols = grid_b2.age_opt_co2_th_grid_avg[0,ii,z]*55. ; vcols = grid_b2_v2024.age_opt_co2_th_grid_avg[0,ii,z]*55. ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; p = plot(lat_grid[ii],replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=2,/overplot) ; p = plot(lat_grid[ii]-1.35,replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=2,/overplot) ; p = plot(lat_grid[ii]+1.35,replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=2,/overplot) ; endif ;endfor ;p = plot(lat_tp,tpause_theta,thick=2,color='magenta',/overplot) ;cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname0,tickvalues=findgen(10)*28.,RGB_TABLE=rgb,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='$\Gamma$ (years)') ;p.save,dir+'Plots/Balloon Mean Ages/Age_CO2_opt_grid_'+ext[2]+'.png' ; ;p = plot(indgen(2),/nodata,xrange=[-90,90],xtickinterval=20,xminor=1,yrange=[7,22],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Altitude (km)',font_size=11, $ ; dimensions=[700,450],title='Aircraft CO$_2$ Mean Ages') ;for z = 0, nz-1 do begin ; ii = where(finite(grid.age_co2_grid_avg[0,*,z]),nii) ; if nii gt 0 then begin ; vcols = grid.age_co2_grid_avg[0,ii,z]*45. ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; p = plot(lat_grid[ii],replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=2.2,/overplot) ; endif ;endfor ;p = plot(lat_tp,tpause_alt,thick=2,color='magenta',/overplot) ;cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname,tickvalues=findgen(12)*22.,RGB_TABLE=rgb,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='$\Gamma$ (years)') ;p = plot(indgen(2),/nodata,xrange=[-30,90],xtickinterval=20,xminor=1,yrange=[7,35],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Altitude (km)',font_size=11,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Balloon Optimal CO$_2$ Mean Ages '+ext_yrs[fi]) ;for z = 0, nz-1 do begin ; ii = where(finite(grid.age_opt_co2_grid_avg[0,*,z]),nii) ; if nii gt 0 then begin ; vcols = grid.age_opt_co2_grid_avg[0,ii,z]*35. ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; p = plot(lat_grid[ii],replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=1,/overplot) ; p = plot(lat_grid[ii]-1.67,replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=1,/overplot) ; p = plot(lat_grid[ii]+1.67,replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=1,/overplot) ; endif ;endfor ;p = plot(lat_tp,tpause_alt,thick=2,color='magenta',/overplot) ;cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname1,tickvalues=findgen(7)*40.,RGB_TABLE=rgb,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='$\Gamma$ (years)') ;p.save,dir+'Plots/Balloon Mean Ages/Age_CO2_opt_grid_'+ext[fi]+'.png' ;p = plot(indgen(2),/nodata,xrange=[-90,90],xtickinterval=20,xminor=1,yrange=[300,550],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Theta (K)',font_size=11, $ ; dimensions=[700,450],title='Aircraft Optimal CO$_2$ Mean Ages') ;for z = 0, nth-1 do begin ; ii = where(finite(grid.age_opt_co2_th_grid_avg[0,*,z]),nii) ; if nii gt 0 then begin ; vcols = grid.age_opt_co2_th_grid_avg[0,ii,z]*45. ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; p = plot(lat_grid[ii],replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=2.2,/overplot) ; endif ;endfor ;p = plot(lat_tp,tpause_theta,thick=2,color='magenta',/overplot) ;cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname,tickvalues=findgen(12)*22.,RGB_TABLE=rgb,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='$\Gamma$ (years)') ; ;p = plot(indgen(2),/nodata,xrange=[-90,90],xtickinterval=20,xminor=1,yrange=[8,22],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Altitude (km)',font_size=11,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Optimal CO$_2$ Surface Source Latitudes '+ext_yrs[fi]) ;for z = 0, nz-1 do begin ; ii = where(finite(grid.lat_source_c_opt_co2_grid_avg[0,*,z]),nii) ; if nii gt 0 then begin ; vcols = (grid.lat_source_c_opt_co2_grid_avg[0,ii,z]+30)*4. ; test = where(vcols ge 250.,ntest) ; if ntest gt 0 then vcols[test] = 250. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(lat_grid[ii],replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=69,vert_colors=vcols,sym_size=2.2,/overplot) ; endif ;endfor ;p = plot(lat_tp,tpause_alt,thick=2,color='magenta',/overplot) ;cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname3,tickvalues=findgen(7)*40.,RGB_TABLE=rgb_69,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10, $ ; title='Surface Lat (deg)') ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_lats_CO2_opt_grid_'+ext[fi]+'.png' ;p = plot(indgen(2),/nodata,xrange=[-30,90],xtickinterval=20,xminor=1,yrange=[7,35],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Altitude (km)',font_size=11,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Balloon Optimal CO$_2$ Surface Source Latitudes '+ext_yrs[fi]) ;for z = 0, nz-1 do begin ; ii = where(finite(grid.lat_source_c_opt_co2_grid_avg[0,*,z]),nii) ; if nii gt 0 then begin ; vcols = (grid.lat_source_c_opt_co2_grid_avg[0,ii,z]+30)*4. ; test = where(vcols ge 250.,ntest) ; if ntest gt 0 then vcols[test] = 250. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(lat_grid[ii],replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=69,vert_colors=vcols,sym_size=1,/overplot) ; p = plot(lat_grid[ii]-1.67,replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=69,vert_colors=vcols,sym_size=1,/overplot) ; p = plot(lat_grid[ii]+1.67,replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=69,vert_colors=vcols,sym_size=1,/overplot) ; endif ;endfor ;p = plot(lat_tp,tpause_alt,thick=2,color='magenta',/overplot) ;cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname3,tickvalues=findgen(7)*40.,RGB_TABLE=rgb_69,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10, $ ; title='Surface Lat (deg)') ;p.save,dir+'Plots/Balloon Mean Ages/Surface_lats_CO2_opt_grid_'+ext[fi]+'.png' ;p = plot(indgen(2),/nodata,xrange=[-30,90],xtickinterval=20,xminor=1,yrange=[300,570],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Theta (K)',font_size=11,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Balloon Optimal CO$_2$ Surface Source Latitudes '+ext_yrs[0]) ;for z = 0, nth-1 do begin ; ii = where(finite(grid_b0.lat_source_c_opt_co2_th_grid_avg[0,*,z]),nii) ; if nii gt 0 then begin ; vcols = (grid_b0.lat_source_c_opt_co2_th_grid_avg[0,ii,z]+30)*4. ; test = where(vcols ge 250.,ntest) ; if ntest gt 0 then vcols[test] = 250. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(lat_grid[ii],replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=69,vert_colors=vcols,sym_size=1.8,/overplot) ; p = plot(lat_grid[ii]-1.3,replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=69,vert_colors=vcols,sym_size=1.8,/overplot) ; p = plot(lat_grid[ii]+1.3,replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=69,vert_colors=vcols,sym_size=1.8,/overplot) ; endif ;endfor ;p = plot(lat_tp,tpause_theta,thick=2,color='magenta',/overplot) ;cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname3,tickvalues=findgen(7)*40.,RGB_TABLE=rgb_69,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10, $ ; title='Surface Lat (deg)') ;p.save,dir+'Plots/Balloon Mean Ages/Surface_lats_CO2_opt_th_grid_'+ext[0]+'.png' ;p = plot(indgen(2),/nodata,xrange=[-90,90],xtickinterval=20,xminor=1,yrange=[7,22],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Altitude (km)',font_size=11,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Aircraft Optimal SF$_6$ Mean Ages '+ext_yrs[fi]) ;for z = 0, nz-1 do begin ; ii = where(finite(grid.age_opt_sf6_grid_avg[0,*,z]),nii) ; if nii gt 0 then begin ; vcols = grid.age_opt_sf6_grid_avg[0,ii,z]*45. ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; p = plot(lat_grid[ii],replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=2.2,/overplot) ; endif ;endfor ;p = plot(lat_tp,tpause_alt,thick=2,color='magenta',/overplot) ;cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname,tickvalues=findgen(12)*22.,RGB_TABLE=rgb,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='years') ;p.save,dir+'Plots/Aircraft Mean Ages/Ages_SF6_opt_grid_'+ext[fi]+'.png' ;p = plot(indgen(2),/nodata,xrange=[-30,90],xtickinterval=20,xminor=1,yrange=[7,35],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Altitude (km)',font_size=11,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Balloon Optimal SF$_6$ Mean Ages '+ext_yrs[fi]) ;for z = 0, nz-1 do begin ; ii = where(finite(grid.age_opt_sf6_grid_avg[0,*,z]),nii) ; if nii gt 0 then begin ; vcols = grid.age_opt_sf6_grid_avg[0,ii,z]*35. ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; p = plot(lat_grid[ii],replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=1,/overplot) ; p = plot(lat_grid[ii]-1.67,replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=1,/overplot) ; p = plot(lat_grid[ii]+1.67,replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=1,/overplot) ; endif ;endfor ;p = plot(lat_tp,tpause_alt,thick=2,color='magenta',/overplot) ;cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname1,tickvalues=findgen(7)*40.,RGB_TABLE=rgb,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='$\Gamma$ (years)') ;p.save,dir+'Plots/Balloon Mean Ages/Age_SF6_opt_grid_'+ext[fi]+'.png' ;p = plot(indgen(2),/nodata,xrange=[-90,90],xtickinterval=20,xminor=1,yrange=[7,22],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Altitude (km)',font_size=11, $ ; dimensions=[700,450],title='Aircraft SF$_6$ Mean Ages') ;for z = 0, nz-1 do begin ; ii = where(finite(grid.age_sf6_grid_avg[0,*,z]),nii) ; if nii gt 0 then begin ; vcols = grid.age_sf6_grid_avg[0,ii,z]*45. ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(lat_grid[ii],replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=2.2,/overplot) ; endif ;endfor ;p = plot(lat_tp,tpause_alt,thick=2,color='magenta',/overplot) ;cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname,tickvalues=findgen(12)*22.,RGB_TABLE=rgb,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='$\Gamma$ (years)') ;p = plot(indgen(2),/nodata,xrange=[-90,90],xtickinterval=20,xminor=1,yrange=[8,22],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Altitude (km)',font_size=11,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Aircraft Optimal CO$_2$ Ratios of Moments '+ext_yrs[fi]) ;for z = 0, nz-1 do begin ; ii = where(finite(grid.ratio_opt_co2_grid_avg[0,*,z]),nii) ; if nii gt 0 then begin ; vcols = (grid.ratio_opt_co2_grid_avg[0,ii,z]-1)*310. ; test = where(vcols ge 250.,ntest) ; if ntest gt 0 then vcols[test] = 250. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(lat_grid[ii],replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=33,vert_colors=vcols,sym_size=2.2,/overplot) ; endif ;endfor ;p = plot(lat_tp,tpause_alt,thick=2,color='magenta',/overplot) ;cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname2,tickvalues=findgen(9)*31.,RGB_TABLE=rgb_33,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10, $ ; title='$\Delta$$^2$/$\Gamma$ (years)') ;p.save,dir+'Plots/Aircraft Mean Ages/Ratio_of_moments_CO2_opt_grid_'+ext[fi]+'.png' ;p = plot(indgen(2),/nodata,xrange=[0,90],xtickinterval=10,xminor=1,yrange=[300,550],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Theta (K)',font_size=12,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Aircraft Optimal Ratios of Moments 2021-22') ;for z = 0, nth-1 do begin ; ii = where(finite(grid_a2.ratio_opt_th_grid_avg[0,*,z]),nii) ; if nii gt 0 then begin ; vcols = (grid_a2.ratio_opt_th_grid_avg[0,ii,z]-1)*310. ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(lat_grid[ii],replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=33,vert_colors=vcols,sym_size=2,/overplot) ; p = plot(lat_grid[ii]-1.4,replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=33,vert_colors=vcols,sym_size=2,/overplot) ; p = plot(lat_grid[ii]+1.4,replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=33,vert_colors=vcols,sym_size=2,/overplot) ; endif ;endfor ;p = plot(lat_tp,tpause_seas_theta[*,2],thick=2,color='magenta',/overplot) ;cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname2,tickvalues=findgen(9)*31.,RGB_TABLE=rgb_33,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='years') ;p.save,dir+'Plots/Aircraft Mean Ages/Ratios_opt_th_grid_'+ext[2]+'.png' ;p = plot(indgen(2),/nodata,xrange=[-30,90],xtickinterval=20,xminor=1,yrange=[7,35],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Altitude (km)',font_size=11,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Balloon Optimal CO$_2$ Ratios of Moments '+ext_yrs[fi]) ;for z = 0, nz-1 do begin ; ii = where(finite(grid.ratio_opt_co2_grid_avg[0,*,z]),nii) ; if nii gt 0 then begin ; vcols = (grid.ratio_opt_co2_grid_avg[0,ii,z]-1)*310. ; test = where(vcols ge 250.,ntest) ; if ntest gt 0 then vcols[test] = 250. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(lat_grid[ii],replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=33,vert_colors=vcols,sym_size=1,/overplot) ; p = plot(lat_grid[ii]-1.67,replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=33,vert_colors=vcols,sym_size=1,/overplot) ; p = plot(lat_grid[ii]+1.67,replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=33,vert_colors=vcols,sym_size=1,/overplot) ; endif ;endfor ;p = plot(lat_tp,tpause_alt,thick=2,color='magenta',/overplot) ;cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname2,tickvalues=findgen(9)*31.,RGB_TABLE=rgb_33,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10, $ ; title='$\Delta$$^2$/$\Gamma$ (years)') ;p.save,dir+'Plots/Balloon Mean Ages/Ratio_of_moments_CO2_opt_grid_'+ext[fi]+'.png' ;p = plot(indgen(2),/nodata,xrange=[0,90],xtickinterval=20,xminor=1,yrange=[300,550],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Theta (K)',font_size=11, $ ; dimensions=[700,450],title='Balloon Optimal Ratios of Moments 2019-23') ;for z = 0, nth-1 do begin ; ii = where(finite(grid_b2.ratio_opt_th_grid_avg[0,*,z]),nii) ; if nii gt 0 then begin ; vcols = (grid_b2.ratio_opt_th_grid_avg[0,ii,z]-1)*310. ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(lat_grid[ii],replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=33,vert_colors=vcols,sym_size=2,/overplot) ; p = plot(lat_grid[ii]-1.4,replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=33,vert_colors=vcols,sym_size=2,/overplot) ; p = plot(lat_grid[ii]+1.4,replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=33,vert_colors=vcols,sym_size=2,/overplot) ; endif ;endfor ;p = plot(lat_tp,tpause_theta,thick=2,color='magenta',/overplot) ;cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname2,tickvalues=findgen(9)*31.,RGB_TABLE=rgb_33,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='years') ;p = plot(indgen(2),/nodata,xrange=[-30,90],xtickinterval=20,xminor=1,yrange=[300,970],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Theta (K)',font_size=12,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Balloon Optimal CO$_2$ Ratios of Moments 1996-2000') ;for z = 0, nth-1 do begin ; ii = where(finite(grid_b0.ratio_opt_co2_th_grid_avg[0,*,z]),nii) ; if nii gt 0 then begin ; vcols = (grid_b0.ratio_opt_co2_th_grid_avg[0,ii,z]-1)*310. ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(lat_grid[ii],replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=33,vert_colors=vcols,sym_size=1,/overplot) ; p = plot(lat_grid[ii]-1.67,replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=33,vert_colors=vcols,sym_size=1,/overplot) ; p = plot(lat_grid[ii]+1.67,replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=33,vert_colors=vcols,sym_size=1,/overplot) ; endif ;endfor ;p = plot(lat_tp,tpause_theta,thick=2,color='magenta',/overplot) ;cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname2,tickvalues=findgen(9)*31.,RGB_TABLE=rgb_33,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='years') ;p.save,dir+'Plots/Balloon Mean Ages/Ratio_of_moments_CO2_opt_th_grid_'+ext[0]+'.png' ;p = plot(indgen(2),/nodata,xrange=[0,90],xtickinterval=20,xminor=1,yrange=[300,630],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Theta (K)',font_size=12,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Balloon Optimal CO$_2$ Ratios of Moments 2021-24') ;for z = 0, nth-1 do begin ;; ii = where(finite(grid_b2.ratio_opt_co2_th_grid_avg[0,*,z]),nii) ; ii = where(finite(grid_b2_v2024.ratio_opt_co2_th_grid_avg[0,*,z]),nii) ; if nii gt 0 then begin ;; vcols = (grid_b2.ratio_opt_co2_th_grid_avg[0,ii,z]-1)*310. ; vcols = (grid_b2_v2024.ratio_opt_co2_th_grid_avg[0,ii,z]-1)*310. ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(lat_grid[ii],replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=33,vert_colors=vcols,sym_size=2,/overplot) ; p = plot(lat_grid[ii]-1.35,replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=33,vert_colors=vcols,sym_size=2,/overplot) ; p = plot(lat_grid[ii]+1.35,replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=33,vert_colors=vcols,sym_size=2,/overplot) ; endif ;endfor ;p = plot(lat_tp,tpause_theta,thick=2,color='magenta',/overplot) ;cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname2,tickvalues=findgen(9)*31.,RGB_TABLE=rgb_33,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='years') ;p.save,dir+'Plots/Balloon Mean Ages/Ratio_of_moments_CO2_opt_grid_'+ext[2]+'.png' ;p = plot(indgen(2),/nodata,xrange=[-90,90],xtickinterval=20,xminor=1,yrange=[7,22],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Altitude (km)',font_size=11,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Aircraft Optimal SF$_6$ Ratios of Moments '+ext_yrs[fi]) ;for z = 0, nz-1 do begin ; ii = where(finite(grid.ratio_opt_sf6_grid_avg[0,*,z]),nii) ; if nii gt 0 then begin ; vcols = (grid.ratio_opt_sf6_grid_avg[0,ii,z]-1)*310. ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(lat_grid[ii],replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=33,vert_colors=vcols,sym_size=2.2,/overplot) ; endif ;endfor ;p = plot(lat_tp,tpause_alt,thick=2,color='magenta',/overplot) ;cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname2,tickvalues=findgen(9)*31.,RGB_TABLE=rgb_33,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10, $ ; title='$\Delta$$^2$/$\Gamma$ (years)') ;p.save,dir+'Plots/Aircraft Mean Ages/Ratio_of_moments_SF6_opt_grid_'+ext[fi]+'.png' ;p = plot(indgen(2),/nodata,xrange=[0,90],xtickinterval=20,xminor=1,yrange=[300,550],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Theta (K)',font_size=12,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Aircraft Optimal Surface Source Latitudes 2021-22') ;for z = 0, nth-1 do begin ; ii = where(finite(grid_a2.lat_source_c_opt_th_grid_avg[0,*,z]),nii) ; if nii gt 0 then begin ; vcols = (grid_a2.lat_source_c_opt_th_grid_avg[0,ii,z]+30)*4. ; test = where(vcols ge 250.,ntest) ; if ntest gt 0 then vcols[test] = 250. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(lat_grid[ii],replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=69,vert_colors=vcols,sym_size=2,/overplot) ; p = plot(lat_grid[ii]-1.4,replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=69,vert_colors=vcols,sym_size=2,/overplot) ; p = plot(lat_grid[ii]+1.4,replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=69,vert_colors=vcols,sym_size=2,/overplot) ; endif ;endfor ;p = plot(lat_tp,tpause_seas_theta[*,2],thick=2,color='magenta',/overplot) ;cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname3,tickvalues=findgen(7)*40.,RGB_TABLE=rgb_69,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='Surface Lat (deg)') ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_lats_opt_th_grid_'+ext[2]+'.png' ;p = plot(indgen(2),/nodata,xrange=[-90,90],xtickinterval=20,xminor=1,yrange=[7,22],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Altitude (km)',font_size=11,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Optimal SF$_6$ Surface Source Latitudes '+ext_yrs[fi]) ;for z = 0, nz-1 do begin ; ii = where(finite(grid.lat_source_c_opt_sf6_grid_avg[0,*,z]),nii) ; if nii gt 0 then begin ; vcols = (grid.lat_source_c_opt_sf6_grid_avg[0,ii,z]+30)*4. ; test = where(vcols ge 250.,ntest) ; if ntest gt 0 then vcols[test] = 250. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(lat_grid[ii],replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=69,vert_colors=vcols,sym_size=2.2,/overplot) ; endif ;endfor ;p = plot(lat_tp,tpause_alt,thick=2,color='magenta',/overplot) ;cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname3,tickvalues=findgen(7)*40.,RGB_TABLE=rgb_69,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10, $ ; title='Surface Lat (deg)') ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_lats_SF6_opt_grid_'+ext[fi]+'.png' ;p = plot(indgen(2),/nodata,xrange=[-30,90],xtickinterval=20,xminor=1,yrange=[7,35],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Altitude (km)',font_size=11,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Balloon Optimal SF$_6$ Ratios of Moments '+ext_yrs[fi]) ;for z = 0, nz-1 do begin ; ii = where(finite(grid.ratio_opt_sf6_grid_avg[0,*,z]),nii) ; if nii gt 0 then begin ; vcols = (grid.ratio_opt_sf6_grid_avg[0,ii,z]-1)*310. ; test = where(vcols ge 250.,ntest) ; if ntest gt 0 then vcols[test] = 250. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(lat_grid[ii],replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=33,vert_colors=vcols,sym_size=1,/overplot) ; p = plot(lat_grid[ii]-1.67,replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=33,vert_colors=vcols,sym_size=1,/overplot) ; p = plot(lat_grid[ii]+1.67,replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=33,vert_colors=vcols,sym_size=1,/overplot) ; endif ;endfor ;p = plot(lat_tp,tpause_alt,thick=2,color='magenta',/overplot) ;cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname2,tickvalues=findgen(9)*31.,RGB_TABLE=rgb_33,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10, $ ; title='$\Delta$$^2$/$\Gamma$ (years)') ;p.save,dir+'Plots/Balloon Mean Ages/Ratio_of_moments_SF6_opt_grid_'+ext[fi]+'.png' ; ;p = plot(indgen(2),/nodata,xrange=[-30,90],xtickinterval=20,xminor=1,yrange=[7,35],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Altitude (km)',font_size=11,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Balloon Optimal SF$_6$ Surface Source Latitudes '+ext_yrs[fi]) ;for z = 0, nz-1 do begin ; ii = where(finite(grid.lat_source_c_opt_sf6_grid_avg[0,*,z]),nii) ; if nii gt 0 then begin ; vcols = (grid.lat_source_c_opt_sf6_grid_avg[0,ii,z]+30)*4. ; test = where(vcols ge 250.,ntest) ; if ntest gt 0 then vcols[test] = 250. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(lat_grid[ii],replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=69,vert_colors=vcols,sym_size=1,/overplot) ; p = plot(lat_grid[ii]-1.67,replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=69,vert_colors=vcols,sym_size=1,/overplot) ; p = plot(lat_grid[ii]+1.67,replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=69,vert_colors=vcols,sym_size=1,/overplot) ; endif ;endfor ;p = plot(lat_tp,tpause_alt,thick=2,color='magenta',/overplot) ;cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname3,tickvalues=findgen(7)*40.,RGB_TABLE=rgb_69,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10, $ ; title='Surface Lat (deg)') ;p.save,dir+'Plots/Balloon Mean Ages/Surface_lats_SF6_opt_grid_'+ext[fi]+'.png' ;p = plot(indgen(2),/nodata,xrange=[0,90],xtickinterval=20,xminor=1,yrange=[300,630],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Theta (K)',font_size=12,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Balloon Optimal CO$_2$ Surface Source Latitudes 2021-24') ;for z = 0, nth-1 do begin ;; ii = where(finite(grid_b2.lat_source_c_opt_co2_th_grid_avg[0,*,z]),nii) ; ii = where(finite(grid_b2_v2024.lat_source_c_opt_co2_th_grid_avg[0,*,z]),nii) ; if nii gt 0 then begin ;; vcols = (grid_b2.lat_source_c_opt_co2_th_grid_avg[0,ii,z]+30)*4. ; vcols = (grid_b2_v2024.lat_source_c_opt_co2_th_grid_avg[0,ii,z]+30)*4. ; test = where(vcols ge 250.,ntest) ; if ntest gt 0 then vcols[test] = 250. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(lat_grid[ii],replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=69,vert_colors=vcols,sym_size=2,/overplot) ; p = plot(lat_grid[ii]-1.35,replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=69,vert_colors=vcols,sym_size=2,/overplot) ; p = plot(lat_grid[ii]+1.35,replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=69,vert_colors=vcols,sym_size=2,/overplot) ; endif ;endfor ;p = plot(lat_tp,tpause_theta,thick=2,color='magenta',/overplot) ;cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname3,tickvalues=findgen(7)*40.,RGB_TABLE=rgb_69,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='Surface Lat (deg)') ;p.save,dir+'Plots/Balloon Mean Ages/Surface_lats_CO2_opt_th_grid_'+ext[fi]+'.png' ; ;for t = 9, 11 do begin ; p = plot(indgen(2),/nodata,xrange=[-90,90],xtickinterval=20,xminor=1,yrange=[7,22],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Altitude (km)',font_size=11, $ ; dimensions=[700,450],title='Aircraft Optimal CO2 Mean Ages '+months[t]) ; for z = 0, nz-1 do begin ; ii = where(finite(grid.age_opt_co2_grid_mon_avg[0,*,z,t]),nii) ; if nii gt 0 then begin ; vcols = grid.age_opt_co2_grid_mon_avg[0,ii,z,t]*45. ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; p = plot(lat_grid[ii],replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=2.2,/overplot) ; endif ; endfor ; p = plot(lat_tp,tpause_alt,thick=2,color='magenta',/overplot) ; cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname,tickvalues=findgen(12)*22.,RGB_TABLE=rgb,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='years') ;endfor ;for t = 1, 1 do begin ; p = plot(indgen(2),/nodata,xrange=[-90,90],xtickinterval=20,xminor=1,yrange=[7,22],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Altitude (km)',font_size=11, $ ; dimensions=[700,450],title='Aircraft Optimal CO2 Mean Ages '+seas[t]) ; for z = 0, nz-1 do begin ; ii = where(finite(grid.age_opt_co2_grid_seas_avg[0,*,z,t]),nii) ; if nii gt 0 then begin ; vcols = grid.age_opt_co2_grid_seas_avg[0,ii,z,t]*45. ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; p = plot(lat_grid[ii],replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=2.2,/overplot) ; endif ; endfor ; p = plot(lat_tp,tpause_alt,thick=2,color='magenta',/overplot) ; cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname,tickvalues=findgen(12)*22.,RGB_TABLE=rgb,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='years') ;endfor ;for t = 0, 3 do begin ; p = plot(indgen(2),/nodata,xrange=[-90,90],xtickinterval=20,xminor=1,yrange=[300,550],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Theta (K)',font_size=11,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Aircraft Optimal CO$_2$ Mean Ages '+seas[t]) ; for z = 0, nth-1 do begin ; ii = where(finite(grid.age_opt_co2_th_grid_seas_avg[0,*,z,t]),nii) ; if nii gt 0 then begin ; vcols = grid.age_opt_co2_th_grid_seas_avg[0,ii,z,t]*45. ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; p = plot(lat_grid[ii],replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=2.2,/overplot) ; endif ; endfor ; p = plot(lat_tp,tpause_theta,thick=2,color='magenta',/overplot) ; cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname,tickvalues=findgen(12)*22.,RGB_TABLE=rgb,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='$\Gamma$ (years)') ; p.save,dir+'Plots/Aircraft Mean Ages/Age_CO2_opt_grid_'+seas[t]+'_'+ext[fi]+'.png' ;endfor ; ;for t = 0, 3 do begin ; p = plot(indgen(2),/nodata,xrange=[-90,90],xtickinterval=20,xminor=1,yrange=[300,550],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Theta (K)',font_size=11,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Aircraft Optimal SF$_6$ Mean Ages '+seas[t]) ; for z = 0, nth-1 do begin ; ii = where(finite(grid.age_opt_sf6_th_grid_seas_avg[0,*,z,t]),nii) ; if nii gt 0 then begin ; vcols = grid.age_opt_sf6_th_grid_seas_avg[0,ii,z,t]*45. ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; p = plot(lat_grid[ii],replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=2.2,/overplot) ; endif ; endfor ; p = plot(lat_tp,tpause_theta,thick=2,color='magenta',/overplot) ; cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname,tickvalues=findgen(12)*22.,RGB_TABLE=rgb,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='$\Gamma$ (years)') ; p.save,dir+'Plots/Aircraft Mean Ages/Age_SF6_opt_grid_'+seas[t]+'_'+ext[fi]+'.png' ;endfor ; ;for t = 0, 3 do begin ; p = plot(indgen(2),/nodata,xrange=[-90,90],xtickinterval=20,xminor=1,yrange=[300,550],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Theta (K)',font_size=11,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Aircraft Optimal CO$_2$ Ratios of Moments '+seas[t]) ; for z = 0, nth-1 do begin ; ii = where(finite(grid.ratio_opt_co2_th_grid_seas_avg[0,*,z,t]),nii) ; if nii gt 0 then begin ; vcols = (grid.ratio_opt_co2_th_grid_seas_avg[0,ii,z,t]-1.)*310. ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(lat_grid[ii],replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=33,vert_colors=vcols,sym_size=2.2,/overplot) ; endif ; endfor ; p = plot(lat_tp,tpause_theta,thick=2,color='magenta',/overplot) ; cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname2,tickvalues=findgen(9)*31.,RGB_TABLE=rgb_33,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10, $ ; title='$\Delta$$^2$/$\Gamma$ (years)') ; p.save,dir+'Plots/Aircraft Mean Ages/Ratios_CO2_opt_grid_'+seas[t]+'_'+ext[fi]+'.png' ;endfor ;for t = 0, 3 do begin ; p = plot(indgen(2),/nodata,xrange=[-90,90],xtickinterval=20,xminor=1,yrange=[7,22],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Altitude (km)',font_size=11,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Aircraft Optimal CO$_2$ Surface Source Latitudes '+seas[t]) ; for z = 0, nz-1 do begin ; ii = where(finite(grid.lat_source_c_opt_co2_grid_seas_avg[0,*,z,t]),nii) ; if nii gt 0 then begin ; vcols = (grid.lat_source_c_opt_co2_grid_seas_avg[0,ii,z,t]+30)*4. ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(lat_grid[ii],replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=69,vert_colors=vcols,sym_size=2.2,/overplot) ; endif ; endfor ; p = plot(lat_tp,tpause_alt,thick=2,color='magenta',/overplot) ; cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname3,tickvalues=findgen(7)*40.,RGB_TABLE=rgb_69,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='Surface Lat (deg)') ; p.save,dir+'Plots/Aircraft Mean Ages/Surface_lats_CO2_opt_grid_'+seas[t]+'_'+ext[fi]+'.png' ;endfor ;for t = 0, 3 do begin ; p = plot(indgen(2),/nodata,xrange=[-90,90],xtickinterval=20,xminor=1,yrange=[300,550],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Theta (K)',font_size=11,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Aircraft Optimal CO$_2$ Surface Source Latitudes '+seas[t]) ; for z = 0, nth-1 do begin ; ii = where(finite(grid.lat_source_c_opt_co2_th_grid_seas_avg[0,*,z,t]),nii) ; if nii gt 0 then begin ; vcols = (grid.lat_source_c_opt_co2_th_grid_seas_avg[0,ii,z,t]+30)*4. ; test = where(vcols ge 250.,ntest) ; if ntest gt 0 then vcols[test] = 250. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(lat_grid[ii],replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=69,vert_colors=vcols,sym_size=2.2,/overplot) ; endif ; endfor ; p = plot(lat_tp,tpause_theta,thick=2,color='magenta',/overplot) ; cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname3,tickvalues=findgen(7)*40.,RGB_TABLE=rgb_69,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='Surface Lat (deg)') ; p.save,dir+'Plots/Aircraft Mean Ages/Surface_lats_CO2_opt_th_grid_'+seas[t]+'_'+ext[fi]+'.png' ;endfor ;for t = 1, 1 do begin ; p = plot(indgen(2),/nodata,xrange=[-90,90],xtickinterval=20,xminor=1,yrange=[7,22],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Altitude (km)',font_size=11,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Aircraft Optimal CO$_2$ Surface Source Latitudes '+months[t]) ; for z = 0, nz-1 do begin ; ii = where(finite(grid.lat_source_c_opt_co2_grid_mon_avg[0,*,z,t]),nii) ; if nii gt 0 then begin ; vcols = (grid.lat_source_c_opt_co2_grid_mon_avg[0,ii,z,t]+30)*4. ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(lat_grid[ii],replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=69,vert_colors=vcols,sym_size=2.2,/overplot) ; endif ; endfor ; p = plot(lat_tp,tpause_alt,thick=2,color='magenta',/overplot) ; cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname3,tickvalues=findgen(7)*40.,RGB_TABLE=rgb_69,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='Surface Lat (deg)') ;; p.save,dir+'Plots/Aircraft Mean Ages/Surface_lats_CO2_opt_grid_'+months[t]+'_'+ext[fi]+'.png' ;endfor ;for t = 0, 11 do begin ; p = plot(indgen(2),/nodata,xrange=[-90,90],xtickinterval=20,xminor=1,yrange=[300,550],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Theta (K)',font_size=11,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Aircraft Optimal CO$_2$ Surface Source Latitudes '+months[t]) ; for z = 0, nth-1 do begin ; ii = where(finite(grid.lat_source_c_opt_co2_th_grid_mon_avg[0,*,z,t]),nii) ; if nii gt 0 then begin ; vcols = (grid.lat_source_c_opt_co2_th_grid_mon_avg[0,ii,z,t]+30)*4. ; test = where(vcols ge 250.,ntest) ; if ntest gt 0 then vcols[test] = 250. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(lat_grid[ii],replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=69,vert_colors=vcols,sym_size=2.2,/overplot) ; endif ; endfor ; p = plot(lat_tp,tpause_theta,thick=2,color='magenta',/overplot) ; cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname3,tickvalues=findgen(7)*40.,RGB_TABLE=rgb_69,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10, $ ; title='Surface Lat (deg)') ;; p.save,dir+'Plots/Aircraft Mean Ages/Surface_lats_CO2_opt_th_grid_'+months[t]+'_'+ext[fi]+'.png' ;endfor ;for t = 0, 11 do begin ; p = plot(indgen(2),/nodata,xrange=[-90,90],xtickinterval=20,xminor=1,yrange=[7,22],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Altitude (km)',font_size=11,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Aircraft Old CO$_2$ - Optimal CO$_2$ Mean Ages '+months[t]) ; for z = 0, nz-1 do begin ; ii = where(finite(grid_a0.age_opt_co2_grid_mon_avg[0,*,z,t]) and finite(grid_a0.age_co2_grid_mon_avg[0,*,z,t]),nii) ; if nii gt 0 then begin ; vcols = (grid_a0.age_opt_co2_grid_mon_avg[0,ii,z,t]-grid_a0.age_co2_grid_mon_avg[0,ii,z,t] + 1.5)*83. ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(lat_grid[ii],replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=70,vert_colors=vcols,sym_size=2.2,/overplot) ; endif ; endfor ; p = plot(lat_tp,tpause_alt,thick=2,color='magenta',/overplot) ; cb = COLORBAR(POSITION=[0.9,0.2,0.92,0.75],tickname=tickname5,tickvalues=findgen(11)*25.,RGB_TABLE=reverse(rgb_70),BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='d$\Gamma$ (years)') ; p.save,dir+'Plots/Aircraft Mean Ages/Age_diffs_CO2_grid_'+months[t]+'_'+ext[fi]+'.png' ;endfor ;for t = 17, 18 do begin ; p = plot(indgen(2),/nodata,xrange=[0,90],xtickinterval=20,xminor=1,yrange=[300,550],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Theta (K)',font_size=12,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Aircraft Optimal Mean Ages '+mission_names[t]) ; for z = 0, nth-1 do begin ; ii = where(finite(grid_a2.age_opt_th_grid_mission_avg[0,*,z,t]),nii) ; if nii gt 0 then begin ; vcols = grid_a2.age_opt_th_grid_mission_avg[0,ii,z,t]*55. ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; p = plot(lat_grid[ii],replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=2,/overplot) ; p = plot(lat_grid[ii]-1.4,replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=2,/overplot) ; p = plot(lat_grid[ii]+1.4,replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=2,/overplot) ; endif ; endfor ; p = plot(lat_tp,tpause_seas_theta[*,2],thick=2,color='magenta',/overplot) ; cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname0,tickvalues=findgen(10)*28.,RGB_TABLE=rgb,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='$\Gamma$ (years)') ; p.save,dir+'Plots/Aircraft Mean Ages/Age_opt_th_grid_'+mission_names[t]+'.png' ;endfor ;for t = 7, 7 do begin ; p = plot(indgen(2),/nodata,xrange=[-90,90],xtickinterval=20,xminor=1,yrange=[7,22],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Altitude (km)',font_size=11, $ ; dimensions=[700,450],title='Aircraft Optimal CO2 Mean Ages '+mission_names[t]) ; for z = 0, nz-1 do begin ; ii = where(finite(grid.age_opt_co2_grid_mission_avg[0,*,z,t]),nii) ; if nii gt 0 then begin ; vcols = grid.age_opt_co2_grid_mission_avg[0,ii,z,t]*50. ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; p = plot(lat_grid[ii],replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=2.2,/overplot) ; endif ; endfor ; p = plot(lat_tp,tpause_alt,thick=2,color='magenta',/overplot) ; cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname1,tickvalues=findgen(11)*25.,RGB_TABLE=rgb,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='years') ;endfor ;for t = 17, 18 do begin ; p = plot(indgen(2),/nodata,xrange=[0,90],xtickinterval=20,xminor=1,yrange=[300,550],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Theta (K)',font_size=11, $ ; dimensions=[700,450],title='Aircraft Optimal CO$_2$ Mean Ages '+mission_names[t]) ; for z = 0, nth-1 do begin ; ii = where(finite(grid_a2.age_opt_co2_th_grid_mission_avg[0,*,z,t]),nii) ; if nii gt 0 then begin ; vcols = grid_a2.age_opt_co2_th_grid_mission_avg[0,ii,z,t]*55. ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; p = plot(lat_grid[ii],replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=2,/overplot) ; p = plot(lat_grid[ii]-1.4,replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=2,/overplot) ; p = plot(lat_grid[ii]+1.4,replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=2,/overplot) ; endif ; endfor ; p = plot(lat_tp,tpause_seas_theta[*,2],thick=2,color='magenta',/overplot) ; cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname0,tickvalues=findgen(10)*28.,RGB_TABLE=rgb,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='$\Gamma$ (years)') ;endfor ;for t = 17, 18 do begin ; p = plot(indgen(2),/nodata,xrange=[0,90],xtickinterval=20,xminor=1,yrange=[300,550],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Theta (K)',font_size=11,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Aircraft Optimal CO$_2$ Surface Source Latitudes '+mission_names[t]) ; for z = 0, nth-1 do begin ; ii = where(finite(grid.lat_source_c_opt_co2_th_grid_mission_avg[0,*,z,t]),nii) ; if nii gt 0 then begin ; vcols = (grid.lat_source_c_opt_co2_th_grid_mission_avg[0,ii,z,t]+30)*4. ; test = where(vcols ge 250.,ntest) ; if ntest gt 0 then vcols[test] = 250. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(lat_grid[ii],replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=69,vert_colors=vcols,sym_size=2,/overplot) ; p = plot(lat_grid[ii]-1.4,replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=69,vert_colors=vcols,sym_size=2,/overplot) ; p = plot(lat_grid[ii]+1.4,replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=69,vert_colors=vcols,sym_size=2,/overplot) ; endif ; endfor ; p = plot(lat_tp,tpause_seas_theta[*,2],thick=2,color='magenta',/overplot) ; cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname3,tickvalues=findgen(7)*40.,RGB_TABLE=rgb_69,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='Surface Lat (deg)') ;endfor ;for t = 19, 19 do begin ; p = plot(indgen(2),/nodata,xrange=[0,90],xtickinterval=20,xminor=1,yrange=[7,20],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Altitude (km)',font_size=11, $ ; dimensions=[700,450],title='Aircraft Optimal SF$_6$ Mean Ages '+mission_names[t]) ; for z = 0, nz-1 do begin ; ii = where(finite(grid.age_opt_sf6_grid_mission_avg[0,*,z,t]),nii) ; if nii gt 0 then begin ; vcols = grid.age_opt_sf6_grid_mission_avg[0,ii,z,t]*55. ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; p = plot(lat_grid[ii],replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=2,/overplot) ; p = plot(lat_grid[ii]-1.4,replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=2,/overplot) ; p = plot(lat_grid[ii]+1.4,replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=2,/overplot) ; endif ; endfor ; p = plot(lat_tp,tpause_alt,thick=2,color='magenta',/overplot) ; cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname0,tickvalues=findgen(10)*28.,RGB_TABLE=rgb,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='$\Gamma$ (years)') ;endfor ;for t = 19, 19 do begin ; p = plot(indgen(2),/nodata,xrange=[0,90],xtickinterval=10,xminor=1,yrange=[300,500],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Theta (K)',font_size=12,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Aircraft Optimal SF$_6$ Mean Ages '+mission_names[t]) ; for z = 0, nth-1 do begin ; ii = where(finite(grid_a2.age_opt_sf6_th_grid_mission_avg[0,*,z,t]),nii) ; if nii gt 0 then begin ; vcols = grid_a2.age_opt_sf6_th_grid_mission_avg[0,ii,z,t]*55. ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; p = plot(lat_grid[ii],replicate(theta_grid[z],nii)+1.5,symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=2,/overplot) ; p = plot(lat_grid[ii]-1.4,replicate(theta_grid[z]+1.5,nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=2,/overplot) ; p = plot(lat_grid[ii]+1.4,replicate(theta_grid[z]+1.5,nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=2,/overplot) ; p = plot(lat_grid[ii],replicate(theta_grid[z],nii)-1.5,symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=2,/overplot) ; p = plot(lat_grid[ii]-1.4,replicate(theta_grid[z]-1.5,nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=2,/overplot) ; p = plot(lat_grid[ii]+1.4,replicate(theta_grid[z]-1.5,nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=2,/overplot) ; endif ; endfor ; p = plot(lat_tp,tpause_seas_theta[*,0],thick=2,color='magenta',/overplot) ; cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname0,tickvalues=findgen(10)*28.,RGB_TABLE=rgb,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='$\Gamma$ (years)') ; p.save,dir+'Plots/Aircraft Mean Ages/Age_opt_sf6_th_grid_'+mission_names[t]+'.png' ;endfor ;for t = 7, 7 do begin ; p = plot(indgen(2),/nodata,xrange=[-90,90],xtickinterval=20,xminor=1,yrange=[7,22],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Altitude (km)',font_size=11, $ ; dimensions=[700,450],title='Aircraft Optimal CO2 Ratios of Moments '+mission_names[t]) ; for z = 0, nz-1 do begin ; ii = where(finite(grid.ratio_opt_co2_grid_mission_avg[0,*,z,t]),nii) ; if nii gt 0 then begin ; vcols = (grid.ratio_opt_co2_grid_mission_avg[0,ii,z,t]-0.8)*260. ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(lat_grid[ii],replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=2.2,/overplot) ; endif ; endfor ; p = plot(lat_tp,tpause_alt,thick=2,color='magenta',/overplot) ; cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname2,tickvalues=findgen(7)*40.,RGB_TABLE=rgb,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='years') ;endfor ;for t = 17, 18 do begin ; p = plot(indgen(2),/nodata,xrange=[0,90],xtickinterval=10,xminor=1,yrange=[300,550],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Theta (K)',font_size=12,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Aircraft Optimal Ratios of Moments '+mission_names[t]) ; for z = 0, nth-1 do begin ; ii = where(finite(grid.ratio_opt_th_grid_mission_avg[0,*,z,t]),nii) ; if nii gt 0 then begin ; vcols = (grid.ratio_opt_th_grid_mission_avg[0,ii,z,t]-1)*310. ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(lat_grid[ii],replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=33,vert_colors=vcols,sym_size=2,/overplot) ; p = plot(lat_grid[ii]-1.4,replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=33,vert_colors=vcols,sym_size=2,/overplot) ; p = plot(lat_grid[ii]+1.4,replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=33,vert_colors=vcols,sym_size=2,/overplot) ; endif ; endfor ; p = plot(lat_tp,tpause_seas_theta[*,1],thick=2,color='magenta',/overplot) ; cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname2,tickvalues=findgen(9)*31.,RGB_TABLE=rgb_33,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='years') ; p.save,dir+'Plots/Aircraft Mean Ages/Ratios_opt_th_grid_'+mission_names[t]+'.png' ;endfor ;for t = 17, 18 do begin ; p = plot(indgen(2),/nodata,xrange=[0,90],xtickinterval=20,xminor=1,yrange=[300,550],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Theta (K)',font_size=11, $ ; dimensions=[700,450],title='Aircraft Optimal CO$_2$ Ratios of Moments '+mission_names[t]) ; for z = 0, nth-1 do begin ; ii = where(finite(grid.ratio_opt_co2_th_grid_mission_avg[0,*,z,t]),nii) ; if nii gt 0 then begin ; vcols = (grid.ratio_opt_co2_th_grid_mission_avg[0,ii,z,t]-1)*310. ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(lat_grid[ii],replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=33,vert_colors=vcols,sym_size=2,/overplot) ; p = plot(lat_grid[ii]-1.4,replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=33,vert_colors=vcols,sym_size=2,/overplot) ; p = plot(lat_grid[ii]+1.4,replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=33,vert_colors=vcols,sym_size=2,/overplot) ; endif ; endfor ; p = plot(lat_tp,tpause_seas_theta[*,1],thick=2,color='magenta',/overplot) ; cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname2,tickvalues=findgen(9)*31.,RGB_TABLE=rgb_33,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='years') ;endfor ;for t = 17, 18 do begin ; p = plot(indgen(2),/nodata,xrange=[-90,90],xtickinterval=20,xminor=1,yrange=[7,22],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Altitude (km)',font_size=11, $ ; dimensions=[700,450],title='Aircraft Optimal SF$_6$ Ratios of Moments '+mission_names[t]) ; for z = 0, nz-1 do begin ; ii = where(finite(grid.ratio_opt_sf6_grid_mission_avg[0,*,z,t]),nii) ; if nii gt 0 then begin ; vcols = (grid.ratio_opt_sf6_grid_mission_avg[0,ii,z,t]-0.8)*260. ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(lat_grid[ii],replicate(alt_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=39,vert_colors=vcols,sym_size=2.2,/overplot) ; endif ; endfor ; p = plot(lat_tp,tpause_alt,thick=2,color='magenta',/overplot) ; cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname2,tickvalues=findgen(7)*40.,RGB_TABLE=rgb,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='years') ;endfor ;for t = 19, 19 do begin ; p = plot(indgen(2),/nodata,xrange=[0,90],xtickinterval=10,xminor=1,yrange=[300,550],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Theta (K)',font_size=12,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Aircraft Optimal SF$_6$ Ratios of Moments '+mission_names[t]) ; for z = 0, nth-1 do begin ; ii = where(finite(grid.ratio_opt_sf6_th_grid_mission_avg[0,*,z,t]),nii) ; if nii gt 0 then begin ; vcols = (grid.ratio_opt_sf6_th_grid_mission_avg[0,ii,z,t]-1)*310. ; test = where(vcols ge 240.,ntest) ; if ntest gt 0 then vcols[where(vcols ge 240.)] = 240. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(lat_grid[ii],replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=33,vert_colors=vcols,sym_size=2,/overplot) ; p = plot(lat_grid[ii]-1.4,replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=33,vert_colors=vcols,sym_size=2,/overplot) ; p = plot(lat_grid[ii]+1.4,replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=33,vert_colors=vcols,sym_size=2,/overplot) ; endif ; endfor ; p = plot(lat_tp,tpause_seas_theta[*,0],thick=2,color='magenta',/overplot) ; cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname2,tickvalues=findgen(9)*31.,RGB_TABLE=rgb_33,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='years') ; p.save,dir+'Plots/Aircraft Mean Ages/Ratios_opt_sf6_th_grid_'+mission_names[t]+'.png' ;endfor ;for t = 19, 19 do begin ; p = plot(indgen(2),/nodata,xrange=[0,90],xtickinterval=20,xminor=1,yrange=[300,570],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Theta (K)',font_size=12,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Aircraft Optimal SF$_6$ Surface Source Latitudes '+mission_names[t]) ; for z = 0, nth-1 do begin ; ii = where(finite(grid.lat_source_c_opt_sf6_th_grid_mission_avg[0,*,z,t]),nii) ; if nii gt 0 then begin ; vcols = (grid.lat_source_c_opt_sf6_th_grid_mission_avg[0,ii,z,t]+30)*4. ; test = where(vcols ge 250.,ntest) ; if ntest gt 0 then vcols[test] = 250. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(lat_grid[ii],replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=69,vert_colors=vcols,sym_size=2,/overplot) ; p = plot(lat_grid[ii]-1.4,replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=69,vert_colors=vcols,sym_size=2,/overplot) ; p = plot(lat_grid[ii]+1.4,replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=69,vert_colors=vcols,sym_size=2,/overplot) ; endif ; endfor ; p = plot(lat_tp,tpause_seas_theta[*,0],thick=2,color='magenta',/overplot) ; cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname3,tickvalues=findgen(7)*40.,RGB_TABLE=rgb_69,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='Surface Lat (deg)') ;; p.save,dir+'Plots/Aircraft Mean Ages/Surface_lats_opt_sf6_th_grid_'+mission_names[t]+'.png' ;endfor ;for t = 19, 19 do begin ; p = plot(indgen(2),/nodata,xrange=[0,90],xtickinterval=20,xminor=1,yrange=[300,550],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Theta (K)',font_size=12,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Aircraft Optimal SF$_6$ Surface Source Latitudes '+mission_names[t]) ; for z = 0, nth-1 do begin ; ii = where(finite(grid.lat_source_opt_sf6_th_grid_mission_avg[0,*,z,t]),nii) ; if nii gt 0 then begin ; vcols = (grid.lat_source_opt_sf6_th_grid_mission_avg[0,ii,z,t]+40)*3. ; test = where(vcols ge 250.,ntest) ; if ntest gt 0 then vcols[test] = 250. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(lat_grid[ii],replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=69,vert_colors=vcols,sym_size=2,/overplot) ; p = plot(lat_grid[ii]-1.4,replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=69,vert_colors=vcols,sym_size=2,/overplot) ; p = plot(lat_grid[ii]+1.4,replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=69,vert_colors=vcols,sym_size=2,/overplot) ; endif ; endfor ; p = plot(lat_tp,tpause_seas_theta[*,0],thick=2,color='magenta',/overplot) ; cb = COLORBAR(POSITION=[0.905,0.2,0.925,0.75],tickname=tickname33,tickvalues=findgen(9)*31.,RGB_TABLE=rgb_69,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='Surface Lat (deg)') ; p.save,dir+'Plots/Aircraft Mean Ages/Surface_lats_orig_opt_sf6_th_grid_'+mission_names[t]+'.png' ;endfor ;for t = 19, 19 do begin ; p = plot(indgen(2),/nodata,xrange=[0,90],xtickinterval=20,xminor=1,yrange=[300,550],position=[0.1,0.1,0.89,0.9],xtitle='Equivalent Latitude',ytitle='Theta (K)',font_size=12,xticklen=0.04, $ ; yticklen=0.03,dimensions=[700,450],title='Aircraft Optimal SF$_6$ Extratropical Fractions '+mission_names[t]) ; for z = 0, nth-1 do begin ; ii = where(finite(grid.frac_extratr_opt_sf6_th_grid_mission_avg[0,*,z,t]),nii) ; if nii gt 0 then begin ; vcols = grid.frac_extratr_opt_sf6_th_grid_mission_avg[0,ii,z,t]*250. ; test = where(vcols ge 250.,ntest) ; if ntest gt 0 then vcols[test] = 250. ; test = where(vcols lt 0.,ntest) ; if ntest gt 0 then vcols[test] = 0. ; p = plot(lat_grid[ii],replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=33,vert_colors=vcols,sym_size=2,/overplot) ; p = plot(lat_grid[ii]-1.4,replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=33,vert_colors=vcols,sym_size=2,/overplot) ; p = plot(lat_grid[ii]+1.4,replicate(theta_grid[z],nii),symbol='s',/sym_filled,linestyle=6,rgb_table=33,vert_colors=vcols,sym_size=2,/overplot) ; endif ; endfor ; p = plot(lat_tp,tpause_seas_theta[*,0],thick=2,color='magenta',/overplot) ; cb = COLORBAR(POSITION=[0.9,0.2,0.92,0.75],tickname=tickname6,tickvalues=findgen(11)*25.,RGB_TABLE=rgb_33,BORDER=1, ORIENTATION=1,/textpos,/tickdir,font_size=10,title='Fraction') ; p.save,dir+'Plots/Aircraft Mean Ages/Extra_frac_opt_sf6_th_grid_'+mission_names[t]+'.png' ;endfor ;p = plot(indgen(2),/nodata,xrange=[0,11],yrange=[-22,22],xtitle='Month',ytitle='Surface Lat Source',font_size=11,title='Seasonal Cycle of Surface Lat Source in Tropics') ;p = plot([0,11],[0,0],linestyle=2,/overplot) ;;for z = 0, 2 do for y = 0, 1 do p = plot(indgen(12),lat_source_c_opt_co2_grid_mon_avg[y,z,*],symbol='o',/sym_filled,color=colors[y],linestyle=z+1,/overplot) ;for z = 0, 2 do for y = 0, 1 do p = plot(indgen(4)*3+0.5,lat_source_c_opt_co2_grid_seas_avg[y,z,*],symbol='s',/sym_filled,thick=3,color=colors[y],linestyle=z+1,/overplot) ;p = plot(indgen(2),/nodata,xrange=[-24,24],yrange=[14,20],ytitle='Altitude (km)',xtitle='Surface Lat Source',font_size=11,title='Seasonal Cycle of Surface Lat Source in Northern Tropics 0-20N') ;poly = polygon([0,20,20,0],[14,14,22,22],/fill_background,/data,fill_color='light grey',color='white') ;p = plot([0,0],[14,20],linestyle=2,/overplot) ;p = plot(lat_tp,tpause_alt,thick=2,color='magenta',/overplot) ;for t = 0, 3 do p = errorplot(lat_source_c_opt_co2_grid_seas_avg[0,1,*,t,0],indgen(3)*2+15+0.1*t,lat_source_c_opt_co2_grid_seas_avg[1,1,*,t,0],replicate(1,3),symbol='s',sym_size=2,/sym_filled, $ ; thick=3,color=colors[2*t+2],errorbar_capsize=0,errorbar_thick=2,/overplot) ;for t = 0, 3 do p = errorplot(lat_source_c_opt_co2_grid_seas_avg[0,1,*,t,1],indgen(3)*2+15+0.1*t,lat_source_c_opt_co2_grid_seas_avg[1,1,*,t,1],replicate(1,3),symbol='s',sym_size=2,/sym_filled, $ ; thick=3,color=colors[2*t+2],linestyle=2,errorbar_capsize=0,errorbar_thick=2,/overplot) ;for t = 0, 3 do txt = text(0.2,0.8-t*0.04,seas[t],color=colors[2*t+2],font_size=11,/norm) ;p = plot(indgen(2),/nodata,xrange=[-30,40],yrange=[14,20],ytitle='Altitude (km)',xtitle='Surface Lat Source',font_size=11, $ ; title='Seasonal Cycle of Extratropical Surface Lat Source in Northern Tropics 0-20N') ;poly = polygon([0,20,20,0],[14,14,22,22],/fill_background,/data,fill_color='light grey',color='white') ;p = plot([0,0],[14,20],linestyle=2,/overplot) ;p = plot(lat_tp,tpause_alt,thick=2,color='magenta',/overplot) ;for t = 0, 3 do p = errorplot(lat_source_opt_co2_grid_seas_avg[0,1,*,t],indgen(3)*2+15+0.1*t,lat_source_opt_co2_grid_seas_avg[1,1,*,t],replicate(1,3),symbol='s',sym_size=2,/sym_filled,thick=3, $ ; color=colors[2*t+2],errorbar_capsize=0,errorbar_thick=2,/overplot) ;for t = 0, 3 do txt = text(0.18,0.8-t*0.04,seas[t],color=colors[2*t+2],font_size=11,/norm) ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_lats_CO2_opt_seas_north_tropics_'+ext[fi]+'.png' ;p = plot(indgen(2),/nodata,xrange=[-24,24],yrange=[14,20],ytitle='Altitude (km)',xtitle='Surface Lat Source',font_size=11,title='Seasonal Cycle of Surface Lat Source in Southern Tropics 0-20S') ;poly = polygon([-20,0,0,-20],[14,14,22,22],/fill_background,/data,fill_color='light grey',color='white') ;p = plot([0,0],[14,20],linestyle=2,/overplot) ;p = plot(lat_tp,tpause_alt,thick=2,color='magenta',/overplot) ;for t = 0, 3 do p = errorplot(lat_source_c_opt_co2_grid_seas_avg[0,0,*,t,0],indgen(3)*2+15+0.1*t,lat_source_c_opt_co2_grid_seas_avg[1,0,*,t,0],replicate(1,3),symbol='s',sym_size=2,/sym_filled, $ ; thick=3,color=colors[2*t+2],errorbar_capsize=0,errorbar_thick=2,/overplot) ;for t = 0, 3 do p = errorplot(lat_source_c_opt_co2_grid_seas_avg[0,0,*,t,1],indgen(3)*2+15+0.1*t,lat_source_c_opt_co2_grid_seas_avg[1,0,*,t,1],replicate(1,3),symbol='s',sym_size=2,/sym_filled, $ ; thick=3,color=colors[2*t+2],linestyle=2,errorbar_capsize=0,errorbar_thick=2,/overplot) ;for t = 0, 3 do txt = text(0.2,0.8-t*0.04,seas[t],color=colors[2*t+2],font_size=11,/norm) ;p = plot(indgen(2),/nodata,xrange=[-30,40],yrange=[14,20],ytitle='Altitude (km)',xtitle='Surface Lat Source',font_size=11, $ ; title='Seasonal Cycle of Extratropical Surface Lat Source in Southern Tropics 0-20S') ;poly = polygon([-20,0,0,-20],[14,14,22,22],/fill_background,/data,fill_color='light grey',color='white') ;p = plot([0,0],[14,20],linestyle=2,/overplot) ;p = plot(lat_tp,tpause_alt,thick=2,color='magenta',/overplot) ;for t = 0, 3 do p = errorplot(lat_source_opt_co2_grid_seas_avg[0,0,*,t],indgen(3)*2+15+0.1*t,lat_source_opt_co2_grid_seas_avg[1,0,*,t],replicate(1,3),symbol='s',sym_size=2,/sym_filled,thick=3, $ ; color=colors[2*t+2],errorbar_capsize=0,errorbar_thick=2,/overplot) ;for t = 0, 3 do txt = text(0.18,0.8-t*0.04,seas[t],color=colors[2*t+2],font_size=11,/norm) ;p.save,dir+'Plots/Aircraft Mean Ages/Surface_lats_CO2_opt_seas_south_tropics_'+ext[fi]+'.png' end