I am working with MODIS Terra imagery (MOD13Q1). I am currently trying to compute the autocorrelation structure of the pixels in an MODIS NDVI raster. The problem is that I have clipped the original MODIS raster to focus on certain regions of interest (ROI). This means the MODIS raster has lots of missing data pixels in between my ROIs. I imported the MODIS raster as a netCDF file, then transformed it to a double matrix:
{clear;
%ndvi data
ndvi = double(ncread('j193dzpad.nc', 'NDVI'));
NDVI = ndvi/10000;
%apply no data values
nodata = min(min(NDVI(:,:,1)));
NDVI(NDVI==nodata) = NaN;}
In my case, the minimum pixel value in the MODIS raster is the no data value.
The problem is that when I try to loop through the rows of the MODIS matrix (say to compute my directional autocorrelation values), MATLAB returns NaN.
It's easy to remove the NaN values from the matrix, but doesn't this alter the shape of the matrix?
In my case, I want to maintain the spatial integrity of the data, so I cannot remove the NaN pixels.
Any thoughts on how to work with NaN matrices where one does not want to remove NaN values?
Should I convert my original GeoTiff to another format?