diff --git a/plots/3C405_x136060/3C405_FOC_combine_FWHM100_rot.png b/plots/3C405_x136060/3C405_FOC_combine_FWHM100_rot.png index b096eed..a439f46 100644 Binary files a/plots/3C405_x136060/3C405_FOC_combine_FWHM100_rot.png and b/plots/3C405_x136060/3C405_FOC_combine_FWHM100_rot.png differ diff --git a/plots/3C405_x136060/3C405_FOC_combine_FWHM100_rot_IQU.png b/plots/3C405_x136060/3C405_FOC_combine_FWHM100_rot_IQU.png index d81a259..886c66b 100644 Binary files a/plots/3C405_x136060/3C405_FOC_combine_FWHM100_rot_IQU.png and b/plots/3C405_x136060/3C405_FOC_combine_FWHM100_rot_IQU.png differ diff --git a/plots/3C405_x136060/3C405_FOC_combine_FWHM100_rot_P.png b/plots/3C405_x136060/3C405_FOC_combine_FWHM100_rot_P.png index 797ef42..bd91629 100644 Binary files a/plots/3C405_x136060/3C405_FOC_combine_FWHM100_rot_P.png and b/plots/3C405_x136060/3C405_FOC_combine_FWHM100_rot_P.png differ diff --git a/plots/3C405_x136060/3C405_FOC_combine_FWHM100_rot_P_err.png b/plots/3C405_x136060/3C405_FOC_combine_FWHM100_rot_P_err.png index 6b8a1c3..1072589 100644 Binary files a/plots/3C405_x136060/3C405_FOC_combine_FWHM100_rot_P_err.png and b/plots/3C405_x136060/3C405_FOC_combine_FWHM100_rot_P_err.png differ diff --git a/plots/3C405_x136060/3C405_FOC_combine_FWHM100_rot_SNRi.png b/plots/3C405_x136060/3C405_FOC_combine_FWHM100_rot_SNRi.png index 3b1080c..2a7c974 100644 Binary files a/plots/3C405_x136060/3C405_FOC_combine_FWHM100_rot_SNRi.png and b/plots/3C405_x136060/3C405_FOC_combine_FWHM100_rot_SNRi.png differ diff --git a/plots/3C405_x136060/3C405_FOC_combine_FWHM100_rot_SNRp.png b/plots/3C405_x136060/3C405_FOC_combine_FWHM100_rot_SNRp.png index 356406b..8f678ec 100644 Binary files a/plots/3C405_x136060/3C405_FOC_combine_FWHM100_rot_SNRp.png and b/plots/3C405_x136060/3C405_FOC_combine_FWHM100_rot_SNRp.png differ diff --git a/plots/3C405_x136060/3C405_FOC_gaussian_FWHM100_rot.png b/plots/3C405_x136060/3C405_FOC_gaussian_FWHM100_rot.png new file mode 100644 index 0000000..266f7b6 Binary files /dev/null and b/plots/3C405_x136060/3C405_FOC_gaussian_FWHM100_rot.png differ diff --git a/plots/3C405_x136060/3C405_FOC_gaussian_FWHM100_rot_IQU.png b/plots/3C405_x136060/3C405_FOC_gaussian_FWHM100_rot_IQU.png new file mode 100644 index 0000000..683fb09 Binary files /dev/null and b/plots/3C405_x136060/3C405_FOC_gaussian_FWHM100_rot_IQU.png differ diff --git a/plots/3C405_x136060/3C405_FOC_gaussian_FWHM100_rot_P.png b/plots/3C405_x136060/3C405_FOC_gaussian_FWHM100_rot_P.png new file mode 100644 index 0000000..7d32cab Binary files /dev/null and b/plots/3C405_x136060/3C405_FOC_gaussian_FWHM100_rot_P.png differ diff --git a/plots/3C405_x136060/3C405_FOC_gaussian_FWHM100_rot_P_err.png b/plots/3C405_x136060/3C405_FOC_gaussian_FWHM100_rot_P_err.png new file mode 100644 index 0000000..c515c05 Binary files /dev/null and b/plots/3C405_x136060/3C405_FOC_gaussian_FWHM100_rot_P_err.png differ diff --git a/plots/3C405_x136060/3C405_FOC_gaussian_FWHM100_rot_SNRi.png b/plots/3C405_x136060/3C405_FOC_gaussian_FWHM100_rot_SNRi.png new file mode 100644 index 0000000..365bc12 Binary files /dev/null and b/plots/3C405_x136060/3C405_FOC_gaussian_FWHM100_rot_SNRi.png differ diff --git a/plots/3C405_x136060/3C405_FOC_gaussian_FWHM100_rot_SNRp.png b/plots/3C405_x136060/3C405_FOC_gaussian_FWHM100_rot_SNRp.png new file mode 100644 index 0000000..0fce8f1 Binary files /dev/null and b/plots/3C405_x136060/3C405_FOC_gaussian_FWHM100_rot_SNRp.png differ diff --git a/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100.png b/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100.png new file mode 100644 index 0000000..0bde8f6 Binary files /dev/null and b/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100.png differ diff --git a/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_IQU.png b/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_IQU.png new file mode 100644 index 0000000..6e956c3 Binary files /dev/null and b/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_IQU.png differ diff --git a/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_P.png b/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_P.png new file mode 100644 index 0000000..3979bce Binary files /dev/null and b/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_P.png differ diff --git a/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_P_err.png b/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_P_err.png new file mode 100644 index 0000000..f0dd6ef Binary files /dev/null and b/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_P_err.png differ diff --git a/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_SNRi.png b/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_SNRi.png new file mode 100644 index 0000000..3adb431 Binary files /dev/null and b/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_SNRi.png differ diff --git a/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_SNRp.png b/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_SNRp.png new file mode 100644 index 0000000..e1f61e4 Binary files /dev/null and b/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_SNRp.png differ diff --git a/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot.png b/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot.png new file mode 100644 index 0000000..58ec29a Binary files /dev/null and b/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot.png differ diff --git a/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot2.png b/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot2.png new file mode 100644 index 0000000..cd01e0a Binary files /dev/null and b/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot2.png differ diff --git a/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot2_IQU.png b/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot2_IQU.png new file mode 100644 index 0000000..9f31249 Binary files /dev/null and b/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot2_IQU.png differ diff --git a/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot2_P.png b/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot2_P.png new file mode 100644 index 0000000..ac4d7f8 Binary files /dev/null and b/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot2_P.png differ diff --git a/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot2_P_err.png b/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot2_P_err.png new file mode 100644 index 0000000..b6eb0e4 Binary files /dev/null and b/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot2_P_err.png differ diff --git a/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot2_SNRi.png b/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot2_SNRi.png new file mode 100644 index 0000000..ea4f78d Binary files /dev/null and b/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot2_SNRi.png differ diff --git a/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot2_SNRp.png b/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot2_SNRp.png new file mode 100644 index 0000000..b90755d Binary files /dev/null and b/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot2_SNRp.png differ diff --git a/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot_IQU.png b/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot_IQU.png new file mode 100644 index 0000000..78913ef Binary files /dev/null and b/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot_IQU.png differ diff --git a/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot_P.png b/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot_P.png new file mode 100644 index 0000000..e99065b Binary files /dev/null and b/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot_P.png differ diff --git a/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot_P_err.png b/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot_P_err.png new file mode 100644 index 0000000..650419f Binary files /dev/null and b/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot_P_err.png differ diff --git a/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot_SNRi.png b/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot_SNRi.png new file mode 100644 index 0000000..775c0b1 Binary files /dev/null and b/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot_SNRi.png differ diff --git a/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot_SNRp.png b/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot_SNRp.png new file mode 100644 index 0000000..450e9c5 Binary files /dev/null and b/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot_SNRp.png differ diff --git a/src/FOC_reduction.py b/src/FOC_reduction.py index 3e9d226..317a256 100755 --- a/src/FOC_reduction.py +++ b/src/FOC_reduction.py @@ -102,11 +102,11 @@ def main(): smoothing_FWHM = 1.00 #If None, no smoothing is done smoothing_scale = 'arcsec' #pixel or arcsec # Rotation - rotate_stokes = False #rotation to North convention can give erroneous results + rotate_stokes = True #rotation to North convention can give erroneous results rotate_data = False #rotation to North convention can give erroneous results # Polarization map output figname = '3C405_FOC' #target/intrument name - figtype = '_combine_FWHM100' #additionnal informations + figtype = '_combine_FWHM100_rot' #additionnal informations SNRp_cut = 3 #P measurments with SNR>3 SNRi_cut = 30 #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 diff --git a/src/lib/reduction.py b/src/lib/reduction.py index 25227a4..656b99e 100755 --- a/src/lib/reduction.py +++ b/src/lib/reduction.py @@ -1018,8 +1018,8 @@ def compute_Stokes(data_array, error_array, headers, FWHM=None, plt.show() #I_stokes[mask]=0. - Q_stokes[mask]=0. - U_stokes[mask]=0. + #Q_stokes[mask]=0. + #U_stokes[mask]=0. #Stokes covariance matrix Stokes_cov = np.zeros((3,3,I_stokes.shape[0],I_stokes.shape[1])) @@ -1427,4 +1427,20 @@ def rotate2_Stokes(I_stokes, Q_stokes, U_stokes, Stokes_cov, headers, ang): new_headers.append(new_header) + # Nan handling : + fmax = np.finfo(np.float64).max + + new_I_stokes[np.isnan(new_I_stokes)] = 0. + new_Q_stokes[new_I_stokes == 0.] = 0. + new_U_stokes[new_I_stokes == 0.] = 0. + new_Q_stokes[np.isnan(new_Q_stokes)] = 0. + new_U_stokes[np.isnan(new_U_stokes)] = 0. + new_Stokes_cov[np.isnan(new_Stokes_cov)] = fmax + P[np.isnan(P)] = 0. + s_P[np.isnan(s_P)] = fmax + s_PA[np.isnan(s_PA)] = fmax + debiased_P[np.isnan(debiased_P)] = 0. + s_P_P[np.isnan(s_P_P)] = fmax + s_PA_P[np.isnan(s_PA_P)] = fmax + return new_I_stokes, new_Q_stokes, new_U_stokes, new_Stokes_cov, P, debiased_P, s_P, s_P_P, PA, s_PA, s_PA_P, new_headers