spacetelescope / webbpsf

James Webb Space Telescope PSF simulation tool
https://webbpsf.readthedocs.io
BSD 3-Clause "New" or "Revised" License
115 stars 61 forks source link

bug fix an edge case for switching MIRI apertures #843

Closed mperrin closed 3 months ago

mperrin commented 4 months ago

Fix an edge case in some of the pixel scale checking code which happens when changing apertures.

Currently, can't switch from a SLIT type aperture back to a regular aperture. The following will fail:

miri = webbpsf.MIRI()
miri.set_position_from_aperture_name("MIRIM_SLIT")
miri.set_position_from_aperture_name('MIRIM_FULL')

With this PR, the above works without error.

pep8speaks commented 4 months ago

Hello @mperrin, Thank you for updating !

Line 10:1: E402 module level import not at top of file Line 14:1: E402 module level import not at top of file Line 16:1: E731 do not assign a lambda expression, use a def Line 17:1: E731 do not assign a lambda expression, use a def Line 18:1: E731 do not assign a lambda expression, use a def Line 20:1: E731 do not assign a lambda expression, use a def

Line 306:126: E501 line too long (148 > 125 characters) Line 760:1: E266 too many leading '#' for block comment Line 983:126: E501 line too long (133 > 125 characters) Line 995:126: E501 line too long (145 > 125 characters) Line 996:126: E501 line too long (133 > 125 characters) Line 999:24: E271 multiple spaces after keyword Line 1016:126: E501 line too long (134 > 125 characters) Line 1412:126: E501 line too long (200 > 125 characters) Line 1567:126: E501 line too long (131 > 125 characters) Line 1802:13: E731 do not assign a lambda expression, use a def Line 1804:13: E731 do not assign a lambda expression, use a def Line 1823:9: E266 too many leading '#' for block comment Line 1854:9: E266 too many leading '#' for block comment Line 1855:9: E266 too many leading '#' for block comment Line 1917:126: E501 line too long (127 > 125 characters) Line 2069:126: E501 line too long (141 > 125 characters) Line 2355:126: E501 line too long (130 > 125 characters) Line 2399:126: E501 line too long (130 > 125 characters) Line 2409:126: E501 line too long (141 > 125 characters) Line 2433:126: E501 line too long (130 > 125 characters)

Comment last updated at 2024-05-12 04:02:49 UTC