function[timesAll,timesAllUTC,fullGrid,fullGridRaw,datesAll,cloud_fracs_all,heightvectorTot,stationNum,lat,lon,alt,year,numRemovedY]=buildInterpolatedSNRData(stationNum, year)

    [dates1,levelheights1,snr1,stationNum,alldatesmdy1,timeDifs1,cloud_fracs1,lat,lon,alt,avgtime]=readerloader(stationNum, year);
    
    minheight= min(levelheights1);
    maxheight=max(levelheights1(levelheights1<=4000));
    heightvectorTot=minheight:1:maxheight;
    [timesAll]=NaN.*ones(1,38000);
    [timesAllUTC]=NaN.*ones(1,38000);
    [cloud_fracs_all]=NaN.*ones(1,38000);
    [fullGrid]=NaN.*ones(size(heightvectorTot,2),38000);
    [fullGridRaw]=fullGrid;
    [datesAll]=NaN.*ones(4380,3);
    numRemovedY=0;
    timeIdx=1;
    cycleidx=1;
    
    
    for i =1:size(alldatesmdy1,1)
        try 
            [snrRaster,rawSnrRaster,~,matrixMapC,minutesvector,heightvector,numRemoved]=getSNRgrid(alldatesmdy1(i,1),alldatesmdy1(i,2),alldatesmdy1(i,3),levelheights1,snr1,dates1,avgtime);
            numRemovedY=numRemovedY+numRemoved;
            %matrixMapC=matrixMapC+timeIdx-1;
            columnIdx=NaN.*ones(size(matrixMapC,1),1);
            for j=1:size(matrixMapC,1)
                columnIdx(j)=nanmean(matrixMapC(j,:));
            end
            %disp(columnIdx);
            datestr=strcat(int2str(alldatesmdy1(i,3)),'-',int2str(alldatesmdy1(i,1)),'-',int2str(alldatesmdy1(i,2)));


            numMinutes = minutes(diff(datetime({'2009-05-17'; datestr}, 'InputFormat', 'yyyy-MM-dd')));
            minutesvectorAdj=minutesvector+numMinutes;
            utcAdjFact=timeDifs1(i)*60;
            minutesvectorAdjUtc=minutesvectorAdj-utcAdjFact;
            minutesvectorAdj=minutesvectorAdj(columnIdx);
            minutesvector_Idx=minutesvector(columnIdx);
            minutesvectorAdjUtc=minutesvectorAdjUtc(columnIdx);
            snrRaster=snrRaster(:,columnIdx);
            rawSnrRaster=rawSnrRaster(:,columnIdx);
            
            cloud_fracs_date=NaN.*ones(size(minutesvectorAdj,1),size(minutesvectorAdj,2));
            cloud_fracs_date(minutesvector_Idx<720)=cloud_fracs1(i,1);
            cloud_fracs_date(minutesvector_Idx>=720 & minutesvector_Idx<960)=cloud_fracs1(i,2);
            cloud_fracs_date(minutesvector_Idx>=960)=cloud_fracs1(i,3);
            
            timesAll(timeIdx:timeIdx+size(minutesvectorAdj,2)-1)=minutesvectorAdj;
            timesAllUTC(timeIdx:timeIdx+size(minutesvectorAdjUtc,2)-1)=minutesvectorAdjUtc;
            cloud_fracs_all(timeIdx:timeIdx+size(cloud_fracs_date,2)-1)=cloud_fracs_date;
            fullGrid((heightvector-minheight+1)',timeIdx:timeIdx+size(minutesvectorAdj,2)-1)=snrRaster;
            fullGridRaw((heightvector-minheight+1)',timeIdx:timeIdx+size(minutesvectorAdj,2)-1)=rawSnrRaster;
            
            timeIdx=timeIdx+size(minutesvectorAdj,2);           
            datesAll(cycleidx,1:3)=alldatesmdy1(i,1:3);   
            cycleidx=cycleidx+1;
        catch
            disp(strcat(int2str(alldatesmdy1(i,3)),'-',int2str(alldatesmdy1(i,1)),'-',int2str(alldatesmdy1(i,2))));
            
        end      
    end
    
    fullGridRaw(:, all(isnan(fullGrid),1)) = [];
    fullGrid(:, all(isnan(fullGrid),1)) = [];
    
    timesAllUTC(size(fullGrid,2)+1:end)=[];
    timesAll(size(fullGrid,2)+1:end)=[];
    cloud_fracs_all(size(fullGrid,2)+1:end)=[];
    cloud_fracs_all(cloud_fracs_all==99)=NaN;
    
    fullGrid((isnan(fullGrid)))=1.e+15;
    


    
end