Scatter plot data different resolution satellite images
7 次查看(过去 30 天)
显示 更早的评论
I have two satellite images with different resolutions and I would like to do a scatter plot comparing pixels

for the same latitude and longitude. I have both images in netcdf format, with their correspondent latitude, longitude and band information (in this case Reflectance at 859 nm). Any ideas on how I could do this in matlab? I have inserted an image showing what I want to obtain (Vanhellemont & Ruddick 2015).
2 个评论
Walter Roberson
2015-6-10
Is the scale large enough that curvature of the Earth must be worried about, or can it be treated as flat rectangular?
回答(1 个)
Chad Greene
2015-6-10
If both images are the same size, and each pixel in image A corresponds to the same lat/lon of the same pixel in image B, You can get a scatter plot by
plot(A(:),B(:),'b.')
Does the color in your example image correspond to density of scattered points? If so, something like this might help.
Here's an example with some random data:
% Create lat/lon grid:
[lon,lat] = meshgrid(-180:180,-90:90);
% Create two sample data images:
A = 50*cosd(lat) + 5*sind(lon);
B = A+30*randn(size(A))./(A.^1.2);
A = A/2e3;
B = B/2e3;
B(B<0) = NaN;
% Set ocean data to NaN:
ocean = ~landmask(lat,lon);
A(ocean) = NaN;
B(ocean) = NaN;
figure
subplot(211)
pcolor(lon,lat,A);
colormap(brewermap(256,'*BrBg'))
shading flat
axis tight
borders('countries','color',rgb('dark gray'),'nomap')
title 'Image A'
subplot(212)
pcolor(lon,lat,B);
shading flat
axis tight
borders('countries','color',rgb('dark gray'),'nomap')
title 'Image B'

And to compare the two images:
figure
plot(A(:),B(:),'b.')
axis([0 0.03 0 0.03])
hold on
polyplot(A(:),B(:),'k-')
xlabel 'Rrs 859 nm (MODIS-Terra)'
ylabel 'Rrs 865 nm (OLI)'

Above, landmask, brewermap, borders, rgb, and polyplot are all available on the File Exchange site.
2 个评论
Chad Greene
2015-6-11
Ah, you mean horizontal spatial resolution. I'd use interp2 to downsample the higher resolution image. But note that simply using interp2 may result in slightly aliased data from high-spatial-frequency information, so you may want to do a low-pass filter before interp2. If you have the image processing toolbox, imresize is another option.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!