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
0
votes
1 answer

Write a matrix of strings to netCDF file in R

Is it possible to write a matrix of string variables to a netCDF file in R? When I run the following the R session aborts. library(ncdf4) # define a small set of netCDF dimensions lon3 <- seq(0, 2.0, 0.5) nlon3 <- length(lon3) lat3 <- seq(0, 0.5,…
Dave_L
  • 363
  • 2
  • 10
0
votes
1 answer

Find the daily and monthly mean from daily data

I am very new to python so please bare with me. So far I have a loop that identifies my netcdf files within a date range. I now need to calculate the daily averages and then the monthly averages for each month and add it to my dataframe so I can…
0
votes
1 answer

Xarray: slicing latitude longitude using dimension name

I am writing a program that will open Meteorological NetCDF data, slice it for a given region and then do some calculations, for example: data =xr.open_dataset(SomeFile) SlicedData = data.sel(lat=slice(max_lat,min_lat), …
daniloceano
  • 3
  • 1
  • 3
0
votes
1 answer

chanaging standard_name and long_name with NCO

I calculated the potential temperaure from a NetCDF file. I would like to change standard_name and long_name with NCO. I have tried some commands without sucess, e.g.: > ncatted -a name,Temperature,o,c,"Potential_Temperature"…
ahmathelte
  • 559
  • 3
  • 15
0
votes
1 answer

AttributeError: 'IcclimLogger' object has no attribute 'timezone' jupyter notebook

I have following block of code: i want to use ICCLIM (Indice Calculation CLIMate) is a Python library To calculate some indices how to solve this problem ?? files = ['tasmax_day_CNRM-CM5_historical_r1i1p1_19950101-19991231.nc',…
Dana017
  • 1
  • 2
0
votes
1 answer

Netcdf-Fortran failure when installing: netcdf-fortran-4.5/nf03_test

I am desperated and hope someone might be able to bring some light on this problem: I am trying to install netcdf-fortran in Fedora 35 using Intel compilers. To do so, I first installed ONEAPI from intel in /opt/intel/oneapi. Then, I…
Bpi
  • 3
  • 1
0
votes
1 answer

wrong cftime value from a netcdf file

I'm opening a netcdf file with xarray. 'exp_date' is one of the dimensions in the NETCDF, and its description in the netcdf as follows: double exp_date(exp_date) ; exp_date:calendar = "noleap" ; exp_date:long_name = "time" ; …
shambakey1
  • 37
  • 7
0
votes
1 answer

Trying to read and print netCDF variables in Python

I have imported a netcdf file into Python and am now trying to access specific variables in the file (of over 100 variables). This is the code i'm using in order to just print and read each variables: ds = Dataset(fn, 'r') yr =…
Eleanor
  • 1
  • 1
0
votes
2 answers

Using netcdf file data in pygmt

one little question. Is there an easy way to convert netcdf file data to a grid which can be used in pygmt? Pygmt has as default example the following dataset: array([[-3539.5, -3510.5, -3557.5,…
S.Kociok
  • 168
  • 1
  • 14
0
votes
1 answer

Obtain mean value of specific area in netCDF

I am trying to plot a time series of the sea surface temperature (SST) for a specific region from a .nc file. The SST is a three-dimensional variable (lat,lon,time), that has mean daily values for a specific region from 1982 to 2016. I want my plot…
OlegRuskiy
  • 173
  • 2
  • 12
0
votes
0 answers

Use netCDF file in Python

Hello for a project I am working , I need to get the data from a NetCDF file. The file was downloaded from here : https://ads.atmosphere.copernicus.eu/cdsapp#!/dataset/cams-europe-air-quality-forecasts?tab=form. I have opened the file using python…
Collina
  • 33
  • 4
0
votes
0 answers

NetCDF file with all data variable values missing when I read it into Python with both Xarray and netCDF4

I have a netCDF file generated by a model output. The file contains spatially gridded variables over a 30 yr time span and I've confirmed that the file contains the data using Ferret from within linux. When I read the file into Python with both…
spurdom
  • 1
  • 2
0
votes
1 answer

Seasonal average with ncra --mro only selecting value of first record

I have files with monthly data only for September, October and November (filtered in a previous step) and I want to compute seasonal averages (one value for each trimester of each year). I'm using ncra --mro -d time,,,3,3 (average on the record…
Elio Campitelli
  • 1,408
  • 1
  • 10
  • 20
0
votes
2 answers

Extracting the dimension of a netcdf variable in python

Considering a given dataset "data", extracted from a netcdf4 file containing a variable named clcalispo2. I am working with python and f I do: print(data['clcalipso2'].ncattrs()) I got this output: clcalipso2
vincent
  • 11
  • 3
0
votes
0 answers

Removing a dimension from netcdf file in xarray

I have a dataset (ds) loaded from a netcdf file in xarray that looks like this: Where the coordinates (lon, lat) and the data variable (tasmax) are tied to the region dimension. Instead of region, I'd like the dimensions to be lat, lon, time. When…
pbreach
  • 16,049
  • 27
  • 82
  • 120
1 2 3
99
100