Skip to main content

Questions tagged [netcdf]

NetCDF (Network Common Data Form) is a set of software libraries and self-describing, machine-independent data formats that support the creation, access, and sharing of array-oriented scientific data.

Filter by
Sorted by
Tagged with
6 votes
1 answer
17k views

Masking NetCDF time series data from shapefile using Python

I have a 3-D time-series precipitation data (187 x 1800 x 3600), stored in a NetCDF file. I need to obtain the precipitation data for a shapefile. import matplotlib.pyplot as plt from netCDF4 import ...
Ehsan's user avatar
  • 75
12 votes
4 answers
27k views

Converting NetCDF dataset array to GeoTiff using rasterio Python

I have read a NetCDF file using the netCDF4 library and then read one of its datasets ("Evapotranspiration") into a variable (variable contains array) using the following code. Subsequently ...
RRSC NGP's user avatar
  • 658
5 votes
1 answer
5k views

How to match a raster NetCDF data with a vector layer in QGIS?

When I load a raster layer with humidity data from NOAA database (for instance rhum.2m.2014.nc at ftp://ftp.cdc.noaa.gov/Datasets/NARR/Dailies/monolevel/) I am not able to match it with a simple map ...
Sébastien's user avatar
15 votes
3 answers
12k views

Convert timeseries stack of GTiff raster to single NetCDF

Moving from gdal-dev mailing list: On Mon, Sep 2, 2013 at 7:09 PM, David Shean wrote: Hi list, I'm trying to package a timeseries of GTiff rasters with identical projection/extent/resolution as a ...
David Shean's user avatar
8 votes
3 answers
4k views

NetCDF layer (.nc) appears flipped and rotated in QGIS

I'm trying to import NetCDF layers with environmental information to QGIS and they appear flipped and rotated In the top-left you can see the Europe coastal line I was using, in the bottom-right the ...
Moskar's user avatar
  • 81
8 votes
1 answer
2k views

Mapping a NetCDF in QGIS in the correct location on Earth

I was wondering if anyone has encountered NetCDFs being mapped in the "wrong" location by QGIS? I'm using QGIS 3.16 and I've tried 2.18 too. I think the problem has to do with the longitude ...
Orla Osborne's user avatar
12 votes
3 answers
3k views

What coordinate system is this netCDF raster?

I obtained a netCDF raster file, but I couldn't get any metadata to get the name of the coordinate system the raster has been built on. The raster itself doesn't have any coordinate system embedded. I ...
multigoodverse's user avatar
9 votes
3 answers
11k views

Displaying netCDF data with correct CRS?

I successfully extracted some data from a netCDF file with a single variable E. (the original file was taking ages to load). I used the following code to extract the data: ncks -d lon,24.,36. -d lat,...
mmfl's user avatar
  • 91
8 votes
1 answer
3k views

Write projected array to NetCDF file, best practice

I'm trying to write projected rasters to NetCDF files including projection information in a way that GDAL can understand it. I found two ways to achieve that: By adding the geotransform as an ...
Loïc Dutrieux's user avatar
8 votes
3 answers
2k views

Longitudinal Issues with NetCDF data [closed]

I am seeking advice on working with world data sets where the GCS has a positive range (0 degrees to 360 degrees). The data I am working with are NetCDF oceanographic data and have positive coordinate ...
geografa's user avatar
  • 141
7 votes
2 answers
10k views

Batch converting netCDF to Raster using ArcPy?

I'm having trouble using the Dimension Values (Optional) argument in arcpy.MakeNetCDFRasterLayer_md. Whatever I seem to do the output raster is always the first layer which is the default value. ...
EnE_'s user avatar
  • 605
7 votes
3 answers
10k views

Cannot open NetCDF File in QGIS

I am trying to open a NetCDF file in QGIS. However it is not loading when I try to open it using Layer > Add Layer > Raster or even dragging and dropping it. I have also tried upgrading to master as ...
Nikko's user avatar
  • 611
7 votes
1 answer
6k views

xarray slicing across the antimeridian

I'm just starting with using xarray for working with n-dimensional NetCDF datasets. I particularly like the techniques for slicing using both indexes and labels (isel and sel): import xarray as xr ds ...
alphabetasoup's user avatar
4 votes
0 answers
1k views

QGIS NetCDF loaded upside down

What am I missing here? When I load ("Add Raster Layer") my NetCDF file into QGIS (3.14), it appears to be georeferenced into the correct location, but always appears flipped upside down. ...
tbc's user avatar
  • 141
3 votes
1 answer
3k views

Converting a NetCDF from 0 to 360 to -180 to 180 via xarray

I've got an ERA5 NetCDF that's in 0 to 360 and I'd like to convert it to -180 to 180 before saving it off as a raster. I've got the current workflow set up, but am unsure of how to switch the longs. ...
JWB's user avatar
  • 604
3 votes
2 answers
3k views

transpose large netCDF with GDAL, NCL, NCO or CDO

I have a large netCDF file (444GB) that I would like to transpose. The file is flipped with latitude on the x-axis and lon on the y-axis. See pictures of one band below. Not correct Correct: I ...
code123's user avatar
  • 345
3 votes
1 answer
4k views

How to open NetCDF in QGIS

Despite the topic Cannot open NetCDF File in QGIS, I cannot properly visualize my NetCDF file (nc4) in QGIS. It is quite strange because Panoply can do this (see image below). My NetCDF file visualize ...
Luckasino's user avatar
  • 293
1 vote
1 answer
2k views

Importing NetCDF file to ArcGIS Desktop as point feature layer?

I have a netcdf file of my computational grid. It is a structured curvilinear grid. When I make a feature layer from a it with the Multidimension Tool toolbox, I cannot get the point locations to plot ...
ZZZ's user avatar
  • 530
1 vote
1 answer
1k views

How to reduce the size of a NetCDF in R?

I'm working with a large land cover file (~2.3 GB) saved in NetCDF format (it's the 2018 gridded map from here). My aim is to associate GPS points with this land cover data using R. The problem is ...
adkane's user avatar
  • 339
1 vote
1 answer
221 views

Loading NetCDF file on QGIS as raster

I have gotten very rusty at QGIS. I am attempting to load a NetCDF file of the average monthly temperature for a midwestern state. I go through the normal [layer-add layer- raster] steps and for some ...
Han's user avatar
  • 13
1 vote
1 answer
2k views

Using GDALwarp for reprojecting netCDF file?

I am trying to re-project a netCDF file using the gdalwarp command. However, the gdalwarp is giving me a black output. Below is my code: import gdal import osr import netCDF4 from osgeo.gdalconst ...
npal's user avatar
  • 23
1 vote
1 answer
2k views

Set projection (netCDF) with R-ncdf4-Package

I want to create a netCDF-file that has a defined projection ("WGS 84 / UTM zone 32N") with the netcdf4 package in R. The input float array has the size of x=880 and y=760. So i define the two ...
MaTo's user avatar
  • 21
1 vote
1 answer
2k views

Handle Curvilinear/rotated grid NetCDF file in R

I have a NetCDF file with a curvilinear (rotated) grid that contains meteorological data. I am trying to crop the NetCDF based on a mask shapefile in R, but the rotated grid does not project the data ...
Mohamed Ismaiel Ahmed's user avatar
1 vote
0 answers
558 views

Pixel height and width in degrees

I am planning to create a NetCDF file from a script (Github). My shapefile is in GCS_WGS_1984 (this is one of the required files for the script). Now, the script requires to define the cell/pixel ...
Arthur_Morgan's user avatar
1 vote
2 answers
942 views

Reading *.cdf files in ArcMap?

I received some geospatial data (on rainfall) in a "cdf" format. I have worked with "nc" files and uses the 'Make NetCDF Raster Layer' tool in ArcMap to read NetCDF files. However, I wasn't able ...
user26750's user avatar
  • 695
0 votes
1 answer
1k views

Retrieving interested grid data from E-OBS grid datasets in netCDF file?

Recently I am working with geospatial data in R, I faced this problem. I downloaded E-OBS gridded data from E-OBS grid data, I am interested in 0.25 degree grid data of land surface temperature and ...
Andy.Jian's user avatar
12 votes
3 answers
14k views

Extract data from NetCDF using a shapefile polygon in Python [duplicate]

I need to subset data from a NetCDF using a specific shapefile. The data are sea surface temperature and ocean color at 1/4 degree resolution. I have 4 polygons describing the US. Northeast ...
Ryan's user avatar
  • 231
7 votes
0 answers
401 views

How to transform ERA5 vertical datum to WGS84

I am trying to plot a netcdf file from ECMWF ERA5 in a folium map but I am having troubles with the projections in the file. ECMWF documentation states: ECMWF data is referenced in the horizontal with ...
Giacomo's user avatar
  • 307
7 votes
2 answers
2k views

GeoTIFF (ESA Copernicus data) georeferencing coordinates are mirrored and projection slightly off when checking on Google Maps

I worked on downloading a Sentinel 5P data in my question at Converting a netCDF4 file to (georeferenced) GeoTIFF, problems with georeferencing and also transforming the netCDF4 (.nc) file into a ...
Veksi's user avatar
  • 235
7 votes
2 answers
5k views

How to extract value from a raster based on lat and lon?

I have several netcdf files that I can read using the netCDF4 library in python. The data is gridded in 4320 rows and 2160 columns. I also have a list of lat/lon (in decimal degrees) and I am trying ...
user26750's user avatar
  • 695
7 votes
4 answers
7k views

R Raster package: write NetCDF with time dimension

I am writing a rasterbrick with multiple layers to a netcdf file using the raster package in R: writeRaster(gridfile, "Data", "CDF", overwrite=TRUE, varname="Data",varunit="mm.d-1",longname="...
Dom's user avatar
  • 71
6 votes
1 answer
11k views

Using rioxarray to assign spatial reference (EPSG:4326) to NetCDF built from CSV with lat long columns

I am trying to create a NetCDF from a CSV file. The idea comes from the fact that the original CSV comes with many columns, three of these representing: a specific year ("time") the Y ...
umbe1987's user avatar
  • 3,785
6 votes
1 answer
4k views

Subsetting a curvilinear netCDF file (ROMS model output) using a lon/lat bounding box.

I am attempting to get salinity data from one of the ocean models in our region and have run into a roadblock. This is ROMS model output in NetCDF form, but the grid is curvilinear (lon and lat arrays ...
Dan R's user avatar
  • 63
5 votes
1 answer
3k views

gdalwarp netcdf input file has no raster bands

I use netCDF data from ftp://podaac-ftp.jpl.nasa.gov/allData/merged_alt/L4/cdr_grid I call gdalwarp as gdalwarp -of netCDF -ts 480 1080 ssh_grids_v1609_2014122612.nc o.nc and get Input file ...
Antonio's user avatar
  • 331
5 votes
2 answers
17k views

Plotting NetCDF file using lat and lon contained in variables

I am trying to plot this NetCDF file (and similar) as a 2d contour map. The file contains a single layer of one variable, "pr". The file has 413x229 X-Y pixel coordinates, and, stored inside the "...
AF7's user avatar
  • 703
5 votes
1 answer
5k views

Converting netCDF to geotiff file?

NetCDF files downloaded from NASA ocean color website could not be converted to geotiff using gdaltranslate command below: gdal_translate -ot float32 -unscale -CO COMPRESS=deflate NETCDF:"...
wondim's user avatar
  • 1,383
5 votes
1 answer
2k views

gdalwarp with NETCDF files

I have been looking for it for a while but couldn't find what exactly I need. I have WRF outputs in NETCDF format and I want to convert them to Geotiffs with gdalwarp. I think my -s_srs should be ...
user2515090's user avatar
5 votes
2 answers
7k views

How to load a NetCDF-file into QGIS using Python?

I have a CF-conform NetCDF-file which can be loaded into Quantum GIS (Version 1.8) by using the "Add Raster Layer"-button and subsequently choosing the file and the raster layers of interest. This ...
Magnus's user avatar
  • 91
5 votes
2 answers
4k views

Converting Sentinel-3 data (netcdf) to GeoTIFF?

I'm trying to convert Sentinel-3 data to GeoTiff file. The Sentinel-3 data comes as separate nc files (netcdf): a file for each spectral band and a nc file for qualityFlags, geo_coordinates etc' and ...
user88484's user avatar
  • 1,829
5 votes
2 answers
11k views

R - NetCDF to Raster

I've recently started working with spatial data in R. I am currently working on a project that uses data in both raster and netcdf formats, and I'd be happy to convert the latter to the former, ...
yassem's user avatar
  • 53
5 votes
1 answer
6k views

how to extract a variable at specific time and depth from netcdf in r

I have the following netcdf file containing 7 variables and 4 dimensions. [1] "file data.nc has 4 dimensions:" [1] "depth Size: 12" [1] "time Size: 37" [1] "x Size: 305" [1] "y Size: 432" [1]...
Herman Toothrot's user avatar
4 votes
1 answer
3k views

How to save a clipped NetCDF data as a new NetCDF file in Python?

I have used xarray to clip my NetCDF file‌ (it can be downloaded here) by a shapefile (it can be downloaded from here). Here is the code: import xarray import rioxarray import geopandas from shapely....
Muser's user avatar
  • 225
4 votes
2 answers
4k views

How to re-project a netcdf file?

I want to re-project and resample a netcf file but I am getting a usage problem: gdalwarp -t_srs EPSG:3410 -ts 1383 586 NETCFD:"C:\data\product.nc":gsfc output.tiff
temor's user avatar
  • 163
4 votes
1 answer
1k views

Longitude/Latitude from NetCDF with (row,column)

I downloaded a "Sentinel-3 Land Surface Temperature" netcdf file. I want to get the longitude and latitude for each temperature entry in the file. Well the file has pairs of rows and column. Using ...
Hala's user avatar
  • 41
4 votes
1 answer
377 views

Longitude range NETCDF vs ASCII

I am trying to preprocess a netcdf dataset with arcgis such that it has the same extent, cellsize and format as an ascii dataset I am using. Both are visualized in the image below: The big one in ...
user2160180's user avatar
3 votes
1 answer
6k views

"ValueError: negative dimensions are not allowed" when using raster created from NetCDF

My code creates a geoTiff from a NetCDF and then I'm trying to compute zonal_stats() from a raster file I created from a NetCDF. I end up getting ValueError: negative dimensions are not allowed at the ...
sheß's user avatar
  • 289
3 votes
3 answers
6k views

Plotting Netcdf data. How to get right projection?

Maybe it's very easy for someone to fix, but I'a a new one in R, so I really need help. I/m trying to plot data containing lat, lon and variable (nmf2). The grid isn't a regular one, so there are some ...
Svetlana  Kalashnikova's user avatar
3 votes
1 answer
458 views

Are there examples of high-level interfaces to NetCDF

The R raster package and GDAL both have independent wrappers around NetCDF-4* that treat an array variable as a "complete" dataset, i.e. they provide objects or interfaces that seamlessly give access ...
mdsumner's user avatar
  • 8,206
2 votes
2 answers
1k views

Installing netCDF plugin for Geoserver

I want to install the netCDF plugin for Geoserver, in order to publish radar data in netCDF format. I'm following the instructions listed at Geosolutions IT Training. I have to add -Duser.timezone=...
Ralu Bur's user avatar
  • 583
2 votes
1 answer
1k views

Georeferencing Sentinel-3 LST product

I have been stuck attempting to convert Sentinel-3 LST netCDF data to geotiffs for a while now as part of my master's thesis. Firstly, an introduction to the data. It is packaged as follow: The data ...
TheOGMalan's user avatar