def view(): #_energy_mean,_emin, _emax, _pol_deg, _pol_deg_err, _pol_angle, \ # _pol_angle_err = \ # # numpy.loadtxt(ANALYSIS_FILE_PATH, unpack=True) _mcube = xBinnedModulationCube(MCUBE_FILE_PATH) _mcube.fit() _fit_results = _mcube.fit_results[0] plt.figure('Polarization degree') _mcube.plot_polarization_degree(show=False, color='blue') pol_degree_spline.plot(color='lightgray',label='Model %s corona'%model_type, show=False) plt.figtext(0.2, 0.85,'XIPE %s ks'%(SIM_DURATION/1000.),size=18) #plt.errorbar(_energy_mean, _pol_deg, yerr=_pol_deg_err, color='blue',marker='o') plt.legend() plt.figure('Polarization angle') _mcube.plot_polarization_angle(show=False, color='blue', degree=False) pol_angle_spline.plot(color='lightgray',label='Model %s corona'%model_type, show=False) plt.figtext(0.2, 0.85,'XIPE %s ks'%(SIM_DURATION/1000.),size=18) #plt.errorbar(_energy_mean,_pol_angle, yerr= _pol_angle_err,color='blue',marker='o') plt.legend() plt.figure('MDP %s'%base_name) mdp = _mcube.mdp99 emean = _mcube.emean emin = _mcube.emin emax = _mcube.emax width = (emax-emin)/2. plt.errorbar(emean,mdp,xerr=width, label='MDP99',marker='o',linestyle='--') plt.figtext(0.2, 0.85,'XIPE %s ks'%(SIM_DURATION/1000.),size=18) plt.xlim([1,10]) plt.ylabel('MPD 99 %') plt.xlabel('Energy (keV)') #plt.legend() plt.show()
def plot(): spherical_mcube = xBinnedModulationCube(SPHERICAL_MCUBE_PATH) wedge_mcube = xBinnedModulationCube(WEDGE_MCUBE_PATH) spherical_mcube.fit() wedge_mcube.fit() spherical_fit_results = spherical_mcube.fit_results[0] wedge_fit_results = wedge_mcube.fit_results[0] plt.figure('Polarization degree') spherical_mcube.plot_polarization_degree(show=False, color='blue') pol_degree_spline_spherical.plot(color='lightblue',label='Spherical corona model (40 degree inclination)', show=False) wedge_mcube.plot_polarization_degree(show=False, color='red') pol_degree_spline_wedge.plot(color='lightsalmon',label='Wedge corona model (40 degree inclination)', show=False) plt.figtext(0.2, 0.85,'XIPE %s ks'%((SIM_DURATION*NUM_RUNS)/1000.),size=18) plt.xlim([1,10]) plt.legend() plt.show()