New answers tagged

2

All the X,Y coordinates are stored in arrays and can be extracted by: x=f.variables['X'][:] y=f.variables['Y'][:] Let's say we need to extract the value of IR_108 at a specific location (X=500000, Y=250000). Get the array indices for the data point nearest this position: idx=(np.abs(x-500000)).argmin() idy=(np.abs(y-250000)).argmin() The grid coords for ...


2

The process is quite simple: get the netcdf's latitudes and longitudes as lists; use these lists to get the column and row of the netcdf's grid that correspond to your point's longitude and latitude, respectively; use these column and row values to get the netcdf data for your variable. Below I attach a function that implements the aforementioned workflow ...


0

When you use the -a_srs flag you are telling GDAL that you know that the projection of the raster is the following epsg code (in your case EPSG:4326) but that is not the projection of your raster (grid_mapping=Lambert_Conformal). There isn't enough information encoded in the raster to tell us what the actual projection is but you should be able to find it ...


2

QGIS can read NetCDF vector files but has no visible support for writing them at the moment: https://github.com/qgis/QGIS/issues/30492 You can use GDAL's ogr2ogr though: ogr2ogr -F netCDF output.nc input.shp Make sure you throughly read through https://gdal.org/drivers/vector/netcdf.html so that your output is not accidently broken or misleading.


1

A raster is a set of cells that form a grid; each cell has a value. When you reproject a raster, you are re-drawing the grid to be aligned with a new projection. So, in the below figure, your original raster grid is shown in blue, and the reprojected grid is shown in red. Right away you can see a problem--the grids do not align. So, for example, in the ...


Top 50 recent answers are included