Filter löschen
Filter löschen

Scatter plot data different resolution satellite images

4 Ansichten (letzte 30 Tage)
SnovG
SnovG am 10 Jun. 2015
Kommentiert: Chad Greene am 11 Jun. 2015
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 Kommentare
Walter Roberson
Walter Roberson am 10 Jun. 2015
Is the scale large enough that curvature of the Earth must be worried about, or can it be treated as flat rectangular?
SnovG
SnovG am 11 Jun. 2015
Yes, it can be treated as rectangular. Is not large.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Chad Greene
Chad Greene am 10 Jun. 2015
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 Kommentare
SnovG
SnovG am 11 Jun. 2015
Thank you for your answer. The only thing is that since they have diferent resolutions, I think I need to degrade the MODIS data to have both grids overlap. Or I wonder if I should coarse the grid of OLI 8, o make the MODIS grid finer, to have the same amount of pixels to compare.
Chad Greene
Chad Greene am 11 Jun. 2015
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.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Visual Exploration finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by