I have a netCDF file that I wish to extract a subset from defined by latitude/longitude boundaries (i.e. a lat/long defined box), using the ‘ncdf’ package in R.
A summa
If you are using Linux this can be achieved easily using nctoolkit (https://nctoolkit.readthedocs.io/en/latest/):
import nctoolkit as nc data = nc.open_data("example.nc") data.clip(lon = [-12, -5], lat = [35.4, 44.5])