Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the error_ellipse calculation. #792

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
14 changes: 8 additions & 6 deletions vast_pipeline/image/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion vast_pipeline/tests/test_regression/test_epoch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
'''
Expand Down
2 changes: 1 addition & 1 deletion vast_pipeline/tests/test_regression/test_epoch_forced.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -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):
'''
Expand Down
2 changes: 1 addition & 1 deletion vast_pipeline/tests/test_regression/test_normal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
'''
Expand Down
Loading