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
Is there a particular reason that SI prefixes are disabled for the Angstrom unit?
I am working on a project that prefers to describe the dispersion of a spectrograph in milliangstroms per pixel, and not having this unit is becoming tedious.
I realize the Angstrom is not an SI unit, but I think there is an argument to be made to add at least the milli- prefix.
Welcome to Astropy 👋 and thank you for your first issue!
A project member will respond to you as soon as possible; in the meantime, please double-check the guidelines for submitting issues and make sure you've provided the requested details.
If you feel that this issue has not been responded to in a timely manner, please leave a comment mentioning our software support engineer @embray, or send a message directly to the development mailing list. If the issue is urgent or sensitive in nature (e.g., a security vulnerability) please send an e-mail directly to the private e-mail [email protected].
I do believe this is pretty non-standard, though I also see it is used in some papers, especially related to x-ray spectroscopy.
I'd lean against allowing arbitrary SI units with Angstrom, but I'll let the experts bikeshed over that. However, in the meantime, you can define your own like:
Now you can use mAA in any calculations with units, and it will work as expected. However, if you want to do reductions to units of mÅ it might take a bit more finessing.
I'd lean against allowing arbitrary SI units with Angstrom, but I'll let the experts bikeshed over that.
I don't think this is arbitrary at all, in my experience it is (or historically has been) fairly standard use in any contexts with corresponding spectral resolution. Might perhaps need some justification why we allow one specific SI prefix, but no others (but certainly would not want to open this to abuse like DÅ or cÅ ;-).
I've seen it too, which I think makes enough of us to enable just the milli prefix. @byrdie - would you be willing to make a PR? Just change the angstrom definition in astropy/units/si.py to have the same prefix definition as bar in astropy/units/misc.py.
EDIT: I guess bar is pretty good precedent too - I've never seen any other prefix than milli.
Activity
github-actions commentedon May 17, 2021
Welcome to Astropy 👋 and thank you for your first issue!
A project member will respond to you as soon as possible; in the meantime, please double-check the guidelines for submitting issues and make sure you've provided the requested details.
If you feel that this issue has not been responded to in a timely manner, please leave a comment mentioning our software support engineer @embray, or send a message directly to the development mailing list. If the issue is urgent or sensitive in nature (e.g., a security vulnerability) please send an e-mail directly to the private e-mail [email protected].
embray commentedon May 17, 2021
I do believe this is pretty non-standard, though I also see it is used in some papers, especially related to x-ray spectroscopy.
I'd lean against allowing arbitrary SI units with Angstrom, but I'll let the experts bikeshed over that. However, in the meantime, you can define your own like:
Now you can use
mAAin any calculations with units, and it will work as expected. However, if you want to do reductions to units of mÅ it might take a bit more finessing.dhomeier commentedon May 25, 2021
I don't think this is arbitrary at all, in my experience it is (or historically has been) fairly standard use in any contexts with corresponding spectral resolution. Might perhaps need some justification why we allow one specific SI prefix, but no others (but certainly would not want to open this to abuse like DÅ or cÅ ;-).
mhvk commentedon May 25, 2021
I've seen it too, which I think makes enough of us to enable just the milli prefix. @byrdie - would you be willing to make a PR? Just change the angstrom definition in
astropy/units/si.pyto have the same prefix definition asbarinastropy/units/misc.py.EDIT: I guess
baris pretty good precedent too - I've never seen any other prefix than milli.Update si.py
Added milli-prefix to Angstrom unit.