Daymet netCDF file manipulation (read, write, plot, season analysis) in Python
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Python Methods to Derive a Seasonal Mean from Daymet Data - Reading/Writing netCDF

Date: February 28, 2018
Contact for ORNL DAAC:

Keywords: Daymet, Python, netCDF, THREDDS


These tutorials demonstrate how to use the Python netCDF4 and numpy modules to work with a dataset in netCDF file format using N-dimensional array objects. Python numpy array methods are shown that open and subset a temporal range from a gridded multidimentional netCDF file. The example uses data from the maximum temperature variables of a dataset (Daymet) that contain daily gridded meteorologic data. In the first tutorial, a summer average maximum temperature is created and the results saved into a new netCDF file. A second tutorial condenses introductory information and demonstates how to loop through more than one year of data.

Max Temp Avg, Summer 2016, GSMNP

Source Data

Spatial subsets of the North American Daymet dataset daily data:

For these tutorials, spatial subsets were obtained from the ORNL DAAC's THREDDS netCDF Subset Service (NCSS). A tutorial of the NCSS is available here under the "Gridded Subsets" tab: .

You can download the 2015 maximum temperature Daymet subset data used in these tutorials by pasting the following HTTP GET NCSS Request URL into a browser:

Daymet subset data for 2016 can be downloaded by updating the URL above to the 2016 dataset path and changing to 2016 in the time_start and time_end parameters.


Python 2.7 or later. Python modules: netCDF4, numpy, matplotlib, pylab, datetime


You can access the two tutorials here: Tutorial 1 Tutorial 2