#!/bin/bash

if [ "$1" == "" ]; then
    curdate=$(date +%Y%m%d -d '-1day')
else
    curdate=$1
fi

if [ "$2" == "" ]; then
    interp=False
else
    interp=True
fi

PYTHON=$HOME/dust-dashboard/bin/ipython

# $PYTHON interpolate_netcdf.py $curdate
# wait
$PYTHON probability_maps.py $curdate $interp
wait

for var in /data/daily_dashboard/prob/{sconc_dust,od550_dust}
do
    for thresh in $var/*
	do
	    rm $thresh/geojson/$curdate/*geojson
            $PYTHON $HOME/interactive-forecast-viewer/preproc/nc2geojson.py PROB $thresh/geojson/ $thresh/netcdf/$curdate/$curdate*nc
	done
done
