Thursday, May 8, 2014

Creating DINEOF movie for AOD 2006-2008

Basic code for getting movie for the tabfilled variable
 load('box_Lat_lon.mat');
  
    for kk = 1:length(tabfilled)
      
        %For plots
        latlim =([35 46]);
        lonlim =([-85 -69]);
      
        %     fig_title = sprintf('MODIS AOD %i-%i-%i',file_mm,file_dd,file_yy);
        h1 = figure(1)
        %     orient landscape;
        ax = worldmap(latlim, lonlim);
        states = shaperead('usastatehi','UseGeoCoords', true, 'BoundingBox', [lonlim', latlim']);
        geoshow(ax, states, 'FaceColor', [1 1 1]);
        surfacem(box_lat,box_lon,tabfilled(:,:,kk));
        h1=gca;
        set(h1,'CLimMode','Manual','CLim',[0, 1]);
        h2=colorbar('vert','FontSize',12);
        title(['2008 Day: ', num2str(kk)],'FontSize',14);
      
      
        M(kk) = getframe(h1);
       
    end
  
    % Output the movie as an avi file
    movie2avi(M,'AOD_IDWMovie2008r1.avi', 'compression','None', 'fps',2);
  
   

No comments: