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

add spat unit of solid angle #10726

Merged
merged 2 commits into from
Sep 11, 2020
Merged

add spat unit of solid angle #10726

merged 2 commits into from
Sep 11, 2020

Conversation

ntessore
Copy link
Contributor

Description

This pull request is to address #10721. It adds the spat unit (abbreviation sp, apparently) where 1 spat corresponds to 4pi steradian, i.e. the solid angle of the entire sphere.

That makes it possible to convert fsky sky fractions to solid angle transparently:

survey_area = fsky*u.spat

And also to convert solid angles to sky fractions:

sky = survey_area.to_value(u.spat)

Fixes #10721

@astropy-bot astropy-bot bot added the units label Sep 11, 2020
@pllim pllim added this to the v4.2 milestone Sep 11, 2020
@pllim pllim requested a review from mhvk September 11, 2020 21:00
@pllim
Copy link
Member

pllim commented Sep 11, 2020

Hello and thank you! Please add a change log under "new features" under the given milestone.

@mhvk , does this need a "what's new"?

Copy link
Contributor

@mhvk mhvk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super! And funny to see that in the previous PR for cycle, we didn't seem to see a need to include it even in CHANGES.rst - we have made some progress! Don't think it is necessary to add to what's new - I hope units are such that when people want something, it is already there, and, if not, they'll add it (like here). Thanks, @ntessore!

@mhvk mhvk merged commit ed9ec69 into astropy:master Sep 11, 2020
@ntessore ntessore deleted the units-spat branch September 11, 2020 23:10
@ntessore
Copy link
Contributor Author

Thanks everyone for the quick help! That was fun

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add the Spat unit for solid angles
3 participants