clc
clear 
close all

AERONET_latlon_dust(1,1)=4939;
AERONET_latlon_dust(1,2)=1865;
AERONET_latlon_dust(2,1)=5090;
AERONET_latlon_dust(2,2)=1974;

for Jday=161:182
    
    
    start_day=0; 
    
Y=datevec(datenum(2020,0,Jday));
M=sprintf('%02d',Y(2));
D=sprintf('%02d',Y(3));
JJday=sprintf('%03d',Jday);
Jday_str=num2str(Jday,'%03.f')

addpath(['/ships19/hercules/mino/Satellite_Out/GOES-16_ABI/global/2020/level2/',Jday_str,'/'])

time=[0800;0830;0900;0930;1000;1030;...
      1100;1130;1200;1230;1300;1330;...
      1400;1430;1500;1530;1600;1630;...
      1700;1730;1800;1830;1900;1930;...
      2000;2030;2100;2130;2200;2230;...
      2300;2330];
		

    
%clavrx_OR_ABI-L1b-RadF-M6C01_G16_s20201700800195.level2.nc 
fname=dir('clavrx_OR_ABI-L1b-RadF-M6C01_G16_s2020*.level2.nc);

for jj=1:length(fname)

 Tempfname=fname(jj).name;

 JulianDay=Tempfname(39:41);

 tt=str2num(Tempfname(42:45));
 
 k=find(tt==time);
 
  

filename=Tempfname;

if (length(k)>0)
   % File exists.

finfo = ncinfo(filename);
disp(finfo)
finfo.Variables.Name;




%finfo.Groups(2).Variables.Size


latitude=ncread(filename,'latitude');
longitude=ncread(filename,'longitude');
cloud_mask=ncread(filename,'cloud_mask');

solar_zenith_angle=ncread(filename,'solar_zenith_angle');
sensor_zenith_angle=ncread(filename,'sensor_zenith_angle');
relative_azimuth_angle=ncread(filename,'relative_azimuth_angle');
scattering_angle=ncread(filename,'scattering_angle');
glint_zenith_angle=ncread(filename,'glint_zenith_angle');

land_class=ncread(filename,'land_class');
surface_type=ncread(filename,'surface_type');
surface_elevation=ncread(filename,'surface_elevation');
sediment_class_muri=ncread(filename,'sediment_class_muri');
aerosol_QA_muri=ncread(filename,'aerosol_QA_muri');


CLAVRXAOD0=ncread(filename,'aerosol_optical_depth_muri');
CLAVRXAOD0(aerosol_QA_muri<1|cloud_mask>0)=NaN;

CLAVRXAOD1=CLAVRXAOD0;
CLAVRXAOD2=CLAVRXAOD0;
CLAVRXAOD3=CLAVRXAOD0;
CLAVRXAOD4=CLAVRXAOD0;

CLAVRXAOD_cw0=CLAVRXAOD0;
CLAVRXAOD_land0=CLAVRXAOD0;
CLAVRXAOD_ocean0=CLAVRXAOD0;

CLAVRXAOD_cw0(sediment_class_muri<1)=NaN; % coastal water 
CLAVRXAOD_land0(land_class<1|land_class>1)=NaN;
CLAVRXAOD_ocean0(land_class>0&land_class<6)=NaN;

CLAVRXAOD_ocean0(glint_zenith_angle<40)=NaN;
CLAVRXAOD_cw0(glint_zenith_angle<40)=NaN;



CLAVRXAOD_cw1=CLAVRXAOD_cw0;
CLAVRXAOD_cw2=CLAVRXAOD_cw0;
CLAVRXAOD_cw3=CLAVRXAOD_cw0;
CLAVRXAOD_cw4=CLAVRXAOD_cw0;

CLAVRXAOD_land1=CLAVRXAOD_land0;
CLAVRXAOD_land2=CLAVRXAOD_land0;
CLAVRXAOD_land3=CLAVRXAOD_land0;
CLAVRXAOD_land4=CLAVRXAOD_land0;

CLAVRXAOD_ocean1=CLAVRXAOD_ocean0;
CLAVRXAOD_ocean2=CLAVRXAOD_ocean0;
CLAVRXAOD_ocean3=CLAVRXAOD_ocean0;
CLAVRXAOD_ocean4=CLAVRXAOD_ocean0;


aerosol_coarse_mode_muri=ncread(filename,'aerosol_coarse_mode_muri');
aerosol_fine_mode_muri=ncread(filename,'aerosol_fine_mode_muri');
aerosol_fine_mode_ratio_muri=ncread(filename,'aerosol_fine_mode_ratio_muri');
aerosol_fitting_error_muri=ncread(filename,'aerosol_fitting_error_muri');
%angstrom_exponent_muri=ncread(filename,'angstrom_exponent_muri');

refl_0_47um_nom=ncread(filename,'refl_0_47um_nom');
refl_0_65um_nom=ncread(filename,'refl_0_65um_nom');
refl_0_86um_nom=ncread(filename,'refl_0_86um_nom');
refl_1_60um_nom=ncread(filename,'refl_1_60um_nom');
refl_2_10um_nom=ncread(filename,'refl_2_10um_nom');

refl_0_65um_nom_stddev_3x3=ncread(filename,'refl_0_65um_nom_stddev_3x3');
%temp_11_0um_nom_stddev_3x3=ncread(filename,'temp_11_0um_nom_stddev_3x3');

Cld_distance_03=ncread(filename,'Cld_distance_03');
Cld_distance_04=ncread(filename,'Cld_distance_04');
Cld_distance_05=ncread(filename,'Cld_distance_05');


%***************************************************************************
CLAVRXAOD1(solar_zenith_angle>78|sensor_zenith_angle>78|Cld_distance_03>0|refl_0_65um_nom_stddev_3x3>1)=NaN;
CLAVRXAOD2(solar_zenith_angle>78|sensor_zenith_angle>78|Cld_distance_03>0|refl_0_65um_nom_stddev_3x3>0.5)=NaN;
CLAVRXAOD3(solar_zenith_angle>78|sensor_zenith_angle>78|Cld_distance_03>0|refl_0_65um_nom_stddev_3x3>0.25)=NaN;
CLAVRXAOD4(solar_zenith_angle>78|sensor_zenith_angle>78|Cld_distance_03>0|refl_0_65um_nom_stddev_3x3>0.1)=NaN;

CLAVRXAOD_cw1(solar_zenith_angle>78|sensor_zenith_angle>78|Cld_distance_03>0|refl_0_65um_nom_stddev_3x3>1)=NaN;
CLAVRXAOD_cw2(solar_zenith_angle>78|sensor_zenith_angle>78|Cld_distance_03>0|refl_0_65um_nom_stddev_3x3>0.5)=NaN;
CLAVRXAOD_cw3(solar_zenith_angle>78|sensor_zenith_angle>78|Cld_distance_03>0|refl_0_65um_nom_stddev_3x3>0.25)=NaN;
CLAVRXAOD_cw4(solar_zenith_angle>78|sensor_zenith_angle>78|Cld_distance_03>0|refl_0_65um_nom_stddev_3x3>0.1)=NaN;

CLAVRXAOD_land1(solar_zenith_angle>78|sensor_zenith_angle>78|Cld_distance_03>0|refl_0_65um_nom_stddev_3x3>1)=NaN;
CLAVRXAOD_land2(solar_zenith_angle>78|sensor_zenith_angle>78|Cld_distance_03>0|refl_0_65um_nom_stddev_3x3>0.5)=NaN;
CLAVRXAOD_land3(solar_zenith_angle>78|sensor_zenith_angle>78|Cld_distance_03>0|refl_0_65um_nom_stddev_3x3>0.25)=NaN;
CLAVRXAOD_land4(solar_zenith_angle>78|sensor_zenith_angle>78|Cld_distance_03>0|refl_0_65um_nom_stddev_3x3>0.1)=NaN;

CLAVRXAOD_ocean1(solar_zenith_angle>78|sensor_zenith_angle>78|Cld_distance_03>0|refl_0_65um_nom_stddev_3x3>1)=NaN;
CLAVRXAOD_ocean2(solar_zenith_angle>78|sensor_zenith_angle>78|Cld_distance_03>0|refl_0_65um_nom_stddev_3x3>0.5)=NaN;
CLAVRXAOD_ocean3(solar_zenith_angle>78|sensor_zenith_angle>78|Cld_distance_03>0|refl_0_65um_nom_stddev_3x3>0.25)=NaN;
CLAVRXAOD_ocean4(solar_zenith_angle>78|sensor_zenith_angle>78|Cld_distance_03>0|refl_0_65um_nom_stddev_3x3>0.1)=NaN;



for site=1:63
 
 dataview=site
 
row=AERONETlocation(site,1);
col=AERONETlocation(site,2);

AHI_CLAVRX_aerosol_data_v3_2020.cloud_mask(:,:,k,Jday-start_day,site)=cloud_mask(row-15:row+15,col-15:col+15);

AHI_CLAVRX_aerosol_data_v3_2020.AOD(:,:,k,Jday-start_day,site,1)=single(CLAVRXAOD0(row-15:row+15,col-15:col+15));
AHI_CLAVRX_aerosol_data_v3_2020.AOD(:,:,k,Jday-start_day,site,2)=single(CLAVRXAOD1(row-15:row+15,col-15:col+15));
AHI_CLAVRX_aerosol_data_v3_2020.AOD(:,:,k,Jday-start_day,site,3)=single(CLAVRXAOD2(row-15:row+15,col-15:col+15));
AHI_CLAVRX_aerosol_data_v3_2020.AOD(:,:,k,Jday-start_day,site,4)=single(CLAVRXAOD3(row-15:row+15,col-15:col+15));
AHI_CLAVRX_aerosol_data_v3_2020.AOD(:,:,k,Jday-start_day,site,5)=single(CLAVRXAOD4(row-15:row+15,col-15:col+15));


Temp_AOD=CLAVRXAOD0(row-12:row+12,col-12:col+12);
Temp_AOD(Temp_AOD<0)=NaN;
AHI_CLAVRX_aerosol_data_v3_2020.avg_AOD0(k,Jday-start_day,site)=single(nanmean(nanmean(Temp_AOD)));
AHI_CLAVRX_aerosol_data_v3_2020.num_AOD0(k,Jday-start_day,site)=single(length(find(Temp_AOD>0)));

Temp_AOD=CLAVRXAOD1(row-12:row+12,col-12:col+12);
Temp_AOD(Temp_AOD<0)=NaN;
AHI_CLAVRX_aerosol_data_v3_2020.avg_AOD1(k,Jday-start_day,site)=single(nanmean(nanmean(Temp_AOD)));
AHI_CLAVRX_aerosol_data_v3_2020.num_AOD1(k,Jday-start_day,site)=single(length(find(Temp_AOD>0)));

Temp_AOD=CLAVRXAOD2(row-12:row+12,col-12:col+12);
Temp_AOD(Temp_AOD<0)=NaN;
AHI_CLAVRX_aerosol_data_v3_2020.avg_AOD2(k,Jday-start_day,site)=single(nanmean(nanmean(Temp_AOD)));
AHI_CLAVRX_aerosol_data_v3_2020.num_AOD2(k,Jday-start_day,site)=single(length(find(Temp_AOD>0)));

Temp_AOD=CLAVRXAOD3(row-12:row+12,col-12:col+12);
Temp_AOD(Temp_AOD<0)=NaN;
AHI_CLAVRX_aerosol_data_v3_2020.avg_AOD3(k,Jday-start_day,site)=single(nanmean(nanmean(Temp_AOD)));
AHI_CLAVRX_aerosol_data_v3_2020.num_AOD3(k,Jday-start_day,site)=single(length(find(Temp_AOD>0)));

Temp_AOD=CLAVRXAOD4(row-12:row+12,col-12:col+12);
Temp_AOD(Temp_AOD<0)=NaN;
AHI_CLAVRX_aerosol_data_v3_2020.avg_AOD4(k,Jday-start_day,site)=single(nanmean(nanmean(Temp_AOD)));
AHI_CLAVRX_aerosol_data_v3_2020.num_AOD4(k,Jday-start_day,site)=single(length(find(Temp_AOD>0)));



AHI_CLAVRX_aerosol_data_v3_2020.AOD_cw(:,:,k,Jday-start_day,site,1)=single(CLAVRXAOD_cw0(row-15:row+15,col-15:col+15));
AHI_CLAVRX_aerosol_data_v3_2020.AOD_cw(:,:,k,Jday-start_day,site,2)=single(CLAVRXAOD_cw1(row-15:row+15,col-15:col+15));
AHI_CLAVRX_aerosol_data_v3_2020.AOD_cw(:,:,k,Jday-start_day,site,3)=single(CLAVRXAOD_cw2(row-15:row+15,col-15:col+15));
AHI_CLAVRX_aerosol_data_v3_2020.AOD_cw(:,:,k,Jday-start_day,site,4)=single(CLAVRXAOD_cw3(row-15:row+15,col-15:col+15));
AHI_CLAVRX_aerosol_data_v3_2020.AOD_cw(:,:,k,Jday-start_day,site,5)=single(CLAVRXAOD_cw4(row-15:row+15,col-15:col+15));

Temp_AOD=CLAVRXAOD_cw0(row-12:row+12,col-12:col+12);
Temp_AOD(Temp_AOD<0)=NaN;
AHI_CLAVRX_aerosol_data_v3_2020.avg_AODcw0(k,Jday-start_day,site)=single(nanmean(nanmean(Temp_AOD)));
AHI_CLAVRX_aerosol_data_v3_2020.num_AODcw0(k,Jday-start_day,site)=single(length(find(Temp_AOD>0)));

Temp_AOD=CLAVRXAOD_cw1(row-12:row+12,col-12:col+12);
Temp_AOD(Temp_AOD<0)=NaN;
AHI_CLAVRX_aerosol_data_v3_2020.avg_AODcw1(k,Jday-start_day,site)=single(nanmean(nanmean(Temp_AOD)));
AHI_CLAVRX_aerosol_data_v3_2020.num_AODcw1(k,Jday-start_day,site)=single(length(find(Temp_AOD>0)));

Temp_AOD=CLAVRXAOD_cw2(row-12:row+12,col-12:col+12);
Temp_AOD(Temp_AOD<0)=NaN;
AHI_CLAVRX_aerosol_data_v3_2020.avg_AODcw2(k,Jday-start_day,site)=single(nanmean(nanmean(Temp_AOD)));
AHI_CLAVRX_aerosol_data_v3_2020.num_AODcw2(k,Jday-start_day,site)=single(length(find(Temp_AOD>0)));

Temp_AOD=CLAVRXAOD_cw3(row-12:row+12,col-12:col+12);
Temp_AOD(Temp_AOD<0)=NaN;
AHI_CLAVRX_aerosol_data_v3_2020.avg_AODcw3(k,Jday-start_day,site)=single(nanmean(nanmean(Temp_AOD)));
AHI_CLAVRX_aerosol_data_v3_2020.num_AODcw3(k,Jday-start_day,site)=single(length(find(Temp_AOD>0)));

Temp_AOD=CLAVRXAOD_cw4(row-12:row+12,col-12:col+12);
Temp_AOD(Temp_AOD<0)=NaN;
AHI_CLAVRX_aerosol_data_v3_2020.avg_AODcw4(k,Jday-start_day,site)=single(nanmean(nanmean(Temp_AOD)));
AHI_CLAVRX_aerosol_data_v3_2020.num_AODcw4(k,Jday-start_day,site)=single(length(find(Temp_AOD>0)));


AHI_CLAVRX_aerosol_data_v3_2020.AOD_land(:,:,k,Jday-start_day,site,1)=single(CLAVRXAOD_land0(row-15:row+15,col-15:col+15));
AHI_CLAVRX_aerosol_data_v3_2020.AOD_land(:,:,k,Jday-start_day,site,2)=single(CLAVRXAOD_land1(row-15:row+15,col-15:col+15));
AHI_CLAVRX_aerosol_data_v3_2020.AOD_land(:,:,k,Jday-start_day,site,3)=single(CLAVRXAOD_land2(row-15:row+15,col-15:col+15));
AHI_CLAVRX_aerosol_data_v3_2020.AOD_land(:,:,k,Jday-start_day,site,4)=single(CLAVRXAOD_land3(row-15:row+15,col-15:col+15));
AHI_CLAVRX_aerosol_data_v3_2020.AOD_land(:,:,k,Jday-start_day,site,5)=single(CLAVRXAOD_land4(row-15:row+15,col-15:col+15));


Temp_AOD=CLAVRXAOD_land0(row-12:row+12,col-12:col+12);
Temp_AOD(Temp_AOD<0)=NaN;
AHI_CLAVRX_aerosol_data_v3_2020.avg_AODland0(k,Jday-start_day,site)=single(nanmean(nanmean(Temp_AOD)));
AHI_CLAVRX_aerosol_data_v3_2020.num_AODland0(k,Jday-start_day,site)=single(length(find(Temp_AOD>0)));

Temp_AOD=CLAVRXAOD_land1(row-12:row+12,col-12:col+12);
Temp_AOD(Temp_AOD<0)=NaN;
AHI_CLAVRX_aerosol_data_v3_2020.avg_AODland1(k,Jday-start_day,site)=single(nanmean(nanmean(Temp_AOD)));
AHI_CLAVRX_aerosol_data_v3_2020.num_AODland1(k,Jday-start_day,site)=single(length(find(Temp_AOD>0)));

Temp_AOD=CLAVRXAOD_land2(row-12:row+12,col-12:col+12);
Temp_AOD(Temp_AOD<0)=NaN;
AHI_CLAVRX_aerosol_data_v3_2020.avg_AODland2(k,Jday-start_day,site)=single(nanmean(nanmean(Temp_AOD)));
AHI_CLAVRX_aerosol_data_v3_2020.num_AODland2(k,Jday-start_day,site)=single(length(find(Temp_AOD>0)));

Temp_AOD=CLAVRXAOD_land3(row-12:row+12,col-12:col+12);
Temp_AOD(Temp_AOD<0)=NaN;
AHI_CLAVRX_aerosol_data_v3_2020.avg_AODland3(k,Jday-start_day,site)=single(nanmean(nanmean(Temp_AOD)));
AHI_CLAVRX_aerosol_data_v3_2020.num_AODland3(k,Jday-start_day,site)=single(length(find(Temp_AOD>0)));

Temp_AOD=CLAVRXAOD_land4(row-12:row+12,col-12:col+12);
Temp_AOD(Temp_AOD<0)=NaN;
AHI_CLAVRX_aerosol_data_v3_2020.avg_AODland4(k,Jday-start_day,site)=single(nanmean(nanmean(Temp_AOD)));
AHI_CLAVRX_aerosol_data_v3_2020.num_AODland4(k,Jday-start_day,site)=single(length(find(Temp_AOD>0)));

AHI_CLAVRX_aerosol_data_v3_2020.AOD_ocean(:,:,k,Jday-start_day,site,1)=single(CLAVRXAOD_ocean0(row-15:row+15,col-15:col+15));
AHI_CLAVRX_aerosol_data_v3_2020.AOD_ocean(:,:,k,Jday-start_day,site,2)=single(CLAVRXAOD_ocean1(row-15:row+15,col-15:col+15));
AHI_CLAVRX_aerosol_data_v3_2020.AOD_ocean(:,:,k,Jday-start_day,site,3)=single(CLAVRXAOD_ocean2(row-15:row+15,col-15:col+15));
AHI_CLAVRX_aerosol_data_v3_2020.AOD_ocean(:,:,k,Jday-start_day,site,4)=single(CLAVRXAOD_ocean3(row-15:row+15,col-15:col+15));
AHI_CLAVRX_aerosol_data_v3_2020.AOD_ocean(:,:,k,Jday-start_day,site,5)=single(CLAVRXAOD_ocean4(row-15:row+15,col-15:col+15));

Temp_AOD=CLAVRXAOD_ocean0(row-12:row+12,col-12:col+12);
Temp_AOD(Temp_AOD<0)=NaN;
AHI_CLAVRX_aerosol_data_v3_2020.avg_AODocean0(k,Jday-start_day,site)=single(nanmean(nanmean(Temp_AOD)));
AHI_CLAVRX_aerosol_data_v3_2020.num_AODocean0(k,Jday-start_day,site)=single(length(find(Temp_AOD>0)));

Temp_AOD=CLAVRXAOD_ocean1(row-12:row+12,col-12:col+12);
Temp_AOD(Temp_AOD<0)=NaN;
AHI_CLAVRX_aerosol_data_v3_2020.avg_AODocean1(k,Jday-start_day,site)=single(nanmean(nanmean(Temp_AOD)));
AHI_CLAVRX_aerosol_data_v3_2020.num_AODocean1(k,Jday-start_day,site)=single(length(find(Temp_AOD>0)));

Temp_AOD=CLAVRXAOD_ocean2(row-12:row+12,col-12:col+12);
Temp_AOD(Temp_AOD<0)=NaN;
AHI_CLAVRX_aerosol_data_v3_2020.avg_AODocean2(k,Jday-start_day,site)=single(nanmean(nanmean(Temp_AOD)));
AHI_CLAVRX_aerosol_data_v3_2020.num_AODocean2(k,Jday-start_day,site)=single(length(find(Temp_AOD>0)));

Temp_AOD=CLAVRXAOD_ocean3(row-12:row+12,col-12:col+12);
Temp_AOD(Temp_AOD<0)=NaN;
AHI_CLAVRX_aerosol_data_v3_2020.avg_AODocean3(k,Jday-start_day,site)=single(nanmean(nanmean(Temp_AOD)));
AHI_CLAVRX_aerosol_data_v3_2020.num_AODocean3(k,Jday-start_day,site)=single(length(find(Temp_AOD>0)));

Temp_AOD=CLAVRXAOD_ocean4(row-12:row+12,col-12:col+12);
Temp_AOD(Temp_AOD<0)=NaN;
AHI_CLAVRX_aerosol_data_v3_2020.avg_AODocean4(k,Jday-start_day,site)=single(nanmean(nanmean(Temp_AOD)));
AHI_CLAVRX_aerosol_data_v3_2020.num_AODocean4(k,Jday-start_day,site)=single(length(find(Temp_AOD>0)));

AHI_CLAVRX_geo_data_v3_2020.latitude(k,Jday-start_day,site)=single(latitude(row,col));
AHI_CLAVRX_geo_data_v3_2020.longitude(k,Jday-start_day,site)=single(longitude(row,col));


AHI_CLAVRX_geo_data_v3_2020.solar_zenith_angle(k,Jday-start_day,site)=single(solar_zenith_angle(row,col));
AHI_CLAVRX_geo_data_v3_2020.sensor_zenith_angle(site)=single(sensor_zenith_angle(row,col));
AHI_CLAVRX_geo_data_v3_2020.relative_azimuth_angle(k,Jday-start_day,site)=single(relative_azimuth_angle(row,col));
AHI_CLAVRX_geo_data_v3_2020.scattering_angle(k,Jday-start_day,site)=single(scattering_angle(row,col));
AHI_CLAVRX_geo_data_v3_2020.glint_zenith_angle(k,Jday-start_day,site)=single(glint_zenith_angle(row,col));

AHI_CLAVRX_geo_data_v3_2020.land_class(:,:,site)=single(land_class(row-15:row+15,col-15:col+15));
AHI_CLAVRX_geo_data_v3_2020.surface_type(:,:,site)=single(surface_type(row-15:row+15,col-15:col+15));
AHI_CLAVRX_geo_data_v3_2020.surface_elevation(:,:,site)=single(surface_elevation(row-15:row+15,col-15:col+15));
AHI_CLAVRX_geo_data_v3_2020.sediment_class_muri(:,:,k,Jday-start_day,site)=single(sediment_class_muri(row-15:row+15,col-15:col+15));

AHI_CLAVRX_aerosol_data_v3_2020.aerosol_QA_muri(:,:,k,Jday-start_day,site)=single(aerosol_QA_muri(row-15:row+15,col-15:col+15));
AHI_CLAVRX_aerosol_data_v3_2020.aerosol_coarse_mode_muri(:,:,k,Jday-start_day,site)=single(aerosol_coarse_mode_muri(row-15:row+15,col-15:col+15));
AHI_CLAVRX_aerosol_data_v3_2020.aerosol_fine_mode_muri(:,:,k,Jday-start_day,site)=single(aerosol_fine_mode_muri(row-15:row+15,col-15:col+15));
AHI_CLAVRX_aerosol_data_v3_2020.aerosol_fine_mode_ratio_muri(:,:,k,Jday-start_day,site)=single(aerosol_fine_mode_ratio_muri(row-15:row+15,col-15:col+15));
AHI_CLAVRX_aerosol_data_v3_2020.aerosol_fitting_error_muri(:,:,k,Jday-start_day,site)=single(aerosol_fitting_error_muri(row-15:row+15,col-15:col+15));
%AHI_CLAVRX_aerosol_data_v3_2020.angstrom_exponent(:,:,k,Jday-start_day,site)=single(angstrom_exponent_muri(row-15:row+15,col-15:col+15));


AHI_CLAVRX_refl_data_v3_2020.refl_0_47um_nom(:,:,k,Jday-start_day,site)=single(refl_0_47um_nom(row-15:row+15,col-15:col+15));
AHI_CLAVRX_refl_data_v3_2020.refl_0_65um_nom(:,:,k,Jday-start_day,site)=single(refl_0_65um_nom(row-15:row+15,col-15:col+15));
AHI_CLAVRX_refl_data_v3_2020.refl_0_86um_nom(:,:,k,Jday-start_day,site)=single(refl_0_86um_nom(row-15:row+15,col-15:col+15));
AHI_CLAVRX_refl_data_v3_2020.refl_1_60um_nom(:,:,k,Jday-start_day,site)=single(refl_1_60um_nom(row-15:row+15,col-15:col+15));
AHI_CLAVRX_refl_data_v3_2020.refl_2_10um_nom(:,:,k,Jday-start_day,site)=single(refl_2_10um_nom(row-15:row+15,col-15:col+15));
AHI_CLAVRX_refl_data_v3_2020.refl_0_65um_nom_stddev_3x3(:,:,k,Jday-start_day,site)=single(refl_0_65um_nom_stddev_3x3(row-15:row+15,col-15:col+15));

AHI_CLAVRX_refl_data_v3_2020.Cld_distance_03(:,:,k,Jday-start_day,site)=Cld_distance_03(row-15:row+15,col-15:col+15);
AHI_CLAVRX_refl_data_v3_2020.Cld_distance_04(:,:,k,Jday-start_day,site)=Cld_distance_04(row-15:row+15,col-15:col+15);
AHI_CLAVRX_refl_data_v3_2020.Cld_distance_05(:,:,k,Jday-start_day,site)=Cld_distance_05(row-15:row+15,col-15:col+15);


end

end
end
end







save AHI_CLAVRX_aerosol_data_v3_2020 AHI_CLAVRX_aerosol_data_v3_2020 -v7.3
save AHI_CLAVRX_refl_data_v3_2020 AHI_CLAVRX_refl_data_v3_2020 -v7.3
save AHI_CLAVRX_geo_data_v3_2020 AHI_CLAVRX_geo_data_v3_2020 -v7.3



