From e623102768c426e86b0ed73904168006dfea2af9 Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Sun, 25 Nov 2018 15:22:48 +0000 Subject: Pipeline now downloads and uses an input dataset In most analysis situations (except for simulations), an input dataset is necessary, but that part of the pipeline was just left out and a general `SURVEY' variable was set and never used. So with this commit, we actually use a sample FITS file from the FITS standard webpage, show it (as well as its histogram) and do some basic calculations on it. This preparation of the input datasets is done in a generic way to enable easy addition of more datasets if necessary. --- configure | 108 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 98 insertions(+), 10 deletions(-) (limited to 'configure') diff --git a/configure b/configure index c33d646..2922365 100755 --- a/configure +++ b/configure @@ -42,6 +42,7 @@ topdir=$(pwd) installedlink=.local lbdir=reproduce/build cdir=reproduce/config +optionaldir="/optional/path" pdir=$cdir/pipeline pconf=$pdir/LOCAL.mk @@ -100,7 +101,7 @@ function create_file_with_notice() { # Since the build directory will go into a symbolic link, we want it to be # an absolute address. With this function we can make sure of that. function absolute_dir() { - echo "$(cd "$(dirname "$inbdir")" && pwd )/$(basename "$inbdir")" + echo "$(cd "$(dirname "$1")" && pwd )/$(basename "$1")" } @@ -179,7 +180,8 @@ fi # the web address. if [ $rewritepconfig = yes ]; then if type wget > /dev/null 2>/dev/null; then - downloader="wget --no-use-server-timestamps -O"; + wgetname=$(which wget) + downloader="$wgetname --no-use-server-timestamps -O"; else cat <> $pconf else # Read the values from existing configuration file. - inbdir=$(awk '$1=="BDIR" {print $NF}' $pconf) - ddir=$(awk '$1=="DEPENDENCIES-DIR" {print $NF}' $pconf) - downloader=$(awk '$1=="DOWNLOADER" {print $NF}' $pconf) + inbdir=$(awk '$1=="BDIR" {print $3}' $pconf) + downloader=$(awk '$1=="DOWNLOADER" {print $3}' $pconf) + + # Make sure all necessary variables have a value + err=0 + verr=0 + novalue="" + if [ x"$inbdir" = x ]; then novalue="BDIR, "; fi + if [ x"$downloader" = x ]; then novalue="$novalue"DOWNLOADER; fi + if [ x"$novalue" != x ]; then verr=1; err=1; fi # Make sure `bdir' is an absolute path and it exists. + berr=0 + ierr=0 bdir=$(absolute_dir $inbdir) - if ! [ -d $bdir ]; then mkdir $bdir; fi + + if ! [ -d $bdir ]; then if ! mkdir $bdir; then berr=1; err=1; fi; fi + if [ $err = 1 ]; then + cat <