Skip to content

Commit

Permalink
fixup light_curve_generator.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
troyraen committed Jan 26, 2024
1 parent 8943ad7 commit 764c331
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions light_curves/light_curve_generator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ print_usage(){
echo " -r : ID for the run. Used to label the output directory. There is no default."
echo " A value is required. No spaces or special characters."
echo " -l ('yang SDSS') : Space-separated list of literature/paper names from which to build the object sample."
echo " -c (true) : whether to consolidate_nearby_objects"
echo " -g ('{"SDSS": {"num": 10}}') : json string representing dicts with keyword arguments."
echo " -m ('gaia heasarc icecube wise ztf') : Space-separated list of missions from which to load light curves."
echo " -o (object_sample.ecsv) : File name storing the object sample."
Expand All @@ -137,6 +138,8 @@ print_usage(){

# ---- Set variable defaults.
literature_names=(yang SDSS)
literature_names_all=(green hon lamassa lopeznavas lyu macleod16 macleod19 ruan papers sheng SDSS TDE yang)
consolidate_nearby_objects=true
get_sample_kwargs='{"SDSS": {"num": 10}}'
mission_names=(gaia heasarc icecube wise ztf)
mission_names_core=(gaia heasarc icecube wise ztf)
Expand All @@ -147,10 +150,15 @@ kill_all_processes=false

# ---- Set variables that were passed in as script arguments.
# info about getopts: https://www.computerhope.com/unix/bash/getopts.htm#examples
while getopts r:l:g:m:o:p:hik flag; do
while getopts r:l:c:g:m:o:p:hik flag; do
case $flag in
r) run_id=$OPTARG;;
l) literature_names=("$OPTARG");;
l) literature_names=("$OPTARG")
if [ "${literature_names[0]}" == "all" ]; then
literature_names=("${literature_names_all[@]}")
fi
;;
c) consolidate_nearby_objects=$OPTARG;;
g) get_sample_kwargs=$OPTARG;;
m) mission_names=("$OPTARG")
if [ "${mission_names[0]}" == "all" ]; then
Expand Down Expand Up @@ -210,7 +218,8 @@ logfiles+=("$logfile")
echo
echo "Build sample is starting. logfile=${logfile}" | tee -a $mylogfile
python code_src/run_light_curve_generator.py --build sample \
--literature_names "${literature_names}" \
--literature_names ${literature_names[@]} \
--consolidate_nearby_objects $consolidate_nearby_objects \
--get_sample_kwargs "${get_sample_kwargs}" \
--sample_filename $sample_filepath \
&> ${logfile}
Expand Down

0 comments on commit 764c331

Please sign in to comment.