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
0 answers

Python: Basemap precipitation data not showing up

I am using python 3.6 to plot precipitation data from CMIP5, the file I have downloaded is a netCDF4 file. I have used this code on another similar file and it worked out fine so I am not sure what the problem is. I am not receiving any error…
CPG
  • 97
  • 2
  • 15
0
votes
1 answer

Python 3.6 convert netCDF file data to a different format

On python 3.6 I have a netCDF file that contains global precipitation data with the variables: lat, lon, time, and precip. My ultimate goal is to plot the precip data on a scatter plot and create a trend-line. However I am new to python and am…
CPG
  • 97
  • 2
  • 15
0
votes
2 answers

netCDF4: Approaches to dealing with multidimensional data with unused grid points

I am using netCDF4 to store multidimensional data. The data has, for example, three dimensions, time = [0, 1, 2], height = [10, 20], direction = [0, 120, 180, 240, 300], but not for all combinations (grid points) there is data. In our example, let…
equaeghe
  • 1,644
  • 18
  • 37
0
votes
1 answer

cross section plot using python Iris module

I want to plot cross section along longitude using python Iris module which developed for oceanography and meteorology, I'm using their example: http://scitools.org.uk/iris/docs/v1.4/examples/graphics/cross_section.html I tried to change their code…
0
votes
1 answer

NetCDF - converting into raster and projection issues

I have the following NetCDF file - I am trying to convert into raster but something is not right. The projection of the NetCDF file is not given but based on the software I received it from it should LatLong but might be cylindrical equal area. I…
MIH
  • 1,083
  • 3
  • 14
  • 26
0
votes
1 answer

NetCDF4 Assign value into variable issue

I have a netCDF file and was trying to create new variables using python netCDF4. However the program failed to assign values into the array. Below is my code import netCDF4 file = netCDF4.Dataset(filename, "r+") tmp = file.createVariable("tmp",…
Henry Lau
  • 1
  • 7
0
votes
1 answer

How to regrid the resolution of data with netcdf format in R

I have a netcdf file named "precip.mon.mean.nc" downloaded from https://www.esrl.noaa.gov/psd/data/gridded/data.cmap.html. It is a monthly mean precipitation dataset and the resolution is 2.5x2.5. I wonder how I can regrid the precipitation data…
Yang Yang
  • 858
  • 3
  • 26
  • 49
0
votes
1 answer

Copy every other element of a three dimensional array

I have an object from netCDF file with the following properties: float32 zeta(time, y, x) long_name: free surface height units: meter unlimited dimensions: time current shape = (200, 52, 52) filling off ) I need to reduce this element by…
Rational Rose
  • 73
  • 1
  • 10
0
votes
1 answer

Need to quickly subset a very big ncdf using a set of coordinates

I have a netcdf file which contains a float array (21600, 43200). I don't want to read in the entire array to RAM because it's too large, so I'm using the Dataset object from the netCDF4 library to read in the array. I would like to calculate the…
0
votes
1 answer

mysql.connector.errors.ProgrammingError: Failed processing format-parameters;Python 'list' cannot be converted to a MySQL type

I am trying to store some data in MYSQL database using python script, but i got the following error. mysql.connector.errors.ProgrammingError: Failed processing format-parameters; Python 'list' cannot be converted to a MySQL type Actually I am…
rob
  • 153
  • 2
  • 6
  • 13
0
votes
1 answer

Size of netcdf file is larger after attempt to reduce it with matlab netcdf package

I tried to reduce the size of a netcdf file by dividing the temporal resolution of its variables by two, using the following: infilename = 'original_file.nc4'; outfilename = 'new_file.nc4'; %% CREATE OUTPUT NETCDF FILE ncid_out =…
0000011111
  • 133
  • 1
  • 9
0
votes
2 answers

Java NetCDF : Aggregating Existing Files : time dimension not found issue

For my brain teaser, I've searched through the docs and mailing list archives awhile and am having a hard time putting together the steps I need to handle this aggregation. CFSR 1 hour data files data from here :…
Tom H
  • 59
  • 6
0
votes
1 answer

Write netcdf-4 file

I'm trying to write a Netcdf-4 file from a Dataset model, following this http://www.unidata.ucar.edu/software/thredds/current/netcdf-java/tutorial/NetcdfWriting.html resulting in the following code: NetcdfDataset model =…
republicca
  • 43
  • 1
  • 8
0
votes
1 answer

Extracting variable from group in netCDF

I have a netCDF file with the foll. ncdump: netcdf test_nc { dimensions: time = UNLIMITED ; // (20 currently) latitude = 360 ; longitude = 720 ; N = 3 ; strlen = 1 ; variables: float data_array(time, latitude, longitude, N)…
user308827
  • 21,227
  • 87
  • 254
  • 417
0
votes
1 answer

Error while extracting netcdf files into raster

I have many NCDF files in a folder. I try to extract them into raster brick using raster and ncdf4 packages. If I separately extract each NCDF file it works. However, I try to extract all files using for loop then it gives me…
rar
  • 894
  • 1
  • 9
  • 24