From aa581844da9870b4234455a9ebbe1319adc2a0bd Mon Sep 17 00:00:00 2001 From: Tom Mauch Date: Fri, 22 Nov 2024 16:57:12 +1100 Subject: [PATCH 1/4] Fix the error_ellipse calculation. --- vast_pipeline/image/main.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/vast_pipeline/image/main.py b/vast_pipeline/image/main.py index 2a8edaf5..5bdadc22 100644 --- a/vast_pipeline/image/main.py +++ b/vast_pipeline/image/main.py @@ -436,11 +436,14 @@ def read_selavy(self, dj_image: models.Image) -> pd.DataFrame: df['ew_sys_err'] = self.config["ra_uncertainty"] / 3600. df['ns_sys_err'] = self.config["dec_uncertainty"] / 3600. - df['error_radius'] = calc_error_radius( - df['ra'].values, - df['ra_err'].values, - df['dec'].values, - df['dec_err'].values, + # NOTE: The simplified error_radius calculation + # computed here is a replacement for the erroneous + # implementation in the calc_error_radius function + # in utils.py. It should mimic the intended functionality + # of that function as well as the implementation + # in TraP. + df['error_radius'] = np.hypot( + df['ra_err'].values, df['dec_err'].values ) df['uncertainty_ew'] = np.hypot( From 41d0c1475196ac4a78f550254864b25f810ac06b Mon Sep 17 00:00:00 2001 From: Tom Mauch Date: Fri, 22 Nov 2024 16:59:51 +1100 Subject: [PATCH 2/4] Remove unused import --- vast_pipeline/image/main.py | 1 - 1 file changed, 1 deletion(-) diff --git a/vast_pipeline/image/main.py b/vast_pipeline/image/main.py index 5bdadc22..8d1f7741 100644 --- a/vast_pipeline/image/main.py +++ b/vast_pipeline/image/main.py @@ -14,7 +14,6 @@ from astropy.wcs.utils import proj_plane_pixel_scales from typing import Dict -from .utils import calc_error_radius from .utils import calc_condon_flux_errors from vast_pipeline import models From b41b43606780f8e188cf3c07514ea9ebc5cf649d Mon Sep 17 00:00:00 2001 From: Tom Mauch Date: Fri, 22 Nov 2024 17:02:38 +1100 Subject: [PATCH 3/4] Update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 299db4f2..87f00e80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), #### Fixed +- Fixed incorrect error ellipse calculation [#792](https://github.com/askap-vast/vast-pipeline/pull/792) - Renamed variable in pipeline.finalise to better reflect what the dataframe represents (sources_df -> associations_df) [#787](https://github.com/askap-vast/vast-pipeline/pull/787) - Fixed typo in variable name ("assoications") [#787](https://github.com/askap-vast/vast-pipeline/pull/787) - Fix processing config parameters not displaying in web interface [#782](https://github.com/askap-vast/vast-pipeline/pull/782) @@ -23,6 +24,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), #### List of PRs +- [#792](https://github.com/askap-vast/vast-pipeline/pull/792): fix: Simplify and correct error ellipse calculation. - [#787](https://github.com/askap-vast/vast-pipeline/pull/787): fix: Optimise associations merge and minor variable name updates - [#782](https://github.com/askap-vast/vast-pipeline/pull/782): fix: Fix processing config parameters not displaying in web interface - [#780](https://github.com/askap-vast/vast-pipeline/pull/780): docs: Fix incorrect zenodo links From 9113614e7a5c8b7a84c08855e80ce74b99fcfda5 Mon Sep 17 00:00:00 2001 From: Tom Mauch Date: Mon, 25 Nov 2024 11:17:33 +1100 Subject: [PATCH 4/4] Update source numbers in De Ruiter tests --- vast_pipeline/tests/test_regression/test_epoch.py | 2 +- vast_pipeline/tests/test_regression/test_epoch_forced.py | 2 +- .../tests/test_regression/test_epoch_parallel_add_image.py | 2 +- vast_pipeline/tests/test_regression/test_normal.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/vast_pipeline/tests/test_regression/test_epoch.py b/vast_pipeline/tests/test_regression/test_epoch.py index 05d88927..3d36c2c0 100644 --- a/vast_pipeline/tests/test_regression/test_epoch.py +++ b/vast_pipeline/tests/test_regression/test_epoch.py @@ -225,7 +225,7 @@ def test_num_sources(self): ''' See documentation for test_num_sources in property_check. ''' - property_check.test_num_sources(self, self.sources, 616) + property_check.test_num_sources(self, self.sources, 609) def test_most_relations(self): ''' diff --git a/vast_pipeline/tests/test_regression/test_epoch_forced.py b/vast_pipeline/tests/test_regression/test_epoch_forced.py index 44ea7b31..0981a634 100644 --- a/vast_pipeline/tests/test_regression/test_epoch_forced.py +++ b/vast_pipeline/tests/test_regression/test_epoch_forced.py @@ -286,4 +286,4 @@ def test_forced_num(self): See documentation for test_forced_num in property_check. ''' property_check.test_forced_num( - self, self.forced, 982) + self, self.forced, 961) diff --git a/vast_pipeline/tests/test_regression/test_epoch_parallel_add_image.py b/vast_pipeline/tests/test_regression/test_epoch_parallel_add_image.py index 793beb4f..02272bdd 100644 --- a/vast_pipeline/tests/test_regression/test_epoch_parallel_add_image.py +++ b/vast_pipeline/tests/test_regression/test_epoch_parallel_add_image.py @@ -275,7 +275,7 @@ def test_num_sources(self): ''' See documentation for test_num_sources in property_check. ''' - property_check.test_num_sources(self, self.sources, 617) + property_check.test_num_sources(self, self.sources, 610) def test_most_relations(self): ''' diff --git a/vast_pipeline/tests/test_regression/test_normal.py b/vast_pipeline/tests/test_regression/test_normal.py index 79e3be41..3a2bab73 100644 --- a/vast_pipeline/tests/test_regression/test_normal.py +++ b/vast_pipeline/tests/test_regression/test_normal.py @@ -225,7 +225,7 @@ def test_num_sources(self): ''' See documentation for test_num_sources in property_check. ''' - property_check.test_num_sources(self, self.sources, 618) + property_check.test_num_sources(self, self.sources, 611) def test_most_relations(self): '''