Commit efab57ce authored by Carl Schreck's avatar Carl Schreck

Operational prism_to_netcdf

parent f98cb6f2
......@@ -13,8 +13,8 @@ mkdir -p $LOG_DIR
for month in {1..12}
do
# for var_name in tmin tmax tmean ppt
for var_name in tmean ppt
for var_name in tmin tmax tmean ppt
# for var_name in tmean ppt
do
JOB_NAME=prism_to_netcdf"_"$var_name"_"$month
echo $JOB_NAME `date`
......
......@@ -64,8 +64,7 @@ time = xr.DataArray(pd.date_range(f'{year}-{month:02}-01',
attrs={'long_name': 'time'})
time.assign_coords(time=time)
out_data = xr.DataArray(np.full((len(time),len(lat), len(lon)), np.nan,
dtype='float32'),
out_data = xr.DataArray(np.full((len(time),len(lat), len(lon)), np.nan),
coords=[time, lat, lon],
name=var_name,
dims=['time', 'lat', 'lon'],
......@@ -87,7 +86,8 @@ for curr_time in time.values:
cjs.tstamp('Writing')
out_data.to_netcdf(out_path, encoding={var_name:
{'zlib': True, 'complevel': 1}})
{'zlib': True, 'complevel': 1,
'dtype': 'float32'}})
cjs.tstamp('Thank you, come again.')
......
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