l = aware_utils.get_file_list(imgloc, 'fts') # # Calculate the running difference images # accum = info[example]["accum"] mc = Map(aware_utils.accumulate_from_file_list(l, accum=accum), cube=True) rd = mapcube_tools.running_difference(mc) # # Calculate the percentage base difference # pbd_location = os.path.expanduser(os.path.join(pbdloc, info[example]["pbd"])) base = Map(pbd_location).superpixel((4,4)) base = Map(base.data / base.exposure_time, base.meta) pbd = Map(mapcube_tools.base_difference(mc, base=base, fraction=True)[1:], cube=True) newpbd = [] for m in pbd: m.data[np.isnan(m.data)] = 0.0 m.data[np.isinf(m.data)] = 0.0 newpbd.append(Map(m.data, m.meta)) pbd = Map(newpbd, cube=True) # Get a nicely formatted time time = '\n{date:{tmf}}'.format(date=parse_time(newrd.date), tmf=TIME_FORMAT) # # Calculate the running difference persistence images # rdpi = mapcube_tools.running_difference(mapcube_tools.persistence(mc))
print('Accumulating AIA data.') mc = euv_wave_data['finalmaps'] mc = mapcube_tools.accumulate(mapcube_tools.superpixel(mc, spatial_summing), temporal_summing) for differencing_type in differencing_types: if differencing_type == 'RD': # running difference print('Calculating the running difference.') mc_rd = mapcube_tools.running_difference(mc) new = deepcopy(mc_rd[index]) new.plot_settings['cmap'] = cm.RdGy if differencing_type == 'PBD': # fraction base difference print('Calculating the base difference.') mc_pbd = mapcube_tools.base_difference(mc, fraction=True) new = deepcopy(mc_pbd[index+1]) new.plot_settings['norm'].vmax = 0.5 new.plot_settings['norm'].vmin = -0.5 new.plot_settings['cmap'] = cm.RdGy if differencing_type == 'RDP': # running difference persistence images print('Calculating the running difference persistence images.') mc_rdp = mapcube_tools.running_difference(mapcube_tools.persistence(mc)) new = deepcopy(mc_rdp[index]) new.plot_settings['cmap'] = cm.gray_r maps[differencing_type] = new rd_all_vmax = np.max([maps['RD'].plot_settings['norm'].vmax,
def base_difference(self): return self.__init__(mapcube_tools.base_difference(self.mc))