Skip to content

Bugfix#409

Open
sanjibs wants to merge 2 commits into
spacetelescope:mainfrom
sanjibs:bugfix
Open

Bugfix#409
sanjibs wants to merge 2 commits into
spacetelescope:mainfrom
sanjibs:bugfix

Conversation

@sanjibs
Copy link
Copy Markdown

@sanjibs sanjibs commented Jan 15, 2026

This just fixes the bugs

(x_idl, y_idl) correspond to (y, z) components of the unit vector respectively.
Did not work if any element of  x_rad, y_rad, z_rad was zero.
Copy link
Copy Markdown
Collaborator

@tonysohn tonysohn left a comment

Choose a reason for hiding this comment

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

I approve this change. Found out the same bug while working with @Skyhawk172 .

Copy link
Copy Markdown
Collaborator

@tonysohn tonysohn left a comment

Choose a reason for hiding this comment

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

Clarification: Approve both changes included in this PR.

@tonysohn
Copy link
Copy Markdown
Collaborator

tonysohn commented Jan 20, 2026

Clarification: Approve both changes included in this PR.

Sorry, I need to un-approve this PR since there needs to be some changes in the submitted aperture.py. I left my reviews below.

Copy link
Copy Markdown
Collaborator

@tonysohn tonysohn left a comment

Choose a reason for hiding this comment

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

I found two places that need to be changed.

Comment thread pysiaf/aperture.py
# then apply 3D rotation matrix to tel
unit_vector_idl = rotations.unit_vector_from_cartesian(x=x_idl*u.arcsec, y=y_idl*u.arcsec)
unit_vector_idl = rotations.unit_vector_from_cartesian(y=x_idl*u.arcsec, z=y_idl*u.arcsec)
unit_vector_idl[1] = aperture.VIdlParity * unit_vector_idl[1]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

aperture.VIdlParity should be self.VIdlParity

Comment thread pysiaf/aperture.py
if output_coordinates == 'cartesian':
x_idl_arcsec, y_idl_arcsec = unit_vector_idl[0] * u.rad.to(u.arcsec), unit_vector_idl[
1] * u.rad.to(u.arcsec)
unit_vector_idl[1] = aperture.VIdlParity * unit_vector_idl[1]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

aperture.VIdlParity should be self.VIdlParity

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@sanjibs Would you be able to change these and resubmit the PR? (Sorry, I'm not familiar enough to do this from my end).

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.

2 participants