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

Update handling of solar radius in sunpy.map #5416

Merged
merged 4 commits into from Jul 21, 2021
Merged

Conversation

dstansby
Copy link
Member

This cleans up handling of rsun_obs and rsun_meters so:

@dstansby dstansby added the No Backport A PR that isn't to be backported to any release branch. (To be used as a flag to other maintainers) label Jun 21, 2021
@dstansby dstansby requested review from a team as code owners June 21, 2021 12:36
@dstansby dstansby added this to the 3.1 milestone Jun 21, 2021
@@ -0,0 +1,3 @@
`sunpy.map.GenericMap.rsun_meters` now uses `sunpy.map.GenericMap.rsun_obs`
as a fallback to calculate the radial distance if RSUN_REF metadata isn't
Copy link
Member

Choose a reason for hiding this comment

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

"radial distance" is potentially confusing, since a reader may think you mean the Sun-observer distance (which is the radius in HeliographicStonyhurst).

Copy link
Member Author

Choose a reason for hiding this comment

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

👍 , I also changed the property docstring slightly, and went with "assumed radius of observed emission". Other suggestions welcome.

@@ -70,6 +70,11 @@ def _angular_radius(sol_radius, distance):
return Angle(solar_semidiameter_rad.to(u.arcsec))


@u.quantity_input
def _radius(angular_radius: u.arcsec, distance: u.m):
Copy link
Member

Choose a reason for hiding this comment

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

I suggest being more verbose in the name of this function, e.g., _physical_radius_from_angular_radius()

Copy link
Member Author

Choose a reason for hiding this comment

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

👍 - I went with _radius_from_angular_radius, but happy to go more explicit again and put physical at the front.

@dstansby dstansby force-pushed the rsun branch 2 times, most recently from 9fbbe5b to 360ad40 Compare June 21, 2021 14:02
@nabobalis nabobalis removed this from the 3.1 milestone Jun 22, 2021
@dstansby dstansby force-pushed the rsun branch 3 times, most recently from 70679fd to b7306d1 Compare June 22, 2021 15:47
@pep8speaks
Copy link

pep8speaks commented Jun 22, 2021

Hello @dstansby! Thanks for updating this PR.

Line 123:13: E704 multiple statements on one line (def)

Comment last updated at 2021-07-10 11:33:09 UTC

@nabobalis nabobalis added Needs Review Needs reviews before merge map Affects the map submodule labels Jun 23, 2021
Copy link
Member

@wtbarnes wtbarnes left a comment

Choose a reason for hiding this comment

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

Minor wording nitpicks

sunpy/map/mapbase.py Show resolved Hide resolved
sunpy/map/mapbase.py Show resolved Hide resolved
sunpy/map/mapbase.py Show resolved Hide resolved
@nabobalis nabobalis removed the request for review from a team July 10, 2021 11:32
@dstansby dstansby removed the Needs Review Needs reviews before merge label Jan 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
map Affects the map submodule No Backport A PR that isn't to be backported to any release branch. (To be used as a flag to other maintainers)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move solar angular radius assumption from warning to log.debug?
5 participants