Commit e147b090 authored by Carl Schreck's avatar Carl Schreck

Fixed climatology to 1981-2010

parent 8d300fd2
......@@ -11,8 +11,8 @@ import cjs # '~carl/lib-py'
cjs.tstamp('Here we go!')
# These are some parameters that could be useful to have up top
var_name = 'prcp'
clim_range = pd.date_range(start='1981-01-01', end='1982-12-31', freq='M')
var_name = 'tavg'
clim_range = pd.date_range(start='1981-01-01', end='2010-12-31', freq='M')
in_path = [
f'~/data/nclimgrid/beta/{var_name}/'
......
......@@ -18,8 +18,8 @@ from datetime import datetime
# These are some parameters that could be useful to have up top
year = 2019
month = 10
first_day = 24
last_day = 31
first_day = 6
last_day = 10
time_range = slice(f'{year}-{month:02}-{first_day:02}',
f'{year}-{month:02}-{last_day:02}')
......@@ -48,7 +48,7 @@ dayofyear = total_ds.time.sel(time=time_range).dt.dayofyear
total_data = total_ds['prcp'].sel(time=time_range).sum(dim='time')
cjs.tstamp('Read and average climatology')
clim_path = f'{os.environ["DATA_DIR"]}/nclimgrid/beta/prcp.clim.1981.1982.nc'
clim_path = f'{os.environ["DATA_DIR"]}/nclimgrid/beta/prcp.clim.1981.2010.nc'
clim_ds = xr.open_dataset(clim_path)
clim_data = clim_ds['prcp'].sel(dayofyear=dayofyear.values).sum(
dim='dayofyear')
......
......@@ -51,7 +51,7 @@ dayofyear = total_ds.time.sel(time=time_range).dt.dayofyear
total_data = total_ds['tavg'].sel(time=time_range).mean(dim='time')
cjs.tstamp('Read and average climatology')
clim_path = f'{os.environ["DATA_DIR"]}/nclimgrid/beta/tavg.clim.1981.1982.nc'
clim_path = f'{os.environ["DATA_DIR"]}/nclimgrid/beta/tavg.clim.1981.2010.nc'
clim_ds = xr.open_dataset(clim_path)
clim_data = clim_ds['tavg'].sel(dayofyear=dayofyear.values).mean(
dim='dayofyear')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment