From 6598d3c4e8285e6aa52231784d1f3a67ddb3f9a3 Mon Sep 17 00:00:00 2001 From: Blaise deB Frederick Date: Tue, 31 Oct 2023 11:05:33 +0000 Subject: [PATCH] Added ability to invert noise regressor --- rapidtide/workflows/rapidtide.py | 2 ++ rapidtide/workflows/rapidtide_parser.py | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/rapidtide/workflows/rapidtide.py b/rapidtide/workflows/rapidtide.py index 55bf9f222..cf224c46f 100755 --- a/rapidtide/workflows/rapidtide.py +++ b/rapidtide/workflows/rapidtide.py @@ -845,6 +845,8 @@ def rapidtide_main(argparsingfunc): dummy, dummy, ) = tide_io.readvectorsfromtextfile(optiondict["noisetimecoursespec"], onecol=True) + if optiondict["noiseinvert"]: + noisevec *= -1.0 noisefreq = optiondict["noisefreq"] noisestarttime = optiondict["noisestarttime"] if noisefreq is None: diff --git a/rapidtide/workflows/rapidtide_parser.py b/rapidtide/workflows/rapidtide_parser.py index 79fe612b5..35ce0c067 100755 --- a/rapidtide/workflows/rapidtide_parser.py +++ b/rapidtide/workflows/rapidtide_parser.py @@ -1189,6 +1189,7 @@ def _get_parser(): help=("Attempt to detect and remove respiratory signal that strays into " "the LFO band."), default=False, ) + experimental.add_argument( "--noisetimecourse", dest="noisetimecoursespec", @@ -1229,7 +1230,6 @@ def _get_parser(): ), default="auto", ) - experimental.add_argument( "--noisestart", dest="noisestarttime", @@ -1243,6 +1243,13 @@ def _get_parser(): ), default=0.0, ) + experimental.add_argument( + "--noiseinvert", + dest="noiseinvert", + action="store_true", + help=("Invert noise regressor prior to alignment."), + default=False, + ) experimental.add_argument( "--acfix",