clear

nx = 2160;
pinV = '~dmenemen/llc_2160/regions/global/dopplerSCAT2/KE_V'
pinU = '~dmenemen/llc_2160/regions/global/dopplerSCAT2/KE_U'
n = 0;
keTU = 0;
keTV = 0;
for  ts=92160:(80*24):92160+10*80*24%1586400;
   
     dy=ts2dte(ts,45,2011,1,17,30);
     
    fld=0; nn=0;
    
    finV = [pinV '/KE_V_' num2str(nx) 'x' num2str(nx*13) '.' dy];
    finU = [pinU '/KE_U_' num2str(nx) 'x' num2str(nx*13) '.' dy];
    
    if exist(finU) 
        n = n + 1;
        keTU = keTU + readbin(finU,[8640,7560]);
        keTV = keTV + readbin(finV,[8640,7560]);
        if n == 4
            keT4 = keTU./4+keTV./4;
        elseif n == 6
            keT6 = keTU./6+keTV./6;
        elseif n == 8
            keT8 = keTU./8+keTV./8;
        end
        
    end
end

%%

fig = figure('color','white','units','normalized','outerposition',[0 0 1 1],'name','1');
quikpcolor(medfilt2(keT8)');
c = colorbar;
caxis([-.02 .05])
title('Total Power Per Area 3x3 Median Filter-- Filtered + Noisy, 8 day avg of hourly snapshots')
xlabel(c,'Power Per Area (W/m^2)')
set(get(gca,'title'),'fontsize',16);
a = get(c,'xlabel');
set(a,'fontsize',16);
set(gca,'xtick',[])
set(gca,'ytick',[])
daspect([1 1 1])
%print('-dpng','-r300','totalPWR_medfilt_global_dopplerscat_8d.png')
        
    
        