필터 지우기
필터 지우기

How can I calculate the percentage of clouds within each grid box i.e. 1 degree x 1 degree?

조회 수: 2 (최근 30일)
Hello everyone,
My data (clouds: 11376*270) has a spatial resolution of 5 km. It contains values: 1 (clear), 2 (probably clear), 3 (cloudy) and 4 (probably cloudy). How can I calculate the percentage/fraction of clouds within each grid box i.e. 1 degree x 1 degree (for just condition 3 (cloudy))? I want to make a figure of spatial distribution of percentage frequencies of cloudy (case 3).
My code and the figure it produces:
figure
h1=axesm('mercator', 'MapLatLimit',[15 55],'MapLonLimit',[80 150]);
gridm;
framem on;
mlabel on;
plabel on;
xlabel ('Spatial distribution of occurence frequencies (%) of clouds')
tightmap;
geoshow(h1,lat,lon,clouds,'DisplayType','texturemap')
colormap(jet(4))
labels={'Clear','P_Clear','Cloudy','P_Cloudy'};
lcolorbar(labels,'fontweight','bold');
hold on
coast=load('coast');
geoshow(coast.lat, coast.long,'DisplayType','line','Color','red')
Any suggestions what I'm missing or what changes should I need to do in my code?
Kindly help.
  댓글 수: 2
IMC
IMC 2021년 3월 27일
Didn't get your question.
I have data from 2 days (around 18 files/granules per day for my defined area) . And for each granule, latitude and longitude values are different. Below image shows lat values for just one granule (406 rows and 270 columns). Similarly lon and data (clouds) for one granule will also have 406*270.

댓글을 달려면 로그인하십시오.

답변 (2개)

darova
darova 2021년 3월 28일
Here is an example using griddata
% x y v are your data
% create new mesh 0.1 degree in each direciton
x1 = min(x(:)):0.1:max(x(:));
y1 = min(y(:)):0.1:max(y(:));
v1 = griddata(x,y,z,x1,y1); % interpolate data
v11 = v1*0; % preallocate
for i = 1:10:size(x1,1)
for j = 1:10:size(x1,2)
C = v1(i:i+9,j:j+9);
v11(i:i+9,j:j+9) = sum(C(:)==3)/100; % find '3' and sum
end
end
pcolor(v11)
  댓글 수: 4
IMC
IMC 2021년 3월 28일
It's actually data from geostationary satellite and had lat (y) and lon (x) as a column vector. So, I used meshgrid to create a matrix. Below is figure of latitude values (4802*2401).
darova
darova 2021년 3월 29일
You have 0.05 degree step for lattitude. DO you know how to convert it to kilometers?

댓글을 달려면 로그인하십시오.


Bruno Luong
Bruno Luong 2021년 3월 29일
Take a look at function histcount2 and histogram2

카테고리

Help CenterFile Exchange에서 Point Cloud Processing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by