#! /bin/bash 
# Last edited on 2021-03-05 22:50:28 by jstolfi

# Runs "combine_graphs.py" on all images.

export PATH=".:..:../..:${PATH}"

rsmooth="$1"; shift  # Smoothing radius: "0150", "0300", etc.
selegg="$1"; shift    # Optional egg to plot; if missing, plot all eggs.

dayeggs=(
  2021-02-28/egg-a
  2021-02-28/egg-b
  2021-02-28/egg-c
  2021-03-02/egg-d
  2021-03-03/egg-e
  2021-03-03/egg-f
  2021-03-03/egg-z
  2021-03-04/egg-y
)

if [[ "/${selegg}" != "/" ]]; then
  # Restrict to selected egg:
  dayeggs=( `echo ${dayeggs[@]} | tr ' ' '\012' | grep -e "${selegg}"` )
fi

for de in ${dayeggs[@]} ; do 
  day="${de%%/*}"
  egg="${de##*/}"
  echo "day = [${day}] egg = [${egg}]" 1>&2 
  ( cd tests && make EGGNAME="${egg}" RSMOOTH=${rsmooth} SHOW=0 combined )
done
    
