cropping nc4 file with shapefile in matlab
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Muhammad Usman Saleem
el 25 de Feb. de 2017
Comentada: Muhammad Usman Saleem
el 25 de Feb. de 2017
I want to crop my nc4 file according to my shapefile extent. I am trying this
file = 'GLDAS_NOAH10_3H.A20050102.0000.020.nc4' ;
lon = ncread(file,'lon') ;
lat = ncread(file,'lat') ;
RF = ncread(file,'SnowDepth_inst') ;
path = [pwd filesep 'indus_upper.shp'] ;
S = shaperead(path) ;
n = length(S) ;
[a,b]=meshgrid(S.Y,S.X);
myX=[a(:)];
myY=[b(:)];
%[Z, R] = vec2mtx(S.Y, S.X, 0.25, 'filled');
%for i = 1:length(myY)
% x = S(i).X ; y = S(i).Y ;
% plot(x,y,'k')
rfi = interp2(lon,lat,RF',myX,myY) ;
I am not sure about my making of meshgrid. Anybody tell me how can i resolve my problem?
Respuestas (0)
Ver también
Categorías
Más información sobre Data Import and Analysis en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!