Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/processData.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ASTROMDIR=astrometry_net_data

usage() {
print_error
print_error "Usage: $0 [-cmvfiear] [-h] [-- <options to validateDrp.py>]"
print_error "Usage: $0 [-cmvfiear] [-h]"
print_error
print_error "Specifc options:"
print_error " -c Camera"
Expand Down
50 changes: 41 additions & 9 deletions examples/runCfhtQuickTest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,44 @@ CAMERA=CfhtQuick
CONFIG_FILE="${PRODUCT_DIR}/config/cfhtConfig.py"
MAPPER=lsst.obs.cfht.MegacamMapper

"${PRODUCT_DIR}/examples/processData.sh" \
-c "$CAMERA" \
-m "$MAPPER" \
-v "$VALIDATION_DATA_DIR" \
-f "$CONFIG_FILE" \
-- "$@"
"${PRODUCT_DIR}/examples/validateRepo.sh" \
-c "$CAMERA" \
-- "$@"
print_error() {
>&2 echo "$@"
}

DOPROCESS=true
DOVERIFY=true

usage() {
print_error
Copy link
Contributor

@jhoblitt jhoblitt Jan 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is down to personal preference but you could replace the multiple print_error calls with.

print_error "$(cat <<-EOF

EOF
)"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to leave this as is since it's the same as in other scripts in this repo. I'm happy to file a ticket to update the syntax in the future.

print_error "Usage: $0 [-pv] [-h] [-- <extra options to validateDrp.py>]"
print_error
print_error "Specifc options:"
print_error " -p Skip processing?"
print_error " -v Skip verification?"
print_error " -h show this message"
exit 1
}

# thank OSX for not including getopt
while getopts "vph" option; do
case "$option" in
p) DOPROCESS=false;;
v) DOVERIFY=false;;
h) usage;;
esac
done
shift $((OPTIND-1))

if [[ $DOPROCESS == true ]] ; then
"${PRODUCT_DIR}/examples/processData.sh" \
-c "$CAMERA" \
-m "$MAPPER" \
-v "$VALIDATION_DATA_DIR" \
-f "$CONFIG_FILE"
fi

if [[ $DOVERIFY = true ]] ; then
"${PRODUCT_DIR}/examples/validateRepo.sh" \
-c "$CAMERA" \
-- "$@"
fi
50 changes: 41 additions & 9 deletions examples/runCfhtTest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,44 @@ CAMERA=Cfht
CONFIG_FILE="${PRODUCT_DIR}/config/cfhtConfig.py"
MAPPER=lsst.obs.cfht.MegacamMapper

"${PRODUCT_DIR}/examples/processData.sh" \
-c "$CAMERA" \
-m "$MAPPER" \
-v "$VALIDATION_DATA_DIR" \
-f "$CONFIG_FILE" \
-- "$@"
"${PRODUCT_DIR}/examples/validateRepo.sh" \
-c "$CAMERA" \
-- "$@"
print_error() {
>&2 echo "$@"
}

DOPROCESS=true
DOVERIFY=true

usage() {
print_error
print_error "Usage: $0 [-pv] [-h] [-- <extra options to validateDrp.py>]"
print_error
print_error "Specifc options:"
print_error " -p Skip processing?"
print_error " -v Skip verification?"
print_error " -h show this message"
exit 1
}

# thank OSX for not including getopt
while getopts "vph" option; do
case "$option" in
p) DOPROCESS=false;;
v) DOVERIFY=false;;
h) usage;;
esac
done
shift $((OPTIND-1))

if [[ $DOPROCESS == true ]] ; then
"${PRODUCT_DIR}/examples/processData.sh" \
-c "$CAMERA" \
-m "$MAPPER" \
-v "$VALIDATION_DATA_DIR" \
-f "$CONFIG_FILE"
fi

if [[ $DOVERIFY = true ]] ; then
"${PRODUCT_DIR}/examples/validateRepo.sh" \
-c "$CAMERA" \
-- "$@"
fi
51 changes: 41 additions & 10 deletions examples/runDecamQuickTest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,44 @@ CAMERA=DecamQuick
CONFIG_FILE="${PRODUCT_DIR}/config/decamConfig.py"
MAPPER=lsst.obs.decam.DecamMapper

"${PRODUCT_DIR}/examples/processData.sh" \
-c "$CAMERA" \
-m "$MAPPER" \
-v "$VALIDATION_DATA_DIR" \
-f "$CONFIG_FILE" \
-i ingestImagesDecam.py \
-- "$@"
"${PRODUCT_DIR}/examples/validateRepo.sh" \
-c "$CAMERA" \
-- "$@"
print_error() {
>&2 echo "$@"
}

DOPROCESS=true
DOVERIFY=true

usage() {
print_error
print_error "Usage: $0 [-pv] [-h] [-- <extra options to validateDrp.py>]"
print_error
print_error "Specifc options:"
print_error " -p Skip processing?"
print_error " -v Skip verification?"
print_error " -h show this message"
exit 1
}

# thank OSX for not including getopt
while getopts "vph" option; do
case "$option" in
p) DOPROCESS=false;;
v) DOVERIFY=false;;
h) usage;;
esac
done
shift $((OPTIND-1))

if [[ $DOPROCESS == true ]] ; then
"${PRODUCT_DIR}/examples/processData.sh" \
-c "$CAMERA" \
-m "$MAPPER" \
-v "$VALIDATION_DATA_DIR" \
-f "$CONFIG_FILE"
fi

if [[ $DOVERIFY = true ]] ; then
"${PRODUCT_DIR}/examples/validateRepo.sh" \
-c "$CAMERA" \
-- "$@"
fi
51 changes: 41 additions & 10 deletions examples/runDecamTest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,44 @@ CAMERA=Decam
CONFIG_FILE="${PRODUCT_DIR}/config/decamConfig.py"
MAPPER=lsst.obs.decam.DecamMapper

"${PRODUCT_DIR}/examples/processData.sh" \
-c "$CAMERA" \
-m "$MAPPER" \
-v "$VALIDATION_DATA_DIR" \
-f "$CONFIG_FILE" \
-i ingestImagesDecam.py \
-- "$@"
"${PRODUCT_DIR}/examples/validateRepo.py" \
-c "$CAMERA" \
-- "$@"
print_error() {
>&2 echo "$@"
}

DOPROCESS=true
DOVERIFY=true

usage() {
print_error
print_error "Usage: $0 [-pv] [-h] [-- <extra options to validateDrp.py>]"
print_error
print_error "Specifc options:"
print_error " -p Skip processing?"
print_error " -v Skip verification?"
print_error " -h show this message"
exit 1
}

# thank OSX for not including getopt
while getopts "vph" option; do
case "$option" in
p) DOPROCESS=false;;
v) DOVERIFY=false;;
h) usage;;
esac
done
shift $((OPTIND-1))

if [[ $DOPROCESS == true ]] ; then
"${PRODUCT_DIR}/examples/processData.sh" \
-c "$CAMERA" \
-m "$MAPPER" \
-v "$VALIDATION_DATA_DIR" \
-f "$CONFIG_FILE"
fi

if [[ $DOVERIFY = true ]] ; then
"${PRODUCT_DIR}/examples/validateRepo.sh" \
-c "$CAMERA" \
-- "$@"
fi
54 changes: 41 additions & 13 deletions examples/runHscQuickTest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,44 @@ exit 1

ASTROMDIR=sdss-dr9-fink-v5b

"${PRODUCT_DIR}/examples/processData.sh" \
-c "$CAMERA" \
-m "$MAPPER" \
-v "$VALIDATION_DATA_DIR" \
-f "$CONFIG_FILE" \
-e "fits" \
-a "$ASTROMDIR" \
-d "$CALIB_DATA" \
-r \
-- "$@"
"${PRODUCT_DIR}/examples/validateRepo.sh" \
-c "$CAMERA" \
-- "$@"
print_error() {
>&2 echo "$@"
}

DOPROCESS=true
DOVERIFY=true

usage() {
print_error
print_error "Usage: $0 [-pv] [-h] [-- <extra options to validateDrp.py>]"
print_error
print_error "Specifc options:"
print_error " -p Skip processing?"
print_error " -v Skip verification?"
print_error " -h show this message"
exit 1
}

# thank OSX for not including getopt
while getopts "vph" option; do
case "$option" in
p) DOPROCESS=false;;
v) DOVERIFY=false;;
h) usage;;
esac
done
shift $((OPTIND-1))

if [[ $DOPROCESS == true ]] ; then
"${PRODUCT_DIR}/examples/processData.sh" \
-c "$CAMERA" \
-m "$MAPPER" \
-v "$VALIDATION_DATA_DIR" \
-f "$CONFIG_FILE"
fi

if [[ $DOVERIFY = true ]] ; then
"${PRODUCT_DIR}/examples/validateRepo.sh" \
-c "$CAMERA" \
-- "$@"
fi
54 changes: 41 additions & 13 deletions examples/runHscTest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,44 @@ CONFIG_FILE="${PRODUCT_DIR}/config/hscConfig.py"
MAPPER=lsst.obs.hsc.HscMapper
ASTROMDIR=sdss-dr9-fink-v5b

"${PRODUCT_DIR}/examples/processData.sh" \
-c "$CAMERA" \
-m "$MAPPER" \
-v "$VALIDATION_DATA_DIR" \
-f "$CONFIG_FILE" \
-e "fits" \
-a "$ASTROMDIR" \
-d "$CALIB_DATA" \
-r \
-- "$@"
"${PRODUCT_DIR}/examples/validateRepo.sh" \
-c "$CAMERA" \
-- "$@"
print_error() {
>&2 echo "$@"
}

DOPROCESS=true
DOVERIFY=true

usage() {
print_error
print_error "Usage: $0 [-pv] [-h] [-- <extra options to validateDrp.py>]"
print_error
print_error "Specifc options:"
print_error " -p Skip processing?"
print_error " -v Skip verification?"
print_error " -h show this message"
exit 1
}

# thank OSX for not including getopt
while getopts "vph" option; do
case "$option" in
p) DOPROCESS=false;;
v) DOVERIFY=false;;
h) usage;;
esac
done
shift $((OPTIND-1))

if [[ $DOPROCESS == true ]] ; then
"${PRODUCT_DIR}/examples/processData.sh" \
-c "$CAMERA" \
-m "$MAPPER" \
-v "$VALIDATION_DATA_DIR" \
-f "$CONFIG_FILE"
fi

if [[ $DOVERIFY = true ]] ; then
"${PRODUCT_DIR}/examples/validateRepo.sh" \
-c "$CAMERA" \
-- "$@"
fi
3 changes: 2 additions & 1 deletion examples/validateRepo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ WORKSPACE=${CAMERA}
OUTPUT=${WORKSPACE}/output

if ! [ -d "${OUTPUT}" ]; then
print_error "Repository does not exist. Please run processData.sh first."
print_error "Repository does not exist. Please run processData.sh first."
exit 1
fi

# YAML config file for validation configuration
Expand Down