You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR adds two equivalencies, intended for converting from angular scales to either focal plane lengths or pixels on detectors. To see them in action check out the changes to equivalencies.rst
Looks good, but these are very simple indeed. Was there a particular need that just (pix * platescale).to(u.arcsec) didn't quite work? (I don't mind having it, but ask in part since I've found that the only one I ever use is dimensionless_angles()).
@mhvk - The use case that prompted me in the first case was an ipython notebook where I was constantly doing things like ((10*u.arcsec)*platescale).to(u.pixel) and of course getting an error because it actually was supposed to be /platescale. Then I would correct myself but later do ((10*u.pixel)/platescale).to(u.arcmin) and then get the other kind of error. That's when it struck me that it really is an "equivalency" in the sense that there's no reason for me to remember whether its angle/pixel or pixel/angle. So it seemed perfect for this because it does what equivalencies are supposed to do: make it easier to do unit transformations with minimal mental overhead.
The other reason this is useful is that it allows using set_enabled_equivalencies - that's particularly useful here because a notebook will often be all about analyzing data from a particular telescope/instrument, so you can just add that at the top and always have the pixel<->angle equivalency available for immediate use. I avoid set_enabled_equivalencies in any situation where it's not clear what's desired, but here I see no other reason why you would want to convert pixel to/from angle.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds two equivalencies, intended for converting from angular scales to either focal plane lengths or pixels on detectors. To see them in action check out the changes to
equivalencies.rst