From 091f5c647b87514cef1a1d4fcda2f360bcf7ff67 Mon Sep 17 00:00:00 2001 From: tgalvin Date: Mon, 19 Aug 2024 10:43:26 +0800 Subject: [PATCH 1/6] flagging casda style MS on conversion --- flint/prefect/common/imaging.py | 2 +- flint/prefect/flows/continuum_pipeline.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/flint/prefect/common/imaging.py b/flint/prefect/common/imaging.py index 65691526..d5910201 100644 --- a/flint/prefect/common/imaging.py +++ b/flint/prefect/common/imaging.py @@ -106,7 +106,7 @@ def task_potato_peel( @task def task_flag_ms_aoflagger(ms: FlagMS, container: Path) -> FlagMS: - extracted_ms = ms.ms if isinstance(ms, ApplySolutions) else ms + extracted_ms = MS.cast(ms=ms) extracted_ms = flag_ms_aoflagger(ms=extracted_ms, container=container) diff --git a/flint/prefect/flows/continuum_pipeline.py b/flint/prefect/flows/continuum_pipeline.py index 673421ed..58fb8392 100644 --- a/flint/prefect/flows/continuum_pipeline.py +++ b/flint/prefect/flows/continuum_pipeline.py @@ -181,6 +181,9 @@ def process_science_fields( preprocess_science_mss = task_copy_and_preprocess_casda_askap_ms.map( casda_ms=science_mss, output_directory=output_split_science_path ) + preprocess_science_mss = task_flag_ms_aoflagger.map( # type: ignore + ms=preprocess_science_mss, container=field_options.flagger_container + ) else: # TODO: This will likely need to be expanded should any # other calibration strategies get added From 2dbaf6c46ed72e8f30a402a16e7012b014fdcbaa Mon Sep 17 00:00:00 2001 From: tgalvin Date: Mon, 19 Aug 2024 15:08:17 +0800 Subject: [PATCH 2/6] added 0.0 to linmos cutoff --- flint/coadd/linmos.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flint/coadd/linmos.py b/flint/coadd/linmos.py index d6083ed1..eedb5da5 100644 --- a/flint/coadd/linmos.py +++ b/flint/coadd/linmos.py @@ -379,7 +379,7 @@ def generate_linmos_parameter_set( f"linmos.useweightslog = true\n" f"linmos.weighttype = Combined\n" f"linmos.weightstate = Inherent\n" - f"linmos.cutoff = {cutoff}\n" + f"linmos.cutoff = 0.0,{cutoff}\n" ) # Construct the holography section of the linmos parset parset += _get_holography_linmos_options(holofile=holofile, pol_axis=pol_axis) From 997058d45a487e11882b513186d492bfdb6b1f00 Mon Sep 17 00:00:00 2001 From: tgalvin Date: Mon, 19 Aug 2024 15:56:04 +0800 Subject: [PATCH 3/6] added final cutoff --- flint/coadd/linmos.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flint/coadd/linmos.py b/flint/coadd/linmos.py index eedb5da5..307466f7 100644 --- a/flint/coadd/linmos.py +++ b/flint/coadd/linmos.py @@ -379,7 +379,8 @@ def generate_linmos_parameter_set( f"linmos.useweightslog = true\n" f"linmos.weighttype = Combined\n" f"linmos.weightstate = Inherent\n" - f"linmos.cutoff = 0.0,{cutoff}\n" + f"linmos.cutoff = {cutoff}\n" + f"linmos.finalcutoff = 0.01\n" ) # Construct the holography section of the linmos parset parset += _get_holography_linmos_options(holofile=holofile, pol_axis=pol_axis) From ab63b3fa32cac9937732475e1c587aa20d0acf76 Mon Sep 17 00:00:00 2001 From: tgalvin Date: Mon, 19 Aug 2024 16:40:35 +0800 Subject: [PATCH 4/6] added a type ignore --- flint/prefect/common/imaging.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flint/prefect/common/imaging.py b/flint/prefect/common/imaging.py index d5910201..7032413b 100644 --- a/flint/prefect/common/imaging.py +++ b/flint/prefect/common/imaging.py @@ -106,7 +106,7 @@ def task_potato_peel( @task def task_flag_ms_aoflagger(ms: FlagMS, container: Path) -> FlagMS: - extracted_ms = MS.cast(ms=ms) + extracted_ms = MS.cast(ms=ms) # type: ignore - a product of the type alias, pirate thinks extracted_ms = flag_ms_aoflagger(ms=extracted_ms, container=container) From 5084647e38cec52111ab1ea33c68411dc6e79de5 Mon Sep 17 00:00:00 2001 From: tgalvin Date: Mon, 19 Aug 2024 16:45:40 +0800 Subject: [PATCH 5/6] fixed the type syntax error --- flint/prefect/common/imaging.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flint/prefect/common/imaging.py b/flint/prefect/common/imaging.py index 7032413b..3aec7902 100644 --- a/flint/prefect/common/imaging.py +++ b/flint/prefect/common/imaging.py @@ -106,7 +106,8 @@ def task_potato_peel( @task def task_flag_ms_aoflagger(ms: FlagMS, container: Path) -> FlagMS: - extracted_ms = MS.cast(ms=ms) # type: ignore - a product of the type alias, pirate thinks + # Pirate believes the type ignore below is due to the decorated function and type alias + extracted_ms = MS.cast(ms=ms) # type: ignore extracted_ms = flag_ms_aoflagger(ms=extracted_ms, container=container) From 1e657b5ff9d9b5749083bf06af3f129ad29135b4 Mon Sep 17 00:00:00 2001 From: tgalvin Date: Mon, 19 Aug 2024 16:53:57 +0800 Subject: [PATCH 6/6] version lock --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 44a9c529..11899cf6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,6 +39,7 @@ pandas = "*" ConfigArgParse = "^1.7" fitscube = "^0.4.3" astroquery = "^0.4.7" +griffe = "0.48.0" [tool.poetry.group.dev.dependencies] black = "^23.3.0"