Skip to content

Commit

Permalink
Add some utility scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Frits Sweijen committed Oct 5, 2023
1 parent 175d2eb commit 9f00ea1
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
21 changes: 21 additions & 0 deletions utility/extract_MS_and_compress.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash
HELP="$(basename $0)"
if [[ $1 == "-h" || $1 == "--help" ]]; then
echo "Extracts tar archives downloaded from the LTA, dysco compresses them and removes the full-resolution flags."
echo "Usage:"
echo $HELP
exit 0
fi
# The average step is a workaround for newer DP3 versions where writefullresflags has been removed.
# Without averaging they remain, but "averaging" with a factor 1 trigger their removal.
set -e
for f in *.tar; do
echo $f
tar xf $f
msname=$(echo $f | awk -F'_' '{print $1"_"$2"_uv.MS"}')
echo $msname
DP3 msin=$msname msout=$(basename $msname .MS).dysco.MS msout.writefullresflag=False msout.storagemanager=dysco steps=[average] average.timestep=1 average.freqstep=1
rm -rf $msname
mv $(basename $msname .MS).dysco.MS $msname
rm $f
done
10 changes: 10 additions & 0 deletions utility/rename_MS_from_LTA.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
# See https://www.astron.nl/lofarwiki/doku.php?id=public:lta_howto
HELP="$(basename $0)"
if [[ $1 == "-h" || $1 == "--help" ]]; then
echo "Renames tar archives downloaded from the LTA that starts with SRMifoGet* to their proper name."
echo "Usage:"
echo $HELP
exit 0
fi
find . -name "SRMFifoGet*" | awk -F %2F '{system("mv "$0" "$NF)}'

0 comments on commit 9f00ea1

Please sign in to comment.