The area average problem

I just use the monthly u-wind data from NCEP/NCAR, it has four dimensions, namely lon,lat,level and time. I want to calculate the area average of (100E-120E , 0-20N). But the result is not very good. So I found that the process of read may have some problems. But it has no scale and add factors and I just used the common command. So is there someone have used the same dataset, please feel free to contact me! Thank you! It is some kind of emergency!

Respuestas (1)

Chad Greene
Chad Greene el 9 de En. de 2015

0 votos

Your question is unclear, so I will make some assumptions about what you are asking.
First, I think u is three dimensional, not four dimensional. Its dimensions are probably lat x lon x time, or lon x lat x time. Are lat and lon 1D or gridded 2D? If they're 1D, I often find it easiest to grid lat and lon using meshgrid. Then, find the row and column indices of lat and lon in your range of interest:
[row,col] = find(lat>=100 & lat<= 120 & lon>=0 & lon<=20);
It is not clear whether you want to bin all values in this lat/lon range to create a single average value, and it is not clear what you want to do about time. mean(u,3) will give you a 2D grid of averages across all time for each grid cell.
ubox = u(row,col,1);
Will give you a 2D grid of just the values in your lat/lon box for time 1. Then you can average all those values with
mean(ubox(:))
But again, you will have to be very clear about what values you are seeking.

Categorías

Etiquetas

Preguntada:

XU
el 9 de En. de 2015

Respondida:

el 9 de En. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by