ref_SDI = pca.pca(np.mean(simple_hypercube_2, axis=0) / ap.exposure_time, angle_list=np.zeros((len(diff_cube[0]))), scale_list=scale_list, mask_center_px=None) # quicklook_im(tar_SDI, logAmp=True) # quicklook_im(ref_SDI, logAmp=True) # quicklook_im(tar_SDI-ref_SDI, logAmp=True) cube.append(Lmap) cube.append(BBmap) cube.append(SDI) # cube.append(tar_SDI-ref_SDI) indep_images(cube, logAmp=True, vmins=[0.01, 1, 10], vmaxs=[6, 6, 1e3], annos=['BB DSI', 'BB Sim DSI', 'SDI'], titles=['$I_\mathrm{L}$', '$I_\mathrm{L}$', '$I$']) iop.hyperFile = iop.datadir + '/noWnoRollHyperWcomp1000cont_Aug_1st.pkl' #5 simple_hypercube = read.get_integ_hypercube(plot=False) #/ap.numframes wsamples = np.linspace(tp.band[0], tp.band[1], tp.nwsamp) # scale_list = tp.band[0] / wsamples scale_list = wsamples / tp.band[0] angle_list = np.zeros((tp.nwsamp)) print np.mean(simple_hypercube, axis=0).shape static_psf = pca.pca(np.mean(simple_hypercube, axis=0), angle_list=angle_list, scale_list=scale_list, mask_center_px=None,
# iop.hyperFile = iop.datadir + 'noWnoRollHyperWcomp1000cont_Aug_2ndMKIDs2.pkl'#5 simple_hypercube_2 = read.get_integ_hypercube(plot=False) #/ap.numframes loop_frames(simple_hypercube_1[::10, 0], logAmp=True) loop_frames(simple_hypercube_2[:, 0], logAmp=True) diff_cube = simple_hypercube_1[2:] - simple_hypercube_2[2:] loop_frames(diff_cube[:, 0], logAmp=False) # quicklook_im(np.mean(diff_cube[:,0],axis=0), logAmp=False) quicklook_im(np.mean(diff_cube[:, 0], axis=0), logAmp=True) quicklook_im(np.median(diff_cube[:, 0], axis=0), logAmp=True) # LCcube = np.transpose(diff_cube, (2, 3, 0, 1)) algo_dict = {'thresh': 0} Dmap = Analysis.stats.get_Dmap(LCcube, algo_dict['thresh']) # DSI indep_images([Dmap], vmins=[0.01], vmaxs=[0.5], logAmp=True) #SDI +DSI iop.hyperFile = iop.datadir + '/noWnoRollHyperWcomp1000cont_Aug_1st.pkl' #5 simple_hypercube = read.get_integ_hypercube(plot=False) #/ap.numframes wsamples = np.linspace(tp.band[0], tp.band[1], tp.nwsamp) # scale_list = tp.band[0] / wsamples scale_list = wsamples / tp.band[0] angle_list = np.zeros((tp.nwsamp)) print np.mean(simple_hypercube, axis=0).shape static_psf = pca.pca(np.mean(simple_hypercube, axis=0), angle_list=angle_list, scale_list=scale_list, mask_center_px=None, full_output=True)
# print binned # hist, bins = np.histogram(binned, bins=range(0, int(np.max(binned)) + 1)) # plt.plot(bins[:-1], hist) # plt.show() LCmap = np.transpose(bunch_hypercube[:, 0]) SSD_maps = Analysis.stats.get_Iratio(LCmap, xlocs, ylocs, None, None, None) SSD_maps = np.array(SSD_maps)[:-1] # # SSD_maps[:2] /= star_phot # # SSD_maps[2] /= SSD_starphot # SSD_maps #/= star_phot #vmins = [2e-11, 2e-8, 1e-12], vmaxs = [5e-7, 1.5e-7, 1e-6] indep_images( SSD_maps, logAmp=True, titles=[r' $I_C / I^{*}$', r' $I_S / I^{*}$', r' $I_r / I^{*}$'], annos=['Deterministic', 'Random', 'Beam Ratio']) print 'here' # quicklook_im(bunch_hypercube[0,0]) ap.exposure_time = 1 stacked = read.take_exposure(bunch_hypercube) quicklook_im(stacked[0, 0]) from statsmodels.tsa.stattools import acovf, acf, ccf mask = Analysis.phot.aperture(64, 64, 1) aper_idx = np.where(mask) print aper_idx # quicklook_im(mask)
axes[0].plot(rad_samp,thruput) for noise in plotdata[:,1]: axes[1].plot(rad_samp,noise) for cont in plotdata[:,2]: axes[2].plot(rad_samp,cont) for ax in axes: ax.set_yscale('log') ax.set_xlabel('Radial Separation') ax.tick_params(direction='in',which='both', right=True, top=True) axes[0].set_ylabel('Throughput') axes[1].set_ylabel('Noise') axes[2].set_ylabel('5$\sigma$ Contrast') axes[2].legend(['Fast','Med','Slow']) # plt.show() indep_images(maps, logAmp=True) plt.show() # Plot just contrast curves # rad_samp = np.linspace(0, tp.platescale / 1000. * (plotdata.shape[2]-6), plotdata.shape[2]-6) rad_samp = np.linspace(0, tp.platescale / 1000. * 100, plotdata.shape[2]) fig, axes = plt.subplots(nrows=1, ncols=1, figsize=(6, 6)) for cont in plotdata[:, 2]: # dprint((len(cont[:-6]), plotdata.shape[2]-6)) axes.plot(rad_samp, cont, '-') # axes.plot(rad_samp[:-3], cont[:-9], '-o') # axes.plot(rad_samp[-4:-2], cont[-10:-8], '--') axes.plot([0.4, 0.65, 0.9], [1e-4,1e-4,1e-4], 'o') axes.set_yscale('log') axes.set_xlabel('Radial Separation') axes.tick_params(direction='in',which='both', right=True, top=True)