Questions tagged [netcdf4]

Questions related to NetCDF (Network Common Data Form) format and corresponding libraries/implementations may have this tag.

In 2008, the netCDF4 format was added to support per-variable compression, multiple unlimited dimensions, more complex data types, and better performance, by layering an enhanced netCDF access interface on top of the HDF5 format.

At the same time, a fourth format variant, netCDF-4 classic model format, was added for users who needed the performance benefits of the new format (such as compression) without the complexity of a new programming interface or enhanced data mode.

Every netCDF-4 or netCDF-4 classic model file can be read or written by the HDF5 library version 1.8 or later, so in that respect netCDF-4 files are already HDF5 files and need no conversion.

According to netCDF FAQ installing the netCDF4 is required for any of the following situations:

  • you need to access netCDF data that makes use of netCDF-4 compression or chunking
  • you need to access data in all netCDF formats including netCDF-4 or netCDF-4 classic model formats
  • you need to write non-record variables larger than 4GiB or record variables with more than 4GiB per record
  • you are installing netCDF to support other software packages that require netCDF-4 features
  • you want to write data that takes advantage of compression, chunking, or other netCDF-4 features
  • you want to be able to read netCDF-4 classic model data with no changes to your current software except relinking with the new library
  • you want to benchmark your current applications with the new libraries to determine whether the benefits are significant enough to justify the upgrade
  • you need to use parallel I/O with netCDF-4 or netCDF-4 classic files
651 questions
0
votes
3 answers

Creating/concatenate multi-dimensional NetCDF in R

Using this as a source : How to concatenate monthly TRMM netCDF files into a single netCDF file using NCO or R on windows…
marie_r
  • 67
  • 1
  • 7
0
votes
0 answers

Error while installing netcdf4-python

I am trying to install netcdf4-python by following https://code.google.com/archive/p/netcdf4-python/wikis/UbuntuInstall.wiki I had installed HDF5 successfully but when i was installing netCDF4, in "make"command, am getting the below errors collect2:…
Harnish Kumar
  • 315
  • 5
  • 17
0
votes
1 answer

Export raster names from raster stack to NetCDF file in R

I am trying to extract raster layer names from a netcdf file as previously written from a raster stack. Exporting the raster stack to ncdf works fine. For example: library(raster) library(ncdf4) library(RNetCDF) #Create some rasters…
Mat W
  • 35
  • 4
0
votes
1 answer

Extracting site-specific information from NetCDF file in R

I got a NetCDF file from the German Meteorological Service concerning mean temperatures in Europe (CDC FDP SERVER). The only thing I want to extract is the daily mean temperature for Bornholm, which is an island in the central Baltic. I know how to…
Robert
  • 133
  • 10
0
votes
1 answer

How to add a new dimension to an existing variable in netCDF?

The code is this answer does work Add a new dimension but it does not do what I want it to do. To illustrate my problem further - I have the following definitions Time(unlimited), latitude, longitude, level as four dimensions and one variable…
gansub
  • 1,164
  • 3
  • 20
  • 47
0
votes
1 answer

Fortran NetCDF - added new dimension need to fill it with zeroes

I added a new dimension to an existing netCDF file in fortran using the following code - retval = nf_open(cfn,NF_WRITE,ncid) if (retval .ne. nf_noerr) call handle_err(retval) retval = nf_redef(ncid) if (retval .ne. nf_noerr) call…
gansub
  • 1,164
  • 3
  • 20
  • 47
0
votes
1 answer

how to count the netCDF for every daily file in python

i want to achieve calculate the number of event over the min of daily netCDF4 file temperature. I have a code like below, but it keep telling me the index out of bounds. The netCDf4 file a three dimensional array with 349x277x2920. the third…
alice
  • 225
  • 5
  • 14
0
votes
2 answers

Rotating map plot using basemap in python

I am trying to plot data from a netcdf using Basemap but I guess since the latitude indices are inverted I get a map that is upside down. How should I fix this? Thanks! fnc = Dataset(ncfile, 'r') lat = fnc.variables['latitude'][:] lon =…
user26750
  • 259
  • 6
  • 15
-1
votes
1 answer

Reproject geo data and save to NetCDF4

I need to reproject geodetic point data from Gauß-Krüger coord system with discrete data values into a UTM coord system and finally write that data into a netCDF raster file. I was recommended to use python to do this. I tried with PyProj4 which…
Tobias
  • 33
  • 5
-1
votes
1 answer

Normalization data by CDO / NCO

I tried to do normalized data(sfcWind) by the following codes as a new user. But it seems to be the incorrect results. Can anybody correct us cdo timmax infil.nc Imax.nc cdo timmin infil.nc Imin.nc cdo sub Imax.nc Imin.nc A.nc cdo sub infil.nc…
Abid
  • 3
  • 2
-1
votes
1 answer

Is there a module to create time varying spatial plots in python

I have multiple .nc files for each time step(say 15-minute interval, 96 files for a day), I want to produce an animated plot of the spatial domain with respect to time. I am new to python spatial plottings. please help I am able to read the NC file,…
-1
votes
1 answer

How do I drop NA values in a netcdf file?

I'm working with some weather data and have a netcdf file that gives me wave height. My goal is to match ports along a coast to the closest grid point. I pulled the data from the ERA5 data store. When requesting the data, you can specify the bounds…
Tham v
  • 51
  • 4
-1
votes
1 answer

Creating numpy array where values are within the range of two other arranges of the same size

I have created a map of a particular climate variable, which has been produced by extracting data from netCDF4 files and converting them into mask arrays. The data is the ensemble mean of 9 CMIP6 models. I would like to plot over the top of this…
-1
votes
1 answer

Extracting data from a NETCDF file

I am just a python begginner and I am having some trouble in extracting data from a netcdf file. For example, in this code I was trying to create a variable with the temperature but it is not appearing at the variable explorer console. Does anyone…
-1
votes
1 answer

plotting data from a 4-dimensional variable from a netcdf file with cartopy

How can I plot on a map the data from the variable "r" (relative humidity) of a NetCDF file with cartopy? from netCDF4 import Dataset import cartopy.crs as ccrs import numpy as np import xarray as xr import cartopy.crs as ccrs import…
leojim19
  • 29
  • 4