Skip to content

Commit

Permalink
cal, img: add cal suffix
Browse files Browse the repository at this point in the history
  • Loading branch information
d3v-null committed Jan 15, 2025
1 parent 7af4370 commit c1724df
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
13 changes: 7 additions & 6 deletions demo/06_cal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ fi
# if using GPU, no need for source count limit
export dical_args="${dical_args:---num-sources 500}" # e.g. --uvw-min 30 --max-iterations 300
export apply_args="${apply_args:-}" # e.g. --time-average 8s --freq-average 80kHz
export dical_suffix=${dical_suffix:-""}
if [[ -n "${gpus:-}" ]]; then
dical_args=""
fi
Expand All @@ -65,7 +66,7 @@ mkdir -p "${outdir}/${obsid}/cal"
set -eu
# loop over all the preprocessed files
eval ls -1 $prep_uvfits_pattern | while read -r prep_uvfits; do
export prep_uvfits
export prep_uvfits;

# find prepqa relative to this uvfits file
export prepqa="${prep_uvfits%%.uvfits}_qa.json"
Expand All @@ -80,11 +81,11 @@ eval ls -1 $prep_uvfits_pattern | while read -r prep_uvfits; do
# e.g. for prep_uvfits=a/b/prep/birli_X_chY.uvfits, parent=a/b, obs=X_chY
export parent=${prep_uvfits%/*}
export parent=${parent%/*}
export obs=${prep_uvfits##*/birli_}
export obs=${obs%.uvfits}
export hyp_soln="${parent}/cal/hyp_soln_${obs}.fits"
export cal_ms="${parent}/cal/hyp_cal_${obs}.ms"
export model_ms="${parent}/cal/hyp_model_${obs}.ms"
export dical_name=${prep_uvfits##*/birli_}
export dical_name="${dical_name%.uvfits}${dical_suffix}"
export hyp_soln="${parent}/cal/hyp_soln_${dical_name}.fits"
export cal_ms="${parent}/cal/hyp_cal_${dical_name}.ms"
export model_ms="${parent}/cal/hyp_model_${dical_name}.ms"

if [[ ! -f "$hyp_soln" ]]; then
echo "calibrating with sourcelist $srclist"
Expand Down
8 changes: 7 additions & 1 deletion demo/07_img.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,15 @@ export SCRIPT_BASE=${SCRIPT_BASE:-$(dirname $ME)}
source "$SCRIPT_BASE/00_env.sh"

export obsid=${obsid:-1121334536}

# ### #
# CAL #
# ### #

export dical_suffix=${dical_suffix:-""}
# check for calibrated measurement set from previous step
# export cal_ms="${cal_ms:-${outdir}/${obsid}/cal/hyp_cal_${obsid}.ms}"
export ms_pattern=${ms_pattern:-${outdir}/${obsid}/\{cal,peel\}/hyp_\*${obsid}\*.ms}
export ms_pattern=${ms_pattern:-${outdir}/${obsid}/\{cal,peel\}/hyp_\*${obsid}\*${dical_suffix}\*.ms}
if ! eval ls -1d $ms_pattern >/dev/null; then
echo "ms_pattern=$ms_pattern does not exist. trying 06_cal.sh"
$SCRIPT_BASE/06_cal.sh
Expand Down

0 comments on commit c1724df

Please sign in to comment.