Skip to content

Commit

Permalink
🚧 update to use temp dir
Browse files Browse the repository at this point in the history
  • Loading branch information
astrokatross committed Apr 18, 2024
1 parent c2679e3 commit 53d598f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions templates/selfcal.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ track_task.py start --jobid="${jobid}" --taskid="${taskid}" --start_time="$(date

datadir="${base}/${obsnum}"
cd "${datadir}" || exit
mkdir -p /tmp/${SLURM_JOB_ID}/slurm_wsclean
cp -rf ${obsnum}.ms /tmp/${SLURM_JOB_ID}/slurm_wsclean

# Adding a check to see if there are any selfsolutions already, will not recalculated
if [[ -e ${obsnum}_selfsolutions.bin ]] || [[ -e ${obsnum}_selfsolutions_failed.bin ]]
Expand All @@ -59,10 +61,10 @@ fi
# Which data column to image
if [[ ! -z $debug ]]
then
taql update ${obsnum}.ms set DATA=CORRECTED_DATA
taql update /tmp/${SLURM_JOB_ID}/slurm_wsclean/${obsnum}.ms set DATA=CORRECTED_DATA
fi
# Removing any previous model column to make sure its not accidentally included in the model for selfcal
taql alter table ${obsnum}.ms drop column MODEL_DATA
taql alter table /tmp/${SLURM_JOB_ID}/slurm_wsclean/${obsnum}.ms drop column MODEL_DATA

# TODO: replace with find
metafits="$(ls -t ${obsnum}*metafits* | head -1)"
Expand Down Expand Up @@ -163,6 +165,7 @@ then
wsclean \
-abs-mem ${GXMEMORY} \
$multiscale \
-temp-dir /tmp/${SLURM_JOB_ID}/slurm_wsclean/ \
-nmiter 1 \
-niter 40000 \
-stop-negative \
Expand All @@ -173,7 +176,7 @@ then
-pol XX,YY,XY,YX \
-channels-out 4 \
-join-polarizations \
"${obsnum}.ms" | tee wsclean.log
"/tmp/${SLURM_JOB_ID}/slurm_wsclean/${obsnum}.ms" | tee wsclean.log

else
echo "Already have initial images, not reimaging shallow clean"
Expand All @@ -186,6 +189,7 @@ then
echo 'Initial image did not generate! Something probs happened with WSClean'
exit 1
else
rm -rf ${obsnum}.ms && cp -rf /tmp/${SLURM_JOB_ID}/slurm_wsclean/${obsnum}.ms ./
calibrate \
-j ${GXNCPUS} \
-absmem ${GXABSMEMORY} \
Expand Down

0 comments on commit 53d598f

Please sign in to comment.