Questions tagged [netcdf]

NetCDF (Network Common Data Form) is a binary file format for storing array-oriented scientific data. Use this tag for questions about programmatically encoding and/or decoding data to/from NetCDF files.

NetCDF (Network Common Data Form) is a binary file format for storing array-oriented scientific data.

From version 4, NetCDF files use the HDF5 format as container, and therefore can be read by HDF5 readers. Reliance on the HDF5 format also enabled easy parallel I/O and efficient compression.

References

2306 questions
8
votes
1 answer

Python, NetCDF4 and HDF5

I don't know why these packages are always such a pain to install. I have been using NetCDF/HDF5 for a long time now and it's always been a pure horror trip getting them to install or run properly, no matter if it's on Linux or OSX, no matter if C,…
Jürgen Simon
  • 876
  • 1
  • 12
  • 35
8
votes
2 answers

Importing and decoding dataset in xarray to avoid conflicting _FillValue and missing_value

When using xarray open_dataset or open_mfdataset to load a NARR netcdf dataset (e.g. ftp://ftp.cdc.noaa.gov/Datasets/NARR/monolevel/air.2m.2010.nc), xarray returns an error regarding "conflicting _FillValue and missing_values". Entering: ds =…
csg2136
  • 235
  • 4
  • 10
8
votes
3 answers

Convert grib to netcdf file

Is there a way to convert a grib file into a NetCDF format on Windows? I use a software named tkdegrib but it catches one argument by one argument whereas I want all my grib's arguments in the same file. Unfortunately, I can't use Linux.
piecess
  • 187
  • 4
  • 11
8
votes
2 answers

Creating multi-dimensional NetCDF in R

I am trying to create a multi-dimensional NetCDF file using the R package ncdf. I am working with climatic daily observations for a set of 1500 points, the number of observations is ~ 18250 for each point. The problem is that the structure of the…
Gago-Silva
  • 1,873
  • 4
  • 22
  • 46
7
votes
2 answers

Efficient way to extract data from NETCDF files

I have a number of coordinates (roughly 20000) for which I need to extract data from a number of NetCDF files each comes roughly with 30000 timesteps (future climate scenarios). Using the solution here is not efficient and the reason is the time…
Seji
  • 371
  • 1
  • 10
7
votes
1 answer

R CMD SHLIB Fortran 90 file which use NetCDF

I would like compile a fortran 90 file which use NetCDF. I have installed NetCDF-Fortran and as shown here, to compile the file test_nc.f90: program test_nc use netcdf implicit none integer :: ncid, nc_err nc_err =…
Sergio
  • 714
  • 1
  • 8
  • 24
7
votes
2 answers

Updating attritubtes in xarray inplace

I'm fairly new to using xarrays. I want to modify attributes of a NetCDF file inplace. But, the built-in function gives another new dataset instead. ds = xr.open_dataset(file_) # ds has "time" as one of the coordinates whose attributes I want to…
Light_B
  • 1,660
  • 1
  • 14
  • 28
7
votes
2 answers

How to handle NULLS: C#, Microsoft SDS 1.3 and NetCDF files

I am writing a C# program that uses Microsoft Scientific Data-Set to read NetCDF files. using System; using System.IO; using sds = Microsoft.Research.Science.Data; using Microsoft.Research.Science.Data.Imperative; namespace NetCDFConsoleApp { …
Sir Swears-a-lot
  • 402
  • 7
  • 20
7
votes
2 answers

How to calculate number of missing values summed over time dimension in a netcdf file in bash

I have a netcdf file with data as a function of lon,lat and time. I would like to calculate the total number of missing entries in each grid cell summed over the time dimension, preferably with CDO or NCO so I do not need to invoke R, python etc. I…
ClimateUnboxed
  • 7,106
  • 3
  • 41
  • 86
7
votes
1 answer

Extracting specific netcdf info and converting to GeoTIFF in python

I am attempting to extract a specific set of data from a netCDF file and then convert said data to a GeoTIFF. So far I have managed to extract the data I want using netCDF4, all the data in the file are stored as 1d arrays (lat, lon, data I want)…
cd123
  • 511
  • 1
  • 5
  • 15
7
votes
2 answers

Adding global attribute using xarray

Is there some way to add a global attribute to a netCDF file using xarray? When I do something like hndl_nc['global_attribute'] = 25, it just adds a new variable.
user308827
  • 21,227
  • 87
  • 254
  • 417
7
votes
1 answer

Python - Read data from netCDF file with time as "seconds since" beginning of measurement

I need to extract values from a netCDf file. I am pretty new to python and even newer this file format. I need to extract time series data at a specific location (lat, lon). I have found that there is a variable (called "base_time") in UNIX time and…
beginner123
  • 73
  • 2
  • 8
7
votes
3 answers

How to convert fixed size dimension to unlimited in a netcdf file

I'm downloading daily 600MB netcdf-4 files that have this structure: netcdf myfile { dimensions: time_counter = 18 ; depth = 50 ; latitude = 361 ; longitude = 601 ; variables: salinity temp, etc …
Favo
  • 818
  • 6
  • 15
7
votes
3 answers

convert csv to netcdf

I am trying to convert a .csv file to a netCDF4 via Python but I am having trouble figuring out how I can store information from a .csv table format into a netCDF. My main concern is how do we declare the variables from the columns into a workable…
user3275006
  • 97
  • 1
  • 2
  • 7
7
votes
3 answers

Extract time series of a point ( lon, lat) from netCDF in R

I am relatively new on R. I am trying to get time series of different points ( lat, lon) of temperature data from a netCDF file. My sample data file is here and here is the small file . I have tried netCDF package and the code i have used so far…
Cirrus
  • 638
  • 3
  • 13
  • 26