diff --git a/plots/IC5063_x3nl030/103GHz_overplot_forced.png b/plots/IC5063_x3nl030/103GHz_overplot_forced.png index b61926f..324cf80 100644 Binary files a/plots/IC5063_x3nl030/103GHz_overplot_forced.png and b/plots/IC5063_x3nl030/103GHz_overplot_forced.png differ diff --git a/plots/IC5063_x3nl030/18GHz_overplot_forced.png b/plots/IC5063_x3nl030/18GHz_overplot_forced.png index 6f3bd87..046ebdd 100644 Binary files a/plots/IC5063_x3nl030/18GHz_overplot_forced.png and b/plots/IC5063_x3nl030/18GHz_overplot_forced.png differ diff --git a/plots/IC5063_x3nl030/229GHz_overplot_forced.png b/plots/IC5063_x3nl030/229GHz_overplot_forced.png index e321243..7891e93 100644 Binary files a/plots/IC5063_x3nl030/229GHz_overplot_forced.png and b/plots/IC5063_x3nl030/229GHz_overplot_forced.png differ diff --git a/plots/IC5063_x3nl030/24GHz_overplot_forced.png b/plots/IC5063_x3nl030/24GHz_overplot_forced.png index 8ce821f..44bf199 100644 Binary files a/plots/IC5063_x3nl030/24GHz_overplot_forced.png and b/plots/IC5063_x3nl030/24GHz_overplot_forced.png differ diff --git a/plots/IC5063_x3nl030/357GHz_overplot_forced.png b/plots/IC5063_x3nl030/357GHz_overplot_forced.png index 85e6bee..2a6fea6 100644 Binary files a/plots/IC5063_x3nl030/357GHz_overplot_forced.png and b/plots/IC5063_x3nl030/357GHz_overplot_forced.png differ diff --git a/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020.png b/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020.png index 163189c..b5f3f9f 100644 Binary files a/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020.png and b/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020.png differ diff --git a/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_I.png b/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_I.png index 8b045c8..3a77ad4 100644 Binary files a/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_I.png and b/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_I.png differ diff --git a/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_IQU.png b/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_IQU.png index 7f6ace6..8f0cdbe 100644 Binary files a/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_IQU.png and b/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_IQU.png differ diff --git a/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_I_err.png b/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_I_err.png index b810285..75e4488 100644 Binary files a/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_I_err.png and b/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_I_err.png differ diff --git a/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_P.png b/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_P.png index 15a9bc5..2ea322d 100644 Binary files a/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_P.png and b/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_P.png differ diff --git a/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_PA.png b/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_PA.png index 7909b02..6931e2d 100644 Binary files a/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_PA.png and b/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_PA.png differ diff --git a/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_P_err.png b/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_P_err.png index 3699dc4..0405934 100644 Binary files a/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_P_err.png and b/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_P_err.png differ diff --git a/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_P_flux.png b/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_P_flux.png index dadf4a4..468659c 100644 Binary files a/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_P_flux.png and b/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_P_flux.png differ diff --git a/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_SNRi.png b/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_SNRi.png index 3e295c8..18f3ec2 100644 Binary files a/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_SNRi.png and b/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_SNRi.png differ diff --git a/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_SNRp.png b/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_SNRp.png index 73b69b9..94a6529 100644 Binary files a/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_SNRp.png and b/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_SNRp.png differ diff --git a/plots/IC5063_x3nl030/IR_overplot_forced.png b/plots/IC5063_x3nl030/IR_overplot_forced.png index 8547c08..5dbbe41 100644 Binary files a/plots/IC5063_x3nl030/IR_overplot_forced.png and b/plots/IC5063_x3nl030/IR_overplot_forced.png differ diff --git a/plots/NGC1068_x274020/NGC1068.png b/plots/NGC1068_x274020/NGC1068.png index 2102122..791565b 100644 Binary files a/plots/NGC1068_x274020/NGC1068.png and b/plots/NGC1068_x274020/NGC1068.png differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010.png b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010.png index f3d0b11..e79c567 100644 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010.png and b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010.png differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_I.png b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_I.png index d27b910..69fe46b 100644 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_I.png and b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_I.png differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_IQU.png b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_IQU.png index db02a3d..dd7c477 100644 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_IQU.png and b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_IQU.png differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_I_err.png b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_I_err.png index 2cf4fe9..42d9495 100644 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_I_err.png and b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_I_err.png differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_P.png b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_P.png index cb17d68..a185435 100644 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_P.png and b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_P.png differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_PA.png b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_PA.png index e5101cf..b6070f9 100644 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_PA.png and b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_PA.png differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_P_err.png b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_P_err.png index 649d14a..a2aa310 100644 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_P_err.png and b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_P_err.png differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_P_flux.png b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_P_flux.png index b3cb27e..bf468f7 100644 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_P_flux.png and b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_P_flux.png differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_SNRi.png b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_SNRi.png index 780cfe0..3d35e85 100644 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_SNRi.png and b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_SNRi.png differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_SNRp.png b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_SNRp.png index a6311e6..6638190 100644 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_SNRp.png and b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_SNRp.png differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020.png b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020.png index 951c2b7..aa4b93c 100644 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020.png and b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020.png differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_I.png b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_I.png index ad7f5ad..6290d67 100644 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_I.png and b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_I.png differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_IQU.png b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_IQU.png index cc81c4f..3000e93 100644 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_IQU.png and b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_IQU.png differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_I_err.png b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_I_err.png index c45738d..1a4cccc 100644 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_I_err.png and b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_I_err.png differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_P.png b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_P.png index 79a024b..2e9ce19 100644 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_P.png and b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_P.png differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_PA.png b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_PA.png index 8956bfc..3c29ccc 100644 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_PA.png and b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_PA.png differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_P_err.png b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_P_err.png index 8c103ca..65d22b8 100644 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_P_err.png and b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_P_err.png differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_P_flux.png b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_P_flux.png index cf049b8..37d822f 100644 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_P_flux.png and b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_P_flux.png differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_SNRi.png b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_SNRi.png index 3d733a1..b44e597 100644 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_SNRi.png and b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_SNRi.png differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_SNRp.png b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_SNRp.png index 25e9391..ab95ad1 100644 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_SNRp.png and b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_SNRp.png differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_SNRp3.png b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_SNRp3.png deleted file mode 100644 index 30e2972..0000000 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_SNRp3.png and /dev/null differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_SNRp6.png b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_SNRp6.png deleted file mode 100644 index cb0a07d..0000000 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_SNRp6.png and /dev/null differ diff --git a/plots/NGC1068_x274020/NGC1068_K_comparison.png b/plots/NGC1068_x274020/NGC1068_K_comparison.png index 8ed4add..092e763 100644 Binary files a/plots/NGC1068_x274020/NGC1068_K_comparison.png and b/plots/NGC1068_x274020/NGC1068_K_comparison.png differ diff --git a/plots/NGC1068_x274020/NGC1068_polang.png b/plots/NGC1068_x274020/NGC1068_polang.png index 0b60847..1b96784 100644 Binary files a/plots/NGC1068_x274020/NGC1068_polang.png and b/plots/NGC1068_x274020/NGC1068_polang.png differ diff --git a/plots/NGC1068_x274020/NGC1068_poldeg.png b/plots/NGC1068_x274020/NGC1068_poldeg.png index 3039731..7f78e36 100644 Binary files a/plots/NGC1068_x274020/NGC1068_poldeg.png and b/plots/NGC1068_x274020/NGC1068_poldeg.png differ diff --git a/plots/NGC1068_x274020/NGC1068_polflux.png b/plots/NGC1068_x274020/NGC1068_polflux.png index 52bdeec..1f33da6 100644 Binary files a/plots/NGC1068_x274020/NGC1068_polflux.png and b/plots/NGC1068_x274020/NGC1068_polflux.png differ diff --git a/plots/NGC1068_x274020/NGC1068_totalflux.png b/plots/NGC1068_x274020/NGC1068_totalflux.png index 6861bec..64cbd95 100644 Binary files a/plots/NGC1068_x274020/NGC1068_totalflux.png and b/plots/NGC1068_x274020/NGC1068_totalflux.png differ diff --git a/src/FOC_reduction.py b/src/FOC_reduction.py index c70a4b5..6939b91 100755 --- a/src/FOC_reduction.py +++ b/src/FOC_reduction.py @@ -128,25 +128,25 @@ def main(): # Data binning rebin = True if rebin: - pxsize = 0.10 - px_scale = 'arcsec' #pixel, arcsec or full + pxsize = 10 + px_scale = 'pixel' #pixel, arcsec or full rebin_operation = 'sum' #sum or average # Alignement align_center = 'image' #If None will align image to image center display_data = False # Smoothing smoothing_function = 'combine' #gaussian_after, weighted_gaussian_after, gaussian, weighted_gaussian or combine - smoothing_FWHM = 0.20 #If None, no smoothing is done + smoothing_FWHM = None #If None, no smoothing is done smoothing_scale = 'arcsec' #pixel or arcsec # Rotation rotate_stokes = True #rotation to North convention can give erroneous results rotate_data = False #rotation to North convention can give erroneous results # Final crop crop = False #Crop to desired ROI - final_display = True + final_display = False # Polarization map output figname = 'NGC1068_FOC' #target/intrument name - figtype = '_combine_FWHM020' #additionnal informations + figtype = '_bin10px' #additionnal informations SNRp_cut = 5. #P measurments with SNR>3 SNRi_cut = 50. #I measurments with SNR>30, which implies an uncertainty in P of 4.7%. step_vec = 1 #plot all vectors in the array. if step_vec = 2, then every other vector will be plotted @@ -197,7 +197,7 @@ def main(): # FWHM of FOC have been estimated at about 0.03" across 1500-5000 Angstrom band, which is about 2 detector pixels wide # see Jedrzejewski, R.; Nota, A.; Hack, W. J., A Comparison Between FOC and WFPC2 # Bibcode : 1995chst.conf...10J - I_stokes, Q_stokes, U_stokes, Stokes_cov = proj_red.compute_Stokes(data_array, error_array, data_mask, headers, FWHM=smoothing_FWHM, scale=smoothing_scale, smoothing=smoothing_function) + I_stokes, Q_stokes, U_stokes, Stokes_cov = proj_red.compute_Stokes(data_array, error_array, data_mask, headers, FWHM=smoothing_FWHM, scale=smoothing_scale, smoothing=smoothing_function,transmitcorr=False) ## Step 3: # Rotate images to have North up diff --git a/src/comparison_Kishimoto.py b/src/comparison_Kishimoto.py index 73c7a44..87bd47c 100755 --- a/src/comparison_Kishimoto.py +++ b/src/comparison_Kishimoto.py @@ -65,9 +65,9 @@ ax = fig.add_subplot(111, projection=wcs) fig.subplots_adjust(right=0.85) cbar_ax = fig.add_axes([0.88, 0.12, 0.01, 0.75]) -#im0 = ax.imshow(data_S['I']*convert_flux,norm=LogNorm(data_S['I'][data_S['I']>0].min()*convert_flux,data_S['I'][data_S['I']>0].max()*convert_flux),origin='lower',cmap='gray',label=r"$I_{STOKES}$ through this pipeline") +im0 = ax.imshow(data_S['I']*convert_flux,norm=LogNorm(data_S['I'][data_S['I']>0].min()*convert_flux,data_S['I'][data_S['I']>0].max()*convert_flux),origin='lower',cmap='gray',label=r"$I_{STOKES}$ through this pipeline") #im0 = ax.imshow(data_K['P']*100.,vmin=0.,vmax=100.,origin='lower',cmap='inferno',label=r"$P$ through Kishimoto's pipeline") -im0 = ax.imshow(data_S['P']*100.,vmin=0.,vmax=100.,origin='lower',cmap='inferno',label=r"$P$ through this pipeline") +#im0 = ax.imshow(data_S['P']*100.,vmin=0.,vmax=100.,origin='lower',cmap='inferno',label=r"$P$ through this pipeline") #im0 = ax.imshow(data_K['PA'],vmin=0.,vmax=360.,origin='lower',cmap='inferno',label=r"$\theta_P$ through Kishimoto's pipeline") #im0 = ax.imshow(data_S['PA'],vmin=0.,vmax=360.,origin='lower',cmap='inferno',label=r"$\theta_P$ through this pipeline") quiv0 = ax.quiver(data_S['X'],data_S['Y'],data_S['xy_U'],data_S['xy_V'],units='xy',angles='uv',scale=0.5,scale_units='xy',pivot='mid',headwidth=0.,headlength=0.,headaxislength=0.,width=0.1,color='b',alpha=0.75, label="PA through this pipeline") @@ -83,8 +83,8 @@ ax.coords[1].set_axislabel_position('l') ax.coords[1].set_ticklabel_position('l') #ax.axis('equal') -#cbar = plt.colorbar(im0, cax=cbar_ax, label=r"$F_{\lambda}$ [$ergs \cdot cm^{-2} \cdot s^{-1} \cdot \AA^{-1}$]") -cbar = plt.colorbar(im0, cax=cbar_ax, label=r"$P$ [%]") +cbar = plt.colorbar(im0, cax=cbar_ax, label=r"$F_{\lambda}$ [$ergs \cdot cm^{-2} \cdot s^{-1} \cdot \AA^{-1}$]") +#cbar = plt.colorbar(im0, cax=cbar_ax, label=r"$P$ [%]") #cbar = plt.colorbar(im0, cax=cbar_ax, label=r"$\theta_P$ [°]") plt.rcParams.update({'font.size': 15}) ax.legend(loc='upper right') diff --git a/src/lib/plots.py b/src/lib/plots.py index 216427e..e19b8fe 100755 --- a/src/lib/plots.py +++ b/src/lib/plots.py @@ -1891,15 +1891,15 @@ class pol_map(object): ax = self.ax if hasattr(self, 'an_int'): self.an_int.remove() - #self.an_int = ax.annotate(r"$F_{{\lambda}}^{{int}}$({0:.0f} $\AA$) = {1} $ergs \cdot cm^{{-2}} \cdot s^{{-1}} \cdot \AA^{{-1}}$".format(self.pivot_wav,sci_not(I_reg*self.convert_flux,I_reg_err*self.convert_flux,2))+"\n"+r"$P^{{int}}$ = {0:.1f} $\pm$ {1:.1f} %".format(P_reg*100.,np.ceil(P_reg_err*1000.)/10.)+"\n"+r"$\theta_{{P}}^{{int}}$ = {0:.1f} $\pm$ {1:.1f} °".format(PA_reg,np.ceil(PA_reg_err*10.)/10.), color='white', fontsize=12, xy=(0.01, 0.93), xycoords='axes fraction') - self.an_int = ax.annotate(r"$F_{{\lambda}}^{{int}}$({0:.0f} $\AA$) = {1} $ergs \cdot cm^{{-2}} \cdot s^{{-1}} \cdot \AA^{{-1}}$".format(self.pivot_wav,sci_not(I_reg*self.convert_flux,I_reg_err*self.convert_flux,2))+"\n"+r"$P^{{int}}$ = {0:.1f} $\pm$ {1:.1f} %".format(P_reg*100.,np.ceil(P_reg_err*1000.)/10.)+"\n"+r"$\theta_{{P}}^{{int}}$ = {0:.1f} $\pm$ {1:.1f} °".format(PA_reg,np.ceil(PA_reg_err*10.)/10.)+"\n"+r"$P^{{cut}}$ = {0:.1f} $\pm$ {1:.1f} %".format(P_cut*100.,np.ceil(P_cut_err*1000.)/10.)+"\n"+r"$\theta_{{P}}^{{cut}}$ = {0:.1f} $\pm$ {1:.1f} °".format(PA_cut,np.ceil(PA_cut_err*10.)/10.), color='white', fontsize=12, xy=(0.01, 0.85), xycoords='axes fraction') + self.an_int = ax.annotate(r"$F_{{\lambda}}^{{int}}$({0:.0f} $\AA$) = {1} $ergs \cdot cm^{{-2}} \cdot s^{{-1}} \cdot \AA^{{-1}}$".format(self.pivot_wav,sci_not(I_reg*self.convert_flux,I_reg_err*self.convert_flux,2))+"\n"+r"$P^{{int}}$ = {0:.1f} $\pm$ {1:.1f} %".format(P_reg*100.,np.ceil(P_reg_err*1000.)/10.)+"\n"+r"$\theta_{{P}}^{{int}}$ = {0:.1f} $\pm$ {1:.1f} °".format(PA_reg,np.ceil(PA_reg_err*10.)/10.), color='white', fontsize=12, xy=(0.01, 0.93), xycoords='axes fraction') + #self.an_int = ax.annotate(r"$F_{{\lambda}}^{{int}}$({0:.0f} $\AA$) = {1} $ergs \cdot cm^{{-2}} \cdot s^{{-1}} \cdot \AA^{{-1}}$".format(self.pivot_wav,sci_not(I_reg*self.convert_flux,I_reg_err*self.convert_flux,2))+"\n"+r"$P^{{int}}$ = {0:.1f} $\pm$ {1:.1f} %".format(P_reg*100.,np.ceil(P_reg_err*1000.)/10.)+"\n"+r"$\theta_{{P}}^{{int}}$ = {0:.1f} $\pm$ {1:.1f} °".format(PA_reg,np.ceil(PA_reg_err*10.)/10.)+"\n"+r"$P^{{cut}}$ = {0:.1f} $\pm$ {1:.1f} %".format(P_cut*100.,np.ceil(P_cut_err*1000.)/10.)+"\n"+r"$\theta_{{P}}^{{cut}}$ = {0:.1f} $\pm$ {1:.1f} °".format(PA_cut,np.ceil(PA_cut_err*10.)/10.), color='white', fontsize=12, xy=(0.01, 0.85), xycoords='axes fraction') if not self.region is None: self.cont = ax.contour(self.region.astype(float),levels=[0.5], colors='white', linewidths=0.8) fig.canvas.draw_idle() return self.an_int else: - #ax.annotate(r"$F_{{\lambda}}^{{int}}$({0:.0f} $\AA$) = {1} $ergs \cdot cm^{{-2}} \cdot s^{{-1}} \cdot \AA^{{-1}}$".format(self.pivot_wav,sci_not(I_reg*self.convert_flux,I_reg_err*self.convert_flux,2))+"\n"+r"$P^{{int}}$ = {0:.1f} $\pm$ {1:.1f} %".format(P_reg*100.,np.ceil(P_reg_err*1000.)/10.)+"\n"+r"$\theta_{{P}}^{{int}}$ = {0:.1f} $\pm$ {1:.1f} °".format(PA_reg,np.ceil(PA_reg_err*10.)/10.), color='white', fontsize=12, xy=(0.01, 0.94), xycoords='axes fraction') - ax.annotate(r"$F_{{\lambda}}^{{int}}$({0:.0f} $\AA$) = {1} $ergs \cdot cm^{{-2}} \cdot s^{{-1}} \cdot \AA^{{-1}}$".format(self.pivot_wav,sci_not(I_reg*self.convert_flux,I_reg_err*self.convert_flux,2))+"\n"+r"$P^{{int}}$ = {0:.1f} $\pm$ {1:.1f} %".format(P_reg*100.,np.ceil(P_reg_err*1000.)/10.)+"\n"+r"$\theta_{{P}}^{{int}}$ = {0:.1f} $\pm$ {1:.1f} °".format(PA_reg,np.ceil(PA_reg_err*10.)/10.)+"\n"+r"$P^{{cut}}$ = {0:.1f} $\pm$ {1:.1f} %".format(P_cut*100.,np.ceil(P_cut_err*1000.)/10.)+"\n"+r"$\theta_{{P}}^{{cut}}$ = {0:.1f} $\pm$ {1:.1f} °".format(PA_cut,np.ceil(PA_cut_err*10.)/10.), color='white', fontsize=12, xy=(0.01, 0.90), xycoords='axes fraction') + ax.annotate(r"$F_{{\lambda}}^{{int}}$({0:.0f} $\AA$) = {1} $ergs \cdot cm^{{-2}} \cdot s^{{-1}} \cdot \AA^{{-1}}$".format(self.pivot_wav,sci_not(I_reg*self.convert_flux,I_reg_err*self.convert_flux,2))+"\n"+r"$P^{{int}}$ = {0:.1f} $\pm$ {1:.1f} %".format(P_reg*100.,np.ceil(P_reg_err*1000.)/10.)+"\n"+r"$\theta_{{P}}^{{int}}$ = {0:.1f} $\pm$ {1:.1f} °".format(PA_reg,np.ceil(PA_reg_err*10.)/10.), color='white', fontsize=12, xy=(0.01, 0.94), xycoords='axes fraction') + #ax.annotate(r"$F_{{\lambda}}^{{int}}$({0:.0f} $\AA$) = {1} $ergs \cdot cm^{{-2}} \cdot s^{{-1}} \cdot \AA^{{-1}}$".format(self.pivot_wav,sci_not(I_reg*self.convert_flux,I_reg_err*self.convert_flux,2))+"\n"+r"$P^{{int}}$ = {0:.1f} $\pm$ {1:.1f} %".format(P_reg*100.,np.ceil(P_reg_err*1000.)/10.)+"\n"+r"$\theta_{{P}}^{{int}}$ = {0:.1f} $\pm$ {1:.1f} °".format(PA_reg,np.ceil(PA_reg_err*10.)/10.)+"\n"+r"$P^{{cut}}$ = {0:.1f} $\pm$ {1:.1f} %".format(P_cut*100.,np.ceil(P_cut_err*1000.)/10.)+"\n"+r"$\theta_{{P}}^{{cut}}$ = {0:.1f} $\pm$ {1:.1f} °".format(PA_cut,np.ceil(PA_cut_err*10.)/10.), color='white', fontsize=12, xy=(0.01, 0.90), xycoords='axes fraction') if not self.region is None: ax.contour(self.region.astype(float),levels=[0.5], colors='white', linewidths=0.8) fig.canvas.draw_idle() diff --git a/src/lib/reduction.py b/src/lib/reduction.py index 44bd543..e1ba275 100755 --- a/src/lib/reduction.py +++ b/src/lib/reduction.py @@ -1138,7 +1138,7 @@ def polarizer_avg(data_array, error_array, data_mask, headers, FWHM=None, def compute_Stokes(data_array, error_array, data_mask, headers, - FWHM=None, scale='pixel', smoothing='gaussian_after'): + FWHM=None, scale='pixel', smoothing='gaussian_after', transmitcorr=False): """ Compute the Stokes parameters I, Q and U for a given data_set ---------- @@ -1170,6 +1170,11 @@ def compute_Stokes(data_array, error_array, data_mask, headers, -'gaussian_after' convolve output Stokes I/Q/U with a gaussian of standard deviation stdev = FWHM/(2*sqrt(2*log(2))). Defaults to 'gaussian_after'. Won't be used if FWHM is None. + transmitcorr : bool, optional + Weither the images should be transmittance corrected for each filter + along the line of sight. Latest calibrated data products (.c0f) does + not require such correction. + Defaults to False. ---------- Returns: I_stokes : numpy.ndarray @@ -1219,7 +1224,8 @@ def compute_Stokes(data_array, error_array, data_mask, headers, transmit2 = np.min([trans2[header['filtnam2'].lower()] for header in headers]) transmit3 = np.min([trans3[header['filtnam3'].lower()] for header in headers]) transmit4 = np.min([trans4[header['filtnam4'].lower()] for header in headers]) - transmit *= transmit2*transmit3*transmit4 + if transmitcorr: + transmit *= transmit2*transmit3*transmit4 pol_eff = np.array([pol_efficiency['pol0'], pol_efficiency['pol60'], pol_efficiency['pol120']]) #Calculating correction factor diff --git a/src/overplot.py b/src/overplot.py index 5b450d9..4bb2ae5 100755 --- a/src/overplot.py +++ b/src/overplot.py @@ -7,37 +7,37 @@ from lib.plots import overplot_radio, overplot_pol, align_pol from matplotlib.colors import LogNorm Stokes_UV = fits.open("../data/IC5063_x3nl030/IC5063_FOC_combine_FWHM020.fits") -#Stokes_18GHz = fits.open("../data/IC5063_x3nl030/radio/IC5063.18GHz.fits") -#Stokes_24GHz = fits.open("../data/IC5063_x3nl030/radio/IC5063.24GHz.fits") -#Stokes_103GHz = fits.open("../data/IC5063_x3nl030/radio/I5063_103GHz.fits") -#Stokes_229GHz = fits.open("../data/IC5063_x3nl030/radio/I5063_229GHz.fits") -#Stokes_357GHz = fits.open("../data/IC5063_x3nl030/radio/I5063_357GHz.fits") +Stokes_18GHz = fits.open("../data/IC5063_x3nl030/radio/IC5063.18GHz.fits") +Stokes_24GHz = fits.open("../data/IC5063_x3nl030/radio/IC5063.24GHz.fits") +Stokes_103GHz = fits.open("../data/IC5063_x3nl030/radio/I5063_103GHz.fits") +Stokes_229GHz = fits.open("../data/IC5063_x3nl030/radio/I5063_229GHz.fits") +Stokes_357GHz = fits.open("../data/IC5063_x3nl030/radio/I5063_357GHz.fits") #Stokes_S2 = fits.open("../data/IC5063_x3nl030/POLARIZATION_COMPARISON/S2_rot_crop.fits") Stokes_IR = fits.open("../data/IC5063_x3nl030/IR/u2e65g01t_c0f_rot.fits") -#levelsMorganti = np.array([1.,2.,3.,8.,16.,32.,64.,128.]) -# -##levels18GHz = np.array([0.6, 1.5, 3, 6, 12, 24, 48, 96])/100.*Stokes_18GHz[0].data.max() -#levels18GHz = levelsMorganti*0.28*1e-3 -#A = overplot_radio(Stokes_UV, Stokes_18GHz) -#A.plot(levels=levels18GHz, SNRp_cut=3.0, SNRi_cut=60.0, savename='../plots/IC5063_x3nl030/18GHz_overplot_forced.png') -# -##levels24GHz = np.array([1.,1.5, 3, 6, 12, 24, 48, 96])/100.*Stokes_24GHz[0].data.max() -#levels24GHz = levelsMorganti*0.46*1e-3 -#B = overplot_radio(Stokes_UV, Stokes_24GHz) -#B.plot(levels=levels24GHz, SNRp_cut=3.0, SNRi_cut=80.0, savename='../plots/IC5063_x3nl030/24GHz_overplot_forced.png') -# -#levels103GHz = np.linspace(1,99,11)/100.*np.max(deepcopy(Stokes_103GHz[0].data[Stokes_103GHz[0].data > 0.])) -#C = overplot_radio(Stokes_UV, Stokes_103GHz) -#C.plot(levels=levels103GHz, SNRp_cut=3.0, SNRi_cut=80.0, savename='../plots/IC5063_x3nl030/103GHz_overplot_forced.png') -# -#levels229GHz = np.linspace(1,99,11)/100.*np.max(deepcopy(Stokes_229GHz[0].data[Stokes_229GHz[0].data > 0.])) -#D = overplot_radio(Stokes_UV, Stokes_229GHz) -#D.plot(levels=levels229GHz, SNRp_cut=3.0, SNRi_cut=80.0, savename='../plots/IC5063_x3nl030/229GHz_overplot_forced.png') -# -#levels357GHz = np.linspace(1,99,11)/100.*np.max(deepcopy(Stokes_357GHz[0].data[Stokes_357GHz[0].data > 0.])) -#E = overplot_radio(Stokes_UV, Stokes_357GHz) -#E.plot(levels=levels357GHz, SNRp_cut=3.0, SNRi_cut=80.0, savename='../plots/IC5063_x3nl030/357GHz_overplot_forced.png') +levelsMorganti = np.array([1.,2.,3.,8.,16.,32.,64.,128.]) + +#levels18GHz = np.array([0.6, 1.5, 3, 6, 12, 24, 48, 96])/100.*Stokes_18GHz[0].data.max() +levels18GHz = levelsMorganti*0.28*1e-3 +A = overplot_radio(Stokes_UV, Stokes_18GHz) +A.plot(levels=levels18GHz, SNRp_cut=3.0, SNRi_cut=60.0, savename='../plots/IC5063_x3nl030/18GHz_overplot_forced.png') + +#levels24GHz = np.array([1.,1.5, 3, 6, 12, 24, 48, 96])/100.*Stokes_24GHz[0].data.max() +levels24GHz = levelsMorganti*0.46*1e-3 +B = overplot_radio(Stokes_UV, Stokes_24GHz) +B.plot(levels=levels24GHz, SNRp_cut=3.0, SNRi_cut=80.0, savename='../plots/IC5063_x3nl030/24GHz_overplot_forced.png') + +levels103GHz = np.linspace(1,99,11)/100.*np.max(deepcopy(Stokes_103GHz[0].data[Stokes_103GHz[0].data > 0.])) +C = overplot_radio(Stokes_UV, Stokes_103GHz) +C.plot(levels=levels103GHz, SNRp_cut=3.0, SNRi_cut=80.0, savename='../plots/IC5063_x3nl030/103GHz_overplot_forced.png') + +levels229GHz = np.linspace(1,99,11)/100.*np.max(deepcopy(Stokes_229GHz[0].data[Stokes_229GHz[0].data > 0.])) +D = overplot_radio(Stokes_UV, Stokes_229GHz) +D.plot(levels=levels229GHz, SNRp_cut=3.0, SNRi_cut=80.0, savename='../plots/IC5063_x3nl030/229GHz_overplot_forced.png') + +levels357GHz = np.linspace(1,99,11)/100.*np.max(deepcopy(Stokes_357GHz[0].data[Stokes_357GHz[0].data > 0.])) +E = overplot_radio(Stokes_UV, Stokes_357GHz) +E.plot(levels=levels357GHz, SNRp_cut=3.0, SNRi_cut=80.0, savename='../plots/IC5063_x3nl030/357GHz_overplot_forced.png') #F = overplot_pol(Stokes_UV, Stokes_S2) #F.plot(SNRp_cut=3.0, SNRi_cut=80.0, savename='../plots/IC5063_x3nl030/S2_overplot_forced.png', norm=LogNorm(vmin=5e-20,vmax=5e-18))