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)
 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)
Beispiel #3
0
        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"))