本文整理匯總了Python中sunpy.map.Map.save方法的典型用法代碼示例。如果您正苦於以下問題:Python Map.save方法的具體用法?Python Map.save怎麽用?Python Map.save使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類sunpy.map.Map
的用法示例。
在下文中一共展示了Map.save方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: save
# 需要導入模塊: from sunpy.map import Map [as 別名]
# 或者: from sunpy.map.Map import save [as 別名]
def save(self):
date = sunpy.time.parse_time(self.date)
if not path.exists(self.maps_dir):
makedirs(self.maps_dir)
fname = path.join(self.maps_dir,
'{:%Y-%m-%dT%H_%M_%S}.fits'.format(date))
alldata = np.zeros((self.shape[0], self.shape[1], self.n_params+1))
alldata[..., 0] = self.data
if self.n_params != 1:
fname = fname.replace('.fits', '_full.fits')
alldata[..., 1] = self.dem_width
alldata[..., 2] = self.emission_measure
alldata[..., -1] = self.goodness_of_fit
outmap = Map(alldata, self.meta.copy())
outmap.save(fname, clobber=True)
示例2: Map
# 需要導入模塊: from sunpy.map import Map [as 別名]
# 或者: from sunpy.map.Map import save [as 別名]
emiss = Map(emission[wl, :, w, :].copy(), mapmeta)
emiss.cmap = sunpy.cm.get_cmap('sdoaia{}'.format(wlength))
emiss.meta['naxis1'] = emiss.shape[1]
emiss.meta['naxis2'] = emiss.shape[0]
#emiss.meta['cdelt1'] = widths[1] - widths[0]
emiss.meta['cdelt1'] = heights[1] - heights[0] #np.log10(heights[1]) - np.log10(heights[0])
emiss.meta['cdelt2'] = temps[1] - temps[0]
#emiss.meta['crval1'] = widths[0]
emiss.meta['crval1'] = heights[0] #np.log10(heights[0])
emiss.meta['crval2'] = temps[0]
emiss.meta['crpix1'] = 0.5
emiss.meta['crpix2'] = 0.5
if wlength == '94': wlength = '094'
fits_dir = path.join(CThome, 'data', 'synthetic', wlength)
if not path.exists(fits_dir): makedirs(fits_dir)
emiss.save(path.join(fits_dir, 'model.fits'), clobber=True)
#print '----', emission[2, :, :, :].min(), emission[2, :, :, :].max()
#print '------', emission[2, :, w, :].min(), emission[2, :, w, :].max()
emiss.data /= emission[2, :, w, :]
#print '--------', emiss.min(), emiss.max()
ax = fig.add_subplot(1, 6, wl+1)
emiss.plot(aspect='auto', vmin=emiss.min(), vmax=emiss.max())
plt.title('{}'.format(wlength))
plt.xlabel('Input EM')
plt.ylabel('Input log(T)')
plt.colorbar()
#fig.gca().add_artist(rect)
plt.axvline(20.0, color='white')
plt.axvline(35.0, color='white')
plt.axhline(5.6, color='white')
plt.axhline(7.0, color='white')