Skip to content

Commit

Permalink
Fix missing RMS measurements for non-detections (#476)
Browse files Browse the repository at this point in the history
* Initial fix

* Updated test

* Updated changelog
  • Loading branch information
ddobie authored Aug 11, 2023
1 parent d679b9f commit cf19c26
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

#### Changed

- Changed default behaviour of Image.measure_coord_pixel_values to have `img=False` [#476](https://github.com/askap-vast/vast-tools/pull/476)
- Changed `Fields.direction` to be loaded from pickle rather than generated at each call [#431](https://github.com/askap-vast/vast-tools/pull/431)
- Updated RACS dec limit to +50 [#438](https://github.com/askap-vast/vast-tools/pull/438)
- Updated Query._get_epochs to allow lists and ints [#421](https://github.com/askap-vast/vast-tools/pull/421)
Expand All @@ -64,6 +65,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

#### Fixed

- Fixed missing RMS measurements for non-detections [#476](https://github.com/askap-vast/vast-tools/pull/476)
- Removed duplicates in field matching [#472](https://github.com/askap-vast/vast-tools/pull/472)
- Fix read_selavy to force all flux & flux_err values to be positive [#463](https://github.com/askap-vast/vast-tools/pull/463)
- Fix planet matching to correctly handle field names with/without 'A' suffix [#453](https://github.com/askap-vast/vast-tools/pull/453)
Expand Down Expand Up @@ -102,6 +104,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

#### List of PRs

- [#476](https://github.com/askap-vast/vast-tools/pull/476): fix: Fixed missing RMS measurements for non-detections
- [#472](https://github.com/askap-vast/vast-tools/pull/472): fix: Remove duplicates in field matching
- [#470](https://github.com/askap-vast/vast-tools/pull/470): feat: Added epoch 41
- [#465](https://github.com/askap-vast/vast-tools/pull/465): feat: Added warning when querying corrected data
Expand Down
5 changes: 2 additions & 3 deletions tests/test_survey.py
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,7 @@ def test_image_measure_coord_pixel_values(

expected_values = np.array([8559, 824, 5006], dtype=np.float32)

values = image.measure_coord_pixel_values(coords_to_measure)
values = image.measure_coord_pixel_values(coords_to_measure, img=True)

assert np.all(values == expected_values)

Expand Down Expand Up @@ -1007,7 +1007,6 @@ def test_image_measure_coord_pixel_values_rms(
expected_values = np.array([8115, 4849, 691], dtype=np.float32)

values = image.measure_coord_pixel_values(coords_to_measure,
rms=True,
img=False)
rms=True)

assert np.all(values == expected_values)
6 changes: 3 additions & 3 deletions vasttools/survey.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,9 +502,9 @@ def get_bkg_img(self) -> None:
def measure_coord_pixel_values(
self,
coords: SkyCoord,
img: bool = True,
rms: bool = False,
bkg: bool = False
img: Optional[bool] = False,
rms: Optional[bool] = False,
bkg: Optional[bool] = False
) -> np.ndarray:
"""
Measures the pixel values at the provided coordinate values.
Expand Down

0 comments on commit cf19c26

Please sign in to comment.