diff --git a/CHANGELOG.md b/CHANGELOG.md index d5614bb56..6f4c04065 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,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) @@ -28,6 +29,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. - [#788](https://github.com/askap-vast/vast-pipeline/pull/788): feat, fix: Speed up forced fitting code by using numba-fied forced_phot code and reordering some calculations - [#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 diff --git a/vast_pipeline/image/main.py b/vast_pipeline/image/main.py index 2a8edaf5b..8d1f77413 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 @@ -436,11 +435,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( diff --git a/vast_pipeline/tests/test_regression/test_epoch.py b/vast_pipeline/tests/test_regression/test_epoch.py index 05d889274..3d36c2c0c 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 44ea7b31d..0981a634e 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 793beb4fa..02272bdd4 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 79e3be417..3a2bab73c 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): '''