#!/bin/csh

# Job to create count and photon spectrum plots for one minute at peak of each flare for Browser
# Archive is on hesperia at /data2/rhessi_extras/spectra/flare_plots
 
# This will normally be run as a cron job to do the most recent n days

# To run from command line for most recent n days, do this:
#   cd to /home/softw/det_plots
#   ./run_det_plots &

# To run this from the command line for a specific time period, do this:
#   cd to /home/softw/det_plots
#   ./run_det_plots  1-jan-2005 1-jan-2007 &

# Kim Tolbert
# Modified 13-Mar-2017 to be able to run for specified dates and make log file named by dates

setenv SSW /data/ssw
setenv SSW_INSTR 'hessi xray spex ontology'
source $SSW/gen/setup/setup.ssw
cd /home/softw/det_plots

# these env variables won't be defined in the cron job, just if we put the times in the command line to run
setenv tstart $1
setenv tend $2

$SSW/gen/bin/ssw_batch hsi_run_det_plots run_det_plots_$1_$2.log

