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

Writing a loop for raster levels netcdf file

I have multiple NetCDF files that contain crop and water data. These have around 30 levels of output (for 50 years). I would like to import these and sum them afterwards in R. Currently, I am importing the levels as follows: library(raster) Crop1…
Charles
  • 3
  • 1
0
votes
2 answers

How to subset netcdf variable by a constant threshold

I have a netcdf file with global temperature (tas, degC) data over the 1990-2001 period at daily time-steps in a 1x1deg lat-lon grid. I am interested only in tas days > 10degC. Is there a way I can subset with CDO the netcdf file and create a new…
aaaaa
  • 149
  • 2
  • 18
  • 44
0
votes
1 answer

xarray - resample data to variable-length seasonal frequencies

I have data that is on a monthly timeseries, and I want to resample it in a specific way such that I have two seasonal groups - 5 months (DJFMA) and 7 months (MJJASON) and find the maximum value for each gridpoint from each group. Here is what I…
0
votes
2 answers

Extract specific required data from netCDF using python

I am learning python and I am working with some netCDF files. Suppose I have temperature data from 1950-2020 and I want data for only 1960-2015. How should I extract it.
0
votes
1 answer

xarray.merge: ValueError: Could not find any dimension coordinates to use to order the datasets for concatenation

I want to merge multiple .nc files into one. Each of the .nc files corresponds to a timestep which should be added together to have one .nc file with all data for all dates. When I execute the following line I'll get the error that no dimensions…
ScienceNoob
  • 181
  • 1
  • 2
  • 14
0
votes
1 answer

Import Metadata from csv into netcdf in Python

I am writing netcdf files and I was wondering if it is possible to import the global attributes straight from the csv file metadata instead of typing them in manually. This is the conventional way how I used to do it f.long_name = 'longitude of…
0
votes
1 answer

Can I force xarray.open_dataset() to do a lazy load?

I have a ~1 GB netcdf file on disk. I think that xarray.open_dataset() should do a lazy load so that I can see the file metadata without reading the whole file into memory. But, it takes a really long time (several minutes) to execute the…
Tom F
  • 111
  • 1
  • 8
0
votes
1 answer

why isnt my gridded data showing up on basemap?

I am trying to plot NASA GISS gridded temperature data but my maps keep showing up blank. Below is my code: import pandas as pd import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.basemap import Basemap import geopandas as…
0
votes
1 answer

How to replace values in netcdf file with Nan?

I'm using a NASA GISS netcdf file with gridded monthly temperature values. According to the readme file "Missing data is flagged with a value of 9999.f" I am trying to plot the data but keep getting blank maps. I think its because this 9999.f value…
Megan Martin
  • 221
  • 1
  • 9
0
votes
2 answers

Calculate difference in variable within same day in two nc file

I have two NC files with ERA5land precipitation data from the months AMJJASO of 2001-2020. One NC file of precipitation data from UTC 00.00 and one NC file with precipitation data from UTC 12.00. I would like to subtract the precipitation from UTC…
Thomas
  • 441
  • 3
  • 16
0
votes
0 answers

How can I convert 3d variable in array with regridded another 1d variable(which is in same array) from netCDF4?

I'm trying to handle netCDF4 file and it has dimensions and variables like this. array( root group (NETCDF3_CLASSIC data model, file format NETCDF3): Title: Monthly version of HadISST…
0
votes
1 answer

How do I create a Mean Annual Rainfall table for various durations from a NetCDF4 using Python?

I have downloaded a NetCDF4 file of total hourly precipitation across Sierra Leone from 1974 to Present, and have started to create a code to analyze it. I'm trying to form a table in Python that will display my average annual rainfall for different…
jw99
  • 41
  • 6
0
votes
1 answer

How to multiply with a constant a selected region of a gridded Netcdf file for all the variables with NCO or CDO?

I have a gridded netcdf file with several variables. I want to multiply all the variables with a constant value c but ONLY for a selected region of the grid. with NCO for one variable for example I do the following ncap2 -s 'where((lat >= 40.55 &&…
Nat
  • 325
  • 2
  • 13
0
votes
1 answer

Split netcdf4 file based on latitude values in python

I have a netCDF file with three variables: input.variables {'longitude': float32 longitude(longitude) 'latitude': float32 latitude(latitude) 'Values':
B.Quaink
  • 456
  • 1
  • 4
  • 18
0
votes
2 answers

How to add in a missing day to gridded dataset?

So I have this dataset that runs on a strict 365-day calendar year, apparently meaning that data for December 31st isn't recorded on leap years. This leaves my "day" variable in netCDF files stuck at 365 instead of 366. For the type of analysis I'm…