Plotting data on curvilinear coord projection
    6 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    mashtine
      
 el 1 de Jul. de 2016
  
    
    
    
    
    Comentada: Dushantha Sandaruwan WIJENDRA NAIDHELAGE
 el 3 de Ag. de 2022
            Hello,
I have two lat and lon matrices, each 622x810 and they are of a curvilinear projection. I previously just used vectors of lon and lat to plot my data with surfacem (see below) but I am not sure how to do this with lat and lon as a matrix of curvilinear coordinates.
Any suggestions?
      ax = worldmap(latlim, lonlim);
      S = shaperead('landareas','UseGeoCoords',true);
      surfacem(lat, lon, inpdata)
      shading interp
      geoshow([S.Lat], [S.Lon],'Color','black');
0 comentarios
Respuestas (3)
  KSSV
      
      
 el 1 de Jul. de 2016
        As you have matrices in hand, it shall be very easy to plot what you want. If you want to get vectors of lon, lat from 622x810 matrices of each, try using unique(); this will give you the vectors.
2 comentarios
  Dushantha Sandaruwan WIJENDRA NAIDHELAGE
 el 3 de Ag. de 2022
				Is ther anyway to convert the covarian projection (meshgird) into noramal Longitude and latitudes? 
  José-Luis
      
 el 1 de Jul. de 2016
        It is not clear to me how you want those arrays displayed. If you only want to show the points:
geoshow(S.Lat(:), S.Lon(:),'Color','black');
2 comentarios
  Jonathan Eliashiv
 el 18 de Oct. de 2016
        
      Editada: Jonathan Eliashiv
 el 18 de Oct. de 2016
  
      Super simple actually.
Go ahead and reshape your coordinates and data into 1-d vectors:
 X_curvi = reshape(lon,[],1);
 Y_curvi = reshape(lat,[],1);
 data_curvi = reshape(inpdata,[],1);
Make a meshgrid that you want to interpolate into:
[lon_grid,lat_grid] = meshgrid(minlon:dx:maxlon,minlat:dy:maxlat)
and then you can use the griddata function:
 [~,~,data_rectilinear] = griddata(X_curvi,Y_curvi,data_curvi,...
                                 lon_grid,lat_grid)
and plot away
   pcolor(lon_grid,lat_grid,data_rectilinear); shading flat
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!




