當前位置: 首頁>>代碼示例>>Python>>正文


Python Map.read方法代碼示例

本文整理匯總了Python中sunpy.map.Map.read方法的典型用法代碼示例。如果您正苦於以下問題:Python Map.read方法的具體用法?Python Map.read怎麽用?Python Map.read使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在sunpy.map.Map的用法示例。


在下文中一共展示了Map.read方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: add_map

# 需要導入模塊: from sunpy.map import Map [as 別名]
# 或者: from sunpy.map.Map import read [as 別名]
    def add_map(self, input_, zorder=None, alpha=1, levels=False):
        """Adds a map to the CompositeMap
        
        Parameters
        ----------
        input_ : {sunpy.map, string}
            Map instance or filepath to map to be added
        zorder : int
            The index to use when determining where the map should lie along
            the z-axis; maps with higher z-orders appear above maps with lower
            z-orders.
        alpha : float
            Opacity at which the map should be displayed. An alpha value of 0
            results in a fully transparent image while an alpha value of 1
            results in a fully opaque image. Values between result in semi-
            transparent images.

        """
        if zorder is None:
            zorder = max([m.zorder for m in self._maps]) + 10
        
        m = Map.read(input_)
        m.zorder = zorder
        m.alpha = alpha
        m.levels = levels
        
        self._maps.append(m)
開發者ID:Waino,項目名稱:sunpy,代碼行數:29,代碼來源:compositemap.py

示例2: __new__

# 需要導入模塊: from sunpy.map import Map [as 別名]
# 或者: from sunpy.map.Map import read [as 別名]
    def __new__(cls, *args, **kwargs):
        """Creates a new Map instance"""
        
        maps = []
        data = []
        headers = []
    
        # convert input to maps
        for item in args:
            if isinstance(item, Map):
                maps.append(item)
            else:
                maps.append(Map.read(item))

        # sort data
        sortby = kwargs.get("sortby", "date")
        if hasattr(cls, '_sort_by_%s' % sortby):
            maps.sort(key=getattr(cls, '_sort_by_%s' % sortby)())

        # create data cube
        for map_ in maps:
            data.append(np.array(map_))
            headers.append(map_._original_header)

        obj = np.asarray(data).view(cls)
        obj._headers = headers

        return obj
開發者ID:mjm159,項目名稱:sunpy,代碼行數:30,代碼來源:mapcube.py

示例3: __new__

# 需要導入模塊: from sunpy.map import Map [as 別名]
# 或者: from sunpy.map.Map import read [as 別名]
    def __new__(cls, red, green, blue, **kwargs):
        headers = []
        data = np.zeros((red.shape[0], red.shape[1], 3), dtype=np.uint8)

        # convert input to maps
        for i, item in enumerate([red, green, blue]):
            if isinstance(item, Map):
                map_ = item
            else:
                map_ = Map.read(item)

            data[:, :, i] = map_
            headers.append(map_.get_header(original=True))

        obj = np.asarray(data).view(cls)
        obj._headers = headers

        return obj
開發者ID:katrienbonte,項目名稱:sunpy,代碼行數:20,代碼來源:rgb_composite.py

示例4: __init__

# 需要導入模塊: from sunpy.map import Map [as 別名]
# 或者: from sunpy.map.Map import read [as 別名]
    def __init__(self, *args):
        self._maps = []
        
        # Default alpha and zorder values
        alphas = [1] * len(args)
        zorders = range(0, 10 * len(args), 10)
        levels = [False] * len(args)
        
        # Parse input Maps/filepaths        
        for i, item in enumerate(args):
            # Parse map
            if isinstance(item, Map):
                m = item
            else:
                m = Map.read(item)
            
            # Set z-order and alpha values for the map
            m.zorder = zorders[i]
            m.alpha = alphas[i]
            m.levels = levels[i]

            # Add map
            self._maps.append(m)
開發者ID:Waino,項目名稱:sunpy,代碼行數:25,代碼來源:compositemap.py


注:本文中的sunpy.map.Map.read方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。