Commit 3ff15080 authored by Carl Schreck's avatar Carl Schreck

Automated Nightly Commit - Tue Aug 27 00:01:25 EDT 2019

parent 1ae39322
#!/bin/bash --login
#if [ -z "$1" ]; then
# QUEUE=`pick_queue`
#else
# QUEUE=$1
#fi
QUEUE=allnodes
echo $QUEUE
PY_SCRIPT=merge_imerg
PY_DIR=`pwd`
LOG_DIR=$PY_DIR/log
mkdir -p $LOG_DIR
JOB_NAME=$PY_SCRIPT
echo $JOB_NAME `date`
LOG_FILE=$LOG_DIR/$JOB_NAME.log
ERR_FILE=$LOG_DIR/$JOB_NAME.err
rm $LOG_FILE $ERR_FILE
bsub \
-J $JOB_NAME \
-o $LOG_FILE \
-e $ERR_FILE \
-q $QUEUE \
-n 1 -R "span[hosts=1]" -W 48:00 \
-sp 75 \
~/template/run_py.sh $PY_DIR $PY_SCRIPT "$PY_OPTION"
......@@ -12,8 +12,8 @@ import glob
import numpy as np
cjs.tstamp('Here we go!')
in_path = '/home/carl/data/imerg/2017/3B-HHR.MS.MRG.3IMERG.201706*0000-E*nc'
out_path = '/home/carl/data/imerg/imerg.hr.201706.nc'
in_path = '/home/carl/data/imerg/2016/3B-HHR.MS.MRG.3IMERG.*nc4'
out_path = '/home/carl/data/imerg/imerg.hr.201607.nc'
cjs.tstamp('Open')
in_files = glob.glob(in_path)
......@@ -22,10 +22,13 @@ in_files.sort()
ds = xr.open_mfdataset(in_files, concat_dim='time')
cjs.tstamp('Read/Write')
ds.time.encoding['units'] = 'days since 1800-01-01'
ds.time.encoding['dtype'] = 'float64'
# datetimeindex = ds.indexes['time'].to_datetimeindex()
# ds['time'] = datetimeindex
# ds.time.encoding['units'] = 'days since 1800-01-01'
# ds.time.encoding['dtype'] = 'float64'
# ds.encoding['_FillValue'] = -9999.
ds.sel(lat=slice(10, 20), lon=slice(-120, 0)).to_netcdf(out_path)
# ds.sel(lat=slice(10, 20), lon=slice(-120, 0)).to_netcdf(out_path)
ds.sel.to_netcdf(out_path)
cjs.tstamp('Closing')
ds.close()
......
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