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

plot function doesn't work for circular apertures #343

Open
mperrin opened this issue May 20, 2024 · 1 comment
Open

plot function doesn't work for circular apertures #343

mperrin opened this issue May 20, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@mperrin
Copy link
Collaborator

mperrin commented May 20, 2024

Some HST apertures are defined as circles. The Aperture.plot function doesn't know what to do with these:

cos_aperture = pysiaf.Siaf('hst').apertures['LNPSA']
cos_aperture.plot()

yields:

---------------------------------------------------------------------------
UnboundLocalError                         Traceback (most recent call last)
Cell In[8], line 3
      1 cos_aperture = pysiaf.Siaf('hst').apertures['LNPSA']
----> 3 cos_aperture.plot()

File ~/Dropbox (Personal)/Documents/software/git/pysiaf/pysiaf/aperture.py:666, in Aperture.plot(self, frame, label, ax, title, units, show_frame_origin, mark_ref, fill, fill_color, fill_alpha, label_rotation, **kwargs)
    663     ax.set_xlabel('X pixels ({0})'.format(frame))
    664     ax.set_ylabel('Y pixels ({0})'.format(frame))
--> 666 x, y = self.corners(frame, rederive=False)
    667 x2, y2 = self.closed_polygon_points(frame, rederive=False)
    669 if units.lower() == 'arcsec':

File ~/Dropbox (Personal)/Documents/software/git/pysiaf/pysiaf/aperture.py:1792, in HstAperture.corners(self, to_frame, rederive)
   1789     y_Idl = np.array([self.v1y, self.v2y, self.v3y, self.v4y])
   1790     corners = SiafCoordinates(x_Idl, y_Idl, 'idl')
-> 1792 return self.convert(corners.x, corners.y, corners.frame, to_frame)

UnboundLocalError: cannot access local variable 'corners' where it is not associated with a value
@mperrin mperrin added the bug Something isn't working label May 20, 2024
@mperrin
Copy link
Collaborator Author

mperrin commented May 20, 2024

Oh I just realized this is a duplicate of #336 reported by @Witchblade101

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant