Skip to content
Snippets Groups Projects
Commit b2a87250 authored by Ger van Diepen's avatar Ger van Diepen
Browse files

bug 1446:

Created script taqlflagger to easily (un)flag baselines, etc.
parent cb91d6c8
No related branches found
No related tags found
No related merge requests found
...@@ -99,6 +99,7 @@ CEP/DP3/DPPP/src/PipelineProcessControl.cc -text ...@@ -99,6 +99,7 @@ CEP/DP3/DPPP/src/PipelineProcessControl.cc -text
CEP/DP3/DPPP/src/RunDetails.cc -text CEP/DP3/DPPP/src/RunDetails.cc -text
CEP/DP3/DPPP/src/mwflagger -text CEP/DP3/DPPP/src/mwflagger -text
CEP/DP3/DPPP/src/mwflagger-part -text CEP/DP3/DPPP/src/mwflagger-part -text
CEP/DP3/DPPP/src/taqlflagger -text
CEP/DP3/DPPP/test/CS1_IDPPP.log_prop -text CEP/DP3/DPPP/test/CS1_IDPPP.log_prop -text
CEP/DP3/DPPP/test/CS1_IDPPP.parset -text CEP/DP3/DPPP/test/CS1_IDPPP.parset -text
CEP/DP3/DPPP/test/Makefile.am -text CEP/DP3/DPPP/test/Makefile.am -text
......
...@@ -25,4 +25,5 @@ lofar_add_bin_program(versiondppp versiondppp.cc) ...@@ -25,4 +25,5 @@ lofar_add_bin_program(versiondppp versiondppp.cc)
install(PROGRAMS install(PROGRAMS
mwflagger mwflagger
mwflagger-part mwflagger-part
taqlflagger
DESTINATION bin) DESTINATION bin)
...@@ -27,7 +27,7 @@ pythondir = $(bindir) ...@@ -27,7 +27,7 @@ pythondir = $(bindir)
dist_python_SCRIPTS = dist_python_SCRIPTS =
scriptdir = $(bindir) scriptdir = $(bindir)
dist_script_SCRIPTS = mwflagger mwflagger-part dist_script_SCRIPTS = mwflagger mwflagger-part taqlflagger
versiondppp_SOURCES = versiondppp.cc versiondppp_SOURCES = versiondppp.cc
versiondppp_LDADD = libdppp.la versiondppp_LDADD = libdppp.la
......
#!/bin/sh
# Skip first argument if it is a rank (a numeric value).
res=`echo $1 | sed 's/[0-9]*//'`
test "$res" = "" && shift
# Test if an MS name is given.
err=1
ms=$1
if test "$ms" != ""; then
shift
err=0
# Test if -dry or dry is given.
dry=0
if test "$1" = "-dry" -o "$1" = "dry"; then
dry=1
fi
# Test if flag or unflag is given. flag means use value T, otherwise F.
val=T
if test "$1" = "flag"; then
shift
elif test "$1" = "unflag"; then
val=F
shift
fi
pol=
chan=
where=
while test $# != 0 -a $err = 0
do
sel=$1
# Check if a pol or chan selection is given.
case $sel in
chan=*)
test "$chan" = "" || err=1
chan=`echo $sel | sed -e 's/chan=//'`
cmd="update $ms set FLAG[$chan,]=T"
;;
pol=*)
test "$pol" = "" || err=1
pol=`echo $sel | sed -e 's/pol=//'`
cmd="update $ms set FLAG[,$pol]=T"
;;
*)
if test "$where" = ""; then
where="$sel"
else
where="($where) && ($sel)"
fi
;;
esac
shift
done
fi
if test $err = 0; then
cmd="update $ms set FLAG[$chan,$pol]=$val"
if test "$where" != ""; then
cmd="$cmd where $where"
fi
echo "taql '$cmd'"
if test $dry = 0; then
taql "$cmd" || err=1
fi
fi
if test $err != 0; then
echo ""
echo "Run as: taqlflagger [rank] ms [-dry] [flag|unflag] [selection1 ...]"
echo "The rank is a dummy argument meant for rundist."
echo "ms is the name of the MS to be (un)flagged."
echo "dry tells to do a dry run; it only shows the command to execute."
echo "flag or unflag tells what to do (default is flag)."
echo "The selections must be a TaQL WHERE part like"
echo " ANTENNA1=1"
echo " where multiple such parts are anded"
echo "or a polarization or channel selection like"
echo " pol=0 or chan=0:4"
echo " where the end is exclusive (a la python)"
echo "E.g."
echo " taqlflagger unflag ~/my.ms chan=0:32 pol=0 ANTENNA1=1 'ANTENNA2 in [1:4]'"
echo "unflags XX for channel 0 till 31 for baseline 1,1, 1,2 and 1,3"
echo ""
exit 1
fi
exit 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment