本文整理汇总了Python中sunpy.map.GenericMap.save方法的典型用法代码示例。如果您正苦于以下问题:Python GenericMap.save方法的具体用法?Python GenericMap.save怎么用?Python GenericMap.save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sunpy.map.GenericMap
的用法示例。
在下文中一共展示了GenericMap.save方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: save
# 需要导入模块: from sunpy.map import GenericMap [as 别名]
# 或者: from sunpy.map.GenericMap import save [as 别名]
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: calc_fits
# 需要导入模块: from sunpy.map import GenericMap [as 别名]
# 或者: from sunpy.map.GenericMap import save [as 别名]
print "Calculating temperature values..."
print rank, images.shape, model.shape, parvals.shape, n_vals, n_wlens, x, y, n_params
print [im.max() for im in images]
print model.max(axis=0)
if n_params == 1:
parvals = parvals[:, 0]
temps = calc_fits(images, model, parvals, n_vals, n_wlens, x, y, n_params)
# Convert EM values to log scale if there are any
if temps.shape[2] > 2:
temps[..., 2] = np.log10(temps[..., 2])
if verbose:
print "Done."
# Get data all back in one place and save it
temps = comm.gather(temps, root=0)
if rank == 0:
if verbose:
print len(temps), temps[0].shape
temp = np.zeros(shape=(x, y * size, n_params + 1))
for p in range(size):
mini = (p / size) * temp.shape[1]
maxi = ((p + 1) / size) * temp.shape[1]
temp[:, mini:maxi, :] = temps[p]
if verbose:
print p, mini, maxi, temp[:, mini:maxi, :].shape
temps = temp
if verbose:
print "End ct", temps.shape, temps[..., 0].mean(), temps[..., 1].mean()
tempmap = GenericMap(temps, header)
tempmap.save(path.expanduser("~/CoronaTemps/temporary.fits"))