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

Average all rows/columns in 3D numpy array at each timestep (band)

I have a 3D array of type numpy.ma.core.MaskedArray. The data are 10m wind direction values at every lat/lon point in a 4x4 grid. The dataset is hourly so I have 87672 individual matrices (ten years of data). For each hour, I want the mean of the…
0
votes
1 answer

NCO: change the attribute value of variable with a new string containing blank space

I have a netCDF file FORCING.nc which contains a variable time with attribute value units: hours since 2007-12-28 22:00:00. In python code, it is as following: from netCDF4 import Dataset Dataset('FORCING.nc')["time"] and the output is: Out[3]:…
Xu Shan
  • 175
  • 3
  • 11
0
votes
1 answer

How to Extract Variables from Multiple Aqua Modis netCDF files in R?

Issue: I have a code in R that extracts monthly sea surface temperature (SST) values from a single Aqua Modis netCDF file (see below). However, I have a batch of 59 Aqua Modis netCDF files in one folder. Aim: My aim is to extract the variable's…
Alice Hobbs
  • 1,021
  • 1
  • 15
  • 31
0
votes
1 answer

How to interpolate a multidimensional xarray?

I read a netCDF file using xarray. The dataset contains lat, lon information of the population for the years: 1975, 1990, 2000 and 2015. The dataset looks like the following and I made it also available here: import xarray as xr ds =…
emax
  • 6,965
  • 19
  • 74
  • 141
0
votes
1 answer

Which method to use to create 1 xarray object from two others

I have downloaded 2 different netcdf4 files. Both of them are about the same area(domain) and have the same variables (temperature). What is different is the years that the data is gathered. For example the first one is from 1-1-1950 until…
Alex
  • 149
  • 8
0
votes
0 answers

Principal Component analysis with netcdf data

I would like to run PCA for different variables from ERA5. I have 4 different variables, 30 years of hourly data and longitude, latitude. How should I transform the data to run PCA?
les2004
  • 105
  • 7
0
votes
1 answer

Merge Two Datasets with Different Number of Variables per Timestep Using CDO

I am analyzing a time series of data that is split by time into two NetCDF files (infiles). These files have a different number of variables/fields, by design. Traditionally I have been using Climate Data Operators (CDO) to easily merge two datasets…
Brandon
  • 91
  • 1
  • 11
0
votes
1 answer

How to plot ensemble models mean?

#read data dset = xr.open_mfdataset('/home/users/ruoou/projects/data/cmip6/scenaromip/ssp126/tas/*'+ mod+ '*.nc', parallel=True) #define timescale time = dset.time clim_set_t = dset.sel(time=slice("2015-01-16", "2100-12-16")) clim_ta =…
0
votes
0 answers

How do I extract NetCDF monthly summed totals for a given longitude/latitude?

I've downloaded a NetCDF file that contains monthly summed totals of rainfall over Sierra Leone. I want to extract a time series of these monthly sums for a specific set of coordinates over the year period, so I'm expecting to have 12 values in…
jw99
  • 41
  • 6
0
votes
1 answer

Trying to plot a CSV file that contains latitude and longitude values

I first downloaded NetCDF4 data from this website. Now, I wanted to make the file more cloud friendly so I converted it into CSV. After that, my rows and columns in the CSV looked like this. Now, I want to make a plot which will plot an image which…
CuriousLearner
  • 421
  • 4
  • 14
0
votes
1 answer

Python: how to compute the sum of a variabel in a netCDF file in a radius of n closest pixels?

I have a netCDF that looks like the following ad is available here: import xarray as xr ds=xr.open_dataset('merged_new.nc') ds The dataset has a spatial resolution of 300m. The variable Forest is a binary variable 0 or 1. For each pixel (point) I…
emax
  • 6,965
  • 19
  • 74
  • 141
0
votes
1 answer

How should we display GeoPackage on Mapbox GL JS?

We used wgrib2 to convert weather radar data into NetCDF format. We converted it to GeoPackage format using gdal_translate. We created a Color Map on QGIS 3.10 and the GeoPackage appeared as expected. We would like to display this on the Internet…
Ganessa
  • 782
  • 2
  • 7
  • 24
0
votes
1 answer

Python: how to merge two different netCdf filles with different spatial resolution?

Is it possible to merge two netCDF files with different spatial resolution? I have two datasets. The first one is the ESA Land Cover dataset with a spatial resoltion of 300m as netCDF. The first one is the population living in Italy with a spatial…
emax
  • 6,965
  • 19
  • 74
  • 141
0
votes
1 answer

Turning NetCDF file into a dataframe of mean values

I'm not very familiar with NetCDF, but this is how my file is set up. It's a grid over a longitude (-15 to -10) and latitude (10 to 6.5), containing regular small grid boxes which are 0.25 degrees x 0.25 degrees in size. The grid exists for a single…
jw99
  • 41
  • 6
0
votes
0 answers

NetCDF: Get lat, lon from variable into dimensions

I have a NetCDF file with two variables float_latitude and float_longitude for the lats and lons. In the dimensions, I have, besides the time dim, a column and a row. How can I get the lat and lon as dimensions? Is this possible via xarray? Here is…
ScienceNoob
  • 181
  • 1
  • 2
  • 14