def _process_map(self, tmp_map, crop=None, resample=None):
"""
Rotate, crop and resample map if needed. Can do any other needed processing here too.
Parameters
----------
map : `~sunpy.map.Map`
Original HMI map
crop : `tuple` `[bottom_left_corner,top_right_corner]`, optional
The lower left and upper right corners of the cropped map. Both should be of type
`~astropy.units.Quantity` and have the same units as `map.xrange` and `map.yrange`
resample : `~astropy.units.Quantity`, `[new_xdim,new_ydim]`, optional
The new x- and y-dimensions of the resampled map, should have the same units as
`map.dimensions.x` and `map.dimensions.y`
"""
tmp_map = tmp_map.rotate()
if crop is not None:
bottom_left = SkyCoord(*crop[0], frame=tmp_map.coordinate_frame)
top_right = SkyCoord(*crop[1], frame=tmp_map.coordinate_frame)
tmp_map = tmp_map.submap(bottom_left, top_right)
if resample is not None:
tmp_map = tmp_map.resample(resample, method='linear')
return tmp_map
评论列表
文章目录