本文整理汇总了Python中sunpy.map.GenericMap类的典型用法代码示例。如果您正苦于以下问题:Python GenericMap类的具体用法?Python GenericMap怎么用?Python GenericMap使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了GenericMap类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: save
def save(self):
date = sunpy.time.parse_time(self.date)
error = sys('touch '+self.maps_dir+'data/{:%Y/%m/%d/} > shelloutput.txt'.format(date))
if error != 0:
sys('{0}{1:%Y}; {0}{1:%Y/%m}; {0}{1:%Y/%m/%d} > shelloutput.txt'.format(
'mkdir '+self.maps_dir+'data/', date))
GenericMap.save(self, self.maps_dir+'data/{:%Y/%m/%d/%Y-%m-%dT%H:%M:%S}.fits'.format(date), clobber=True)
示例2: __init__
def __init__(self, data, header, **kwargs):
GenericMap.__init__(self, data, header, **kwargs)
self.meta['CUNIT1'] = self.meta['CUNIT1'].lower()
self.meta['CUNIT2'] = self.meta['CUNIT2'].lower()
# Fill in some missing or broken info
datestr = "{date}T{time}".format(date=self.meta.get('date-obs',
self.meta.get('date_obs')
),
time=self.meta.get('time-obs',
self.meta.get('time_obs')
)
)
self.meta['date-obs'] = datestr
# If non-standard Keyword is present, correct it too, for compatibility.
if 'date_obs' in self.meta:
self.meta['date_obs'] = self.meta['date-obs']
self.meta['wavelnth'] = np.nan
self.meta['waveunit'] = 'nm'
self._nickname = self.instrument + "-" + self.detector
self.plot_settings['cmap'] = cm.get_cmap('soholasco{det!s}'.format(det=self.detector[1]))
self.plot_settings['norm'] = ImageNormalize(stretch=PowerStretch(0.5))
示例3: __init__
def __init__(self, data, header, **kwargs):
GenericMap.__init__(self, data, header, **kwargs)
self.meta['CUNIT1'] = self.meta.get('CUNIT1', 'arcsec').lower()
self.meta['CUNIT2'] = self.meta.get('CUNIT2', 'arcsec').lower()
# Fill in some missing or broken info
# Test if change has already been applied
if 'T' not in self.meta['date-obs']:
datestr = "{date}T{time}".format(date=self.meta.get('date-obs',
self.meta.get('date_obs')
),
time=self.meta.get('time-obs',
self.meta.get('time_obs')
)
)
self.meta['date-obs'] = datestr
# If non-standard Keyword is present, correct it too, for compatibility.
if 'date_obs' in self.meta:
self.meta['date_obs'] = self.meta['date-obs']
self._nickname = self.instrument + "-" + self.detector
self.plot_settings['cmap'] = plt.get_cmap('soholasco{det!s}'.format(det=self.detector[1]))
self.plot_settings['norm'] = ImageNormalize(stretch=source_stretch(self.meta, PowerStretch(0.5)))
示例4: __init__
def __init__(self, data, header, **kwargs):
GenericMap.__init__(self, data, header, **kwargs)
# Fill in some missing info
self.meta['detector'] = "AIA"
self._nickname = self.detector
self.plot_settings['cmap'] = plt.get_cmap(self._get_cmap_name())
self.plot_settings['norm'] = ImageNormalize(stretch=source_stretch(self.meta, AsinhStretch(0.01)))
示例5: __init__
def __init__(self, data, header, **kwargs):
GenericMap.__init__(self, data, header, **kwargs)
self._name = self.observatory + " " + self.detector + " " + str(self.measurement)
self._nickname = "{0}-{1}".format(self.detector, self.observatory[-1])
self.cmap = cm.get_cmap('stereocor%s' % self.detector[-1])
示例6: __init__
def __init__(self, data, header, **kwargs):
# Assume pixel units are arcesc if not given
header['cunit1'] = header.get('cunit1', 'arcsec')
header['cunit2'] = header.get('cunit2', 'arcsec')
GenericMap.__init__(self, data, header, **kwargs)
self.meta['detector'] = "SJI"
self.meta['waveunit'] = "Angstrom"
self.meta['wavelnth'] = header['twave1']
示例7: __init__
def __init__(self, data, header, **kwargs):
GenericMap.__init__(self, data, header, **kwargs)
# Fill in some missing or broken info
self.meta['detector'] = "MDI"
self._fix_dsun()
self._name = self.observatory + " " + self.detector
self._nickname = self.detector + " " + self.measurement
示例8: __init__
def __init__(self, data, header, **kwargs):
GenericMap.__init__(self, data, header, **kwargs)
self.meta["detector"] = "HMI"
# self.meta['instrme'] = "HMI"
# self.meta['obsrvtry'] = "SDO"
self._name = self.detector + " " + str(self.measurement)
self._nickname = self.detector
示例9: __init__
def __init__(self, data, header, **kwargs):
GenericMap.__init__(self, data, header, **kwargs)
# Fill in some missing info
self.meta['detector'] = "AIA"
# self.meta['instrme'] = "AIA"
self._nickname = self.detector
self._name = self.detector + " " + str(self.measurement)
self.cmap = cm.get_cmap(self._get_cmap_name())
示例10: plot
def plot(self, vmin=None, vmax=None, *args, **kwargs):
mean = np.nanmean(self.data, dtype=np.float64)
std = np.nanstd(self.data, dtype=np.float64)
if vmin is None:
vmin = mean - (2.0 * std)
if vmax is None:
vmax = mean + (2.0 * std)
GenericMap.plot(self, vmin=vmin, vmax=vmax, *args, **kwargs)
return
示例11: __init__
def __init__(self, data, header, **kwargs):
GenericMap.__init__(self, data, header, **kwargs)
# Fill in some missing info
self.meta['detector'] = "AIA"
# self.meta['instrme'] = "AIA"
self._nickname = self.detector
self.cmap = cm.get_cmap('sdoaia%d' % self.wavelength)
示例12: __init__
def __init__(self, data, header, **kwargs):
GenericMap.__init__(self, data, header, **kwargs)
self._nickname = "{0}-{1}".format(self.detector, self.observatory[-1])
self.plot_settings['cmap'] = plt.get_cmap('stereohi{det!s}'.format(det=self.detector[-1]))
self.plot_settings['norm'] = ImageNormalize(stretch=source_stretch(self.meta, PowerStretch(0.25)))
# Try to identify when the FITS meta data does not have the correct
# date FITS keyword
if ('date_obs' in self.meta) and not('date-obs' in self.meta):
self.meta['date-obs'] = self.meta['date_obs']
示例13: __init__
def __init__(self, data, header, **kwargs):
GenericMap.__init__(self, data, header, **kwargs)
# It needs to be verified that these must actually be set and
# are not already in the header.
self.meta['detector'] = "SWAP"
# self.meta['instrme'] = "SWAP"
self.meta['obsrvtry'] = "PROBA2"
self._nickname = self.detector
self.plot_settings['cmap'] = cm.get_cmap(name='sdoaia171')
示例14: __init__
def __init__(self, data, header, **kwargs):
GenericMap.__init__(self, data, header, **kwargs)
# It needs to be verified that these must actually be set and are not
# already in the header.
self.meta["detector"] = "TRACE"
self.meta["obsrvtry"] = "TRACE"
self._nickname = self.detector
# Colour maps
self.plot_settings["cmap"] = cm.get_cmap("trace" + self.measurement)
self.plot_settings["norm"] = colors.LogNorm()
示例15: __init__
def __init__(self, data, header, **kwargs):
GenericMap.__init__(self, data, header, **kwargs)
# It needs to be verified that these must actually be set and are not
# already in the header.
self.meta['detector'] = "TRACE"
self.meta['obsrvtry'] = "TRACE"
self._nickname = self.detector
# Colour maps
self.plot_settings['cmap'] = plt.get_cmap('trace' + str(self.meta['WAVE_LEN']))
self.plot_settings['norm'] = ImageNormalize(stretch=source_stretch(self.meta, LogStretch()))