def objfunc(logim): Frames = np.exp(logim.reshape((-1, N_pixel, N_pixel))) if entropy == "simple": s = np.sum(-mx.ssimple(Frames[i].ravel(), nprior_List[i]) for i in range(N_frame)) elif entropy == "l1": s = np.sum(-mx.sl1(Frames[i].ravel(), nprior_List[i]) for i in range(N_frame)) elif entropy == "gs": s = np.sum(-mx.sgs(Frames[i].ravel(), nprior_List[i]) for i in range(N_frame)) elif entropy == "tv": s = np.sum(-mx.stv(Frames[i].ravel(), Prior_List[0].xdim, Prior_List[0].ydim) for i in range(N_frame)) chisq_total = np.sum(mx.chisq_bi(Frames[i].ravel(), A_List[i], bi_List[i], sigma_List[i]) for i in range(N_frame))/N_frame s_dynamic = dynamic_regularizer(Frames, gauss) t = np.sum( [ gamma * (np.sum(Frames[i].ravel()) - Flux_List[i])**2 for i in range(N_frame)] )/N_frame return s + beta * s_dynamic + alpha * (chisq_total - 1.) + t
def objfunc(logim): Frames = np.exp(logim.reshape((-1, N_pixel, N_pixel))) if entropy == "simple": s = np.sum(-mx.ssimple(Frames[i].ravel(), nprior_List[i]) for i in range(N_frame)) elif entropy == "l1": s = np.sum(-mx.sl1(Frames[i].ravel(), nprior_List[i]) for i in range(N_frame)) elif entropy == "gs": s = np.sum(-mx.sgs(Frames[i].ravel(), nprior_List[i]) for i in range(N_frame)) elif entropy == "tv": s = np.sum(-mx.stv(Frames[i].ravel(), Prior_List[0].xdim, Prior_List[0].ydim) for i in range(N_frame)) chisq_total = np.sum(mx.chisq(Frames[i].ravel(), A_List[i], vis_List[i], sigma_List[i]) for i in range(N_frame))/N_frame #print ("chisq_total ",chisq_total) s_dynamic = dynamic_regularizer(Frames, gauss) #print ("s_dynamic ",s_dynamic) #return s_dynamic return s + beta * s_dynamic + alpha * (chisq_total - 1.)