本文整理汇总了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)
示例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
示例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
示例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)