From 42f9206439bd3c318bd795b9749b72118ad589fb Mon Sep 17 00:00:00 2001
From: Timo Millenaar <tmillenaar@gmail.com>
Date: Fri, 13 Jun 2025 12:32:13 +0200
Subject: [PATCH] Add more aggresive filter and averaging settings to parset.
 WARNING: Only to be applied to Tim's survey data, it removes international
 stations

---
 steps/define_parset.cwl | 53 ++++++++++++++++++++++++-----------------
 1 file changed, 31 insertions(+), 22 deletions(-)

diff --git a/steps/define_parset.cwl b/steps/define_parset.cwl
index 79ca3f4..53a0860 100644
--- a/steps/define_parset.cwl
+++ b/steps/define_parset.cwl
@@ -5,28 +5,37 @@ class: CommandLineTool
 label: define_parset
 
 requirements:
-- class: ShellCommandRequirement
-- class: InitialWorkDirRequirement
-  listing:
-  - entryname: input.parset
-    entry: |
-      steps=[flagedge,flagelev$('is_raw'? ',aoflag,flagamp': '')$(inputs.demix? ',demix': '')]
-      #
-      flagedge.chan=[0..nchan/32-1,31*nchan/32..nchan-1]
-      flagedge.type=preflagger
-      #
-      aoflag.keepstatistics=true
-      aoflag.memoryperc=20
-      aoflag.type=aoflagger
-      aoflag.autocorr=$(inputs.flag_autocorrelation?'True':'False')
-      aoflag.strategy=/usr/local/share/aoflagger/strategies/lofar-default.lua
-      #
-      flagelev.type=preflagger
-      flagelev.elevation=0deg..20deg
-      #
-      flagamp.amplmin=1e-30
-      flagamp.type=preflagger
-- class: InlineJavascriptRequirement
+  - class: ShellCommandRequirement
+  - class: InlineJavascriptRequirement
+  - class: InitialWorkDirRequirement
+    listing:
+      - entryname: input.parset
+        entry: |
+          steps=[flagedge,flagelev$('is_raw'? ',aoflag,flagamp': '')$(inputs.demix? ',demix': ''),filter,avg]
+          #
+          flagedge.chan=[0..nchan/32-1,31*nchan/32..nchan-1]
+          flagedge.type=preflagger
+          #
+          aoflag.keepstatistics=true
+          aoflag.memoryperc=20
+          aoflag.type=aoflagger
+          aoflag.autocorr=$(inputs.flag_autocorrelation?'True':'False')
+          aoflag.strategy=/usr/local/share/aoflagger/strategies/lofar-default.lua
+          #
+          flagelev.type=preflagger
+          flagelev.elevation=0deg..20deg
+          #
+          flagamp.amplmin=1e-30
+          flagamp.type=preflagger
+          #
+          filter.baseline="[CR]S*&"
+          filter.remove=True
+          filter.type=filter
+          #
+          avg.type=average
+          avg.timeresolution=4.0
+          avg.freqresolution=48828.125Hz
+
 
 inputs:
 - id: flag_autocorrelation
-- 
GitLab