Created
June 26, 2014 02:05
-
-
Save selimnairb/6d1e6d1dbe0b2ed5ef5e to your computer and use it in GitHub Desktop.
Bare bones script for estimating yearly pan evaporation for a GHCN station using ulmo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ulmo | |
print("Downloading GHCN daily data for station USC00311677...") | |
nc_data = ulmo.ncdc.ghcn_daily.get_data('USC00311677', as_dataframe=True) | |
nc_evap = nc_data['EVAP'].copy().value # evaporation in 1/10-mm | |
nc_evap = nc_evap.truncate(before='1950-01-01', after='2009-12-30') | |
nc_evap = nc_evap.fillna(value=0) | |
nc_evap_yearly = nc_evap.resample('A', how='sum') # get yearly sum | |
nc_evap_yearly_filter = nc_evap_yearly[nc_evap_yearly > 1000] # Filter out very low yearly totals | |
nc_evap_avg_mm = nc_evap_yearly_filter.mean() / 10 | |
print("Mean yearly pan evaporation, Chapel Hill, NC, 1950-2009: {:.2f}-mm".format(nc_evap_avg_mm)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment