Skip to content

Commit

Permalink
Add NormalizeRadiusEditor class to normalize the radius of a sunpy map
Browse files Browse the repository at this point in the history
  • Loading branch information
nkasmanoff committed Dec 17, 2023
1 parent fac7a23 commit 42dac94
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions helio_tools/_src/editors/editors.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,27 @@ def call(self, data, **kwargs):


class NormalizeRadiusEditor(Editor):
"""
Normalizes the radius of a sunpy map to a target value. Optionally crops the map to the specified resolution.
Parameters
----------
resolution : `int`
The target resolution of the map.
padding_factor : `float`
The padding factor for the solar radius. Defaults to 0.1.
crop : `bool`
Whether to crop the map to the specified resolution. Defaults to True.
Usage:
>>> import helio_tools as ht
>>> editor = ht.NormalizeRadiusEditor(resolution=512)
>>> s_map = editor(s_map)
"""

def __init__(self, resolution, padding_factor=0.1, crop=True, **kwargs):
self.padding_factor = padding_factor
self.resolution = resolution
Expand Down

0 comments on commit 42dac94

Please # to comment.