Tuesday, June 3, 2014

Applying griddata to MODIS granule

Text here So, the 'v4' option takes a lot of memory, crashes your small computer.
While I can show 'natural', 'linear' (default) and 'nearest' effects on the griddata.

At the least, do not use the nearest option because it seems to have some spurious effect due to re-gridding.







full_name = '/zxcv.hdf' scale = 0.001; %reads file coordinates Lat = double(hdfread(full_name,'Latitude')); %latitudes Lon = double(hdfread(full_name,'Longitude')); %longitudes %reads file variables Corr_Opt = double(hdfread(full_name,'Corrected_Optical_Depth_Land')); %Corrected Optical Thickness at 0.47, 0.55, and 0.66 �m %gets 550nm wavelength values only AOD550_land = scale*squeeze(Corr_Opt(2,:,:)); %collects the data in the second wavelength 550. fill = -9999*scale AOD550_land(AOD550_land==fill)=NaN; %Grid limits Lat_min = 35; Lat_max = 46; Lon_min = -85; Lon_max = -69; %vector of coordinates latv = Lat_min:0.1:Lat_max; lonv = Lon_min:0.1:Lon_max; [ilatv, ilonv] = meshgrid(latv,lonv); AODgrid = griddata(Lat, Lon, AOD550_land, ilatv,ilonv, 'natural'); %% figure(1) latlim =([36 39]); lonlim =([-85 -74]); ax = worldmap(latlim, lonlim); states = shaperead('usastatehi','UseGeoCoords', true, 'BoundingBox', [lonlim', latlim']); geoshow(ax, states, 'FaceColor', [1 1 1]); surfacem(ilatv,ilonv,AODgrid); colorbar title([ 'natural 2006199'], 'FontSize', 20)

No comments: