-
Notifications
You must be signed in to change notification settings - Fork 29
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
Add angular units #19
Comments
Thank you for this request. I made a first implementation in the branch angular. There is a new dimension Here is how it looks like: Please let me know if this addresses your issue. If so, I will merge the branch and make a new release. |
What's about using the pint library to manage the units and prefixes? |
@ericpre Regarding using pint, could you explain a bit more what you had in mind? I am not sure I would like to add a dependency to the project for something as simple as defining the conversion factor between units. While pint could be used to discover possible units within a unit group (e.g. |
This was a quick suggestion and I haven't thought properly about it but I find it convenient to use! I don't have anything particular in mind other than it is very convenient to get the appropriate prefix and a nice formatting, for example: from pint import UnitRegistry
ureg = UnitRegistry()
length = 1550 * ureg.nm
print(f'{length.to_compact():~}') Pint does more than what is needed here but it is pure python library and has no dependency, so it does not cost much to add it as dependencies! |
Code merged. Please re-open if it doesn't address the original issue. |
It would be very useful for astronomers to have a scale bar showing angular scales such as degree (°), arcmin (') and arcsec ('').
For example, this can be done by adding the so-called
pixel scale
in the units of arc seconds per pixel (or even more available units) as an input. For examplepixel scale = 0.2
implies that each pixel spans 0.2 arcsec. Here is the best I could do with the current version ofmatplotlib-scalebar
.The text was updated successfully, but these errors were encountered: