Skip to content

Conversation

@DanRyanIrish
Copy link
Contributor

This PR enables the phase_center inputs to the Visibilities calculating functions to be given as a SkyCoord. The result is that the Visibilities object knows its phase center in a valid coordinate frame, and hence enable imaging routines to return Maps in the same coordinate frame.

@codecov
Copy link

codecov bot commented Nov 17, 2024

Codecov Report

Attention: Patch coverage is 29.34783% with 65 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@ea833d9). Learn more about missing BASE report.

Files with missing lines Patch % Lines
xrayvision/coordinates/frames.py 38.77% 30 Missing ⚠️
xrayvision/imaging.py 21.05% 15 Missing ⚠️
xrayvision/visibility.py 14.28% 12 Missing ⚠️
xrayvision/transform.py 20.00% 8 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main      #77   +/-   ##
=======================================
  Coverage        ?   15.28%           
=======================================
  Files           ?        8           
  Lines           ?      968           
  Branches        ?        0           
=======================================
  Hits            ?      148           
  Misses          ?      820           
  Partials        ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@DanRyanIrish
Copy link
Contributor Author

Do not merge until #76 is merged.

@samaloney samaloney requested a review from Copilot April 3, 2025 21:09
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 10 out of 12 changed files in this pull request and generated 1 comment.

Files not reviewed (2)
  • changelog/76.feature.rst: Language not supported
  • changelog/77.feature.rst: Language not supported
Comments suppressed due to low confidence (2)

xrayvision/visibility.py:484

  • Directly comparing SkyCoord objects with '!=' may lead to unexpected results due to floating point precision. Consider using SkyCoord's is_equivalent() method or a comparison based on separation.
if self.phase_center != other.phase_center:

xrayvision/transform.py:164

  • [nitpick] The custom attributes 'Tx' and 'Ty' on the SkyCoord object are non-standard and could be confusing. Consider clarifying their purpose or using more conventional attribute names in documentation.
y = generate_xy(m, phase_center.Ty, pixel_size=pixel_size[0])  # type: ignore

Comment on lines +34 to 35
stix_vis.phase_center = SkyCoord(Tx=stix_vis.phase_center[1], Ty=stix_vis.phase_center[0], frame=Projective)

Copy link

Copilot AI Apr 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indexing a SkyCoord object as if it were a sequence may result in an error since phase_center is expected to be a scalar SkyCoord. Use the existing attributes (e.g. phase_center.Tx and phase_center.Ty) instead of indexing.

Suggested change
stix_vis.phase_center = SkyCoord(Tx=stix_vis.phase_center[1], Ty=stix_vis.phase_center[0], frame=Projective)
stix_vis.phase_center = SkyCoord(Tx=stix_vis.phase_center.Tx, Ty=stix_vis.phase_center.Ty, frame=Projective)

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant