| Title | Author | Date |
|---|---|---|
Climate Data Demo |
John Fay |
Fall 2018 |
Explore how Python can read, manipulate, and visualize multi-dimensional climate data.
- Getting Python
- Installing miniconda
- Using Duke's Jupyter containers
- Using the ArcGIS Python installation
- Installing packages:
pip install --upgrade pippip install netCDF4conda install xarray
- Using Jupyter
-
Basic navigation
-
Importing the Python notebooks
git clone https://github.com/ENV859/ClimateData
-
-
1-FetchData.ipynbnotebook- Pulls data to local workspace using Python's
urllibpackage.
- Pulls data to local workspace using Python's
2-Numpy-and-Pandas.ipynbnotebook- Import the
.ncfile into a netCDF4 dataset object. - Exploring the netCDF dataset:
- Dimensions
- Variables
- Attributes (global and variable)
- Working with the data
- ...as netCDF variable objects...
- NetCDF variable shapes
- Extracting single data points from NetCDF variables
- Using NumPy with netCDF variables
- Converting netCDF variables to Numpy [masked] arrays
- Working with NumPy arrays
- Subsetting & visualizing our data
- Time series for a single location
- Location matrix for a single time
- Plotting
- Using Pandas with netCDF variables
- Reducing arrays and converting to dataframes
- Adding indexes and column names
- Subsetting data
- Xarrays...
- Import the
3-xarrays.ipynbnotebook.- Reading data into an xarray dataset object
- Extracting variables into xarray data array objects
- Working with xarray data arrays
- Extracting data for one point
- Plotting a time series for one location
- Mapping precipitation for one time point
- Creating spatial subsets
- Calculating and plotting summer averages