field.py 文件源码

python
阅读 69 收藏 0 点赞 0 评论 0

项目:synthesizAR 作者: wtbarnes 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号