Contour plot of spatial distribution of temperature
Afficher commentaires plus anciens
i have 5 block data i only need 3
Lat lon month year temp
22.25000 -98.25, 1, 2000, 0.1061891
22.25000, -97.75, 1, 2000, 0.2013340
22.25000, -97.25, 1, 2000, -999.9000
22.25000, -96.75, 1, 2000, -999.9000
22.75000, -100.75, 1, 2000, 0.4650421
22.75000, -100.25, 1, 2000, 0.3308848
22.75000, -99.75, 1, 2000, 0.2076520
22.75000, -99.25, 1, 2000, 0.1700439
22.75000, -98.75, 1, 2000, 0.1031799
22.75000, -98.25, 1, 2000, 0.1318403
22.75000, -97.75, 1, 2000, 0.3397914
22.75000, -97.25, 1, 2000, -999.9000
22.75000, -96.75, 1, 2000, -999.9000
23.25000, -100.75, 1, 2000, 0.4653015
23.25000, -100.25, 1, 2000, 0.3465271
i have develop a contour plot of spatial distribution of temperature
even some values have -999.999 some way to interpolate these values and replace it in the vector of temp.
i already started with this
archivo=load('escenarioA2.txt');
lat=archivo(:,1);
lon=archivo(:,2);
month=archivo(:,3);
year=archivo(:,4);
inc=archivo(:,5);
[m,n]=size(archivo);
nx = length(lon);
ny = length(lat);
[X,Y]=meshgrid(lon,lat);
Réponse acceptée
Plus de réponses (1)
Chad Greene
le 4 Avr 2021
The regular quarter-degree spacing of the data suggests that no interpolation is necessary for this dataset--it just needs to be restructured. An easy way to do that is with a function of mine called xyz2grid.
For your matrix M whose columns correspond to [lat, lon, month, year, temp], use longitude as the "x" data and latitude as the "y" data, then grid it up like this:
[Lon,Lat,Temp] = xyz2grid(M(:,2),M(:,1),M(:,5));
Then NaN-out the no-data values like this:
Temp(Temp==-999.9) = nan;
Catégories
En savoir plus sur Contour Plots dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!