diff --git a/plots/3C109_x3mc010/3C109_FOC.png b/plots/3C109_x3mc010/3C109_FOC.png index 8c7205a..eca2ded 100644 Binary files a/plots/3C109_x3mc010/3C109_FOC.png and b/plots/3C109_x3mc010/3C109_FOC.png differ diff --git a/plots/3C109_x3mc010/3C109_FOC_IQU.png b/plots/3C109_x3mc010/3C109_FOC_IQU.png new file mode 100644 index 0000000..d82e883 Binary files /dev/null and b/plots/3C109_x3mc010/3C109_FOC_IQU.png differ diff --git a/plots/3C109_x3mc010/3C109_FOC_P.png b/plots/3C109_x3mc010/3C109_FOC_P.png index 7082efb..1217724 100644 Binary files a/plots/3C109_x3mc010/3C109_FOC_P.png and b/plots/3C109_x3mc010/3C109_FOC_P.png differ diff --git a/plots/3C109_x3mc010/3C109_FOC_POL0_crop_region.png b/plots/3C109_x3mc010/3C109_FOC_POL0_crop_region.png new file mode 100644 index 0000000..845202c Binary files /dev/null and b/plots/3C109_x3mc010/3C109_FOC_POL0_crop_region.png differ diff --git a/plots/3C109_x3mc010/3C109_FOC_P_err.png b/plots/3C109_x3mc010/3C109_FOC_P_err.png index e490bab..4279ac9 100644 Binary files a/plots/3C109_x3mc010/3C109_FOC_P_err.png and b/plots/3C109_x3mc010/3C109_FOC_P_err.png differ diff --git a/plots/3C109_x3mc010/3C109_FOC_SNRi.png b/plots/3C109_x3mc010/3C109_FOC_SNRi.png index fccbb9f..582ef31 100644 Binary files a/plots/3C109_x3mc010/3C109_FOC_SNRi.png and b/plots/3C109_x3mc010/3C109_FOC_SNRi.png differ diff --git a/plots/3C109_x3mc010/3C109_FOC_SNRp.png b/plots/3C109_x3mc010/3C109_FOC_SNRp.png index c02d523..733cda5 100644 Binary files a/plots/3C109_x3mc010/3C109_FOC_SNRp.png and b/plots/3C109_x3mc010/3C109_FOC_SNRp.png differ diff --git a/plots/3C109_x3mc010/3C109_FOC_center_image.png b/plots/3C109_x3mc010/3C109_FOC_center_image.png index 1257cb2..ece33a7 100644 Binary files a/plots/3C109_x3mc010/3C109_FOC_center_image.png and b/plots/3C109_x3mc010/3C109_FOC_center_image.png differ diff --git a/plots/3C109_x3mc010/3C109_FOC_combine_FWHM010_rot.png b/plots/3C109_x3mc010/3C109_FOC_combine_FWHM010_rot.png index 45d7b1a..aa96445 100644 Binary files a/plots/3C109_x3mc010/3C109_FOC_combine_FWHM010_rot.png and b/plots/3C109_x3mc010/3C109_FOC_combine_FWHM010_rot.png differ diff --git a/plots/3C109_x3mc010/3C109_FOC_combine_FWHM010_rot_IQU.png b/plots/3C109_x3mc010/3C109_FOC_combine_FWHM010_rot_IQU.png new file mode 100644 index 0000000..0f72356 Binary files /dev/null and b/plots/3C109_x3mc010/3C109_FOC_combine_FWHM010_rot_IQU.png differ diff --git a/plots/3C109_x3mc010/3C109_FOC_combine_FWHM010_rot_P.png b/plots/3C109_x3mc010/3C109_FOC_combine_FWHM010_rot_P.png index e2b3fdb..58dd133 100644 Binary files a/plots/3C109_x3mc010/3C109_FOC_combine_FWHM010_rot_P.png and b/plots/3C109_x3mc010/3C109_FOC_combine_FWHM010_rot_P.png differ diff --git a/plots/3C109_x3mc010/3C109_FOC_combine_FWHM010_rot_P_err.png b/plots/3C109_x3mc010/3C109_FOC_combine_FWHM010_rot_P_err.png index 03e7dea..9d2f342 100644 Binary files a/plots/3C109_x3mc010/3C109_FOC_combine_FWHM010_rot_P_err.png and b/plots/3C109_x3mc010/3C109_FOC_combine_FWHM010_rot_P_err.png differ diff --git a/plots/3C109_x3mc010/3C109_FOC_combine_FWHM010_rot_SNRi.png b/plots/3C109_x3mc010/3C109_FOC_combine_FWHM010_rot_SNRi.png index 082cd04..d60e84d 100644 Binary files a/plots/3C109_x3mc010/3C109_FOC_combine_FWHM010_rot_SNRi.png and b/plots/3C109_x3mc010/3C109_FOC_combine_FWHM010_rot_SNRi.png differ diff --git a/plots/3C109_x3mc010/3C109_FOC_combine_FWHM010_rot_SNRp.png b/plots/3C109_x3mc010/3C109_FOC_combine_FWHM010_rot_SNRp.png index 6e70f31..6f838cc 100644 Binary files a/plots/3C109_x3mc010/3C109_FOC_combine_FWHM010_rot_SNRp.png and b/plots/3C109_x3mc010/3C109_FOC_combine_FWHM010_rot_SNRp.png differ diff --git a/plots/3C109_x3mc010/3C109_FOC_combine_FWHM020_rot.png b/plots/3C109_x3mc010/3C109_FOC_combine_FWHM020_rot.png index 7821b9b..fab2058 100644 Binary files a/plots/3C109_x3mc010/3C109_FOC_combine_FWHM020_rot.png and b/plots/3C109_x3mc010/3C109_FOC_combine_FWHM020_rot.png differ diff --git a/plots/3C109_x3mc010/3C109_FOC_combine_FWHM020_rot_IQU.png b/plots/3C109_x3mc010/3C109_FOC_combine_FWHM020_rot_IQU.png new file mode 100644 index 0000000..6202df4 Binary files /dev/null and b/plots/3C109_x3mc010/3C109_FOC_combine_FWHM020_rot_IQU.png differ diff --git a/plots/3C109_x3mc010/3C109_FOC_combine_FWHM020_rot_P.png b/plots/3C109_x3mc010/3C109_FOC_combine_FWHM020_rot_P.png index 4535f94..d62efd5 100644 Binary files a/plots/3C109_x3mc010/3C109_FOC_combine_FWHM020_rot_P.png and b/plots/3C109_x3mc010/3C109_FOC_combine_FWHM020_rot_P.png differ diff --git a/plots/3C109_x3mc010/3C109_FOC_combine_FWHM020_rot_P_err.png b/plots/3C109_x3mc010/3C109_FOC_combine_FWHM020_rot_P_err.png index 8d9ed3b..09112de 100644 Binary files a/plots/3C109_x3mc010/3C109_FOC_combine_FWHM020_rot_P_err.png and b/plots/3C109_x3mc010/3C109_FOC_combine_FWHM020_rot_P_err.png differ diff --git a/plots/3C109_x3mc010/3C109_FOC_combine_FWHM020_rot_SNRi.png b/plots/3C109_x3mc010/3C109_FOC_combine_FWHM020_rot_SNRi.png index ba83887..badc6e5 100644 Binary files a/plots/3C109_x3mc010/3C109_FOC_combine_FWHM020_rot_SNRi.png and b/plots/3C109_x3mc010/3C109_FOC_combine_FWHM020_rot_SNRi.png differ diff --git a/plots/3C109_x3mc010/3C109_FOC_combine_FWHM020_rot_SNRp.png b/plots/3C109_x3mc010/3C109_FOC_combine_FWHM020_rot_SNRp.png index 11092a8..165f33a 100644 Binary files a/plots/3C109_x3mc010/3C109_FOC_combine_FWHM020_rot_SNRp.png and b/plots/3C109_x3mc010/3C109_FOC_combine_FWHM020_rot_SNRp.png differ diff --git a/plots/3C109_x3mc010/3C109_FOC_crop_region.png b/plots/3C109_x3mc010/3C109_FOC_crop_region.png new file mode 100644 index 0000000..f8f34be Binary files /dev/null and b/plots/3C109_x3mc010/3C109_FOC_crop_region.png differ diff --git a/plots/3C109_x3mc010/3C109_FOC_errors_background_flux.png b/plots/3C109_x3mc010/3C109_FOC_errors_background_flux.png index e62ef1e..58c318e 100644 Binary files a/plots/3C109_x3mc010/3C109_FOC_errors_background_flux.png and b/plots/3C109_x3mc010/3C109_FOC_errors_background_flux.png differ diff --git a/plots/3C109_x3mc010/3C109_FOC_errors_background_location.png b/plots/3C109_x3mc010/3C109_FOC_errors_background_location.png index d1e5c06..f6e4540 100644 Binary files a/plots/3C109_x3mc010/3C109_FOC_errors_background_location.png and b/plots/3C109_x3mc010/3C109_FOC_errors_background_location.png differ diff --git a/plots/3C109_x3mc010/3C109_FOC_rot.png b/plots/3C109_x3mc010/3C109_FOC_rot.png deleted file mode 100644 index 965aca0..0000000 Binary files a/plots/3C109_x3mc010/3C109_FOC_rot.png and /dev/null differ diff --git a/plots/3C109_x3mc010/3C109_FOC_rot_P.png b/plots/3C109_x3mc010/3C109_FOC_rot_P.png deleted file mode 100644 index 9b5b63b..0000000 Binary files a/plots/3C109_x3mc010/3C109_FOC_rot_P.png and /dev/null differ diff --git a/plots/3C109_x3mc010/3C109_FOC_rot_P_err.png b/plots/3C109_x3mc010/3C109_FOC_rot_P_err.png deleted file mode 100644 index e0e8499..0000000 Binary files a/plots/3C109_x3mc010/3C109_FOC_rot_P_err.png and /dev/null differ diff --git a/plots/3C109_x3mc010/3C109_FOC_rot_SNRi.png b/plots/3C109_x3mc010/3C109_FOC_rot_SNRi.png deleted file mode 100644 index d227c85..0000000 Binary files a/plots/3C109_x3mc010/3C109_FOC_rot_SNRi.png and /dev/null differ diff --git a/plots/3C109_x3mc010/3C109_FOC_rot_SNRp.png b/plots/3C109_x3mc010/3C109_FOC_rot_SNRp.png deleted file mode 100644 index 94dc03a..0000000 Binary files a/plots/3C109_x3mc010/3C109_FOC_rot_SNRp.png and /dev/null differ diff --git a/plots/3C405_x136060/3C405_FOC.png b/plots/3C405_x136060/3C405_FOC.png index 6039ec0..c39c05f 100644 Binary files a/plots/3C405_x136060/3C405_FOC.png and b/plots/3C405_x136060/3C405_FOC.png differ diff --git a/plots/3C405_x136060/3C405_FOC_Enrique.png b/plots/3C405_x136060/3C405_FOC_Enrique.png deleted file mode 100644 index 647ce68..0000000 Binary files a/plots/3C405_x136060/3C405_FOC_Enrique.png and /dev/null differ diff --git a/plots/3C405_x136060/3C405_FOC_Enrique_test_Stokes.png b/plots/3C405_x136060/3C405_FOC_Enrique_test_Stokes.png deleted file mode 100644 index 5f48852..0000000 Binary files a/plots/3C405_x136060/3C405_FOC_Enrique_test_Stokes.png and /dev/null differ diff --git a/plots/3C405_x136060/3C405_FOC_Enrique_test_alignment.png b/plots/3C405_x136060/3C405_FOC_Enrique_test_alignment.png deleted file mode 100644 index 063c053..0000000 Binary files a/plots/3C405_x136060/3C405_FOC_Enrique_test_alignment.png and /dev/null differ diff --git a/plots/3C405_x136060/3C405_FOC_Enrique_test_combinePol.png b/plots/3C405_x136060/3C405_FOC_Enrique_test_combinePol.png deleted file mode 100644 index 7da7717..0000000 Binary files a/plots/3C405_x136060/3C405_FOC_Enrique_test_combinePol.png and /dev/null differ diff --git a/plots/3C405_x136060/3C405_FOC_IQU.png b/plots/3C405_x136060/3C405_FOC_IQU.png index b901eda..7b226f4 100644 Binary files a/plots/3C405_x136060/3C405_FOC_IQU.png and b/plots/3C405_x136060/3C405_FOC_IQU.png differ diff --git a/plots/3C405_x136060/3C405_FOC_P.png b/plots/3C405_x136060/3C405_FOC_P.png index e7a0624..882e97c 100644 Binary files a/plots/3C405_x136060/3C405_FOC_P.png and b/plots/3C405_x136060/3C405_FOC_P.png differ diff --git a/plots/3C405_x136060/3C405_FOC_POL0_crop_region.png b/plots/3C405_x136060/3C405_FOC_POL0_crop_region.png new file mode 100644 index 0000000..2ea1e80 Binary files /dev/null and b/plots/3C405_x136060/3C405_FOC_POL0_crop_region.png differ diff --git a/plots/3C405_x136060/3C405_FOC_P_err.png b/plots/3C405_x136060/3C405_FOC_P_err.png index 0ac67ca..2aa4b41 100644 Binary files a/plots/3C405_x136060/3C405_FOC_P_err.png and b/plots/3C405_x136060/3C405_FOC_P_err.png differ diff --git a/plots/3C405_x136060/3C405_FOC_SNRi.png b/plots/3C405_x136060/3C405_FOC_SNRi.png index 262d65a..1cc1b86 100644 Binary files a/plots/3C405_x136060/3C405_FOC_SNRi.png and b/plots/3C405_x136060/3C405_FOC_SNRi.png differ diff --git a/plots/3C405_x136060/3C405_FOC_SNRp.png b/plots/3C405_x136060/3C405_FOC_SNRp.png index e7f34ec..9ed6a7c 100644 Binary files a/plots/3C405_x136060/3C405_FOC_SNRp.png and b/plots/3C405_x136060/3C405_FOC_SNRp.png differ diff --git a/plots/3C405_x136060/3C405_FOC_center_image.png b/plots/3C405_x136060/3C405_FOC_center_image.png index f671155..ce8bb20 100644 Binary files a/plots/3C405_x136060/3C405_FOC_center_image.png and b/plots/3C405_x136060/3C405_FOC_center_image.png differ diff --git a/plots/3C405_x136060/3C405_FOC_combine_FWHM050.png b/plots/3C405_x136060/3C405_FOC_combine_FWHM050.png deleted file mode 100644 index f8844fc..0000000 Binary files a/plots/3C405_x136060/3C405_FOC_combine_FWHM050.png and /dev/null differ diff --git a/plots/3C405_x136060/3C405_FOC_combine_FWHM050_IQU.png b/plots/3C405_x136060/3C405_FOC_combine_FWHM050_IQU.png deleted file mode 100644 index fce39e3..0000000 Binary files a/plots/3C405_x136060/3C405_FOC_combine_FWHM050_IQU.png and /dev/null differ diff --git a/plots/3C405_x136060/3C405_FOC_combine_FWHM050_P.png b/plots/3C405_x136060/3C405_FOC_combine_FWHM050_P.png deleted file mode 100644 index d89eef5..0000000 Binary files a/plots/3C405_x136060/3C405_FOC_combine_FWHM050_P.png and /dev/null differ diff --git a/plots/3C405_x136060/3C405_FOC_combine_FWHM050_P_err.png b/plots/3C405_x136060/3C405_FOC_combine_FWHM050_P_err.png deleted file mode 100644 index 804669c..0000000 Binary files a/plots/3C405_x136060/3C405_FOC_combine_FWHM050_P_err.png and /dev/null differ diff --git a/plots/3C405_x136060/3C405_FOC_combine_FWHM050_SNRi.png b/plots/3C405_x136060/3C405_FOC_combine_FWHM050_SNRi.png deleted file mode 100644 index 88d5fc7..0000000 Binary files a/plots/3C405_x136060/3C405_FOC_combine_FWHM050_SNRi.png and /dev/null differ diff --git a/plots/3C405_x136060/3C405_FOC_combine_FWHM050_SNRp.png b/plots/3C405_x136060/3C405_FOC_combine_FWHM050_SNRp.png deleted file mode 100644 index 7f97d3c..0000000 Binary files a/plots/3C405_x136060/3C405_FOC_combine_FWHM050_SNRp.png and /dev/null differ diff --git a/plots/3C405_x136060/3C405_FOC_combine_FWHM050_rot.png b/plots/3C405_x136060/3C405_FOC_combine_FWHM050_rot.png index 20ecec3..08f2d88 100644 Binary files a/plots/3C405_x136060/3C405_FOC_combine_FWHM050_rot.png and b/plots/3C405_x136060/3C405_FOC_combine_FWHM050_rot.png differ diff --git a/plots/3C405_x136060/3C405_FOC_combine_FWHM050_rot_IQU.png b/plots/3C405_x136060/3C405_FOC_combine_FWHM050_rot_IQU.png index 22ec9a4..6e85cba 100644 Binary files a/plots/3C405_x136060/3C405_FOC_combine_FWHM050_rot_IQU.png and b/plots/3C405_x136060/3C405_FOC_combine_FWHM050_rot_IQU.png differ diff --git a/plots/3C405_x136060/3C405_FOC_combine_FWHM050_rot_P.png b/plots/3C405_x136060/3C405_FOC_combine_FWHM050_rot_P.png index cb52848..12f1650 100644 Binary files a/plots/3C405_x136060/3C405_FOC_combine_FWHM050_rot_P.png and b/plots/3C405_x136060/3C405_FOC_combine_FWHM050_rot_P.png differ diff --git a/plots/3C405_x136060/3C405_FOC_combine_FWHM050_rot_P_err.png b/plots/3C405_x136060/3C405_FOC_combine_FWHM050_rot_P_err.png index ae4bfc9..2d2b3c0 100644 Binary files a/plots/3C405_x136060/3C405_FOC_combine_FWHM050_rot_P_err.png and b/plots/3C405_x136060/3C405_FOC_combine_FWHM050_rot_P_err.png differ diff --git a/plots/3C405_x136060/3C405_FOC_combine_FWHM050_rot_SNRi.png b/plots/3C405_x136060/3C405_FOC_combine_FWHM050_rot_SNRi.png index 22f1712..e2a7dbe 100644 Binary files a/plots/3C405_x136060/3C405_FOC_combine_FWHM050_rot_SNRi.png and b/plots/3C405_x136060/3C405_FOC_combine_FWHM050_rot_SNRi.png differ diff --git a/plots/3C405_x136060/3C405_FOC_combine_FWHM050_rot_SNRp.png b/plots/3C405_x136060/3C405_FOC_combine_FWHM050_rot_SNRp.png index e5238fc..292ba3d 100644 Binary files a/plots/3C405_x136060/3C405_FOC_combine_FWHM050_rot_SNRp.png and b/plots/3C405_x136060/3C405_FOC_combine_FWHM050_rot_SNRp.png differ diff --git a/plots/3C405_x136060/3C405_FOC_combine_FWHM100.png b/plots/3C405_x136060/3C405_FOC_combine_FWHM100.png deleted file mode 100644 index 21b7fb8..0000000 Binary files a/plots/3C405_x136060/3C405_FOC_combine_FWHM100.png and /dev/null differ diff --git a/plots/3C405_x136060/3C405_FOC_combine_FWHM100_IQU.png b/plots/3C405_x136060/3C405_FOC_combine_FWHM100_IQU.png deleted file mode 100644 index 47abb7b..0000000 Binary files a/plots/3C405_x136060/3C405_FOC_combine_FWHM100_IQU.png and /dev/null differ diff --git a/plots/3C405_x136060/3C405_FOC_combine_FWHM100_P.png b/plots/3C405_x136060/3C405_FOC_combine_FWHM100_P.png deleted file mode 100644 index ae77612..0000000 Binary files a/plots/3C405_x136060/3C405_FOC_combine_FWHM100_P.png and /dev/null differ diff --git a/plots/3C405_x136060/3C405_FOC_combine_FWHM100_P_err.png b/plots/3C405_x136060/3C405_FOC_combine_FWHM100_P_err.png deleted file mode 100644 index 4ffb210..0000000 Binary files a/plots/3C405_x136060/3C405_FOC_combine_FWHM100_P_err.png and /dev/null differ diff --git a/plots/3C405_x136060/3C405_FOC_combine_FWHM100_SNRi.png b/plots/3C405_x136060/3C405_FOC_combine_FWHM100_SNRi.png deleted file mode 100644 index a5a7790..0000000 Binary files a/plots/3C405_x136060/3C405_FOC_combine_FWHM100_SNRi.png and /dev/null differ diff --git a/plots/3C405_x136060/3C405_FOC_combine_FWHM100_SNRp.png b/plots/3C405_x136060/3C405_FOC_combine_FWHM100_SNRp.png deleted file mode 100644 index e99ea6a..0000000 Binary files a/plots/3C405_x136060/3C405_FOC_combine_FWHM100_SNRp.png and /dev/null differ diff --git a/plots/3C405_x136060/3C405_FOC_combine_FWHM100_rot.png b/plots/3C405_x136060/3C405_FOC_combine_FWHM100_rot.png index a439f46..adf77a5 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 886c66b..fbed9be 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 bd91629..f5d64e0 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 1072589..f1bf6bb 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 2a7c974..a4f66ed 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 8f678ec..69369ed 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_crop_region.png b/plots/3C405_x136060/3C405_FOC_crop_region.png new file mode 100644 index 0000000..38d66f3 Binary files /dev/null and b/plots/3C405_x136060/3C405_FOC_crop_region.png differ diff --git a/plots/3C405_x136060/3C405_FOC_errors_background_flux.png b/plots/3C405_x136060/3C405_FOC_errors_background_flux.png index 718e4f3..f40c45f 100644 Binary files a/plots/3C405_x136060/3C405_FOC_errors_background_flux.png and b/plots/3C405_x136060/3C405_FOC_errors_background_flux.png differ diff --git a/plots/3C405_x136060/3C405_FOC_errors_background_location.png b/plots/3C405_x136060/3C405_FOC_errors_background_location.png index 1d147b5..fbb62bc 100644 Binary files a/plots/3C405_x136060/3C405_FOC_errors_background_location.png and b/plots/3C405_x136060/3C405_FOC_errors_background_location.png differ diff --git a/plots/3C405_x136060/3C405_FOC_gaussian_FWHM100_rot.png b/plots/3C405_x136060/3C405_FOC_gaussian_FWHM100_rot.png deleted file mode 100644 index 266f7b6..0000000 Binary files a/plots/3C405_x136060/3C405_FOC_gaussian_FWHM100_rot.png and /dev/null 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 deleted file mode 100644 index 683fb09..0000000 Binary files a/plots/3C405_x136060/3C405_FOC_gaussian_FWHM100_rot_IQU.png and /dev/null 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 deleted file mode 100644 index 7d32cab..0000000 Binary files a/plots/3C405_x136060/3C405_FOC_gaussian_FWHM100_rot_P.png and /dev/null 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 deleted file mode 100644 index c515c05..0000000 Binary files a/plots/3C405_x136060/3C405_FOC_gaussian_FWHM100_rot_P_err.png and /dev/null 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 deleted file mode 100644 index 365bc12..0000000 Binary files a/plots/3C405_x136060/3C405_FOC_gaussian_FWHM100_rot_SNRi.png and /dev/null 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 deleted file mode 100644 index 0fce8f1..0000000 Binary files a/plots/3C405_x136060/3C405_FOC_gaussian_FWHM100_rot_SNRp.png and /dev/null differ diff --git a/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100.png b/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100.png deleted file mode 100644 index 0bde8f6..0000000 Binary files a/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100.png and /dev/null 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 deleted file mode 100644 index 6e956c3..0000000 Binary files a/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_IQU.png and /dev/null 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 deleted file mode 100644 index 3979bce..0000000 Binary files a/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_P.png and /dev/null 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 deleted file mode 100644 index f0dd6ef..0000000 Binary files a/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_P_err.png and /dev/null 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 deleted file mode 100644 index 3adb431..0000000 Binary files a/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_SNRi.png and /dev/null 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 deleted file mode 100644 index e1f61e4..0000000 Binary files a/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_SNRp.png and /dev/null 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 deleted file mode 100644 index 58ec29a..0000000 Binary files a/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot.png and /dev/null 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 deleted file mode 100644 index cd01e0a..0000000 Binary files a/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot2.png and /dev/null 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 deleted file mode 100644 index 9f31249..0000000 Binary files a/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot2_IQU.png and /dev/null 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 deleted file mode 100644 index ac4d7f8..0000000 Binary files a/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot2_P.png and /dev/null 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 deleted file mode 100644 index b6eb0e4..0000000 Binary files a/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot2_P_err.png and /dev/null 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 deleted file mode 100644 index ea4f78d..0000000 Binary files a/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot2_SNRi.png and /dev/null 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 deleted file mode 100644 index b90755d..0000000 Binary files a/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot2_SNRp.png and /dev/null 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 deleted file mode 100644 index 78913ef..0000000 Binary files a/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot_IQU.png and /dev/null 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 deleted file mode 100644 index e99065b..0000000 Binary files a/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot_P.png and /dev/null 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 deleted file mode 100644 index 650419f..0000000 Binary files a/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot_P_err.png and /dev/null 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 deleted file mode 100644 index 775c0b1..0000000 Binary files a/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot_SNRi.png and /dev/null 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 deleted file mode 100644 index 450e9c5..0000000 Binary files a/plots/3C405_x136060/3C405_FOC_gaussian_after_FWHM100_rot_SNRp.png and /dev/null differ diff --git a/plots/3C405_x136060/3C405_FOC_rot.png b/plots/3C405_x136060/3C405_FOC_rot.png deleted file mode 100644 index fab38b2..0000000 Binary files a/plots/3C405_x136060/3C405_FOC_rot.png and /dev/null differ diff --git a/plots/3C405_x136060/3C405_FOC_rot_IQU.png b/plots/3C405_x136060/3C405_FOC_rot_IQU.png deleted file mode 100644 index 5f37938..0000000 Binary files a/plots/3C405_x136060/3C405_FOC_rot_IQU.png and /dev/null differ diff --git a/plots/3C405_x136060/3C405_FOC_rot_P.png b/plots/3C405_x136060/3C405_FOC_rot_P.png deleted file mode 100644 index f3e7745..0000000 Binary files a/plots/3C405_x136060/3C405_FOC_rot_P.png and /dev/null differ diff --git a/plots/3C405_x136060/3C405_FOC_rot_P_err.png b/plots/3C405_x136060/3C405_FOC_rot_P_err.png deleted file mode 100644 index 92e0792..0000000 Binary files a/plots/3C405_x136060/3C405_FOC_rot_P_err.png and /dev/null differ diff --git a/plots/3C405_x136060/3C405_FOC_rot_SNRi.png b/plots/3C405_x136060/3C405_FOC_rot_SNRi.png deleted file mode 100644 index 2aa266f..0000000 Binary files a/plots/3C405_x136060/3C405_FOC_rot_SNRi.png and /dev/null differ diff --git a/plots/3C405_x136060/3C405_FOC_rot_SNRp.png b/plots/3C405_x136060/3C405_FOC_rot_SNRp.png deleted file mode 100644 index 09f7aaf..0000000 Binary files a/plots/3C405_x136060/3C405_FOC_rot_SNRp.png and /dev/null differ diff --git a/plots/3C405_x136060/3C405_FOC_rotated.png b/plots/3C405_x136060/3C405_FOC_rotated.png deleted file mode 100644 index e96151b..0000000 Binary files a/plots/3C405_x136060/3C405_FOC_rotated.png and /dev/null differ diff --git a/plots/CygnusA_x43w0/CygnusA_FOC.png b/plots/CygnusA_x43w0/CygnusA_FOC.png index 3eed5cc..b56fc9a 100644 Binary files a/plots/CygnusA_x43w0/CygnusA_FOC.png and b/plots/CygnusA_x43w0/CygnusA_FOC.png differ diff --git a/plots/CygnusA_x43w0/CygnusA_FOC_IQU.png b/plots/CygnusA_x43w0/CygnusA_FOC_IQU.png new file mode 100644 index 0000000..74acf83 Binary files /dev/null and b/plots/CygnusA_x43w0/CygnusA_FOC_IQU.png differ diff --git a/plots/CygnusA_x43w0/CygnusA_FOC_P.png b/plots/CygnusA_x43w0/CygnusA_FOC_P.png index 6930d27..7477111 100644 Binary files a/plots/CygnusA_x43w0/CygnusA_FOC_P.png and b/plots/CygnusA_x43w0/CygnusA_FOC_P.png differ diff --git a/plots/CygnusA_x43w0/CygnusA_FOC_POL0_crop_region.png b/plots/CygnusA_x43w0/CygnusA_FOC_POL0_crop_region.png new file mode 100644 index 0000000..5f32aad Binary files /dev/null and b/plots/CygnusA_x43w0/CygnusA_FOC_POL0_crop_region.png differ diff --git a/plots/CygnusA_x43w0/CygnusA_FOC_P_err.png b/plots/CygnusA_x43w0/CygnusA_FOC_P_err.png index b3143f4..9ce6c26 100644 Binary files a/plots/CygnusA_x43w0/CygnusA_FOC_P_err.png and b/plots/CygnusA_x43w0/CygnusA_FOC_P_err.png differ diff --git a/plots/CygnusA_x43w0/CygnusA_FOC_SNRi.png b/plots/CygnusA_x43w0/CygnusA_FOC_SNRi.png index d00bfb1..414169c 100644 Binary files a/plots/CygnusA_x43w0/CygnusA_FOC_SNRi.png and b/plots/CygnusA_x43w0/CygnusA_FOC_SNRi.png differ diff --git a/plots/CygnusA_x43w0/CygnusA_FOC_SNRp.png b/plots/CygnusA_x43w0/CygnusA_FOC_SNRp.png index 6ffbb92..9566fae 100644 Binary files a/plots/CygnusA_x43w0/CygnusA_FOC_SNRp.png and b/plots/CygnusA_x43w0/CygnusA_FOC_SNRp.png differ diff --git a/plots/CygnusA_x43w0/CygnusA_FOC_center_image.png b/plots/CygnusA_x43w0/CygnusA_FOC_center_image.png index 3aa24c1..a9240db 100644 Binary files a/plots/CygnusA_x43w0/CygnusA_FOC_center_image.png and b/plots/CygnusA_x43w0/CygnusA_FOC_center_image.png differ diff --git a/plots/CygnusA_x43w0/CygnusA_FOC_combine_FWHM033_rot.png b/plots/CygnusA_x43w0/CygnusA_FOC_combine_FWHM033_rot.png index 6df78c0..4af624d 100644 Binary files a/plots/CygnusA_x43w0/CygnusA_FOC_combine_FWHM033_rot.png and b/plots/CygnusA_x43w0/CygnusA_FOC_combine_FWHM033_rot.png differ diff --git a/plots/CygnusA_x43w0/CygnusA_FOC_combine_FWHM033_rot_IQU.png b/plots/CygnusA_x43w0/CygnusA_FOC_combine_FWHM033_rot_IQU.png new file mode 100644 index 0000000..b4fb0e0 Binary files /dev/null and b/plots/CygnusA_x43w0/CygnusA_FOC_combine_FWHM033_rot_IQU.png differ diff --git a/plots/CygnusA_x43w0/CygnusA_FOC_combine_FWHM033_rot_P.png b/plots/CygnusA_x43w0/CygnusA_FOC_combine_FWHM033_rot_P.png index 58900b3..dcb95be 100644 Binary files a/plots/CygnusA_x43w0/CygnusA_FOC_combine_FWHM033_rot_P.png and b/plots/CygnusA_x43w0/CygnusA_FOC_combine_FWHM033_rot_P.png differ diff --git a/plots/CygnusA_x43w0/CygnusA_FOC_combine_FWHM033_rot_P_err.png b/plots/CygnusA_x43w0/CygnusA_FOC_combine_FWHM033_rot_P_err.png index d072e0d..8d39c06 100644 Binary files a/plots/CygnusA_x43w0/CygnusA_FOC_combine_FWHM033_rot_P_err.png and b/plots/CygnusA_x43w0/CygnusA_FOC_combine_FWHM033_rot_P_err.png differ diff --git a/plots/CygnusA_x43w0/CygnusA_FOC_combine_FWHM033_rot_SNRi.png b/plots/CygnusA_x43w0/CygnusA_FOC_combine_FWHM033_rot_SNRi.png index 93db97d..578a9b7 100644 Binary files a/plots/CygnusA_x43w0/CygnusA_FOC_combine_FWHM033_rot_SNRi.png and b/plots/CygnusA_x43w0/CygnusA_FOC_combine_FWHM033_rot_SNRi.png differ diff --git a/plots/CygnusA_x43w0/CygnusA_FOC_combine_FWHM033_rot_SNRp.png b/plots/CygnusA_x43w0/CygnusA_FOC_combine_FWHM033_rot_SNRp.png index 089e070..33a19b4 100644 Binary files a/plots/CygnusA_x43w0/CygnusA_FOC_combine_FWHM033_rot_SNRp.png and b/plots/CygnusA_x43w0/CygnusA_FOC_combine_FWHM033_rot_SNRp.png differ diff --git a/plots/CygnusA_x43w0/CygnusA_FOC_combine_FWHM066_rot.png b/plots/CygnusA_x43w0/CygnusA_FOC_combine_FWHM066_rot.png index 5b5e071..01db07d 100644 Binary files a/plots/CygnusA_x43w0/CygnusA_FOC_combine_FWHM066_rot.png and b/plots/CygnusA_x43w0/CygnusA_FOC_combine_FWHM066_rot.png differ diff --git a/plots/CygnusA_x43w0/CygnusA_FOC_combine_FWHM066_rot_IQU.png b/plots/CygnusA_x43w0/CygnusA_FOC_combine_FWHM066_rot_IQU.png new file mode 100644 index 0000000..abd16be Binary files /dev/null and b/plots/CygnusA_x43w0/CygnusA_FOC_combine_FWHM066_rot_IQU.png differ diff --git a/plots/CygnusA_x43w0/CygnusA_FOC_combine_FWHM066_rot_P.png b/plots/CygnusA_x43w0/CygnusA_FOC_combine_FWHM066_rot_P.png index 918bf0b..a28cac9 100644 Binary files a/plots/CygnusA_x43w0/CygnusA_FOC_combine_FWHM066_rot_P.png and b/plots/CygnusA_x43w0/CygnusA_FOC_combine_FWHM066_rot_P.png differ diff --git a/plots/CygnusA_x43w0/CygnusA_FOC_combine_FWHM066_rot_P_err.png b/plots/CygnusA_x43w0/CygnusA_FOC_combine_FWHM066_rot_P_err.png index ebcc954..98fe16a 100644 Binary files a/plots/CygnusA_x43w0/CygnusA_FOC_combine_FWHM066_rot_P_err.png and b/plots/CygnusA_x43w0/CygnusA_FOC_combine_FWHM066_rot_P_err.png differ diff --git a/plots/CygnusA_x43w0/CygnusA_FOC_combine_FWHM066_rot_SNRi.png b/plots/CygnusA_x43w0/CygnusA_FOC_combine_FWHM066_rot_SNRi.png index 9b01b2a..a34c9b9 100644 Binary files a/plots/CygnusA_x43w0/CygnusA_FOC_combine_FWHM066_rot_SNRi.png and b/plots/CygnusA_x43w0/CygnusA_FOC_combine_FWHM066_rot_SNRi.png differ diff --git a/plots/CygnusA_x43w0/CygnusA_FOC_combine_FWHM066_rot_SNRp.png b/plots/CygnusA_x43w0/CygnusA_FOC_combine_FWHM066_rot_SNRp.png index 6d11354..f8ab707 100644 Binary files a/plots/CygnusA_x43w0/CygnusA_FOC_combine_FWHM066_rot_SNRp.png and b/plots/CygnusA_x43w0/CygnusA_FOC_combine_FWHM066_rot_SNRp.png differ diff --git a/plots/CygnusA_x43w0/CygnusA_FOC_crop_region.png b/plots/CygnusA_x43w0/CygnusA_FOC_crop_region.png new file mode 100644 index 0000000..72c4453 Binary files /dev/null and b/plots/CygnusA_x43w0/CygnusA_FOC_crop_region.png differ diff --git a/plots/CygnusA_x43w0/CygnusA_FOC_errors_background_flux.png b/plots/CygnusA_x43w0/CygnusA_FOC_errors_background_flux.png index bc36443..67bb9b4 100644 Binary files a/plots/CygnusA_x43w0/CygnusA_FOC_errors_background_flux.png and b/plots/CygnusA_x43w0/CygnusA_FOC_errors_background_flux.png differ diff --git a/plots/CygnusA_x43w0/CygnusA_FOC_errors_background_location.png b/plots/CygnusA_x43w0/CygnusA_FOC_errors_background_location.png index 289a794..088107d 100644 Binary files a/plots/CygnusA_x43w0/CygnusA_FOC_errors_background_location.png and b/plots/CygnusA_x43w0/CygnusA_FOC_errors_background_location.png differ diff --git a/plots/CygnusA_x43w0/CygnusA_FOC_rot.png b/plots/CygnusA_x43w0/CygnusA_FOC_rot.png deleted file mode 100644 index 66934c4..0000000 Binary files a/plots/CygnusA_x43w0/CygnusA_FOC_rot.png and /dev/null differ diff --git a/plots/CygnusA_x43w0/CygnusA_FOC_rot_P.png b/plots/CygnusA_x43w0/CygnusA_FOC_rot_P.png deleted file mode 100644 index 71864e3..0000000 Binary files a/plots/CygnusA_x43w0/CygnusA_FOC_rot_P.png and /dev/null differ diff --git a/plots/CygnusA_x43w0/CygnusA_FOC_rot_P_err.png b/plots/CygnusA_x43w0/CygnusA_FOC_rot_P_err.png deleted file mode 100644 index 17093be..0000000 Binary files a/plots/CygnusA_x43w0/CygnusA_FOC_rot_P_err.png and /dev/null differ diff --git a/plots/CygnusA_x43w0/CygnusA_FOC_rot_SNRi.png b/plots/CygnusA_x43w0/CygnusA_FOC_rot_SNRi.png deleted file mode 100644 index 3c4cc93..0000000 Binary files a/plots/CygnusA_x43w0/CygnusA_FOC_rot_SNRi.png and /dev/null differ diff --git a/plots/CygnusA_x43w0/CygnusA_FOC_rot_SNRp.png b/plots/CygnusA_x43w0/CygnusA_FOC_rot_SNRp.png deleted file mode 100644 index 68d40d1..0000000 Binary files a/plots/CygnusA_x43w0/CygnusA_FOC_rot_SNRp.png and /dev/null differ diff --git a/plots/IC5063_x3nl030/IC5063_FOC.png b/plots/IC5063_x3nl030/IC5063_FOC.png index e5a3436..9afe44a 100644 Binary files a/plots/IC5063_x3nl030/IC5063_FOC.png and b/plots/IC5063_x3nl030/IC5063_FOC.png differ diff --git a/plots/IC5063_x3nl030/IC5063_FOC_IQU.png b/plots/IC5063_x3nl030/IC5063_FOC_IQU.png new file mode 100644 index 0000000..0bf1075 Binary files /dev/null and b/plots/IC5063_x3nl030/IC5063_FOC_IQU.png differ diff --git a/plots/IC5063_x3nl030/IC5063_FOC_P.png b/plots/IC5063_x3nl030/IC5063_FOC_P.png index dfaca68..3243808 100644 Binary files a/plots/IC5063_x3nl030/IC5063_FOC_P.png and b/plots/IC5063_x3nl030/IC5063_FOC_P.png differ diff --git a/plots/IC5063_x3nl030/IC5063_FOC_POL0_crop_region.png b/plots/IC5063_x3nl030/IC5063_FOC_POL0_crop_region.png new file mode 100644 index 0000000..ea75ca8 Binary files /dev/null and b/plots/IC5063_x3nl030/IC5063_FOC_POL0_crop_region.png differ diff --git a/plots/IC5063_x3nl030/IC5063_FOC_P_err.png b/plots/IC5063_x3nl030/IC5063_FOC_P_err.png index b0c9fc5..8bd2c11 100644 Binary files a/plots/IC5063_x3nl030/IC5063_FOC_P_err.png and b/plots/IC5063_x3nl030/IC5063_FOC_P_err.png differ diff --git a/plots/IC5063_x3nl030/IC5063_FOC_SNRi.png b/plots/IC5063_x3nl030/IC5063_FOC_SNRi.png index ff9efe6..02da18e 100644 Binary files a/plots/IC5063_x3nl030/IC5063_FOC_SNRi.png and b/plots/IC5063_x3nl030/IC5063_FOC_SNRi.png differ diff --git a/plots/IC5063_x3nl030/IC5063_FOC_SNRp.png b/plots/IC5063_x3nl030/IC5063_FOC_SNRp.png index 4164905..a21e1a0 100644 Binary files a/plots/IC5063_x3nl030/IC5063_FOC_SNRp.png and b/plots/IC5063_x3nl030/IC5063_FOC_SNRp.png differ diff --git a/plots/IC5063_x3nl030/IC5063_FOC_center_image.png b/plots/IC5063_x3nl030/IC5063_FOC_center_image.png index faaa5ac..0041d38 100644 Binary files a/plots/IC5063_x3nl030/IC5063_FOC_center_image.png and b/plots/IC5063_x3nl030/IC5063_FOC_center_image.png differ diff --git a/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM010_rot.png b/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM010_rot.png index f967967..e9e3780 100644 Binary files a/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM010_rot.png and b/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM010_rot.png differ diff --git a/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM010_rot_IQU.png b/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM010_rot_IQU.png new file mode 100644 index 0000000..0fcc445 Binary files /dev/null and b/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM010_rot_IQU.png differ diff --git a/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM010_rot_P.png b/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM010_rot_P.png index e2d868e..71c968f 100644 Binary files a/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM010_rot_P.png and b/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM010_rot_P.png differ diff --git a/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM010_rot_P_err.png b/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM010_rot_P_err.png index c029ad6..e3db942 100644 Binary files a/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM010_rot_P_err.png and b/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM010_rot_P_err.png differ diff --git a/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM010_rot_SNRi.png b/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM010_rot_SNRi.png index 1e189eb..4d05609 100644 Binary files a/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM010_rot_SNRi.png and b/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM010_rot_SNRi.png differ diff --git a/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM010_rot_SNRp.png b/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM010_rot_SNRp.png index 17ff335..c64a399 100644 Binary files a/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM010_rot_SNRp.png and b/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM010_rot_SNRp.png differ diff --git a/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_rot.png b/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_rot.png index b497f51..f0c21d6 100644 Binary files a/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_rot.png and b/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_rot.png differ diff --git a/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_rot_IQU.png b/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_rot_IQU.png new file mode 100644 index 0000000..a37694d Binary files /dev/null and b/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_rot_IQU.png differ diff --git a/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_rot_P.png b/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_rot_P.png index 817e6ac..e1e571e 100644 Binary files a/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_rot_P.png and b/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_rot_P.png differ diff --git a/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_rot_P_err.png b/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_rot_P_err.png index 886ba51..b193250 100644 Binary files a/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_rot_P_err.png and b/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_rot_P_err.png differ diff --git a/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_rot_SNRi.png b/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_rot_SNRi.png index 1a8b2f5..ed9421a 100644 Binary files a/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_rot_SNRi.png and b/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_rot_SNRi.png differ diff --git a/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_rot_SNRp.png b/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_rot_SNRp.png index baf0ac1..412455b 100644 Binary files a/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_rot_SNRp.png and b/plots/IC5063_x3nl030/IC5063_FOC_combine_FWHM020_rot_SNRp.png differ diff --git a/plots/IC5063_x3nl030/IC5063_FOC_crop_region.png b/plots/IC5063_x3nl030/IC5063_FOC_crop_region.png new file mode 100644 index 0000000..1df7da5 Binary files /dev/null and b/plots/IC5063_x3nl030/IC5063_FOC_crop_region.png differ diff --git a/plots/IC5063_x3nl030/IC5063_FOC_errors_background_flux.png b/plots/IC5063_x3nl030/IC5063_FOC_errors_background_flux.png index dc633b3..b574d97 100644 Binary files a/plots/IC5063_x3nl030/IC5063_FOC_errors_background_flux.png and b/plots/IC5063_x3nl030/IC5063_FOC_errors_background_flux.png differ diff --git a/plots/IC5063_x3nl030/IC5063_FOC_errors_background_location.png b/plots/IC5063_x3nl030/IC5063_FOC_errors_background_location.png index 2b43241..555f738 100644 Binary files a/plots/IC5063_x3nl030/IC5063_FOC_errors_background_location.png and b/plots/IC5063_x3nl030/IC5063_FOC_errors_background_location.png differ diff --git a/plots/IC5063_x3nl030/IC5063_FOC_rot.png b/plots/IC5063_x3nl030/IC5063_FOC_rot.png deleted file mode 100644 index 351f2aa..0000000 Binary files a/plots/IC5063_x3nl030/IC5063_FOC_rot.png and /dev/null differ diff --git a/plots/IC5063_x3nl030/IC5063_FOC_rot_P.png b/plots/IC5063_x3nl030/IC5063_FOC_rot_P.png deleted file mode 100644 index 11c66b4..0000000 Binary files a/plots/IC5063_x3nl030/IC5063_FOC_rot_P.png and /dev/null differ diff --git a/plots/IC5063_x3nl030/IC5063_FOC_rot_P_err.png b/plots/IC5063_x3nl030/IC5063_FOC_rot_P_err.png deleted file mode 100644 index ea05ba5..0000000 Binary files a/plots/IC5063_x3nl030/IC5063_FOC_rot_P_err.png and /dev/null differ diff --git a/plots/IC5063_x3nl030/IC5063_FOC_rot_SNRi.png b/plots/IC5063_x3nl030/IC5063_FOC_rot_SNRi.png deleted file mode 100644 index a048cbd..0000000 Binary files a/plots/IC5063_x3nl030/IC5063_FOC_rot_SNRi.png and /dev/null differ diff --git a/plots/IC5063_x3nl030/IC5063_FOC_rot_SNRp.png b/plots/IC5063_x3nl030/IC5063_FOC_rot_SNRp.png deleted file mode 100644 index 296bad3..0000000 Binary files a/plots/IC5063_x3nl030/IC5063_FOC_rot_SNRp.png and /dev/null differ diff --git a/plots/MKN3_x3md010/MKN3_FOC.png b/plots/MKN3_x3md010/MKN3_FOC.png index 835cc0f..34760a2 100644 Binary files a/plots/MKN3_x3md010/MKN3_FOC.png and b/plots/MKN3_x3md010/MKN3_FOC.png differ diff --git a/plots/MKN3_x3md010/MKN3_FOC_IQU.png b/plots/MKN3_x3md010/MKN3_FOC_IQU.png new file mode 100644 index 0000000..25c6f53 Binary files /dev/null and b/plots/MKN3_x3md010/MKN3_FOC_IQU.png differ diff --git a/plots/MKN3_x3md010/MKN3_FOC_P.png b/plots/MKN3_x3md010/MKN3_FOC_P.png index 9338896..74153ec 100644 Binary files a/plots/MKN3_x3md010/MKN3_FOC_P.png and b/plots/MKN3_x3md010/MKN3_FOC_P.png differ diff --git a/plots/MKN3_x3md010/MKN3_FOC_POL0_crop_region.png b/plots/MKN3_x3md010/MKN3_FOC_POL0_crop_region.png new file mode 100644 index 0000000..8df6015 Binary files /dev/null and b/plots/MKN3_x3md010/MKN3_FOC_POL0_crop_region.png differ diff --git a/plots/MKN3_x3md010/MKN3_FOC_P_err.png b/plots/MKN3_x3md010/MKN3_FOC_P_err.png index df076bb..def92f3 100644 Binary files a/plots/MKN3_x3md010/MKN3_FOC_P_err.png and b/plots/MKN3_x3md010/MKN3_FOC_P_err.png differ diff --git a/plots/MKN3_x3md010/MKN3_FOC_SNRi.png b/plots/MKN3_x3md010/MKN3_FOC_SNRi.png index f5c0cc9..79f2687 100644 Binary files a/plots/MKN3_x3md010/MKN3_FOC_SNRi.png and b/plots/MKN3_x3md010/MKN3_FOC_SNRi.png differ diff --git a/plots/MKN3_x3md010/MKN3_FOC_SNRp.png b/plots/MKN3_x3md010/MKN3_FOC_SNRp.png index 5d0fd21..8158027 100644 Binary files a/plots/MKN3_x3md010/MKN3_FOC_SNRp.png and b/plots/MKN3_x3md010/MKN3_FOC_SNRp.png differ diff --git a/plots/MKN3_x3md010/MKN3_FOC_center_image.png b/plots/MKN3_x3md010/MKN3_FOC_center_image.png index 15f8261..87e66b1 100644 Binary files a/plots/MKN3_x3md010/MKN3_FOC_center_image.png and b/plots/MKN3_x3md010/MKN3_FOC_center_image.png differ diff --git a/plots/MKN3_x3md010/MKN3_FOC_combine_FWHM010_rot.png b/plots/MKN3_x3md010/MKN3_FOC_combine_FWHM010_rot.png index e4667d9..6383c0d 100644 Binary files a/plots/MKN3_x3md010/MKN3_FOC_combine_FWHM010_rot.png and b/plots/MKN3_x3md010/MKN3_FOC_combine_FWHM010_rot.png differ diff --git a/plots/MKN3_x3md010/MKN3_FOC_combine_FWHM010_rot_IQU.png b/plots/MKN3_x3md010/MKN3_FOC_combine_FWHM010_rot_IQU.png new file mode 100644 index 0000000..c4b4328 Binary files /dev/null and b/plots/MKN3_x3md010/MKN3_FOC_combine_FWHM010_rot_IQU.png differ diff --git a/plots/MKN3_x3md010/MKN3_FOC_combine_FWHM010_rot_P.png b/plots/MKN3_x3md010/MKN3_FOC_combine_FWHM010_rot_P.png index 34f2e7e..fbb56f9 100644 Binary files a/plots/MKN3_x3md010/MKN3_FOC_combine_FWHM010_rot_P.png and b/plots/MKN3_x3md010/MKN3_FOC_combine_FWHM010_rot_P.png differ diff --git a/plots/MKN3_x3md010/MKN3_FOC_combine_FWHM010_rot_P_err.png b/plots/MKN3_x3md010/MKN3_FOC_combine_FWHM010_rot_P_err.png index d52b890..e1f46a6 100644 Binary files a/plots/MKN3_x3md010/MKN3_FOC_combine_FWHM010_rot_P_err.png and b/plots/MKN3_x3md010/MKN3_FOC_combine_FWHM010_rot_P_err.png differ diff --git a/plots/MKN3_x3md010/MKN3_FOC_combine_FWHM010_rot_SNRi.png b/plots/MKN3_x3md010/MKN3_FOC_combine_FWHM010_rot_SNRi.png index 9abc9d0..6b6f502 100644 Binary files a/plots/MKN3_x3md010/MKN3_FOC_combine_FWHM010_rot_SNRi.png and b/plots/MKN3_x3md010/MKN3_FOC_combine_FWHM010_rot_SNRi.png differ diff --git a/plots/MKN3_x3md010/MKN3_FOC_combine_FWHM010_rot_SNRp.png b/plots/MKN3_x3md010/MKN3_FOC_combine_FWHM010_rot_SNRp.png index ed44d90..dace2e7 100644 Binary files a/plots/MKN3_x3md010/MKN3_FOC_combine_FWHM010_rot_SNRp.png and b/plots/MKN3_x3md010/MKN3_FOC_combine_FWHM010_rot_SNRp.png differ diff --git a/plots/MKN3_x3md010/MKN3_FOC_combine_FWHM020_rot.png b/plots/MKN3_x3md010/MKN3_FOC_combine_FWHM020_rot.png index 3e6c645..68f5677 100644 Binary files a/plots/MKN3_x3md010/MKN3_FOC_combine_FWHM020_rot.png and b/plots/MKN3_x3md010/MKN3_FOC_combine_FWHM020_rot.png differ diff --git a/plots/MKN3_x3md010/MKN3_FOC_combine_FWHM020_rot_IQU.png b/plots/MKN3_x3md010/MKN3_FOC_combine_FWHM020_rot_IQU.png new file mode 100644 index 0000000..3ca21a2 Binary files /dev/null and b/plots/MKN3_x3md010/MKN3_FOC_combine_FWHM020_rot_IQU.png differ diff --git a/plots/MKN3_x3md010/MKN3_FOC_combine_FWHM020_rot_P.png b/plots/MKN3_x3md010/MKN3_FOC_combine_FWHM020_rot_P.png index 66fdfa5..2e762dd 100644 Binary files a/plots/MKN3_x3md010/MKN3_FOC_combine_FWHM020_rot_P.png and b/plots/MKN3_x3md010/MKN3_FOC_combine_FWHM020_rot_P.png differ diff --git a/plots/MKN3_x3md010/MKN3_FOC_combine_FWHM020_rot_P_err.png b/plots/MKN3_x3md010/MKN3_FOC_combine_FWHM020_rot_P_err.png index 98df975..95f45d8 100644 Binary files a/plots/MKN3_x3md010/MKN3_FOC_combine_FWHM020_rot_P_err.png and b/plots/MKN3_x3md010/MKN3_FOC_combine_FWHM020_rot_P_err.png differ diff --git a/plots/MKN3_x3md010/MKN3_FOC_combine_FWHM020_rot_SNRi.png b/plots/MKN3_x3md010/MKN3_FOC_combine_FWHM020_rot_SNRi.png index ce69214..e28666d 100644 Binary files a/plots/MKN3_x3md010/MKN3_FOC_combine_FWHM020_rot_SNRi.png and b/plots/MKN3_x3md010/MKN3_FOC_combine_FWHM020_rot_SNRi.png differ diff --git a/plots/MKN3_x3md010/MKN3_FOC_combine_FWHM020_rot_SNRp.png b/plots/MKN3_x3md010/MKN3_FOC_combine_FWHM020_rot_SNRp.png index a409300..140fae2 100644 Binary files a/plots/MKN3_x3md010/MKN3_FOC_combine_FWHM020_rot_SNRp.png and b/plots/MKN3_x3md010/MKN3_FOC_combine_FWHM020_rot_SNRp.png differ diff --git a/plots/MKN3_x3md010/MKN3_FOC_crop_region.png b/plots/MKN3_x3md010/MKN3_FOC_crop_region.png new file mode 100644 index 0000000..d113d8f Binary files /dev/null and b/plots/MKN3_x3md010/MKN3_FOC_crop_region.png differ diff --git a/plots/MKN3_x3md010/MKN3_FOC_errors_background_flux.png b/plots/MKN3_x3md010/MKN3_FOC_errors_background_flux.png index 4c6849b..72016a7 100644 Binary files a/plots/MKN3_x3md010/MKN3_FOC_errors_background_flux.png and b/plots/MKN3_x3md010/MKN3_FOC_errors_background_flux.png differ diff --git a/plots/MKN3_x3md010/MKN3_FOC_errors_background_location.png b/plots/MKN3_x3md010/MKN3_FOC_errors_background_location.png index 39515f8..3d1c34c 100644 Binary files a/plots/MKN3_x3md010/MKN3_FOC_errors_background_location.png and b/plots/MKN3_x3md010/MKN3_FOC_errors_background_location.png differ diff --git a/plots/MKN3_x3md010/MKN3_FOC_rot.png b/plots/MKN3_x3md010/MKN3_FOC_rot.png deleted file mode 100644 index 0c25f62..0000000 Binary files a/plots/MKN3_x3md010/MKN3_FOC_rot.png and /dev/null differ diff --git a/plots/MKN3_x3md010/MKN3_FOC_rot_P.png b/plots/MKN3_x3md010/MKN3_FOC_rot_P.png deleted file mode 100644 index 4999e22..0000000 Binary files a/plots/MKN3_x3md010/MKN3_FOC_rot_P.png and /dev/null differ diff --git a/plots/MKN3_x3md010/MKN3_FOC_rot_P_err.png b/plots/MKN3_x3md010/MKN3_FOC_rot_P_err.png deleted file mode 100644 index 19a8c5c..0000000 Binary files a/plots/MKN3_x3md010/MKN3_FOC_rot_P_err.png and /dev/null differ diff --git a/plots/MKN3_x3md010/MKN3_FOC_rot_SNRi.png b/plots/MKN3_x3md010/MKN3_FOC_rot_SNRi.png deleted file mode 100644 index 4922067..0000000 Binary files a/plots/MKN3_x3md010/MKN3_FOC_rot_SNRi.png and /dev/null differ diff --git a/plots/MKN3_x3md010/MKN3_FOC_rot_SNRp.png b/plots/MKN3_x3md010/MKN3_FOC_rot_SNRp.png deleted file mode 100644 index f463626..0000000 Binary files a/plots/MKN3_x3md010/MKN3_FOC_rot_SNRp.png and /dev/null differ diff --git a/plots/MKN3_x3md010/MKN3_zoom_FOC.png b/plots/MKN3_x3md010/MKN3_zoom_FOC.png index ff5dcf1..1e7b22a 100644 Binary files a/plots/MKN3_x3md010/MKN3_zoom_FOC.png and b/plots/MKN3_x3md010/MKN3_zoom_FOC.png differ diff --git a/plots/MKN3_x3md010/MKN3_zoom_FOC_IQU.png b/plots/MKN3_x3md010/MKN3_zoom_FOC_IQU.png new file mode 100644 index 0000000..771f449 Binary files /dev/null and b/plots/MKN3_x3md010/MKN3_zoom_FOC_IQU.png differ diff --git a/plots/MKN3_x3md010/MKN3_zoom_FOC_P.png b/plots/MKN3_x3md010/MKN3_zoom_FOC_P.png index 21f5d8e..14d8044 100644 Binary files a/plots/MKN3_x3md010/MKN3_zoom_FOC_P.png and b/plots/MKN3_x3md010/MKN3_zoom_FOC_P.png differ diff --git a/plots/MKN3_x3md010/MKN3_zoom_FOC_POL120_crop_region.png b/plots/MKN3_x3md010/MKN3_zoom_FOC_POL120_crop_region.png new file mode 100644 index 0000000..364d242 Binary files /dev/null and b/plots/MKN3_x3md010/MKN3_zoom_FOC_POL120_crop_region.png differ diff --git a/plots/MKN3_x3md010/MKN3_zoom_FOC_P_err.png b/plots/MKN3_x3md010/MKN3_zoom_FOC_P_err.png index bb7055b..5ee151e 100644 Binary files a/plots/MKN3_x3md010/MKN3_zoom_FOC_P_err.png and b/plots/MKN3_x3md010/MKN3_zoom_FOC_P_err.png differ diff --git a/plots/MKN3_x3md010/MKN3_zoom_FOC_SNRi.png b/plots/MKN3_x3md010/MKN3_zoom_FOC_SNRi.png index 17756d2..da24e20 100644 Binary files a/plots/MKN3_x3md010/MKN3_zoom_FOC_SNRi.png and b/plots/MKN3_x3md010/MKN3_zoom_FOC_SNRi.png differ diff --git a/plots/MKN3_x3md010/MKN3_zoom_FOC_SNRp.png b/plots/MKN3_x3md010/MKN3_zoom_FOC_SNRp.png index c54690a..1368b4e 100644 Binary files a/plots/MKN3_x3md010/MKN3_zoom_FOC_SNRp.png and b/plots/MKN3_x3md010/MKN3_zoom_FOC_SNRp.png differ diff --git a/plots/MKN3_x3md010/MKN3_zoom_FOC_center_image.png b/plots/MKN3_x3md010/MKN3_zoom_FOC_center_image.png index 1c10195..97040fb 100644 Binary files a/plots/MKN3_x3md010/MKN3_zoom_FOC_center_image.png and b/plots/MKN3_x3md010/MKN3_zoom_FOC_center_image.png differ diff --git a/plots/MKN3_x3md010/MKN3_zoom_FOC_combine_FWHM010_rot.png b/plots/MKN3_x3md010/MKN3_zoom_FOC_combine_FWHM010_rot.png index 1c32ad6..7c3f27b 100644 Binary files a/plots/MKN3_x3md010/MKN3_zoom_FOC_combine_FWHM010_rot.png and b/plots/MKN3_x3md010/MKN3_zoom_FOC_combine_FWHM010_rot.png differ diff --git a/plots/MKN3_x3md010/MKN3_zoom_FOC_combine_FWHM010_rot_IQU.png b/plots/MKN3_x3md010/MKN3_zoom_FOC_combine_FWHM010_rot_IQU.png new file mode 100644 index 0000000..8a09a8f Binary files /dev/null and b/plots/MKN3_x3md010/MKN3_zoom_FOC_combine_FWHM010_rot_IQU.png differ diff --git a/plots/MKN3_x3md010/MKN3_zoom_FOC_combine_FWHM010_rot_P.png b/plots/MKN3_x3md010/MKN3_zoom_FOC_combine_FWHM010_rot_P.png index 8085bf3..167cabc 100644 Binary files a/plots/MKN3_x3md010/MKN3_zoom_FOC_combine_FWHM010_rot_P.png and b/plots/MKN3_x3md010/MKN3_zoom_FOC_combine_FWHM010_rot_P.png differ diff --git a/plots/MKN3_x3md010/MKN3_zoom_FOC_combine_FWHM010_rot_P_err.png b/plots/MKN3_x3md010/MKN3_zoom_FOC_combine_FWHM010_rot_P_err.png index e170ce7..63944d8 100644 Binary files a/plots/MKN3_x3md010/MKN3_zoom_FOC_combine_FWHM010_rot_P_err.png and b/plots/MKN3_x3md010/MKN3_zoom_FOC_combine_FWHM010_rot_P_err.png differ diff --git a/plots/MKN3_x3md010/MKN3_zoom_FOC_combine_FWHM010_rot_SNRi.png b/plots/MKN3_x3md010/MKN3_zoom_FOC_combine_FWHM010_rot_SNRi.png index dd6136a..6ad0477 100644 Binary files a/plots/MKN3_x3md010/MKN3_zoom_FOC_combine_FWHM010_rot_SNRi.png and b/plots/MKN3_x3md010/MKN3_zoom_FOC_combine_FWHM010_rot_SNRi.png differ diff --git a/plots/MKN3_x3md010/MKN3_zoom_FOC_combine_FWHM010_rot_SNRp.png b/plots/MKN3_x3md010/MKN3_zoom_FOC_combine_FWHM010_rot_SNRp.png index f63f72f..34670b5 100644 Binary files a/plots/MKN3_x3md010/MKN3_zoom_FOC_combine_FWHM010_rot_SNRp.png and b/plots/MKN3_x3md010/MKN3_zoom_FOC_combine_FWHM010_rot_SNRp.png differ diff --git a/plots/MKN3_x3md010/MKN3_zoom_FOC_combine_FWHM020_rot.png b/plots/MKN3_x3md010/MKN3_zoom_FOC_combine_FWHM020_rot.png index ca4efaf..57c19c2 100644 Binary files a/plots/MKN3_x3md010/MKN3_zoom_FOC_combine_FWHM020_rot.png and b/plots/MKN3_x3md010/MKN3_zoom_FOC_combine_FWHM020_rot.png differ diff --git a/plots/MKN3_x3md010/MKN3_zoom_FOC_combine_FWHM020_rot_IQU.png b/plots/MKN3_x3md010/MKN3_zoom_FOC_combine_FWHM020_rot_IQU.png new file mode 100644 index 0000000..08c1bd1 Binary files /dev/null and b/plots/MKN3_x3md010/MKN3_zoom_FOC_combine_FWHM020_rot_IQU.png differ diff --git a/plots/MKN3_x3md010/MKN3_zoom_FOC_combine_FWHM020_rot_P.png b/plots/MKN3_x3md010/MKN3_zoom_FOC_combine_FWHM020_rot_P.png index 3cf89f4..67b5140 100644 Binary files a/plots/MKN3_x3md010/MKN3_zoom_FOC_combine_FWHM020_rot_P.png and b/plots/MKN3_x3md010/MKN3_zoom_FOC_combine_FWHM020_rot_P.png differ diff --git a/plots/MKN3_x3md010/MKN3_zoom_FOC_combine_FWHM020_rot_P_err.png b/plots/MKN3_x3md010/MKN3_zoom_FOC_combine_FWHM020_rot_P_err.png index 08677cc..f258aaa 100644 Binary files a/plots/MKN3_x3md010/MKN3_zoom_FOC_combine_FWHM020_rot_P_err.png and b/plots/MKN3_x3md010/MKN3_zoom_FOC_combine_FWHM020_rot_P_err.png differ diff --git a/plots/MKN3_x3md010/MKN3_zoom_FOC_combine_FWHM020_rot_SNRi.png b/plots/MKN3_x3md010/MKN3_zoom_FOC_combine_FWHM020_rot_SNRi.png index 6e75408..f508668 100644 Binary files a/plots/MKN3_x3md010/MKN3_zoom_FOC_combine_FWHM020_rot_SNRi.png and b/plots/MKN3_x3md010/MKN3_zoom_FOC_combine_FWHM020_rot_SNRi.png differ diff --git a/plots/MKN3_x3md010/MKN3_zoom_FOC_combine_FWHM020_rot_SNRp.png b/plots/MKN3_x3md010/MKN3_zoom_FOC_combine_FWHM020_rot_SNRp.png index 831ade2..018000d 100644 Binary files a/plots/MKN3_x3md010/MKN3_zoom_FOC_combine_FWHM020_rot_SNRp.png and b/plots/MKN3_x3md010/MKN3_zoom_FOC_combine_FWHM020_rot_SNRp.png differ diff --git a/plots/MKN3_x3md010/MKN3_zoom_FOC_crop_region.png b/plots/MKN3_x3md010/MKN3_zoom_FOC_crop_region.png new file mode 100644 index 0000000..57998c6 Binary files /dev/null and b/plots/MKN3_x3md010/MKN3_zoom_FOC_crop_region.png differ diff --git a/plots/MKN3_x3md010/MKN3_zoom_FOC_errors_background_flux.png b/plots/MKN3_x3md010/MKN3_zoom_FOC_errors_background_flux.png index de22d80..c56ddb3 100644 Binary files a/plots/MKN3_x3md010/MKN3_zoom_FOC_errors_background_flux.png and b/plots/MKN3_x3md010/MKN3_zoom_FOC_errors_background_flux.png differ diff --git a/plots/MKN3_x3md010/MKN3_zoom_FOC_errors_background_location.png b/plots/MKN3_x3md010/MKN3_zoom_FOC_errors_background_location.png index ab1f2e5..ababd4d 100644 Binary files a/plots/MKN3_x3md010/MKN3_zoom_FOC_errors_background_location.png and b/plots/MKN3_x3md010/MKN3_zoom_FOC_errors_background_location.png differ diff --git a/plots/MKN3_x3md010/MKN3_zoom_FOC_rot.png b/plots/MKN3_x3md010/MKN3_zoom_FOC_rot.png deleted file mode 100644 index 26db52a..0000000 Binary files a/plots/MKN3_x3md010/MKN3_zoom_FOC_rot.png and /dev/null differ diff --git a/plots/MKN3_x3md010/MKN3_zoom_FOC_rot_P.png b/plots/MKN3_x3md010/MKN3_zoom_FOC_rot_P.png deleted file mode 100644 index 678b961..0000000 Binary files a/plots/MKN3_x3md010/MKN3_zoom_FOC_rot_P.png and /dev/null differ diff --git a/plots/MKN3_x3md010/MKN3_zoom_FOC_rot_P_err.png b/plots/MKN3_x3md010/MKN3_zoom_FOC_rot_P_err.png deleted file mode 100644 index 4093d3a..0000000 Binary files a/plots/MKN3_x3md010/MKN3_zoom_FOC_rot_P_err.png and /dev/null differ diff --git a/plots/MKN3_x3md010/MKN3_zoom_FOC_rot_SNRi.png b/plots/MKN3_x3md010/MKN3_zoom_FOC_rot_SNRi.png deleted file mode 100644 index 2666554..0000000 Binary files a/plots/MKN3_x3md010/MKN3_zoom_FOC_rot_SNRi.png and /dev/null differ diff --git a/plots/MKN3_x3md010/MKN3_zoom_FOC_rot_SNRp.png b/plots/MKN3_x3md010/MKN3_zoom_FOC_rot_SNRp.png deleted file mode 100644 index cba70ac..0000000 Binary files a/plots/MKN3_x3md010/MKN3_zoom_FOC_rot_SNRp.png and /dev/null differ diff --git a/plots/MKN3_x3nl010/MKN3_FOC.png b/plots/MKN3_x3nl010/MKN3_FOC.png index 2e56946..3f6c178 100644 Binary files a/plots/MKN3_x3nl010/MKN3_FOC.png and b/plots/MKN3_x3nl010/MKN3_FOC.png differ diff --git a/plots/MKN3_x3nl010/MKN3_FOC_IQU.png b/plots/MKN3_x3nl010/MKN3_FOC_IQU.png new file mode 100644 index 0000000..b6d0ca8 Binary files /dev/null and b/plots/MKN3_x3nl010/MKN3_FOC_IQU.png differ diff --git a/plots/MKN3_x3nl010/MKN3_FOC_P.png b/plots/MKN3_x3nl010/MKN3_FOC_P.png index 33e10df..1c75827 100644 Binary files a/plots/MKN3_x3nl010/MKN3_FOC_P.png and b/plots/MKN3_x3nl010/MKN3_FOC_P.png differ diff --git a/plots/MKN3_x3nl010/MKN3_FOC_POL0_crop_region.png b/plots/MKN3_x3nl010/MKN3_FOC_POL0_crop_region.png new file mode 100644 index 0000000..eb47c13 Binary files /dev/null and b/plots/MKN3_x3nl010/MKN3_FOC_POL0_crop_region.png differ diff --git a/plots/MKN3_x3nl010/MKN3_FOC_P_err.png b/plots/MKN3_x3nl010/MKN3_FOC_P_err.png index 7d5b99f..f48f3ac 100644 Binary files a/plots/MKN3_x3nl010/MKN3_FOC_P_err.png and b/plots/MKN3_x3nl010/MKN3_FOC_P_err.png differ diff --git a/plots/MKN3_x3nl010/MKN3_FOC_SNRi.png b/plots/MKN3_x3nl010/MKN3_FOC_SNRi.png index 390943c..067938e 100644 Binary files a/plots/MKN3_x3nl010/MKN3_FOC_SNRi.png and b/plots/MKN3_x3nl010/MKN3_FOC_SNRi.png differ diff --git a/plots/MKN3_x3nl010/MKN3_FOC_SNRp.png b/plots/MKN3_x3nl010/MKN3_FOC_SNRp.png index d168ed6..6053dbe 100644 Binary files a/plots/MKN3_x3nl010/MKN3_FOC_SNRp.png and b/plots/MKN3_x3nl010/MKN3_FOC_SNRp.png differ diff --git a/plots/MKN3_x3nl010/MKN3_FOC_center_image.png b/plots/MKN3_x3nl010/MKN3_FOC_center_image.png index 45a7aa2..3a3d831 100644 Binary files a/plots/MKN3_x3nl010/MKN3_FOC_center_image.png and b/plots/MKN3_x3nl010/MKN3_FOC_center_image.png differ diff --git a/plots/MKN3_x3nl010/MKN3_FOC_combine_FWHM010_rot.png b/plots/MKN3_x3nl010/MKN3_FOC_combine_FWHM010_rot.png index 1dd1deb..9e713a1 100644 Binary files a/plots/MKN3_x3nl010/MKN3_FOC_combine_FWHM010_rot.png and b/plots/MKN3_x3nl010/MKN3_FOC_combine_FWHM010_rot.png differ diff --git a/plots/MKN3_x3nl010/MKN3_FOC_combine_FWHM010_rot_IQU.png b/plots/MKN3_x3nl010/MKN3_FOC_combine_FWHM010_rot_IQU.png new file mode 100644 index 0000000..56760c2 Binary files /dev/null and b/plots/MKN3_x3nl010/MKN3_FOC_combine_FWHM010_rot_IQU.png differ diff --git a/plots/MKN3_x3nl010/MKN3_FOC_combine_FWHM010_rot_P.png b/plots/MKN3_x3nl010/MKN3_FOC_combine_FWHM010_rot_P.png index f0e552b..bca5389 100644 Binary files a/plots/MKN3_x3nl010/MKN3_FOC_combine_FWHM010_rot_P.png and b/plots/MKN3_x3nl010/MKN3_FOC_combine_FWHM010_rot_P.png differ diff --git a/plots/MKN3_x3nl010/MKN3_FOC_combine_FWHM010_rot_P_err.png b/plots/MKN3_x3nl010/MKN3_FOC_combine_FWHM010_rot_P_err.png index 35193ff..f48df8d 100644 Binary files a/plots/MKN3_x3nl010/MKN3_FOC_combine_FWHM010_rot_P_err.png and b/plots/MKN3_x3nl010/MKN3_FOC_combine_FWHM010_rot_P_err.png differ diff --git a/plots/MKN3_x3nl010/MKN3_FOC_combine_FWHM010_rot_SNRi.png b/plots/MKN3_x3nl010/MKN3_FOC_combine_FWHM010_rot_SNRi.png index e84c550..b0e5971 100644 Binary files a/plots/MKN3_x3nl010/MKN3_FOC_combine_FWHM010_rot_SNRi.png and b/plots/MKN3_x3nl010/MKN3_FOC_combine_FWHM010_rot_SNRi.png differ diff --git a/plots/MKN3_x3nl010/MKN3_FOC_combine_FWHM010_rot_SNRp.png b/plots/MKN3_x3nl010/MKN3_FOC_combine_FWHM010_rot_SNRp.png index 332ca44..c8896cb 100644 Binary files a/plots/MKN3_x3nl010/MKN3_FOC_combine_FWHM010_rot_SNRp.png and b/plots/MKN3_x3nl010/MKN3_FOC_combine_FWHM010_rot_SNRp.png differ diff --git a/plots/MKN3_x3nl010/MKN3_FOC_combine_FWHM020_rot.png b/plots/MKN3_x3nl010/MKN3_FOC_combine_FWHM020_rot.png index 8ba13ee..75fac36 100644 Binary files a/plots/MKN3_x3nl010/MKN3_FOC_combine_FWHM020_rot.png and b/plots/MKN3_x3nl010/MKN3_FOC_combine_FWHM020_rot.png differ diff --git a/plots/MKN3_x3nl010/MKN3_FOC_combine_FWHM020_rot_IQU.png b/plots/MKN3_x3nl010/MKN3_FOC_combine_FWHM020_rot_IQU.png new file mode 100644 index 0000000..286d2f3 Binary files /dev/null and b/plots/MKN3_x3nl010/MKN3_FOC_combine_FWHM020_rot_IQU.png differ diff --git a/plots/MKN3_x3nl010/MKN3_FOC_combine_FWHM020_rot_P.png b/plots/MKN3_x3nl010/MKN3_FOC_combine_FWHM020_rot_P.png index e1b1ba4..b03d46d 100644 Binary files a/plots/MKN3_x3nl010/MKN3_FOC_combine_FWHM020_rot_P.png and b/plots/MKN3_x3nl010/MKN3_FOC_combine_FWHM020_rot_P.png differ diff --git a/plots/MKN3_x3nl010/MKN3_FOC_combine_FWHM020_rot_P_err.png b/plots/MKN3_x3nl010/MKN3_FOC_combine_FWHM020_rot_P_err.png index 0e84e02..fbe2212 100644 Binary files a/plots/MKN3_x3nl010/MKN3_FOC_combine_FWHM020_rot_P_err.png and b/plots/MKN3_x3nl010/MKN3_FOC_combine_FWHM020_rot_P_err.png differ diff --git a/plots/MKN3_x3nl010/MKN3_FOC_combine_FWHM020_rot_SNRi.png b/plots/MKN3_x3nl010/MKN3_FOC_combine_FWHM020_rot_SNRi.png index 5db3bbd..0123156 100644 Binary files a/plots/MKN3_x3nl010/MKN3_FOC_combine_FWHM020_rot_SNRi.png and b/plots/MKN3_x3nl010/MKN3_FOC_combine_FWHM020_rot_SNRi.png differ diff --git a/plots/MKN3_x3nl010/MKN3_FOC_combine_FWHM020_rot_SNRp.png b/plots/MKN3_x3nl010/MKN3_FOC_combine_FWHM020_rot_SNRp.png index 2d26897..db92fa8 100644 Binary files a/plots/MKN3_x3nl010/MKN3_FOC_combine_FWHM020_rot_SNRp.png and b/plots/MKN3_x3nl010/MKN3_FOC_combine_FWHM020_rot_SNRp.png differ diff --git a/plots/MKN3_x3nl010/MKN3_FOC_crop_region.png b/plots/MKN3_x3nl010/MKN3_FOC_crop_region.png new file mode 100644 index 0000000..38e60bb Binary files /dev/null and b/plots/MKN3_x3nl010/MKN3_FOC_crop_region.png differ diff --git a/plots/MKN3_x3nl010/MKN3_FOC_errors_background_flux.png b/plots/MKN3_x3nl010/MKN3_FOC_errors_background_flux.png index 5ea350d..1cc40ea 100644 Binary files a/plots/MKN3_x3nl010/MKN3_FOC_errors_background_flux.png and b/plots/MKN3_x3nl010/MKN3_FOC_errors_background_flux.png differ diff --git a/plots/MKN3_x3nl010/MKN3_FOC_errors_background_location.png b/plots/MKN3_x3nl010/MKN3_FOC_errors_background_location.png index 3ea3493..e4af530 100644 Binary files a/plots/MKN3_x3nl010/MKN3_FOC_errors_background_location.png and b/plots/MKN3_x3nl010/MKN3_FOC_errors_background_location.png differ diff --git a/plots/MKN3_x3nl010/MKN3_FOC_rot.png b/plots/MKN3_x3nl010/MKN3_FOC_rot.png deleted file mode 100644 index 26dde87..0000000 Binary files a/plots/MKN3_x3nl010/MKN3_FOC_rot.png and /dev/null differ diff --git a/plots/MKN3_x3nl010/MKN3_FOC_rot_P.png b/plots/MKN3_x3nl010/MKN3_FOC_rot_P.png deleted file mode 100644 index bbaf1f1..0000000 Binary files a/plots/MKN3_x3nl010/MKN3_FOC_rot_P.png and /dev/null differ diff --git a/plots/MKN3_x3nl010/MKN3_FOC_rot_P_err.png b/plots/MKN3_x3nl010/MKN3_FOC_rot_P_err.png deleted file mode 100644 index 8c105bc..0000000 Binary files a/plots/MKN3_x3nl010/MKN3_FOC_rot_P_err.png and /dev/null differ diff --git a/plots/MKN3_x3nl010/MKN3_FOC_rot_SNRi.png b/plots/MKN3_x3nl010/MKN3_FOC_rot_SNRi.png deleted file mode 100644 index cb3eee3..0000000 Binary files a/plots/MKN3_x3nl010/MKN3_FOC_rot_SNRi.png and /dev/null differ diff --git a/plots/MKN3_x3nl010/MKN3_FOC_rot_SNRp.png b/plots/MKN3_x3nl010/MKN3_FOC_rot_SNRp.png deleted file mode 100644 index 0a692fd..0000000 Binary files a/plots/MKN3_x3nl010/MKN3_FOC_rot_SNRp.png and /dev/null differ diff --git a/plots/MKN463_x2rp030/MKN463_FOC.png b/plots/MKN463_x2rp030/MKN463_FOC.png index 5488e81..44e2ab1 100644 Binary files a/plots/MKN463_x2rp030/MKN463_FOC.png and b/plots/MKN463_x2rp030/MKN463_FOC.png differ diff --git a/plots/MKN463_x2rp030/MKN463_FOC_IQU.png b/plots/MKN463_x2rp030/MKN463_FOC_IQU.png new file mode 100644 index 0000000..38f195f Binary files /dev/null and b/plots/MKN463_x2rp030/MKN463_FOC_IQU.png differ diff --git a/plots/MKN463_x2rp030/MKN463_FOC_P.png b/plots/MKN463_x2rp030/MKN463_FOC_P.png index 0215a0d..7e5471d 100644 Binary files a/plots/MKN463_x2rp030/MKN463_FOC_P.png and b/plots/MKN463_x2rp030/MKN463_FOC_P.png differ diff --git a/plots/MKN463_x2rp030/MKN463_FOC_POL0_crop_region.png b/plots/MKN463_x2rp030/MKN463_FOC_POL0_crop_region.png new file mode 100644 index 0000000..60ecb36 Binary files /dev/null and b/plots/MKN463_x2rp030/MKN463_FOC_POL0_crop_region.png differ diff --git a/plots/MKN463_x2rp030/MKN463_FOC_P_err.png b/plots/MKN463_x2rp030/MKN463_FOC_P_err.png index 545eb0f..10608f5 100644 Binary files a/plots/MKN463_x2rp030/MKN463_FOC_P_err.png and b/plots/MKN463_x2rp030/MKN463_FOC_P_err.png differ diff --git a/plots/MKN463_x2rp030/MKN463_FOC_SNRi.png b/plots/MKN463_x2rp030/MKN463_FOC_SNRi.png index e81b5b0..a27908e 100644 Binary files a/plots/MKN463_x2rp030/MKN463_FOC_SNRi.png and b/plots/MKN463_x2rp030/MKN463_FOC_SNRi.png differ diff --git a/plots/MKN463_x2rp030/MKN463_FOC_SNRp.png b/plots/MKN463_x2rp030/MKN463_FOC_SNRp.png index ec79f1b..4df8078 100644 Binary files a/plots/MKN463_x2rp030/MKN463_FOC_SNRp.png and b/plots/MKN463_x2rp030/MKN463_FOC_SNRp.png differ diff --git a/plots/MKN463_x2rp030/MKN463_FOC_center_image.png b/plots/MKN463_x2rp030/MKN463_FOC_center_image.png index 87f5184..6712cb3 100644 Binary files a/plots/MKN463_x2rp030/MKN463_FOC_center_image.png and b/plots/MKN463_x2rp030/MKN463_FOC_center_image.png differ diff --git a/plots/MKN463_x2rp030/MKN463_FOC_combine_FWHM010_rot.png b/plots/MKN463_x2rp030/MKN463_FOC_combine_FWHM010_rot.png index 7d37034..62d14ae 100644 Binary files a/plots/MKN463_x2rp030/MKN463_FOC_combine_FWHM010_rot.png and b/plots/MKN463_x2rp030/MKN463_FOC_combine_FWHM010_rot.png differ diff --git a/plots/MKN463_x2rp030/MKN463_FOC_combine_FWHM010_rot_IQU.png b/plots/MKN463_x2rp030/MKN463_FOC_combine_FWHM010_rot_IQU.png new file mode 100644 index 0000000..4ee235d Binary files /dev/null and b/plots/MKN463_x2rp030/MKN463_FOC_combine_FWHM010_rot_IQU.png differ diff --git a/plots/MKN463_x2rp030/MKN463_FOC_combine_FWHM010_rot_P.png b/plots/MKN463_x2rp030/MKN463_FOC_combine_FWHM010_rot_P.png index 42ab945..514bce7 100644 Binary files a/plots/MKN463_x2rp030/MKN463_FOC_combine_FWHM010_rot_P.png and b/plots/MKN463_x2rp030/MKN463_FOC_combine_FWHM010_rot_P.png differ diff --git a/plots/MKN463_x2rp030/MKN463_FOC_combine_FWHM010_rot_P_err.png b/plots/MKN463_x2rp030/MKN463_FOC_combine_FWHM010_rot_P_err.png index fd700b1..8ca56f2 100644 Binary files a/plots/MKN463_x2rp030/MKN463_FOC_combine_FWHM010_rot_P_err.png and b/plots/MKN463_x2rp030/MKN463_FOC_combine_FWHM010_rot_P_err.png differ diff --git a/plots/MKN463_x2rp030/MKN463_FOC_combine_FWHM010_rot_SNRi.png b/plots/MKN463_x2rp030/MKN463_FOC_combine_FWHM010_rot_SNRi.png index 11f90d3..db1d89d 100644 Binary files a/plots/MKN463_x2rp030/MKN463_FOC_combine_FWHM010_rot_SNRi.png and b/plots/MKN463_x2rp030/MKN463_FOC_combine_FWHM010_rot_SNRi.png differ diff --git a/plots/MKN463_x2rp030/MKN463_FOC_combine_FWHM010_rot_SNRp.png b/plots/MKN463_x2rp030/MKN463_FOC_combine_FWHM010_rot_SNRp.png index 3e714b4..9952c3d 100644 Binary files a/plots/MKN463_x2rp030/MKN463_FOC_combine_FWHM010_rot_SNRp.png and b/plots/MKN463_x2rp030/MKN463_FOC_combine_FWHM010_rot_SNRp.png differ diff --git a/plots/MKN463_x2rp030/MKN463_FOC_combine_FWHM020_rot.png b/plots/MKN463_x2rp030/MKN463_FOC_combine_FWHM020_rot.png index e9b5e61..22064b3 100644 Binary files a/plots/MKN463_x2rp030/MKN463_FOC_combine_FWHM020_rot.png and b/plots/MKN463_x2rp030/MKN463_FOC_combine_FWHM020_rot.png differ diff --git a/plots/MKN463_x2rp030/MKN463_FOC_combine_FWHM020_rot_IQU.png b/plots/MKN463_x2rp030/MKN463_FOC_combine_FWHM020_rot_IQU.png new file mode 100644 index 0000000..3902f68 Binary files /dev/null and b/plots/MKN463_x2rp030/MKN463_FOC_combine_FWHM020_rot_IQU.png differ diff --git a/plots/MKN463_x2rp030/MKN463_FOC_combine_FWHM020_rot_P.png b/plots/MKN463_x2rp030/MKN463_FOC_combine_FWHM020_rot_P.png index 94d6ef3..11b023c 100644 Binary files a/plots/MKN463_x2rp030/MKN463_FOC_combine_FWHM020_rot_P.png and b/plots/MKN463_x2rp030/MKN463_FOC_combine_FWHM020_rot_P.png differ diff --git a/plots/MKN463_x2rp030/MKN463_FOC_combine_FWHM020_rot_P_err.png b/plots/MKN463_x2rp030/MKN463_FOC_combine_FWHM020_rot_P_err.png index ab0c562..70eb946 100644 Binary files a/plots/MKN463_x2rp030/MKN463_FOC_combine_FWHM020_rot_P_err.png and b/plots/MKN463_x2rp030/MKN463_FOC_combine_FWHM020_rot_P_err.png differ diff --git a/plots/MKN463_x2rp030/MKN463_FOC_combine_FWHM020_rot_SNRi.png b/plots/MKN463_x2rp030/MKN463_FOC_combine_FWHM020_rot_SNRi.png index 86c9de1..3aa5c64 100644 Binary files a/plots/MKN463_x2rp030/MKN463_FOC_combine_FWHM020_rot_SNRi.png and b/plots/MKN463_x2rp030/MKN463_FOC_combine_FWHM020_rot_SNRi.png differ diff --git a/plots/MKN463_x2rp030/MKN463_FOC_combine_FWHM020_rot_SNRp.png b/plots/MKN463_x2rp030/MKN463_FOC_combine_FWHM020_rot_SNRp.png index 89aafaf..4e9a902 100644 Binary files a/plots/MKN463_x2rp030/MKN463_FOC_combine_FWHM020_rot_SNRp.png and b/plots/MKN463_x2rp030/MKN463_FOC_combine_FWHM020_rot_SNRp.png differ diff --git a/plots/MKN463_x2rp030/MKN463_FOC_crop_region.png b/plots/MKN463_x2rp030/MKN463_FOC_crop_region.png new file mode 100644 index 0000000..3d1d4ac Binary files /dev/null and b/plots/MKN463_x2rp030/MKN463_FOC_crop_region.png differ diff --git a/plots/MKN463_x2rp030/MKN463_FOC_errors_background_flux.png b/plots/MKN463_x2rp030/MKN463_FOC_errors_background_flux.png index 975f4af..1d938ad 100644 Binary files a/plots/MKN463_x2rp030/MKN463_FOC_errors_background_flux.png and b/plots/MKN463_x2rp030/MKN463_FOC_errors_background_flux.png differ diff --git a/plots/MKN463_x2rp030/MKN463_FOC_errors_background_location.png b/plots/MKN463_x2rp030/MKN463_FOC_errors_background_location.png index 14164c2..661b89f 100644 Binary files a/plots/MKN463_x2rp030/MKN463_FOC_errors_background_location.png and b/plots/MKN463_x2rp030/MKN463_FOC_errors_background_location.png differ diff --git a/plots/MKN463_x2rp030/MKN463_FOC_rot.png b/plots/MKN463_x2rp030/MKN463_FOC_rot.png deleted file mode 100644 index 6eeddf2..0000000 Binary files a/plots/MKN463_x2rp030/MKN463_FOC_rot.png and /dev/null differ diff --git a/plots/MKN463_x2rp030/MKN463_FOC_rot_P.png b/plots/MKN463_x2rp030/MKN463_FOC_rot_P.png deleted file mode 100644 index c1a6f48..0000000 Binary files a/plots/MKN463_x2rp030/MKN463_FOC_rot_P.png and /dev/null differ diff --git a/plots/MKN463_x2rp030/MKN463_FOC_rot_P_err.png b/plots/MKN463_x2rp030/MKN463_FOC_rot_P_err.png deleted file mode 100644 index b7cb9bb..0000000 Binary files a/plots/MKN463_x2rp030/MKN463_FOC_rot_P_err.png and /dev/null differ diff --git a/plots/MKN463_x2rp030/MKN463_FOC_rot_SNRi.png b/plots/MKN463_x2rp030/MKN463_FOC_rot_SNRi.png deleted file mode 100644 index 706214c..0000000 Binary files a/plots/MKN463_x2rp030/MKN463_FOC_rot_SNRi.png and /dev/null differ diff --git a/plots/MKN463_x2rp030/MKN463_FOC_rot_SNRp.png b/plots/MKN463_x2rp030/MKN463_FOC_rot_SNRp.png deleted file mode 100644 index 260fecc..0000000 Binary files a/plots/MKN463_x2rp030/MKN463_FOC_rot_SNRp.png and /dev/null differ diff --git a/plots/MKN78_x3nl020/MKN78_FOC.png b/plots/MKN78_x3nl020/MKN78_FOC.png index 32964ff..f29a114 100644 Binary files a/plots/MKN78_x3nl020/MKN78_FOC.png and b/plots/MKN78_x3nl020/MKN78_FOC.png differ diff --git a/plots/MKN78_x3nl020/MKN78_FOC_IQU.png b/plots/MKN78_x3nl020/MKN78_FOC_IQU.png new file mode 100644 index 0000000..639ddef Binary files /dev/null and b/plots/MKN78_x3nl020/MKN78_FOC_IQU.png differ diff --git a/plots/MKN78_x3nl020/MKN78_FOC_P.png b/plots/MKN78_x3nl020/MKN78_FOC_P.png index 7b0a3a2..3342b80 100644 Binary files a/plots/MKN78_x3nl020/MKN78_FOC_P.png and b/plots/MKN78_x3nl020/MKN78_FOC_P.png differ diff --git a/plots/MKN78_x3nl020/MKN78_FOC_POL0_crop_region.png b/plots/MKN78_x3nl020/MKN78_FOC_POL0_crop_region.png new file mode 100644 index 0000000..fd63b96 Binary files /dev/null and b/plots/MKN78_x3nl020/MKN78_FOC_POL0_crop_region.png differ diff --git a/plots/MKN78_x3nl020/MKN78_FOC_P_err.png b/plots/MKN78_x3nl020/MKN78_FOC_P_err.png index e96a7f5..edd92b7 100644 Binary files a/plots/MKN78_x3nl020/MKN78_FOC_P_err.png and b/plots/MKN78_x3nl020/MKN78_FOC_P_err.png differ diff --git a/plots/MKN78_x3nl020/MKN78_FOC_SNRi.png b/plots/MKN78_x3nl020/MKN78_FOC_SNRi.png index 634d2a8..d85122b 100644 Binary files a/plots/MKN78_x3nl020/MKN78_FOC_SNRi.png and b/plots/MKN78_x3nl020/MKN78_FOC_SNRi.png differ diff --git a/plots/MKN78_x3nl020/MKN78_FOC_SNRp.png b/plots/MKN78_x3nl020/MKN78_FOC_SNRp.png index 1b73585..f300942 100644 Binary files a/plots/MKN78_x3nl020/MKN78_FOC_SNRp.png and b/plots/MKN78_x3nl020/MKN78_FOC_SNRp.png differ diff --git a/plots/MKN78_x3nl020/MKN78_FOC_center_image.png b/plots/MKN78_x3nl020/MKN78_FOC_center_image.png index d02e057..a75d89e 100644 Binary files a/plots/MKN78_x3nl020/MKN78_FOC_center_image.png and b/plots/MKN78_x3nl020/MKN78_FOC_center_image.png differ diff --git a/plots/MKN78_x3nl020/MKN78_FOC_combine_FWHM010_rot.png b/plots/MKN78_x3nl020/MKN78_FOC_combine_FWHM010_rot.png index 194de13..40182b7 100644 Binary files a/plots/MKN78_x3nl020/MKN78_FOC_combine_FWHM010_rot.png and b/plots/MKN78_x3nl020/MKN78_FOC_combine_FWHM010_rot.png differ diff --git a/plots/MKN78_x3nl020/MKN78_FOC_combine_FWHM010_rot_IQU.png b/plots/MKN78_x3nl020/MKN78_FOC_combine_FWHM010_rot_IQU.png new file mode 100644 index 0000000..30c6b31 Binary files /dev/null and b/plots/MKN78_x3nl020/MKN78_FOC_combine_FWHM010_rot_IQU.png differ diff --git a/plots/MKN78_x3nl020/MKN78_FOC_combine_FWHM010_rot_P.png b/plots/MKN78_x3nl020/MKN78_FOC_combine_FWHM010_rot_P.png index 9724d3e..4a04a47 100644 Binary files a/plots/MKN78_x3nl020/MKN78_FOC_combine_FWHM010_rot_P.png and b/plots/MKN78_x3nl020/MKN78_FOC_combine_FWHM010_rot_P.png differ diff --git a/plots/MKN78_x3nl020/MKN78_FOC_combine_FWHM010_rot_P_err.png b/plots/MKN78_x3nl020/MKN78_FOC_combine_FWHM010_rot_P_err.png index 0e81288..aa4e678 100644 Binary files a/plots/MKN78_x3nl020/MKN78_FOC_combine_FWHM010_rot_P_err.png and b/plots/MKN78_x3nl020/MKN78_FOC_combine_FWHM010_rot_P_err.png differ diff --git a/plots/MKN78_x3nl020/MKN78_FOC_combine_FWHM010_rot_SNRi.png b/plots/MKN78_x3nl020/MKN78_FOC_combine_FWHM010_rot_SNRi.png index 50933cd..5a7360e 100644 Binary files a/plots/MKN78_x3nl020/MKN78_FOC_combine_FWHM010_rot_SNRi.png and b/plots/MKN78_x3nl020/MKN78_FOC_combine_FWHM010_rot_SNRi.png differ diff --git a/plots/MKN78_x3nl020/MKN78_FOC_combine_FWHM010_rot_SNRp.png b/plots/MKN78_x3nl020/MKN78_FOC_combine_FWHM010_rot_SNRp.png index 44f094d..f7f8635 100644 Binary files a/plots/MKN78_x3nl020/MKN78_FOC_combine_FWHM010_rot_SNRp.png and b/plots/MKN78_x3nl020/MKN78_FOC_combine_FWHM010_rot_SNRp.png differ diff --git a/plots/MKN78_x3nl020/MKN78_FOC_combine_FWHM020_rot.png b/plots/MKN78_x3nl020/MKN78_FOC_combine_FWHM020_rot.png index cced1e8..86901b2 100644 Binary files a/plots/MKN78_x3nl020/MKN78_FOC_combine_FWHM020_rot.png and b/plots/MKN78_x3nl020/MKN78_FOC_combine_FWHM020_rot.png differ diff --git a/plots/MKN78_x3nl020/MKN78_FOC_combine_FWHM020_rot_IQU.png b/plots/MKN78_x3nl020/MKN78_FOC_combine_FWHM020_rot_IQU.png new file mode 100644 index 0000000..f800be9 Binary files /dev/null and b/plots/MKN78_x3nl020/MKN78_FOC_combine_FWHM020_rot_IQU.png differ diff --git a/plots/MKN78_x3nl020/MKN78_FOC_combine_FWHM020_rot_P.png b/plots/MKN78_x3nl020/MKN78_FOC_combine_FWHM020_rot_P.png index 13a9763..453d319 100644 Binary files a/plots/MKN78_x3nl020/MKN78_FOC_combine_FWHM020_rot_P.png and b/plots/MKN78_x3nl020/MKN78_FOC_combine_FWHM020_rot_P.png differ diff --git a/plots/MKN78_x3nl020/MKN78_FOC_combine_FWHM020_rot_P_err.png b/plots/MKN78_x3nl020/MKN78_FOC_combine_FWHM020_rot_P_err.png index 9b8047c..7e904aa 100644 Binary files a/plots/MKN78_x3nl020/MKN78_FOC_combine_FWHM020_rot_P_err.png and b/plots/MKN78_x3nl020/MKN78_FOC_combine_FWHM020_rot_P_err.png differ diff --git a/plots/MKN78_x3nl020/MKN78_FOC_combine_FWHM020_rot_SNRi.png b/plots/MKN78_x3nl020/MKN78_FOC_combine_FWHM020_rot_SNRi.png index 470087a..d47a2b5 100644 Binary files a/plots/MKN78_x3nl020/MKN78_FOC_combine_FWHM020_rot_SNRi.png and b/plots/MKN78_x3nl020/MKN78_FOC_combine_FWHM020_rot_SNRi.png differ diff --git a/plots/MKN78_x3nl020/MKN78_FOC_combine_FWHM020_rot_SNRp.png b/plots/MKN78_x3nl020/MKN78_FOC_combine_FWHM020_rot_SNRp.png index b574bc3..6b25635 100644 Binary files a/plots/MKN78_x3nl020/MKN78_FOC_combine_FWHM020_rot_SNRp.png and b/plots/MKN78_x3nl020/MKN78_FOC_combine_FWHM020_rot_SNRp.png differ diff --git a/plots/MKN78_x3nl020/MKN78_FOC_crop_region.png b/plots/MKN78_x3nl020/MKN78_FOC_crop_region.png new file mode 100644 index 0000000..c7169d3 Binary files /dev/null and b/plots/MKN78_x3nl020/MKN78_FOC_crop_region.png differ diff --git a/plots/MKN78_x3nl020/MKN78_FOC_errors_background_flux.png b/plots/MKN78_x3nl020/MKN78_FOC_errors_background_flux.png index 4afcf07..6c01b2a 100644 Binary files a/plots/MKN78_x3nl020/MKN78_FOC_errors_background_flux.png and b/plots/MKN78_x3nl020/MKN78_FOC_errors_background_flux.png differ diff --git a/plots/MKN78_x3nl020/MKN78_FOC_errors_background_location.png b/plots/MKN78_x3nl020/MKN78_FOC_errors_background_location.png index 023f29d..5e74f88 100644 Binary files a/plots/MKN78_x3nl020/MKN78_FOC_errors_background_location.png and b/plots/MKN78_x3nl020/MKN78_FOC_errors_background_location.png differ diff --git a/plots/MKN78_x3nl020/MKN78_FOC_rot.png b/plots/MKN78_x3nl020/MKN78_FOC_rot.png deleted file mode 100644 index fc26c16..0000000 Binary files a/plots/MKN78_x3nl020/MKN78_FOC_rot.png and /dev/null differ diff --git a/plots/MKN78_x3nl020/MKN78_FOC_rot_P.png b/plots/MKN78_x3nl020/MKN78_FOC_rot_P.png deleted file mode 100644 index 4497d7f..0000000 Binary files a/plots/MKN78_x3nl020/MKN78_FOC_rot_P.png and /dev/null differ diff --git a/plots/MKN78_x3nl020/MKN78_FOC_rot_P_err.png b/plots/MKN78_x3nl020/MKN78_FOC_rot_P_err.png deleted file mode 100644 index 89e311f..0000000 Binary files a/plots/MKN78_x3nl020/MKN78_FOC_rot_P_err.png and /dev/null differ diff --git a/plots/MKN78_x3nl020/MKN78_FOC_rot_SNRi.png b/plots/MKN78_x3nl020/MKN78_FOC_rot_SNRi.png deleted file mode 100644 index f923443..0000000 Binary files a/plots/MKN78_x3nl020/MKN78_FOC_rot_SNRi.png and /dev/null differ diff --git a/plots/MKN78_x3nl020/MKN78_FOC_rot_SNRp.png b/plots/MKN78_x3nl020/MKN78_FOC_rot_SNRp.png deleted file mode 100644 index 8e2062e..0000000 Binary files a/plots/MKN78_x3nl020/MKN78_FOC_rot_SNRp.png and /dev/null differ diff --git a/plots/NGC1068_x14w010/NGC1068_FOC.png b/plots/NGC1068_x14w010/NGC1068_FOC.png index 92c98fe..1cafc72 100755 Binary files a/plots/NGC1068_x14w010/NGC1068_FOC.png and b/plots/NGC1068_x14w010/NGC1068_FOC.png differ diff --git a/plots/NGC1068_x14w010/NGC1068_FOC_IQU.png b/plots/NGC1068_x14w010/NGC1068_FOC_IQU.png new file mode 100644 index 0000000..acef28c Binary files /dev/null and b/plots/NGC1068_x14w010/NGC1068_FOC_IQU.png differ diff --git a/plots/NGC1068_x14w010/NGC1068_FOC_P.png b/plots/NGC1068_x14w010/NGC1068_FOC_P.png index a8de4eb..4bc39da 100644 Binary files a/plots/NGC1068_x14w010/NGC1068_FOC_P.png and b/plots/NGC1068_x14w010/NGC1068_FOC_P.png differ diff --git a/plots/NGC1068_x14w010/NGC1068_FOC_POL0_crop_region.png b/plots/NGC1068_x14w010/NGC1068_FOC_POL0_crop_region.png new file mode 100644 index 0000000..0ad3e98 Binary files /dev/null and b/plots/NGC1068_x14w010/NGC1068_FOC_POL0_crop_region.png differ diff --git a/plots/NGC1068_x14w010/NGC1068_FOC_P_err.png b/plots/NGC1068_x14w010/NGC1068_FOC_P_err.png index 83d61a7..780c010 100644 Binary files a/plots/NGC1068_x14w010/NGC1068_FOC_P_err.png and b/plots/NGC1068_x14w010/NGC1068_FOC_P_err.png differ diff --git a/plots/NGC1068_x14w010/NGC1068_FOC_SNRi.png b/plots/NGC1068_x14w010/NGC1068_FOC_SNRi.png index 4d97831..d5c7e91 100644 Binary files a/plots/NGC1068_x14w010/NGC1068_FOC_SNRi.png and b/plots/NGC1068_x14w010/NGC1068_FOC_SNRi.png differ diff --git a/plots/NGC1068_x14w010/NGC1068_FOC_SNRp.png b/plots/NGC1068_x14w010/NGC1068_FOC_SNRp.png index 4fe1e54..3a579a9 100644 Binary files a/plots/NGC1068_x14w010/NGC1068_FOC_SNRp.png and b/plots/NGC1068_x14w010/NGC1068_FOC_SNRp.png differ diff --git a/plots/NGC1068_x14w010/NGC1068_FOC_center_image.png b/plots/NGC1068_x14w010/NGC1068_FOC_center_image.png index 0b323ec..67f9763 100644 Binary files a/plots/NGC1068_x14w010/NGC1068_FOC_center_image.png and b/plots/NGC1068_x14w010/NGC1068_FOC_center_image.png differ diff --git a/plots/NGC1068_x14w010/NGC1068_FOC_combine_FWHM010_rot.png b/plots/NGC1068_x14w010/NGC1068_FOC_combine_FWHM010_rot.png index 44d4411..f696fd7 100644 Binary files a/plots/NGC1068_x14w010/NGC1068_FOC_combine_FWHM010_rot.png and b/plots/NGC1068_x14w010/NGC1068_FOC_combine_FWHM010_rot.png differ diff --git a/plots/NGC1068_x14w010/NGC1068_FOC_combine_FWHM010_rot_IQU.png b/plots/NGC1068_x14w010/NGC1068_FOC_combine_FWHM010_rot_IQU.png new file mode 100644 index 0000000..05b9da3 Binary files /dev/null and b/plots/NGC1068_x14w010/NGC1068_FOC_combine_FWHM010_rot_IQU.png differ diff --git a/plots/NGC1068_x14w010/NGC1068_FOC_combine_FWHM010_rot_P.png b/plots/NGC1068_x14w010/NGC1068_FOC_combine_FWHM010_rot_P.png index 319c395..a10f9e8 100644 Binary files a/plots/NGC1068_x14w010/NGC1068_FOC_combine_FWHM010_rot_P.png and b/plots/NGC1068_x14w010/NGC1068_FOC_combine_FWHM010_rot_P.png differ diff --git a/plots/NGC1068_x14w010/NGC1068_FOC_combine_FWHM010_rot_P_err.png b/plots/NGC1068_x14w010/NGC1068_FOC_combine_FWHM010_rot_P_err.png index a31cc5a..aa27775 100644 Binary files a/plots/NGC1068_x14w010/NGC1068_FOC_combine_FWHM010_rot_P_err.png and b/plots/NGC1068_x14w010/NGC1068_FOC_combine_FWHM010_rot_P_err.png differ diff --git a/plots/NGC1068_x14w010/NGC1068_FOC_combine_FWHM010_rot_SNRi.png b/plots/NGC1068_x14w010/NGC1068_FOC_combine_FWHM010_rot_SNRi.png index 658a095..25721be 100644 Binary files a/plots/NGC1068_x14w010/NGC1068_FOC_combine_FWHM010_rot_SNRi.png and b/plots/NGC1068_x14w010/NGC1068_FOC_combine_FWHM010_rot_SNRi.png differ diff --git a/plots/NGC1068_x14w010/NGC1068_FOC_combine_FWHM010_rot_SNRp.png b/plots/NGC1068_x14w010/NGC1068_FOC_combine_FWHM010_rot_SNRp.png index 03cc303..81066de 100644 Binary files a/plots/NGC1068_x14w010/NGC1068_FOC_combine_FWHM010_rot_SNRp.png and b/plots/NGC1068_x14w010/NGC1068_FOC_combine_FWHM010_rot_SNRp.png differ diff --git a/plots/NGC1068_x14w010/NGC1068_FOC_combine_FWHM020_rot.png b/plots/NGC1068_x14w010/NGC1068_FOC_combine_FWHM020_rot.png index 31494a4..46bc56c 100644 Binary files a/plots/NGC1068_x14w010/NGC1068_FOC_combine_FWHM020_rot.png and b/plots/NGC1068_x14w010/NGC1068_FOC_combine_FWHM020_rot.png differ diff --git a/plots/NGC1068_x14w010/NGC1068_FOC_combine_FWHM020_rot_IQU.png b/plots/NGC1068_x14w010/NGC1068_FOC_combine_FWHM020_rot_IQU.png new file mode 100644 index 0000000..06030cc Binary files /dev/null and b/plots/NGC1068_x14w010/NGC1068_FOC_combine_FWHM020_rot_IQU.png differ diff --git a/plots/NGC1068_x14w010/NGC1068_FOC_combine_FWHM020_rot_P.png b/plots/NGC1068_x14w010/NGC1068_FOC_combine_FWHM020_rot_P.png index 57d1c19..b72f1c1 100644 Binary files a/plots/NGC1068_x14w010/NGC1068_FOC_combine_FWHM020_rot_P.png and b/plots/NGC1068_x14w010/NGC1068_FOC_combine_FWHM020_rot_P.png differ diff --git a/plots/NGC1068_x14w010/NGC1068_FOC_combine_FWHM020_rot_P_err.png b/plots/NGC1068_x14w010/NGC1068_FOC_combine_FWHM020_rot_P_err.png index 79ae906..484fcaf 100644 Binary files a/plots/NGC1068_x14w010/NGC1068_FOC_combine_FWHM020_rot_P_err.png and b/plots/NGC1068_x14w010/NGC1068_FOC_combine_FWHM020_rot_P_err.png differ diff --git a/plots/NGC1068_x14w010/NGC1068_FOC_combine_FWHM020_rot_SNRi.png b/plots/NGC1068_x14w010/NGC1068_FOC_combine_FWHM020_rot_SNRi.png index eaaf57c..41094c1 100644 Binary files a/plots/NGC1068_x14w010/NGC1068_FOC_combine_FWHM020_rot_SNRi.png and b/plots/NGC1068_x14w010/NGC1068_FOC_combine_FWHM020_rot_SNRi.png differ diff --git a/plots/NGC1068_x14w010/NGC1068_FOC_combine_FWHM020_rot_SNRp.png b/plots/NGC1068_x14w010/NGC1068_FOC_combine_FWHM020_rot_SNRp.png index 547788c..c3bdfb2 100644 Binary files a/plots/NGC1068_x14w010/NGC1068_FOC_combine_FWHM020_rot_SNRp.png and b/plots/NGC1068_x14w010/NGC1068_FOC_combine_FWHM020_rot_SNRp.png differ diff --git a/plots/NGC1068_x14w010/NGC1068_FOC_crop_region.png b/plots/NGC1068_x14w010/NGC1068_FOC_crop_region.png new file mode 100644 index 0000000..e5c233c Binary files /dev/null and b/plots/NGC1068_x14w010/NGC1068_FOC_crop_region.png differ diff --git a/plots/NGC1068_x14w010/NGC1068_FOC_errors_background_flux.png b/plots/NGC1068_x14w010/NGC1068_FOC_errors_background_flux.png index 71211d7..695749f 100644 Binary files a/plots/NGC1068_x14w010/NGC1068_FOC_errors_background_flux.png and b/plots/NGC1068_x14w010/NGC1068_FOC_errors_background_flux.png differ diff --git a/plots/NGC1068_x14w010/NGC1068_FOC_errors_background_location.png b/plots/NGC1068_x14w010/NGC1068_FOC_errors_background_location.png index f530246..87d311f 100644 Binary files a/plots/NGC1068_x14w010/NGC1068_FOC_errors_background_location.png and b/plots/NGC1068_x14w010/NGC1068_FOC_errors_background_location.png differ diff --git a/plots/NGC1068_x14w010/NGC1068_FOC_rot.png b/plots/NGC1068_x14w010/NGC1068_FOC_rot.png deleted file mode 100644 index 1223210..0000000 Binary files a/plots/NGC1068_x14w010/NGC1068_FOC_rot.png and /dev/null differ diff --git a/plots/NGC1068_x14w010/NGC1068_FOC_rot_P.png b/plots/NGC1068_x14w010/NGC1068_FOC_rot_P.png deleted file mode 100644 index 9c66935..0000000 Binary files a/plots/NGC1068_x14w010/NGC1068_FOC_rot_P.png and /dev/null differ diff --git a/plots/NGC1068_x14w010/NGC1068_FOC_rot_P_err.png b/plots/NGC1068_x14w010/NGC1068_FOC_rot_P_err.png deleted file mode 100644 index aa54751..0000000 Binary files a/plots/NGC1068_x14w010/NGC1068_FOC_rot_P_err.png and /dev/null differ diff --git a/plots/NGC1068_x14w010/NGC1068_FOC_rot_SNRi.png b/plots/NGC1068_x14w010/NGC1068_FOC_rot_SNRi.png deleted file mode 100644 index cd04293..0000000 Binary files a/plots/NGC1068_x14w010/NGC1068_FOC_rot_SNRi.png and /dev/null differ diff --git a/plots/NGC1068_x14w010/NGC1068_FOC_rot_SNRp.png b/plots/NGC1068_x14w010/NGC1068_FOC_rot_SNRp.png deleted file mode 100644 index 6ef9769..0000000 Binary files a/plots/NGC1068_x14w010/NGC1068_FOC_rot_SNRp.png and /dev/null differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC.png b/plots/NGC1068_x274020/NGC1068_FOC.png index 6ba0955..5e201c5 100644 Binary files a/plots/NGC1068_x274020/NGC1068_FOC.png and b/plots/NGC1068_x274020/NGC1068_FOC.png differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_ELR_same_param.png b/plots/NGC1068_x274020/NGC1068_FOC_ELR_same_param.png deleted file mode 100644 index f0e350f..0000000 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_ELR_same_param.png and /dev/null differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_ELR_same_param_SNRi.png b/plots/NGC1068_x274020/NGC1068_FOC_ELR_same_param_SNRi.png deleted file mode 100644 index a39f22d..0000000 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_ELR_same_param_SNRi.png and /dev/null differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_ELR_same_param_SNRp.png b/plots/NGC1068_x274020/NGC1068_FOC_ELR_same_param_SNRp.png deleted file mode 100644 index 2e4cf35..0000000 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_ELR_same_param_SNRp.png and /dev/null differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_ELR_same_param_same_op.png b/plots/NGC1068_x274020/NGC1068_FOC_ELR_same_param_same_op.png deleted file mode 100644 index 2c6bb14..0000000 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_ELR_same_param_same_op.png and /dev/null differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_ELR_same_param_same_op_SNRi.png b/plots/NGC1068_x274020/NGC1068_FOC_ELR_same_param_same_op_SNRi.png deleted file mode 100644 index 1896eba..0000000 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_ELR_same_param_same_op_SNRi.png and /dev/null differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_ELR_same_param_same_op_SNRp.png b/plots/NGC1068_x274020/NGC1068_FOC_ELR_same_param_same_op_SNRp.png deleted file mode 100644 index 01c450c..0000000 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_ELR_same_param_same_op_SNRp.png and /dev/null differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_ELR_same_param_same_op_sP100.png b/plots/NGC1068_x274020/NGC1068_FOC_ELR_same_param_same_op_sP100.png deleted file mode 100644 index 01a880f..0000000 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_ELR_same_param_same_op_sP100.png and /dev/null differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_ELR_same_param_same_op_sP100_SNRi.png b/plots/NGC1068_x274020/NGC1068_FOC_ELR_same_param_same_op_sP100_SNRi.png deleted file mode 100644 index c54cde1..0000000 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_ELR_same_param_same_op_sP100_SNRi.png and /dev/null differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_ELR_same_param_same_op_sP100_SNRp.png b/plots/NGC1068_x274020/NGC1068_FOC_ELR_same_param_same_op_sP100_SNRp.png deleted file mode 100644 index c3b494d..0000000 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_ELR_same_param_same_op_sP100_SNRp.png and /dev/null differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_ELR_test_polmap.pdf b/plots/NGC1068_x274020/NGC1068_FOC_ELR_test_polmap.pdf deleted file mode 100644 index 01d2db2..0000000 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_ELR_test_polmap.pdf and /dev/null differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_P.png b/plots/NGC1068_x274020/NGC1068_FOC_P.png index e550b10..5a63fa7 100644 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_P.png and b/plots/NGC1068_x274020/NGC1068_FOC_P.png differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_POL0_crop_region.png b/plots/NGC1068_x274020/NGC1068_FOC_POL0_crop_region.png new file mode 100644 index 0000000..7123000 Binary files /dev/null and b/plots/NGC1068_x274020/NGC1068_FOC_POL0_crop_region.png differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_P_err.png b/plots/NGC1068_x274020/NGC1068_FOC_P_err.png index d32c4d8..9015dde 100644 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_P_err.png and b/plots/NGC1068_x274020/NGC1068_FOC_P_err.png differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_SNRi.png b/plots/NGC1068_x274020/NGC1068_FOC_SNRi.png index 24fd7d8..1290788 100644 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_SNRi.png and b/plots/NGC1068_x274020/NGC1068_FOC_SNRi.png differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_SNRp.png b/plots/NGC1068_x274020/NGC1068_FOC_SNRp.png index 41eb676..775b276 100644 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_SNRp.png and b/plots/NGC1068_x274020/NGC1068_FOC_SNRp.png differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_rot.png b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_rot.png index d72f600..bded0a4 100644 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_rot.png and b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_rot.png differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_rot_IQU.png b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_rot_IQU.png index 286280d..611a598 100644 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_rot_IQU.png and b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_rot_IQU.png differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_rot_P.png b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_rot_P.png index 7f2bc3b..17b3041 100644 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_rot_P.png and b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_rot_P.png differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_rot_P_err.png b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_rot_P_err.png index 81f7ce0..e3c37f3 100644 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_rot_P_err.png and b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_rot_P_err.png differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_rot_SNRi.png b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_rot_SNRi.png index 8ef875e..171fb23 100644 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_rot_SNRi.png and b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_rot_SNRi.png differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_rot_SNRp.png b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_rot_SNRp.png index 0bb8a03..55f725b 100644 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_rot_SNRp.png and b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM010_rot_SNRp.png differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_rot.png b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_rot.png index 0ad1526..bfcf8ab 100644 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_rot.png and b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_rot.png differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_rot_IQU.png b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_rot_IQU.png index 2985fb2..1ffb2f0 100644 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_rot_IQU.png and b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_rot_IQU.png differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_rot_P.png b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_rot_P.png index 03bd9f8..fabe03d 100644 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_rot_P.png and b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_rot_P.png differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_rot_P_err.png b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_rot_P_err.png index 0f50954..74f2900 100644 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_rot_P_err.png and b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_rot_P_err.png differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_rot_SNRi.png b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_rot_SNRi.png index 5feb260..e8ea78f 100644 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_rot_SNRi.png and b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_rot_SNRi.png differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_rot_SNRp.png b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_rot_SNRp.png index d53ae0e..3545955 100644 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_rot_SNRp.png and b/plots/NGC1068_x274020/NGC1068_FOC_combine_FWHM020_rot_SNRp.png differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_crop_region.png b/plots/NGC1068_x274020/NGC1068_FOC_crop_region.png new file mode 100644 index 0000000..214919b Binary files /dev/null and b/plots/NGC1068_x274020/NGC1068_FOC_crop_region.png differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_errors_background_flux.png b/plots/NGC1068_x274020/NGC1068_FOC_errors_background_flux.png index 2996afe..73ea314 100644 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_errors_background_flux.png and b/plots/NGC1068_x274020/NGC1068_FOC_errors_background_flux.png differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_errors_background_location.png b/plots/NGC1068_x274020/NGC1068_FOC_errors_background_location.png index a42a092..5d961f6 100644 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_errors_background_location.png and b/plots/NGC1068_x274020/NGC1068_FOC_errors_background_location.png differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_FWHM010_rot.png b/plots/NGC1068_x274020/NGC1068_FOC_gaussian_FWHM010_rot.png deleted file mode 100644 index 0f15e5b..0000000 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_FWHM010_rot.png and /dev/null differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_FWHM010_rot_IQU.png b/plots/NGC1068_x274020/NGC1068_FOC_gaussian_FWHM010_rot_IQU.png deleted file mode 100644 index 5a10037..0000000 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_FWHM010_rot_IQU.png and /dev/null differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_FWHM010_rot_P.png b/plots/NGC1068_x274020/NGC1068_FOC_gaussian_FWHM010_rot_P.png deleted file mode 100644 index efa341a..0000000 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_FWHM010_rot_P.png and /dev/null differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_FWHM010_rot_P_err.png b/plots/NGC1068_x274020/NGC1068_FOC_gaussian_FWHM010_rot_P_err.png deleted file mode 100644 index 64ed298..0000000 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_FWHM010_rot_P_err.png and /dev/null differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_FWHM010_rot_SNRi.png b/plots/NGC1068_x274020/NGC1068_FOC_gaussian_FWHM010_rot_SNRi.png deleted file mode 100644 index 033f729..0000000 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_FWHM010_rot_SNRi.png and /dev/null differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_FWHM010_rot_SNRp.png b/plots/NGC1068_x274020/NGC1068_FOC_gaussian_FWHM010_rot_SNRp.png deleted file mode 100644 index 78ae955..0000000 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_FWHM010_rot_SNRp.png and /dev/null differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_FWHM020_rot.png b/plots/NGC1068_x274020/NGC1068_FOC_gaussian_FWHM020_rot.png deleted file mode 100644 index ff74553..0000000 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_FWHM020_rot.png and /dev/null differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_FWHM020_rot_IQU.png b/plots/NGC1068_x274020/NGC1068_FOC_gaussian_FWHM020_rot_IQU.png deleted file mode 100644 index 7e749fe..0000000 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_FWHM020_rot_IQU.png and /dev/null differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_FWHM020_rot_P.png b/plots/NGC1068_x274020/NGC1068_FOC_gaussian_FWHM020_rot_P.png deleted file mode 100644 index d888469..0000000 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_FWHM020_rot_P.png and /dev/null differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_FWHM020_rot_P_err.png b/plots/NGC1068_x274020/NGC1068_FOC_gaussian_FWHM020_rot_P_err.png deleted file mode 100644 index 75bd958..0000000 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_FWHM020_rot_P_err.png and /dev/null differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_FWHM020_rot_SNRi.png b/plots/NGC1068_x274020/NGC1068_FOC_gaussian_FWHM020_rot_SNRi.png deleted file mode 100644 index 56e154a..0000000 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_FWHM020_rot_SNRi.png and /dev/null differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_FWHM020_rot_SNRp.png b/plots/NGC1068_x274020/NGC1068_FOC_gaussian_FWHM020_rot_SNRp.png deleted file mode 100644 index f65b260..0000000 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_FWHM020_rot_SNRp.png and /dev/null differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_after_FWHM010_rot.png b/plots/NGC1068_x274020/NGC1068_FOC_gaussian_after_FWHM010_rot.png deleted file mode 100644 index 33e1e67..0000000 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_after_FWHM010_rot.png and /dev/null differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_after_FWHM010_rot_IQU.png b/plots/NGC1068_x274020/NGC1068_FOC_gaussian_after_FWHM010_rot_IQU.png deleted file mode 100644 index f77091d..0000000 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_after_FWHM010_rot_IQU.png and /dev/null differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_after_FWHM010_rot_P.png b/plots/NGC1068_x274020/NGC1068_FOC_gaussian_after_FWHM010_rot_P.png deleted file mode 100644 index 4025623..0000000 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_after_FWHM010_rot_P.png and /dev/null differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_after_FWHM010_rot_P_err.png b/plots/NGC1068_x274020/NGC1068_FOC_gaussian_after_FWHM010_rot_P_err.png deleted file mode 100644 index 66d8a7b..0000000 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_after_FWHM010_rot_P_err.png and /dev/null differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_after_FWHM010_rot_SNRi.png b/plots/NGC1068_x274020/NGC1068_FOC_gaussian_after_FWHM010_rot_SNRi.png deleted file mode 100644 index b2f1cd0..0000000 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_after_FWHM010_rot_SNRi.png and /dev/null differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_after_FWHM010_rot_SNRp.png b/plots/NGC1068_x274020/NGC1068_FOC_gaussian_after_FWHM010_rot_SNRp.png deleted file mode 100644 index 94050e1..0000000 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_after_FWHM010_rot_SNRp.png and /dev/null differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_after_FWHM020_rot.png b/plots/NGC1068_x274020/NGC1068_FOC_gaussian_after_FWHM020_rot.png deleted file mode 100644 index 72a3801..0000000 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_after_FWHM020_rot.png and /dev/null differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_after_FWHM020_rot_IQU.png b/plots/NGC1068_x274020/NGC1068_FOC_gaussian_after_FWHM020_rot_IQU.png deleted file mode 100644 index e14375c..0000000 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_after_FWHM020_rot_IQU.png and /dev/null differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_after_FWHM020_rot_P.png b/plots/NGC1068_x274020/NGC1068_FOC_gaussian_after_FWHM020_rot_P.png deleted file mode 100644 index 7ef4fd5..0000000 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_after_FWHM020_rot_P.png and /dev/null differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_after_FWHM020_rot_P_err.png b/plots/NGC1068_x274020/NGC1068_FOC_gaussian_after_FWHM020_rot_P_err.png deleted file mode 100644 index 218a7d3..0000000 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_after_FWHM020_rot_P_err.png and /dev/null differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_after_FWHM020_rot_SNRi.png b/plots/NGC1068_x274020/NGC1068_FOC_gaussian_after_FWHM020_rot_SNRi.png deleted file mode 100644 index 29e47ce..0000000 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_after_FWHM020_rot_SNRi.png and /dev/null differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_after_FWHM020_rot_SNRp.png b/plots/NGC1068_x274020/NGC1068_FOC_gaussian_after_FWHM020_rot_SNRp.png deleted file mode 100644 index 9d2798e..0000000 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_gaussian_after_FWHM020_rot_SNRp.png and /dev/null differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_ratio_deconv_center_maxflux.png b/plots/NGC1068_x274020/NGC1068_FOC_ratio_deconv_center_maxflux.png deleted file mode 100644 index a48f97c..0000000 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_ratio_deconv_center_maxflux.png and /dev/null differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_rot.png b/plots/NGC1068_x274020/NGC1068_FOC_rot.png deleted file mode 100644 index 35729c2..0000000 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_rot.png and /dev/null differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_rot_IQU.png b/plots/NGC1068_x274020/NGC1068_FOC_rot_IQU.png deleted file mode 100644 index 84a75b7..0000000 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_rot_IQU.png and /dev/null differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_rot_P.png b/plots/NGC1068_x274020/NGC1068_FOC_rot_P.png deleted file mode 100644 index e929ad5..0000000 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_rot_P.png and /dev/null differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_rot_P_err.png b/plots/NGC1068_x274020/NGC1068_FOC_rot_P_err.png deleted file mode 100644 index c1f2aab..0000000 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_rot_P_err.png and /dev/null differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_rot_SNRi.png b/plots/NGC1068_x274020/NGC1068_FOC_rot_SNRi.png deleted file mode 100644 index 2baf60d..0000000 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_rot_SNRi.png and /dev/null differ diff --git a/plots/NGC1068_x274020/NGC1068_FOC_rot_SNRp.png b/plots/NGC1068_x274020/NGC1068_FOC_rot_SNRp.png deleted file mode 100644 index 5360236..0000000 Binary files a/plots/NGC1068_x274020/NGC1068_FOC_rot_SNRp.png and /dev/null differ diff --git a/plots/PG1630+377_x39510/1630+377_FOC_POL0_crop_region.png b/plots/PG1630+377_x39510/1630+377_FOC_POL0_crop_region.png new file mode 100644 index 0000000..d0c63d5 Binary files /dev/null and b/plots/PG1630+377_x39510/1630+377_FOC_POL0_crop_region.png differ diff --git a/plots/PG1630+377_x39510/1630+377_FOC_center_image.png b/plots/PG1630+377_x39510/1630+377_FOC_center_image.png new file mode 100644 index 0000000..56fd72b Binary files /dev/null and b/plots/PG1630+377_x39510/1630+377_FOC_center_image.png differ diff --git a/plots/PG1630+377_x39510/1630+377_FOC_crop_region.png b/plots/PG1630+377_x39510/1630+377_FOC_crop_region.png new file mode 100644 index 0000000..267a509 Binary files /dev/null and b/plots/PG1630+377_x39510/1630+377_FOC_crop_region.png differ diff --git a/plots/PG1630+377_x39510/1630+377_FOC_errors_background_flux.png b/plots/PG1630+377_x39510/1630+377_FOC_errors_background_flux.png new file mode 100644 index 0000000..220ea10 Binary files /dev/null and b/plots/PG1630+377_x39510/1630+377_FOC_errors_background_flux.png differ diff --git a/plots/PG1630+377_x39510/1630+377_FOC_errors_background_location.png b/plots/PG1630+377_x39510/1630+377_FOC_errors_background_location.png new file mode 100644 index 0000000..84d0904 Binary files /dev/null and b/plots/PG1630+377_x39510/1630+377_FOC_errors_background_location.png differ diff --git a/plots/PG1630+377_x39510/PG1630+377_FOC_POL0_crop_region.png b/plots/PG1630+377_x39510/PG1630+377_FOC_POL0_crop_region.png new file mode 100644 index 0000000..242d937 Binary files /dev/null and b/plots/PG1630+377_x39510/PG1630+377_FOC_POL0_crop_region.png differ diff --git a/plots/PG1630+377_x39510/PG1630+377_FOC_center_image.png b/plots/PG1630+377_x39510/PG1630+377_FOC_center_image.png index b83398a..7fbfb56 100644 Binary files a/plots/PG1630+377_x39510/PG1630+377_FOC_center_image.png and b/plots/PG1630+377_x39510/PG1630+377_FOC_center_image.png differ diff --git a/plots/PG1630+377_x39510/PG1630+377_FOC_crop_region.png b/plots/PG1630+377_x39510/PG1630+377_FOC_crop_region.png new file mode 100644 index 0000000..4f7ab1f Binary files /dev/null and b/plots/PG1630+377_x39510/PG1630+377_FOC_crop_region.png differ diff --git a/plots/PG1630+377_x39510/PG1630+377_FOC_errors_background_flux.png b/plots/PG1630+377_x39510/PG1630+377_FOC_errors_background_flux.png index 8882ef9..6180610 100644 Binary files a/plots/PG1630+377_x39510/PG1630+377_FOC_errors_background_flux.png and b/plots/PG1630+377_x39510/PG1630+377_FOC_errors_background_flux.png differ diff --git a/plots/PG1630+377_x39510/PG1630+377_FOC_errors_background_location.png b/plots/PG1630+377_x39510/PG1630+377_FOC_errors_background_location.png index 65df305..5c38450 100644 Binary files a/plots/PG1630+377_x39510/PG1630+377_FOC_errors_background_location.png and b/plots/PG1630+377_x39510/PG1630+377_FOC_errors_background_location.png differ diff --git a/src/FOC_reduction.py b/src/FOC_reduction.py index 4967b53..64a6ad2 100755 --- a/src/FOC_reduction.py +++ b/src/FOC_reduction.py @@ -8,6 +8,7 @@ Main script where are progressively added the steps for the FOC pipeline reducti import sys import numpy as np import copy +import matplotlib.pyplot as plt import lib.fits as proj_fits #Functions to handle fits files import lib.reduction as proj_red #Functions used in reduction pipeline import lib.plots as proj_plots #Functions for plotting data @@ -85,6 +86,8 @@ def main(): psf_scale = 'arcsec' psf_shape=(9,9) iterations = 10 + # Cropping + display_crop = False # Error estimation error_sub_shape = (75,75) display_error = False @@ -98,17 +101,17 @@ def main(): align_center = 'image' #If None will align image to image center display_data = False # Smoothing - smoothing_function = 'gaussian' #gaussian_after, gaussian or combine - smoothing_FWHM = 0.10 #If None, no smoothing is done + smoothing_function = 'combine' #gaussian_after, gaussian or combine + smoothing_FWHM = 0.20 #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 # Polarization map output figname = 'NGC1068_FOC' #target/intrument name - figtype = '_gaussian_FWHM010_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%. + figtype = '_combine_FWHM020_rot' #additionnal informations + SNRp_cut = 20 #P measurments with SNR>3 + SNRi_cut = 130 #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 ##### Pipeline start @@ -119,7 +122,7 @@ def main(): if (data < 0.).any(): print("ETAPE 1 : ", data) # Crop data to remove outside blank margins. - data_array, error_array = proj_red.crop_array(data_array, step=5, null_val=0., inside=True) + data_array, error_array = proj_red.crop_array(data_array, headers, step=5, null_val=0., inside=True, display=display_crop, savename=figname, plots_folder=plots_folder) for data in data_array: if (data < 0.).any(): print("ETAPE 2 : ", data) @@ -138,14 +141,14 @@ def main(): if (data < 0.).any(): print("ETAPE 4 : ", data) #Align and rescale images with oversampling. - data_array, error_array = proj_red.align_data(data_array, error_array, upsample_factor=int(Dxy.min()), ref_center=align_center, return_shifts=False) + data_array, error_array, data_mask = proj_red.align_data(data_array, headers, error_array, upsample_factor=int(Dxy.min()), ref_center=align_center, return_shifts=False) for data in data_array: if (data < 0.).any(): print("ETAPE 5 : ", data) # Rotate data to have North up ref_header = copy.deepcopy(headers[0]) if rotate_data: - data_array, error_array, headers = proj_red.rotate_data(data_array, error_array, headers, -ref_header['orientat']) + data_array, error_array, data_mask, headers = proj_red.rotate_data(data_array, error_array, data_mask, headers, -ref_header['orientat']) for data in data_array: if (data < 0.).any(): print("ETAPE 6 : ", data) @@ -159,13 +162,13 @@ 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, 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) ## Step 3: # Rotate images to have North up if rotate_stokes: ref_header = copy.deepcopy(headers[0]) - I_stokes, Q_stokes, U_stokes, Stokes_cov, headers = proj_red.rotate_Stokes(I_stokes, Q_stokes, U_stokes, Stokes_cov, headers, -ref_header['orientat'], SNRi_cut=None) + I_stokes, Q_stokes, U_stokes, Stokes_cov, data_mask, headers = proj_red.rotate_Stokes(I_stokes, Q_stokes, U_stokes, Stokes_cov, data_mask, headers, -ref_header['orientat'], SNRi_cut=None) # Compute polarimetric parameters (polarization degree and angle). P, debiased_P, s_P, s_P_P, PA, s_PA, s_PA_P = proj_red.compute_pol(I_stokes, Q_stokes, U_stokes, Stokes_cov, headers) @@ -175,11 +178,11 @@ def main(): ## Step 5: # Plot polarization map (Background is either total Flux, Polarization degree or Polarization degree error). - proj_plots.polarization_map(copy.deepcopy(Stokes_test), SNRp_cut=SNRp_cut, SNRi_cut=SNRi_cut, step_vec=step_vec, savename=figname+figtype, plots_folder=plots_folder, display=None) - proj_plots.polarization_map(copy.deepcopy(Stokes_test), SNRp_cut=SNRp_cut, SNRi_cut=SNRi_cut, step_vec=step_vec, savename=figname+figtype+"_P", plots_folder=plots_folder, display='Pol_deg') - proj_plots.polarization_map(copy.deepcopy(Stokes_test), SNRp_cut=SNRp_cut, SNRi_cut=SNRi_cut, step_vec=step_vec, savename=figname+figtype+"_P_err", plots_folder=plots_folder, display='Pol_deg_err') - proj_plots.polarization_map(copy.deepcopy(Stokes_test), SNRp_cut=SNRp_cut, SNRi_cut=SNRi_cut, step_vec=step_vec, savename=figname+figtype+"_SNRi", plots_folder=plots_folder, display='SNRi') - proj_plots.polarization_map(copy.deepcopy(Stokes_test), SNRp_cut=SNRp_cut, SNRi_cut=SNRi_cut, step_vec=step_vec, savename=figname+figtype+"_SNRp", plots_folder=plots_folder, display='SNRp') + proj_plots.polarization_map(copy.deepcopy(Stokes_test), data_mask, SNRp_cut=SNRp_cut, SNRi_cut=SNRi_cut, step_vec=step_vec, savename=figname+figtype, plots_folder=plots_folder, display=None) + proj_plots.polarization_map(copy.deepcopy(Stokes_test), data_mask, SNRp_cut=SNRp_cut, SNRi_cut=SNRi_cut, step_vec=step_vec, savename=figname+figtype+"_P", plots_folder=plots_folder, display='Pol_deg') + proj_plots.polarization_map(copy.deepcopy(Stokes_test), data_mask, SNRp_cut=SNRp_cut, SNRi_cut=SNRi_cut, step_vec=step_vec, savename=figname+figtype+"_P_err", plots_folder=plots_folder, display='Pol_deg_err') + proj_plots.polarization_map(copy.deepcopy(Stokes_test), data_mask, SNRp_cut=SNRp_cut, SNRi_cut=SNRi_cut, step_vec=step_vec, savename=figname+figtype+"_SNRi", plots_folder=plots_folder, display='SNRi') + proj_plots.polarization_map(copy.deepcopy(Stokes_test), data_mask, SNRp_cut=SNRp_cut, SNRi_cut=SNRi_cut, step_vec=step_vec, savename=figname+figtype+"_SNRp", plots_folder=plots_folder, display='SNRp') return 0 diff --git a/src/FOC_reduction2_ELR.py b/src/FOC_reduction2_ELR.py deleted file mode 100755 index 2d80c97..0000000 --- a/src/FOC_reduction2_ELR.py +++ /dev/null @@ -1,156 +0,0 @@ -#!/usr/bin/python -#-*- coding:utf-8 -*- -""" -Main script where are progressively added the steps for the FOC pipeline reduction. -""" - -#Project libraries -import sys -import numpy as np -import copy -import lib.fits as proj_fits #Functions to handle fits files -import lib.reduction_ELR as proj_red #Functions used in reduction pipeline -import lib.plots_ELR as proj_plots #Functions for plotting data - - -def main(): - ##### User inputs - ## Input and output locations -# globals()['data_folder'] = "../data/NGC1068_x274020/" -# infiles = ['x274020at.c0f.fits','x274020bt.c0f.fits','x274020ct.c0f.fits', -# 'x274020dt.c0f.fits','x274020et.c0f.fits','x274020ft.c0f.fits', -# 'x274020gt.c0f.fits','x274020ht.c0f.fits','x274020it.c0f.fits'] -# globals()['plots_folder'] = "../plots/NGC1068_x274020/" - -# globals()['data_folder'] = "../data/NGC1068_x14w010/" -# infiles = ['x14w0101t_c0f.fits','x14w0102t_c0f.fits','x14w0103t_c0f.fits', -# 'x14w0104t_c0f.fits','x14w0105p_c0f.fits','x14w0106t_c0f.fits'] -# infiles = ['x14w0101t_c1f.fits','x14w0102t_c1f.fits','x14w0103t_c1f.fits', -# 'x14w0104t_c1f.fits','x14w0105p_c1f.fits','x14w0106t_c1f.fits'] -# globals()['plots_folder'] = "../plots/NGC1068_x14w010/" - - globals()['data_folder'] = "../data/3C405_x136060/" - infiles = ['x1360601t_c0f.fits','x1360602t_c0f.fits','x1360603t_c0f.fits'] -# infiles = ['x1360601t_c1f.fits','x1360602t_c1f.fits','x1360603t_c1f.fits'] - globals()['plots_folder'] = "../plots/3C405_x136060/" - -# globals()['data_folder'] = "../data/CygnusA_x43w0/" -# infiles = ['x43w0101r_c0f.fits', 'x43w0104r_c0f.fits', 'x43w0107r_c0f.fits', -# 'x43w0201r_c0f.fits', 'x43w0204r_c0f.fits', 'x43w0102r_c0f.fits', -# 'x43w0105r_c0f.fits', 'x43w0108r_c0f.fits', 'x43w0202r_c0f.fits', -# 'x43w0205r_c0f.fits', 'x43w0103r_c0f.fits', 'x43w0106r_c0f.fits', -# 'x43w0109r_c0f.fits', 'x43w0203r_c0f.fits', 'x43w0206r_c0f.fits'] -# globals()['plots_folder'] = "../plots/CygnusA_x43w0/" - -# globals()['data_folder'] = "../data/3C109_x3mc010/" -# infiles = ['x3mc0101m_c0f.fits','x3mc0102m_c0f.fits','x3mc0103m_c0f.fits'] -# globals()['plots_folder'] = "../plots/3C109_x3mc010/" - -# globals()['data_folder'] = "../data/MKN463_x2rp030/" -# infiles = ['x2rp0201t_c0f.fits', 'x2rp0203t_c0f.fits', 'x2rp0205t_c0f.fits', -# 'x2rp0207t_c0f.fits', 'x2rp0302t_c0f.fits', 'x2rp0304t_c0f.fits', -# 'x2rp0306t_c0f.fits', 'x2rp0202t_c0f.fits', 'x2rp0204t_c0f.fits', -# 'x2rp0206t_c0f.fits', 'x2rp0301t_c0f.fits', 'x2rp0303t_c0f.fits', -# 'x2rp0305t_c0f.fits', 'x2rp0307t_c0f.fits'] -# globals()['plots_folder'] = "../plots/MKN463_x2rp030/" - -# globals()['data_folder'] = "../data/PG1630+377_x39510/" -# infiles = ['x3990201m_c0f.fits', 'x3990205m_c0f.fits', 'x3995101r_c0f.fits', -# 'x3995105r_c0f.fits', 'x3995109r_c0f.fits', 'x3995201r_c0f.fits', -# 'x3995205r_c0f.fits', 'x3990202m_c0f.fits', 'x3990206m_c0f.fits', -# 'x3995102r_c0f.fits', 'x3995106r_c0f.fits', 'x399510ar_c0f.fits', -# 'x3995202r_c0f.fits','x3995206r_c0f.fits'] -# globals()['plots_folder'] = "../plots/PG1630+377_x39510/" - - ## Reduction parameters - # Deconvolution - deconvolve = False - if deconvolve: - psf = 'gaussian' #Can be user-defined as well - psf_FWHM = 0.10 - psf_scale = 'arcsec' - psf_shape=(9,9) - iterations = 10 - # Error estimation - error_sub_shape = (150,150) - display_error = True - # Data binning - rebin = True - if rebin: - pxsize = 15 - px_scale = 'pixel' #pixel or arcsec - rebin_operation = 'average' #sum or average - # Alignement - align_center = 'image' #If None will align image to image center - display_data = True - # Smoothing - smoothing_function = 'gaussian' #gaussian or combine - smoothing_FWHM = 1 #If None, no smoothing is done - smoothing_scale = 'pixel' #pixel or arcsec - # Rotation - rotate = False #rotation to North convention can give erroneous results - rotate_library = 'scipy' #scipy or pillow - # Polarization map output - figname = '3C405_FOC' #target/intrument name - figtype = '' #additionnal informations - SNRp_cut = 3 #P measurments with SNR>3 - SNRi_cut = 4 #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 - - ##### Pipeline start - ## Step 1: - # Get data from fits files and translate to flux in erg/cm²/s/Angstrom. - data_array, headers = proj_fits.get_obs_data(infiles, data_folder=data_folder, compute_flux=False) - # Crop data to remove outside blank margins. - #data_array, error_array = proj_red.crop_array(data_array, step=5, null_val=0., inside=True) - # Deconvolve data using Richardson-Lucy iterative algorithm with a gaussian PSF of given FWHM. - if deconvolve: - data_array = proj_red.deconvolve_array(data_array, headers, psf=psf, FWHM=psf_FWHM, scale=psf_scale, shape=psf_shape, iterations=iterations) - # Estimate error from data background, estimated from sub-image of desired sub_shape. - data_array, error_array = proj_red.get_error(data_array, sub_shape=error_sub_shape, display=display_error, headers=headers, savename=figname+"_errors", plots_folder=plots_folder) - # Rebin data to desired pixel size. - if rebin: - data_array, error_array, headers, Dxy = proj_red.rebin_array(data_array, error_array, headers, pxsize=pxsize, scale=px_scale, operation=rebin_operation) - #Align and rescale images with oversampling. - data_array, error_array = proj_red.align_data(data_array, error_array, upsample_factor=int(Dxy.min()), ref_center=align_center, return_shifts=False) - - #Plot array for checking output - if display_data: - proj_plots.plot_obs(data_array, headers, vmin=data_array.min(), vmax=data_array.max(), savename=figname+"_center_"+align_center, plots_folder=plots_folder) - - ## Step 2: - # Compute Stokes I, Q, U with smoothed polarized images - # SMOOTHING DISCUSSION : - # 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, headers, FWHM=smoothing_FWHM, scale=smoothing_scale, smoothing=smoothing_function) - - ## Step 3: - # Rotate images to have North up - if rotate: - ref_header = copy.deepcopy(headers[0]) - if rotate_library.lower() in ['scipy','scipy.ndimage']: - I_stokes, Q_stokes, U_stokes, Stokes_cov, headers = proj_red.rotate_sc_Stokes(I_stokes, Q_stokes, U_stokes, Stokes_cov, headers, -ref_header['orientat']) - if rotate_library.lower() in ['pillow','pil']: - I_stokes, Q_stokes, U_stokes, Stokes_cov, headers = proj_red.rotate_PIL_Stokes(I_stokes, Q_stokes, U_stokes, Stokes_cov, headers, -ref_header['orientat']) - # Compute polarimetric parameters (polarization degree and angle). - P, debiased_P, s_P, s_P_P, PA, s_PA, s_PA_P = proj_red.compute_pol(I_stokes, Q_stokes, U_stokes, Stokes_cov, headers) - - ## Step 4: - # Save image to FITS. - Stokes_test = proj_fits.save_Stokes(I_stokes, Q_stokes, U_stokes, Stokes_cov, P, debiased_P, s_P, s_P_P, PA, s_PA, s_PA_P, headers, figname+figtype, data_folder=data_folder, return_hdul=True) - - ## Step 5: - # Plot polarization map (Background is either total Flux, Polarization degree or Polarization degree error). - proj_plots.polarization_map(copy.deepcopy(Stokes_test), SNRp_cut=SNRp_cut, SNRi_cut=SNRi_cut, step_vec=step_vec, savename=figname+figtype, plots_folder=plots_folder, display=None) - #proj_plots.polarization_map(copy.deepcopy(Stokes_test), SNRp_cut=SNRp_cut, SNRi_cut=SNRi_cut, step_vec=step_vec, savename=figname+figtype+"_P", plots_folder=plots_folder, display='Pol_deg') - #proj_plots.polarization_map(copy.deepcopy(Stokes_test), SNRp_cut=SNRp_cut, SNRi_cut=SNRi_cut, step_vec=step_vec, savename=figname+figtype+"_P_err", plots_folder=plots_folder, display='Pol_deg_err') - proj_plots.polarization_map(copy.deepcopy(Stokes_test), SNRp_cut=SNRp_cut, SNRi_cut=SNRi_cut, step_vec=step_vec, savename=figname+figtype+"_SNRi", plots_folder=plots_folder, display='SNRi') - proj_plots.polarization_map(copy.deepcopy(Stokes_test), SNRp_cut=SNRp_cut, SNRi_cut=SNRi_cut, step_vec=step_vec, savename=figname+figtype+"_SNRp", plots_folder=plots_folder, display='SNRp') - - return 0 - - -if __name__ == "__main__": - sys.exit(main()) diff --git a/src/FOC_reduction_ELR.py b/src/FOC_reduction_ELR.py deleted file mode 100644 index dbb29cc..0000000 --- a/src/FOC_reduction_ELR.py +++ /dev/null @@ -1,312 +0,0 @@ -#!/usr/bin/python -#-*- coding:utf-8 -*- - -from pylab import * -import numpy as np -import matplotlib.pyplot as plt -from astropy.io import fits -from astropy.wcs import WCS -from aplpy import FITSFigure -from scipy import ndimage -from scipy import signal -from skimage.feature import register_translation -from astropy.convolution import convolve -from astropy.convolution import Gaussian2DKernel -import os as os - -import lib.fits as proj_fits #Functions to handle fits files -import lib.reduction as proj_red #Functions used in reduction pipeline -import lib.plots as proj_plots #Functions for plotting data - -def bin_ndarray(ndarray, new_shape, operation='sum'): - """ - Bins an ndarray in all axes based on the target shape, by summing or - averaging. - - Number of output dimensions must match number of input dimensions. - - Example - ------- - >>> m = np.arange(0,100,1).reshape((10,10)) - >>> n = bin_ndarray(m, new_shape=(5,5), operation='sum') - >>> print(n) - - [[ 22 30 38 46 54] - [102 110 118 126 134] - [182 190 198 206 214] - [262 270 278 286 294] - [342 350 358 366 374]] - - """ - if not operation.lower() in ['sum', 'median', 'std']: - raise ValueError("Operation not supported.") - if ndarray.ndim != len(new_shape): - raise ValueError("Shape mismatch: {} -> {}".format(ndarray.shape, - new_shape)) - compression_pairs = [(d, c//d) for d,c in zip(new_shape, - ndarray.shape)] - flattened = [l for p in compression_pairs for l in p] - ndarray = ndarray.reshape(flattened) - for i in range(len(new_shape)): - if operation.lower() == "sum": - ndarray = ndarray.sum(-1*(i+1)) - if operation.lower() == "median": - ndarray = ndarray.mean(-1*(i+1)) - if operation.lower() == "std": - ndarray = ndarray.std(-1*(i+1)) - return ndarray - -#load files -def load_files(infiles): - data_array = [] - for name in infiles['filenames']: - with fits.open(infiles['data_folder']+name) as f: - data_array.append(f[0].data) - data_array = np.array(data_array) - return data_array - -def rebin_array(data,config): - data_m = [] - data_s = [] - for ii in range(len(data)): - new_shape = (data[ii].shape[1]//config['downsample_factor'],\ - data[ii].shape[0]//config['downsample_factor']) - data_m.append(bin_ndarray(data[ii], new_shape, operation='median')) - data_s.append(bin_ndarray(data[ii], new_shape, operation='std')) - return data_m, data_s - -def cross_corr(data): - shifts = [] - data_array_c = [] - for ii in range(len(data)): - shift, error, diffphase = register_translation(data[0], data_array[ii]) - print(' -',infiles['filenames'][ii],shift) - shifts.append(shift) - ima_shifted = np.roll(data[ii],round(shifts[ii][0]),axis=0) - ima_shifted = np.roll(ima_shifted,round(shifts[ii][1]),axis=1) - data_array_c.append(ima_shifted) - return data_array_c - -plt.close('all') - - -### User input #### -#Create dictionaries -infiles = {'data_folder':'../data/NGC1068_x274020/',\ - 'filenames':['x274020at.c0f.fits','x274020bt.c0f.fits','x274020ct.c0f.fits',\ - 'x274020dt.c0f.fits','x274020et.c0f.fits','x274020ft.c0f.fits','x274020gt.c0f.fits',\ - 'x274020ht.c0f.fits','x274020it.c0f.fits']} - -config = {'conserve_flux':True,'upsample_factor':1,\ - 'downsample_factor':8,\ - 'rotate':True,'reshape':True} - -fig = {'cmap':'magma','vmin':-20,'vmax':200,'font_size':40.0,'label_size':20,'lw':3,\ - 'SNRp_cut':1,'SNRi_cut':4,'scalevec':0.05,'step_vec':1,\ - 'vec_legend':10,'figname':'NGC1068_FOC_ELR'} -##################### - -##### SCRIPT ##### -#load files -print('--- Load files') -print(' -',infiles['filenames']) -data_array = load_files(infiles) -#crosscorrelation -print('--- Cross-correlate HWP PAs') -data_array_c = cross_corr(data_array) -#resample image -print('--- Downsample image') -data_array_cr_m, data_array_cr_s = rebin_array(data_array_c,config) -#compute stokes -print('--- Combine HWP PAs') -#combine HWP PAs -pol0 = (data_array_cr_m[0]+data_array_cr_m[1]+data_array_cr_m[2]) -pol60 = (data_array_cr_m[3]+data_array_cr_m[4]+data_array_cr_m[5]+data_array_cr_m[6]) -pol120 = (data_array_cr_m[7]+data_array_cr_m[8]) -#Stokes -print('--- Compute Stokes') -I_stokes = (2./3.)*(pol0 + pol60 + pol120) -Q_stokes = (2./3.)*(2*pol0 - pol60 - pol120) -U_stokes = (2./np.sqrt(3.))*(pol60 - pol120) -#Rotate Stokes -if config['rotate']: - print('--- Rotate Stokes') - ima = fits.open(infiles['data_folder']+infiles['filenames'][0]) - PA = ima[0].header['ORIENTAT'] - #roate images - I_stokes = ndimage.rotate(I_stokes,-PA,reshape=config['reshape']) - Q_stokes = ndimage.rotate(Q_stokes,-PA,reshape=config['reshape']) - U_stokes = ndimage.rotate(U_stokes,-PA,reshape=config['reshape']) - #rotate stokes - Q_stokes = Q_stokes*np.cos(np.deg2rad(PA)) - U_stokes*np.sin(np.deg2rad(PA)) - U_stokes = Q_stokes*np.sin(np.deg2rad(PA)) + U_stokes*np.cos(np.deg2rad(PA)) -#smoothing -print('--- Smoothing') -kernel = Gaussian2DKernel(x_stddev=1) -I_stokes = convolve(I_stokes,kernel) -Q_stokes = convolve(Q_stokes,kernel) -U_stokes = convolve(U_stokes,kernel) -#remove annoying pixels due to rotation -I_stokes[I_stokes == 0] = np.nan -Q_stokes[Q_stokes == 0] = np.nan -U_stokes[U_stokes == 0] = np.nan - -#Polarimetry -PI = np.sqrt(Q_stokes*Q_stokes + U_stokes*U_stokes) -P = PI/I_stokes*100 -PA = 0.5*arctan2(U_stokes,Q_stokes)*180./np.pi+90 -s_P = (np.sqrt(2.)*(I_stokes)**(-0.5)) ### Correct this line!!! -s_PA = s_P/(P/100.)*180./np.pi - -### STEP 6. image to FITS with updated WCS -img = fits.open(infiles['data_folder']+infiles['filenames'][0]) -new_wcs = WCS(naxis=2) -new_wcs.wcs.crpix = [I_stokes.shape[0]/2, I_stokes.shape[1]/2] -new_wcs.wcs.crval = [img[0].header['CRVAL1'], img[0].header['CRVAL2']] -new_wcs.wcs.cunit = ["deg", "deg"] -new_wcs.wcs.ctype = ["RA---TAN", "DEC--TAN"] -new_wcs.wcs.cdelt = [img[0].header['CD1_1']*config['downsample_factor'],\ - img[0].header['CD1_2']*config['downsample_factor']] - -stkI=fits.PrimaryHDU(data=I_stokes,header=new_wcs.to_header()) -pol=fits.PrimaryHDU(data=P,header=new_wcs.to_header()) -pang=fits.PrimaryHDU(data=PA,header=new_wcs.to_header()) -pol_err=fits.PrimaryHDU(data=s_P,header=new_wcs.to_header()) -pang_err=fits.PrimaryHDU(data=s_PA,header=new_wcs.to_header()) - -### STEP 7. polarization map -#quality cuts -pxscale = stkI.header['CDELT2'] - -#apply quality cuts -pol.data[stkI.data < 10] = np.nan - - -#levelsI = 2**(np.arange(2,20,0.5)) -levelsI = 2**(np.arange(3,20,0.5)) - -fig1 = plt.figure(figsize=(11,10)) -gc = FITSFigure(stkI,figure=fig1) -gc.show_colorscale(cmap=fig['cmap'],vmin=fig['vmin'],vmax=fig['vmax']) -gc.show_contour(levels=levelsI,colors='grey',linewidths=0.5) -gc.show_vectors(pol,pang,scale=fig['scalevec'],\ - step=fig['step_vec'],color='black',linewidth=2.0) -gc.show_vectors(pol,pang,scale=fig['scalevec'],\ - step=fig['step_vec'],color='white',linewidth=1.0) -#legend vector -vecscale = fig['scalevec'] * new_wcs.wcs.cdelt[0] -gc.add_scalebar(fig['vec_legend']*vecscale,'P ='+np.str(fig['vec_legend'])+'%',\ - corner='bottom right',frame=True,color='black',facecolor='blue') -figname = figname = fig['figname']+'_test_polmap.pdf' -fig1.savefig(figname,dpi=300) -os.system('open '+figname) - -sys.exit() - - - - - - - - - - - - - - -fig2,((ax1,ax2,ax3),(ax4,ax5,ax6)) = plt.subplots(2,3,figsize=(40,20),dpi=200) -CF = ax1.imshow(I_stokes,origin='lower') -cbar = plt.colorbar(CF,ax=ax1) -cbar.ax.tick_params(labelsize=20) -ax1.tick_params(axis='both', which='major', labelsize=20) -ax1.text(2,2,'I',color='white',fontsize=10) - -CF = ax2.imshow(Q_stokes,origin='lower') -cbar = plt.colorbar(CF,ax=ax2) -cbar.ax.tick_params(labelsize=20) -ax2.tick_params(axis='both', which='major', labelsize=20) -ax2.text(2,2,'Q',color='white',fontsize=10) - -CF = ax3.imshow(U_stokes,origin='lower') -cbar = plt.colorbar(CF,ax=ax3) -cbar.ax.tick_params(labelsize=20) -ax3.tick_params(axis='both', which='major', labelsize=20) -ax3.text(2,2,'U',color='white',fontsize=10) - -v = np.linspace(0,40,50) -CF = ax4.imshow(P,origin='lower',vmin=0,vmax=40) -cbar = plt.colorbar(CF,ax=ax4) -cbar.ax.tick_params(labelsize=20) -ax4.tick_params(axis='both', which='major', labelsize=20) -ax4.text(2,2,'P',color='white',fontsize=10) - -CF = ax5.imshow(PA,origin='lower',vmin=0,vmax=180) -cbar = plt.colorbar(CF,ax=ax5) -cbar.ax.tick_params(labelsize=20) -ax5.tick_params(axis='both', which='major', labelsize=20) -ax5.text(2,2,'PA',color='white',fontsize=10) - -CF = ax6.imshow(PI,origin='lower') -cbar = plt.colorbar(CF,ax=ax6) -cbar.ax.tick_params(labelsize=20) -ax6.tick_params(axis='both', which='major', labelsize=20) -ax6.text(2,2,'PI',color='white',fontsize=10) - -figname = fig['figname']+'_test_Stokes.pdf' -fig2.savefig(figname,dpi=300) -#os.system('open '+figname) - - - -### Step 4. Binning and smoothing -#Images can be binned and smoothed to improve SNR. This step can also be done -#using the PolX images. - - -### Step 5. Roate images to have North up -#Images needs to be reprojected to have North up. -#this procedure implies to rotate the Stokes QU using a rotation matrix - - -### STEP 6. image to FITS with updated WCS -img = fits.open(infiles['data_folder']+infiles['filenames'][0]) -new_wcs = WCS(naxis=2) -new_wcs.wcs.crpix = [I_stokes.shape[0]/2, I_stokes.shape[1]/2] -new_wcs.wcs.crval = [img[0].header['CRVAL1'], img[0].header['CRVAL2']] -new_wcs.wcs.cunit = ["deg", "deg"] -new_wcs.wcs.ctype = ["RA---TAN", "DEC--TAN"] -new_wcs.wcs.cdelt = [img[0].header['CD1_1']*config['downsample_factor'],\ - img[0].header['CD1_2']*config['downsample_factor']] - -#hdu_ori = WCS(img[0]) -stkI=fits.PrimaryHDU(data=I_stokes,header=new_wcs.to_header()) -pol=fits.PrimaryHDU(data=P,header=new_wcs.to_header()) -pang=fits.PrimaryHDU(data=PA,header=new_wcs.to_header()) -pol_err=fits.PrimaryHDU(data=s_P,header=new_wcs.to_header()) -pang_err=fits.PrimaryHDU(data=s_PA,header=new_wcs.to_header()) - - -### STEP 7. polarization map -#quality cuts -pxscale = stkI.header['CDELT1'] - -#apply quality cuts -SNRp = pol.data/pol_err.data -pol.data[SNRp < fig['SNRp_cut']] = np.nan - -SNRi = stkI.data/np.std(stkI.data[0:10,0:10]) -SNRi = fits.PrimaryHDU(SNRi,header=stkI.header) -pol.data[SNRi.data < fig['SNRi_cut']] = np.nan -print(np.max(SNRi)) -fig1 = plt.figure(figsize=(11,10)) -gc = FITSFigure(stkI,figure=fig1) -gc.show_colorscale(fig['cmap']) -#gc.show_contour(np.log10(SNRi.data),levels=np.linspace(np.log10(fig['SNRi_cut']),np.nanmax(np.log10(SNRi.data,20))),\ -# filled=True,cmap='magma') -gc.show_vectors(pol,pang,scale=scalevec,step=step_vec,color='white',linewidth=1.0) - -figname = figname = fig['figname']+'_test_polmap.pdf' -fig1.savefig(figname,dpi=300) -os.system('open '+figname) diff --git a/src/FOC_reduction_Enrique.py b/src/FOC_reduction_Enrique.py deleted file mode 100755 index 61304de..0000000 --- a/src/FOC_reduction_Enrique.py +++ /dev/null @@ -1,281 +0,0 @@ -#!/usr/bin/python -#-*- coding:utf-8 -*- - -from pylab import * -import numpy as np -import matplotlib.pyplot as plt -from astropy.io import fits -from astropy.wcs import WCS -from aplpy import FITSFigure -import scipy.ndimage -import os as os - -import lib.fits as proj_fits #Functions to handle fits files -import lib.reduction as proj_red #Functions used in reduction pipeline -import lib.plots as proj_plots #Functions for plotting data - -plt.close('all') - -def bin_ndarray(ndarray, new_shape, operation='sum'): - """ - Bins an ndarray in all axes based on the target shape, by summing or - averaging. - - Number of output dimensions must match number of input dimensions. - - Example - ------- - >>> m = np.arange(0,100,1).reshape((10,10)) - >>> n = bin_ndarray(m, new_shape=(5,5), operation='sum') - >>> print(n) - - [[ 22 30 38 46 54] - [102 110 118 126 134] - [182 190 198 206 214] - [262 270 278 286 294] - [342 350 358 366 374]] - - """ - if not operation.lower() in ['sum', 'mean', 'average', 'avg']: - raise ValueError("Operation not supported.") - if ndarray.ndim != len(new_shape): - raise ValueError("Shape mismatch: {} -> {}".format(ndarray.shape, - new_shape)) - compression_pairs = [(d, c//d) for d,c in zip(new_shape, - ndarray.shape)] - flattened = [l for p in compression_pairs for l in p] - ndarray = ndarray.reshape(flattened) - for i in range(len(new_shape)): - if operation.lower() == "sum": - ndarray = ndarray.sum(-1*(i+1)) - elif operation.lower() in ["mean", "average", "avg"]: - ndarray = ndarray.mean(-1*(i+1)) - return ndarray - -def plots(ax,data,vmax,vmin): - ax.imshow(data,vmax=vmax,vmin=vmin,origin='lower') - - - -### User input - -#infiles = ['x274020at.c0f.fits','x274020bt.c0f.fits','x274020ct.c0f.fits','x274020dt.c0f.fits', -# 'x274020et.c0f.fits','x274020ft.c0f.fits','x274020gt.c0f.fits','x274020ht.c0f.fits', -# 'x274020it.c0f.fits'] - -globals()['data_folder'] = "../data/3C405_x136060/" -infiles = ['x1360601t_c0f.fits','x1360602t_c0f.fits','x1360603t_c0f.fits'] -#infiles = ['x1360601t_c1f.fits','x1360602t_c1f.fits','x1360603t_c1f.fits'] -globals()['plots_folder'] = "../plots/3C405_x136060/" - -#Centroids -#The centroids should be estimated by cross-correlating the images. -#Here I used the position of the central source for each file as the reference pixel position. -#ycen_0 = [304,306,303,296,295,295,294,305,304] -#xcen_0 = [273,274,273,276,274,274,274,272,271] - -data_array = [] -for name in infiles: - with fits.open(data_folder+name) as f: - data_array.append(f[0].data) -data_array = np.array(data_array) -shape = data_array.shape -data_array, error_array = proj_red.crop_array(data_array, step=5, null_val=0., inside=True) -data_array, error_array, shifts, errors = proj_red.align_data(data_array, error_array) -center = np.array([(np.array(shape[1:])/2).astype(int),]*len(infiles))-shifts -xcen_0 = center[:,0].astype(int) -ycen_0 = center[:,1].astype(int) - -#size, in pixels, of the FOV centered in x_cen_0,y_cen_0 -Dx = 500 -Dy = 500 - -#set the new image size (Dxy x Dxy pixels binning) -Dxy = 10 -new_shape = (Dx//Dxy,Dy//Dxy) - -#figures -#test alignment -vmin = 0 -vmax = 6 -font_size=40.0 -label_size=20. -lw = 3. - -#pol. map -SNRp_cut = 3 #P measumentes with SNR>3 -SNRi_cut = 5 #I measuremntes with SNR>30, which implies an uncerrtainty in P of 4.7%. -scalevec = 0.05 #length of vectors in pol. map -step_vec = 1 #plot all vectors in the array. if step_vec = 2, then every other vector will be plotted -vec_legend = 10 #% pol for legend -#figname = 'NGC1068_FOC.png' -figname = '3C405_FOC_Enrique' - - -### SCRIPT ### -### Step 1. Check input images before data reduction -#this step is very simplistic. -#Here I used the position of the central source for each file as the -#reference pixel position. -#The centroids should be estimated by cross-correlating the images, -#and compare with the simplistic approach of using the peak pixel of the -#object as the reference pixel. - - -fig,axs = plt.subplots(3,3,figsize=(30,30),dpi=200,sharex=True,sharey=True) - -for jj, enum in enumerate(list(zip(axs.flatten(),data_array))): - a = enum[0] - img = fits.open(data_folder+infiles[jj]) - ima = img[0].data - ima = ima[ycen_0[jj]-Dy:ycen_0[jj]+Dy,xcen_0[jj]-Dx:xcen_0[jj]+Dx] - ima = bin_ndarray(ima,new_shape=new_shape,operation='sum') #binning - exptime = img[0].header['EXPTIME'] - fil = img[0].header['FILTNAM1'] - ima = ima/exptime - globals()['ima_%s' % jj] = ima - #plots - plots(a,ima,vmax=vmax,vmin=vmin) - #position of centroid - a.plot([ima.shape[1]/2,ima.shape[1]/2],[0,ima.shape[0]-1],lw=1,color='black') - a.plot([0,ima.shape[1]-1],[ima.shape[1]/2,ima.shape[1]/2],lw=1,color='black') - a.text(2,2,infiles[jj][0:8],color='white',fontsize=10) - a.text(2,5,fil,color='white',fontsize=30) - a.text(ima.shape[1]-20,1,exptime,color='white',fontsize=20) -fig.subplots_adjust(hspace=0,wspace=0) -fig.savefig(plots_folder+figname+'_test_alignment.png',dpi=300) -#os.system('open test_alignment.png') - - - -### Step 2. average of all images for a single polarizer to have them in the same units e/s. -pol0 = ima_0#(ima_0 + ima_1 + ima_2)/3. -pol60 = ima_1#(ima_3 + ima_4 + ima_5 + ima_6)/4. -pol120 = ima_2#(ima_7 + ima_8)/2. - -fig1,(ax1,ax2,ax3) = plt.subplots(1,3,figsize=(26,8),dpi=200) -CF = ax1.imshow(pol0,vmin=vmin,vmax=vmax,origin='lower') -cbar = plt.colorbar(CF,ax=ax1) -cbar.ax.tick_params(labelsize=20) -ax1.tick_params(axis='both', which='major', labelsize=20) -ax1.text(2,2,'POL0',color='white',fontsize=10) - -CF = ax2.imshow(pol60,vmin=vmin,vmax=vmax,origin='lower') -cbar = plt.colorbar(CF,ax=ax2) -cbar.ax.tick_params(labelsize=20) -ax2.tick_params(axis='both', which='major', labelsize=20) -ax2.text(2,2,'POL60',color='white',fontsize=10) - -CF = ax3.imshow(pol120,vmin=vmin,vmax=vmax,origin='lower') -cbar = plt.colorbar(CF,ax=ax3) -cbar.ax.tick_params(labelsize=20) -ax3.tick_params(axis='both', which='major', labelsize=20) -ax3.text(2,2,'POL120',color='white',fontsize=10) -fig1.savefig(plots_folder+figname+'_test_combinePol.png',dpi=300) -#os.system('open test_combinePol.png') - - -### Step 3. Compute Stokes IQU, P, PA, PI -#Stokes parameters -I_stokes = (2./3.)*(pol0 + pol60 + pol120) -Q_stokes = (2./3.)*(2*pol0 - pol60 - pol120) -U_stokes = (2./np.sqrt(3.))*(pol60 - pol120) - -#Remove nan -I_stokes[np.isnan(I_stokes)]=0. -Q_stokes[np.isnan(Q_stokes)]=0. -U_stokes[np.isnan(U_stokes)]=0. - -#Polarimetry -PI = np.sqrt(Q_stokes*Q_stokes + U_stokes*U_stokes) -P = PI/I_stokes*100 -PA = 0.5*arctan2(U_stokes,Q_stokes)*180./np.pi+90 -s_P = np.sqrt(2.)*(I_stokes)**(-0.5) -s_PA = s_P/(P/100.)*180./np.pi - -fig2,((ax1,ax2,ax3),(ax4,ax5,ax6)) = plt.subplots(2,3,figsize=(40,20),dpi=200) -CF = ax1.imshow(I_stokes,origin='lower') -cbar = plt.colorbar(CF,ax=ax1) -cbar.ax.tick_params(labelsize=20) -ax1.tick_params(axis='both', which='major', labelsize=20) -ax1.text(2,2,'I',color='white',fontsize=10) - -CF = ax2.imshow(Q_stokes,origin='lower') -cbar = plt.colorbar(CF,ax=ax2) -cbar.ax.tick_params(labelsize=20) -ax2.tick_params(axis='both', which='major', labelsize=20) -ax2.text(2,2,'Q',color='white',fontsize=10) - -CF = ax3.imshow(U_stokes,origin='lower') -cbar = plt.colorbar(CF,ax=ax3) -cbar.ax.tick_params(labelsize=20) -ax3.tick_params(axis='both', which='major', labelsize=20) -ax3.text(2,2,'U',color='white',fontsize=10) - -v = np.linspace(0,40,50) -CF = ax4.imshow(P,origin='lower',vmin=0,vmax=40) -cbar = plt.colorbar(CF,ax=ax4) -cbar.ax.tick_params(labelsize=20) -ax4.tick_params(axis='both', which='major', labelsize=20) -ax4.text(2,2,'P',color='white',fontsize=10) - -CF = ax5.imshow(PA,origin='lower',vmin=0,vmax=180) -cbar = plt.colorbar(CF,ax=ax5) -cbar.ax.tick_params(labelsize=20) -ax5.tick_params(axis='both', which='major', labelsize=20) -ax5.text(2,2,'PA',color='white',fontsize=10) - -CF = ax6.imshow(PI,origin='lower') -cbar = plt.colorbar(CF,ax=ax6) -cbar.ax.tick_params(labelsize=20) -ax6.tick_params(axis='both', which='major', labelsize=20) -ax6.text(2,2,'PI',color='white',fontsize=10) - -fig2.savefig(plots_folder+figname+'_test_Stokes.png',dpi=300) -#os.system('open test_Stokes.png') - -### Step 4. Binning and smoothing -#Images can be binned and smoothed to improve SNR. This step can also be done -#using the PolX images. - - -### Step 5. Roate images to have North up -#Images needs to be reprojected to have North up. -#this procedure implies to rotate the Stokes QU using a rotation matrix - - -### STEP 6. image to FITS with updated WCS -new_wcs = WCS(naxis=2) -new_wcs.wcs.crpix = [I_stokes.shape[0]/2, I_stokes.shape[1]/2] -new_wcs.wcs.crval = [img[0].header['CRVAL1'], img[0].header['CRVAL2']] -new_wcs.wcs.cunit = ["deg", "deg"] -new_wcs.wcs.ctype = ["RA---TAN", "DEC--TAN"] -new_wcs.wcs.cdelt = [img[0].header['CD1_1']*Dxy, img[0].header['CD1_2']*Dxy] - -#hdu_ori = WCS(img[0]) -stkI=fits.PrimaryHDU(data=I_stokes,header=new_wcs.to_header()) -pol=fits.PrimaryHDU(data=P,header=new_wcs.to_header()) -pang=fits.PrimaryHDU(data=PA,header=new_wcs.to_header()) -pol_err=fits.PrimaryHDU(data=s_P,header=new_wcs.to_header()) -pang_err=fits.PrimaryHDU(data=s_PA,header=new_wcs.to_header()) - - -### STEP 7. polarization map -#quality cuts -pxscale = stkI.header['CDELT1'] - -#apply quality cuts -SNRp = pol.data/pol_err.data -pol.data[SNRp < SNRp_cut] = np.nan - -SNRi = stkI.data/np.std(stkI.data[0:10,0:10]) -pol.data[SNRi < SNRi_cut] = np.nan -print(np.max(SNRi)) -fig = plt.figure(figsize=(11,10)) -gc = FITSFigure(stkI,figure=fig) -gc.show_contour(np.log10(SNRi),levels=np.linspace(np.log10(SNRi_cut),np.max(np.log10(SNRi)),20),\ - filled=True,cmap='magma') -gc.show_vectors(pol,pang,scale=scalevec,step=step_vec,color='white',linewidth=1.0) - -fig.savefig(plots_folder+figname,dpi=300) -#os.system('open '+figname) diff --git a/src/lib/plots.py b/src/lib/plots.py index 8e04b70..d2a9abe 100755 --- a/src/lib/plots.py +++ b/src/lib/plots.py @@ -12,10 +12,17 @@ prototypes : import numpy as np import matplotlib.pyplot as plt from matplotlib.patches import Rectangle -from mpl_toolkits.axes_grid1.anchored_artists import AnchoredSizeBar +import matplotlib.font_manager as fm +from mpl_toolkits.axes_grid1.anchored_artists import AnchoredSizeBar, AnchoredDirectionArrows from astropy.wcs import WCS +def sci_not(v,err,rnd=1): + power = - int(('%E' % v)[-3:])+1 + return r"({0} $\pm$ {1})e{2}".format( + round(v*10**power,rnd),round(err*10**power,rnd),-power) + + def plot_obs(data_array, headers, shape=None, vmin=0., vmax=6., rectangle=None, savename=None, plots_folder=""): """ @@ -66,8 +73,8 @@ def plot_obs(data_array, headers, shape=None, vmin=0., vmax=6., rectangle=None, #plots im = ax.imshow(data, vmin=vmin, vmax=vmax, origin='lower') if not(rectangle is None): - x, y, width, height = rectangle[i] - ax.add_patch(Rectangle((x, y), width, height, edgecolor='r', fill=False)) + x, y, width, height, color = rectangle[i] + ax.add_patch(Rectangle((x, y), width, height, edgecolor=color, fill=False)) #position of centroid ax.plot([data.shape[1]/2, data.shape[1]/2], [0,data.shape[0]-1], lw=1, color='black') @@ -137,7 +144,7 @@ def plot_Stokes(Stokes, savename=None, plots_folder=""): return 0 -def polarization_map(Stokes, SNRp_cut=3., SNRi_cut=30., step_vec=1, +def polarization_map(Stokes, data_mask, SNRp_cut=3., SNRi_cut=30., step_vec=1, savename=None, plots_folder="", display=None): """ Plots polarization map from Stokes HDUList. @@ -177,7 +184,8 @@ def polarization_map(Stokes, SNRp_cut=3., SNRi_cut=30., step_vec=1, stkQ = Stokes[np.argmax([Stokes[i].header['datatype']=='Q_stokes' for i in range(len(Stokes))])] stkU = Stokes[np.argmax([Stokes[i].header['datatype']=='U_stokes' for i in range(len(Stokes))])] stk_cov = Stokes[np.argmax([Stokes[i].header['datatype']=='IQU_cov_matrix' for i in range(len(Stokes))])] - pol = Stokes[np.argmax([Stokes[i].header['datatype']=='Pol_deg' for i in range(len(Stokes))])] + #pol = Stokes[np.argmax([Stokes[i].header['datatype']=='Pol_deg' for i in range(len(Stokes))])] + pol = Stokes[np.argmax([Stokes[i].header['datatype']=='Pol_deg_debiased' for i in range(len(Stokes))])] pol_err = Stokes[np.argmax([Stokes[i].header['datatype']=='Pol_deg_err' for i in range(len(Stokes))])] #pol_err_Poisson = Stokes[np.argmax([Stokes[i].header['datatype']=='Pol_deg_err_Poisson_noise' for i in range(len(Stokes))])] pang = Stokes[np.argmax([Stokes[i].header['datatype']=='Pol_ang' for i in range(len(Stokes))])] @@ -210,11 +218,12 @@ def polarization_map(Stokes, SNRp_cut=3., SNRi_cut=30., step_vec=1, print("No pixel with polarization information above requested SNR.") #Plot the map + plt.rcParams.update({'font.size': 16}) fig = plt.figure(figsize=(15,15)) ax = fig.add_subplot(111, projection=wcs) ax.set_facecolor('k') - fig.subplots_adjust(hspace=0, wspace=0, right=0.95) - cbar_ax = fig.add_axes([0.98, 0.12, 0.01, 0.75]) + fig.subplots_adjust(hspace=0, wspace=0, right=0.9) + cbar_ax = fig.add_axes([0.95, 0.12, 0.01, 0.75]) if display is None: # If no display selected, show intensity map @@ -239,6 +248,7 @@ def polarization_map(Stokes, SNRp_cut=3., SNRi_cut=30., step_vec=1, im = ax.imshow(SNRi, extent=[-SNRi.shape[1]/2.,SNRi.shape[1]/2.,-SNRi.shape[0]/2.,SNRi.shape[0]/2.], vmin=vmin, vmax=vmax, aspect='auto', cmap='inferno', alpha=1.) cbar = plt.colorbar(im, cax=cbar_ax, label=r"$I_{Stokes}/\sigma_{I}$") levelsI = np.linspace(SNRi_cut, np.max(SNRi[SNRi > 0.]), 10) + #print(levelsI) cont = ax.contour(SNRi, extent=[-SNRi.shape[1]/2.,SNRi.shape[1]/2.,-SNRi.shape[0]/2.,SNRi.shape[0]/2.], levels=levelsI, colors='grey', linewidths=0.5) elif display.lower() in ['snrp']: # Display polarization degree signal-to-noise map @@ -255,26 +265,31 @@ def polarization_map(Stokes, SNRp_cut=3., SNRi_cut=30., step_vec=1, levelsI = np.linspace(SNRi_cut, SNRi.max(), 10) cont = ax.contour(SNRi, extent=[-SNRi.shape[1]/2.,SNRi.shape[1]/2.,-SNRi.shape[0]/2.,SNRi.shape[0]/2.], levels=levelsI, colors='grey', linewidths=0.5) + fontprops = fm.FontProperties(size=16) px_size = wcs.wcs.get_cdelt()[0] - px_sc = AnchoredSizeBar(ax.transData, 1./px_size, '1 arcsec', 3, pad=0.5, sep=5, borderpad=0.5, frameon=False, size_vertical=0.005, color='w') + px_sc = AnchoredSizeBar(ax.transData, 1./px_size, '1 arcsec', 3, pad=0.5, sep=5, borderpad=0.5, frameon=False, size_vertical=0.005, color='w', fontproperties=fontprops) ax.add_artist(px_sc) X, Y = np.meshgrid(np.linspace(-stkI.data.shape[0]/2.,stkI.data.shape[0]/2.,stkI.data.shape[0]), np.linspace(-stkI.data.shape[1]/2.,stkI.data.shape[1]/2.,stkI.data.shape[1])) U, V = pol.data*np.cos(np.pi/2.+pang.data*np.pi/180.), pol.data*np.sin(np.pi/2.+pang.data*np.pi/180.) Q = ax.quiver(X[::step_vec,::step_vec],Y[::step_vec,::step_vec],U[::step_vec,::step_vec],V[::step_vec,::step_vec],units='xy',angles='uv',scale=50.,scale_units='xy',pivot='mid',headwidth=0.,headlength=0.,headaxislength=0.,width=0.1,color='w') - pol_sc = AnchoredSizeBar(ax.transData, 2., r"$P$= 100 %", 4, pad=0.5, sep=5, borderpad=0.5, frameon=False, size_vertical=0.005, color='w') + pol_sc = AnchoredSizeBar(ax.transData, 2., r"$P$= 100 %", 4, pad=0.5, sep=5, borderpad=0.5, frameon=False, size_vertical=0.005, color='w', fontproperties=fontprops) ax.add_artist(pol_sc) + north_dir = AnchoredDirectionArrows(ax.transAxes, "E", "N", length=-0.08, fontsize=0.03, loc=1, aspect_ratio=-1, sep_y=0.01, sep_x=0.01, angle=-Stokes[0].header['orientat'], color='w', arrow_props={'ec': 'w', 'fc': 'w', 'alpha': 1,'lw': 2}) + ax.add_artist(north_dir) + # Compute integrated parameters and associated errors for pixels in the cut + n_pix = mask.size I_int = stkI.data[mask].sum() Q_int = stkQ.data[mask].sum() U_int = stkU.data[mask].sum() - I_int_err = np.sqrt(np.sum(stk_cov.data[0,0][mask])) - Q_int_err = np.sqrt(np.sum(stk_cov.data[1,1][mask])) - U_int_err = np.sqrt(np.sum(stk_cov.data[2,2][mask])) - IQ_int_err = np.sqrt(np.sum(stk_cov.data[0,1][mask]**2)) - IU_int_err = np.sqrt(np.sum(stk_cov.data[0,2][mask]**2)) - QU_int_err = np.sqrt(np.sum(stk_cov.data[1,2][mask]**2)) + I_int_err = np.sqrt(n_pix)*np.sqrt(np.sum(stk_cov.data[0,0][mask])) + Q_int_err = np.sqrt(n_pix)*np.sqrt(np.sum(stk_cov.data[1,1][mask])) + U_int_err = np.sqrt(n_pix)*np.sqrt(np.sum(stk_cov.data[2,2][mask])) + IQ_int_err = np.sqrt(n_pix)*np.sqrt(np.sum(stk_cov.data[0,1][mask]**2)) + IU_int_err = np.sqrt(n_pix)*np.sqrt(np.sum(stk_cov.data[0,2][mask]**2)) + QU_int_err = np.sqrt(n_pix)*np.sqrt(np.sum(stk_cov.data[1,2][mask]**2)) P_int = np.sqrt(Q_int**2+U_int**2)/I_int*100. P_int_err = (100./I_int)*np.sqrt((Q_int**2*Q_int_err**2 + U_int**2*U_int_err**2 + 2.*Q_int*U_int*QU_int_err)/(Q_int**2 + U_int**2) + ((Q_int/I_int)**2 + (U_int/I_int)**2)*I_int_err**2 - 2.*(Q_int/I_int)*IQ_int_err - 2.*(U_int/I_int)*IU_int_err) @@ -283,23 +298,26 @@ def polarization_map(Stokes, SNRp_cut=3., SNRi_cut=30., step_vec=1, PA_int_err = (90./(np.pi*(Q_int**2 + U_int**2)))*np.sqrt(U_int**2*Q_int_err**2 + Q_int**2*U_int_err**2 - 2.*Q_int*U_int*QU_int_err) # Compute integrated parameters and associated errors for all pixels + n_pix = stkI.data.size I_diluted = stkI.data.sum() Q_diluted = stkQ.data.sum() U_diluted = stkU.data.sum() - I_diluted_err = np.sqrt(np.sum(stk_cov.data[0,0])) - Q_diluted_err = np.sqrt(np.sum(stk_cov.data[1,1])) - U_diluted_err = np.sqrt(np.sum(stk_cov.data[2,2])) - IQ_diluted_err = np.sqrt(np.sum(stk_cov.data[0,1]**2)) - IU_diluted_err = np.sqrt(np.sum(stk_cov.data[0,2]**2)) - QU_diluted_err = np.sqrt(np.sum(stk_cov.data[1,2]**2)) + I_diluted_err = np.sqrt(n_pix)*np.sqrt(np.sum(stk_cov.data[0,0])) + Q_diluted_err = np.sqrt(n_pix)*np.sqrt(np.sum(stk_cov.data[1,1])) + U_diluted_err = np.sqrt(n_pix)*np.sqrt(np.sum(stk_cov.data[2,2])) + IQ_diluted_err = np.sqrt(n_pix)*np.sqrt(np.sum(stk_cov.data[0,1]**2)) + IU_diluted_err = np.sqrt(n_pix)*np.sqrt(np.sum(stk_cov.data[0,2]**2)) + QU_diluted_err = np.sqrt(n_pix)*np.sqrt(np.sum(stk_cov.data[1,2]**2)) P_diluted = np.sqrt(Q_diluted**2+U_diluted**2)/I_diluted*100. P_diluted_err = (100./I_diluted)*np.sqrt((Q_diluted**2*Q_diluted_err**2 + U_diluted**2*U_diluted_err**2 + 2.*Q_diluted*U_diluted*QU_diluted_err)/(Q_diluted**2 + U_diluted**2) + ((Q_diluted/I_diluted)**2 + (U_diluted/I_diluted)**2)*I_diluted_err**2 - 2.*(Q_diluted/I_diluted)*IQ_diluted_err - 2.*(U_diluted/I_diluted)*IU_diluted_err) + P_diluted_err = np.sqrt(2/n_pix)*100. PA_diluted = (90./np.pi)*np.arctan2(U_diluted,Q_diluted)+90. PA_diluted_err = (90./(np.pi*(Q_diluted**2 + U_diluted**2)))*np.sqrt(U_diluted**2*Q_diluted_err**2 + Q_diluted**2*U_diluted_err**2 - 2.*Q_diluted*U_diluted*QU_diluted_err) + PA_diluted_err = P_diluted_err/(2.*P_diluted)*180./np.pi - ax.annotate(r"$F_{{\lambda}}^{{int}}$({0:.0f} $\AA$) = {1:.1e} $\pm$ {2:.1e} $ergs \cdot cm^{{-2}} \cdot s^{{-1}} \cdot \AA^{{-1}}$".format(pivot_wav,I_int*convert_flux,I_int_err*convert_flux)+"\n"+r"$P^{{int}}$ = {0:.2f} $\pm$ {1:.2f} %".format(P_int,P_int_err)+"\n"+r"$\theta_{{P}}^{{int}}$ = {0:.2f} $\pm$ {1:.2f} °".format(PA_int,PA_int_err)+"\n"+r"$P^{{diluted}}$ = {0:.2f} $\pm$ {1:.2f} %".format(P_diluted,P_diluted_err)+"\n"+r"$\theta_{{P}}^{{diluted}}$ = {0:.2f} $\pm$ {1:.2f} °".format(PA_diluted,PA_diluted_err), color='white', fontsize=11, 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(pivot_wav,sci_not(I_diluted*convert_flux,I_diluted_err*convert_flux,2))+"\n"+r"$P^{{int}}$ = {0:.1f} $\pm$ {1:.1f} %".format(P_diluted,P_diluted_err)+"\n"+r"$\theta_{{P}}^{{int}}$ = {0:.1f} $\pm$ {1:.1f} °".format(PA_diluted,PA_diluted_err), color='white', fontsize=16, xy=(0.01, 0.92), xycoords='axes fraction') ax.coords.grid(True, color='white', ls='dotted', alpha=0.5) ax.coords[0].set_axislabel('Right Ascension (J2000)') @@ -311,7 +329,7 @@ def polarization_map(Stokes, SNRp_cut=3., SNRi_cut=30., step_vec=1, ax.axis('equal') if not savename is None: - fig.suptitle(savename) + #fig.suptitle(savename) fig.savefig(plots_folder+savename+".png",bbox_inches='tight',dpi=200) plt.show() diff --git a/src/lib/plots_ELR.py b/src/lib/plots_ELR.py deleted file mode 100755 index 2f69476..0000000 --- a/src/lib/plots_ELR.py +++ /dev/null @@ -1,247 +0,0 @@ -""" -Library functions for displaying informations using matplotlib - -prototypes : - - plot_obs(data_array, headers, shape, vmin, vmax, savename, plots_folder) - Plots whole observation raw data in given display shape - - - polarization_map(Stokes_hdul, SNRp_cut, SNRi_cut, step_vec, savename, plots_folder, display) - Plots polarization map of polarimetric parameters saved in an HDUList -""" - -import numpy as np -import matplotlib.pyplot as plt -from matplotlib.patches import Rectangle -from mpl_toolkits.axes_grid1.anchored_artists import AnchoredSizeBar -from astropy.wcs import WCS - - -def plot_obs(data_array, headers, shape=None, vmin=0., vmax=6., rectangle=None, - savename=None, plots_folder=""): - """ - Plots raw observation imagery with some information on the instrument and - filters. - ---------- - Inputs: - data_array : numpy.ndarray - Array of images (2D floats, aligned and of the same shape) of a - single observation with multiple polarizers of an instrument - headers : header list - List of headers corresponding to the images in data_array - shape : array-like of length 2, optional - Shape of the display, with shape = [#row, #columns]. If None, defaults - to the optimal square. - Defaults to None. - vmin : float, optional - Min pixel value that should be displayed. - Defaults to 0. - vmax : float, optional - Max pixel value that should be displayed. - Defaults to 6. - rectangle : numpy.ndarray, optional - Array of parameters for matplotlib.patches.Rectangle objects that will - be displayed on each output image. If None, no rectangle displayed. - Defaults to None. - savename : str, optional - Name of the figure the map should be saved to. If None, the map won't - be saved (only displayed). - Defaults to None. - plots_folder : str, optional - Relative (or absolute) filepath to the folder in wich the map will - be saved. Not used if savename is None. - Defaults to current folder. - """ - if shape is None: - shape = np.array([np.ceil(np.sqrt(data_array.shape[0])).astype(int),]*2) - fig, ax = plt.subplots(shape[0], shape[1], figsize=(10,10), dpi=200, - sharex=True, sharey=True) - - for i, enum in enumerate(list(zip(ax.flatten(),data_array))): - ax = enum[0] - data = enum[1] - instr = headers[i]['instrume'] - rootname = headers[i]['rootname'] - exptime = headers[i]['exptime'] - filt = headers[i]['filtnam1'] - #plots - im = ax.imshow(data, vmin=vmin, vmax=vmax, origin='lower') - if not(rectangle is None): - x, y, width, height = rectangle[i] - ax.add_patch(Rectangle((x, y), width, height, edgecolor='r', fill=False)) - #position of centroid - ax.plot([data.shape[1]/2, data.shape[1]/2], [0,data.shape[0]-1], lw=1, - color='black') - ax.plot([0,data.shape[1]-1], [data.shape[1]/2, data.shape[1]/2], lw=1, - color='black') - ax.annotate(instr+":"+rootname, color='white', fontsize=5, xy=(0.02, 0.95), xycoords='axes fraction') - ax.annotate(filt, color='white', fontsize=10, xy=(0.02, 0.02), xycoords='axes fraction') - ax.annotate(exptime, color='white', fontsize=5, xy=(0.80, 0.02), xycoords='axes fraction') - - fig.subplots_adjust(hspace=0, wspace=0, right=0.85) - cbar_ax = fig.add_axes([0.9, 0.12, 0.02, 0.75]) - fig.colorbar(im, cax=cbar_ax) - - if not (savename is None): - fig.suptitle(savename) - fig.savefig(plots_folder+savename+".png",bbox_inches='tight') - plt.show() - return 0 - -def polarization_map(Stokes, SNRp_cut=3., SNRi_cut=30., step_vec=1, - savename=None, plots_folder="", display=None): - """ - Plots polarization map from Stokes HDUList. - ---------- - Inputs: - Stokes : astropy.io.fits.hdu.hdulist.HDUList - HDUList containing I, Q, U, P, s_P, PA, s_PA (in this particular order) - for one observation. - SNRp_cut : float, optional - Cut that should be applied to the signal-to-noise ratio on P. - Any SNR < SNRp_cut won't be displayed. - Defaults to 3. - SNRi_cut : float, optional - Cut that should be applied to the signal-to-noise ratio on I. - Any SNR < SNRi_cut won't be displayed. - Defaults to 30. This value implies an uncertainty in P of 4.7% - step_vec : int, optional - Number of steps between each displayed polarization vector. - If step_vec = 2, every other vector will be displayed. - Defaults to 1 - savename : str, optional - Name of the figure the map should be saved to. If None, the map won't - be saved (only displayed). - Defaults to None. - plots_folder : str, optional - Relative (or absolute) filepath to the folder in wich the map will - be saved. Not used if savename is None. - Defaults to current folder. - display : str, optional - Choose the map to display between intensity (default), polarization - degree ('p','pol','pol_deg') or polarization degree error ('s_p', - 'pol_err','pol_deg_err'). - Defaults to None (intensity). - """ - #Get data - stkI = Stokes[np.argmax([Stokes[i].header['datatype']=='I_stokes' for i in range(len(Stokes))])] - stkQ = Stokes[np.argmax([Stokes[i].header['datatype']=='Q_stokes' for i in range(len(Stokes))])] - stkU = Stokes[np.argmax([Stokes[i].header['datatype']=='U_stokes' for i in range(len(Stokes))])] - stk_cov = Stokes[np.argmax([Stokes[i].header['datatype']=='IQU_cov_matrix' for i in range(len(Stokes))])] - pol = Stokes[np.argmax([Stokes[i].header['datatype']=='Pol_deg' for i in range(len(Stokes))])] - pol_err = Stokes[np.argmax([Stokes[i].header['datatype']=='Pol_deg_err' for i in range(len(Stokes))])] - pol_err_Poisson = Stokes[np.argmax([Stokes[i].header['datatype']=='Pol_deg_err_Poisson_noise' for i in range(len(Stokes))])] - pang = Stokes[np.argmax([Stokes[i].header['datatype']=='Pol_ang' for i in range(len(Stokes))])] - pang_err = Stokes[np.argmax([Stokes[i].header['datatype']=='Pol_ang_err' for i in range(len(Stokes))])] - - pivot_wav = Stokes[0].header['photplam'] - convert_flux = Stokes[0].header['photflam']/Stokes[0].header['exptot'] - wcs = WCS(Stokes[0]).deepcopy() - - #Compute SNR and apply cuts - pol.data[pol.data == 0.] = np.nan - #SNRp = pol.data/pol_err.data - SNRp = pol.data/pol_err_Poisson.data - pol.data[SNRp < SNRp_cut] = np.nan - #SNRi = stkI.data/np.sqrt(stk_cov.data[0,0]) - SNRi = stkI.data/np.std(stkI.data[0:10,0:10]) - pol.data[SNRi < SNRi_cut] = np.nan - - mask = (SNRp < SNRp_cut) * (SNRi < SNRi_cut) - - # Look for pixel of max polarization - if np.isfinite(pol.data).any(): - p_max = np.max(pol.data[np.isfinite(pol.data)]) - x_max, y_max = np.unravel_index(np.argmax(pol.data==p_max),pol.data.shape) - else: - print("No pixel with polarization information above requested SNR.") - - #Plot the map - fig = plt.figure(figsize=(15,15)) - ax = fig.add_subplot(111, projection=wcs) - ax.set_facecolor('k') - fig.subplots_adjust(hspace=0, wspace=0, right=0.95) - cbar_ax = fig.add_axes([0.98, 0.12, 0.01, 0.75]) - - if display is None: - # If no display selected, show intensity map - vmin, vmax = 0., np.max(stkI.data[stkI.data > 0.]*convert_flux) - im = ax.imshow(stkI.data*convert_flux,extent=[-stkI.data.shape[1]/2.,stkI.data.shape[1]/2.,-stkI.data.shape[0]/2.,stkI.data.shape[0]/2.], vmin=vmin, vmax=vmax, aspect='auto', cmap='inferno', alpha=1.) - cbar = plt.colorbar(im, cax=cbar_ax, label=r"$F_{\lambda}$ [$ergs \cdot cm^{-2} \cdot s^{-1} \cdot \AA^{-1}$]") - levelsI = np.linspace(SNRi_cut, SNRi.max(), 10) - cont = ax.contour(SNRi, extent=[-SNRi.shape[1]/2.,SNRi.shape[1]/2.,-SNRi.shape[0]/2.,SNRi.shape[0]/2.], levels=levelsI, colors='grey', linewidths=0.5) - elif display.lower() in ['p','pol','pol_deg']: - # Display polarization degree map - vmin, vmax = 0., 100. - im = ax.imshow(pol.data,extent=[-pol.data.shape[1]/2.,pol.data.shape[1]/2.,-pol.data.shape[0]/2.,pol.data.shape[0]/2.], vmin=vmin, vmax=vmax, aspect='auto', cmap='inferno', alpha=1.) - cbar = plt.colorbar(im, cax=cbar_ax, label=r"$P$ [%]") - elif display.lower() in ['s_p','pol_err','pol_deg_err']: - # Display polarization degree error map - vmin, vmax = 0., 5. - im = ax.imshow(pol_err.data,extent=[-pol_err.data.shape[1]/2.,pol_err.data.shape[1]/2.,-pol_err.data.shape[0]/2.,pol_err.data.shape[0]/2.], vmin=vmin, vmax=vmax, aspect='auto', cmap='inferno', alpha=1.) - cbar = plt.colorbar(im, cax=cbar_ax, label=r"$\sigma_P$ [%]") - elif display.lower() in ['snr','snri']: - # Display I_stokes signal-to-noise map - vmin, vmax = 0., SNRi.max() - im = ax.imshow(SNRi, extent=[-SNRi.shape[1]/2.,SNRi.shape[1]/2.,-SNRi.shape[0]/2.,SNRi.shape[0]/2.], vmin=vmin, vmax=vmax, aspect='auto', cmap='inferno', alpha=1.) - cbar = plt.colorbar(im, cax=cbar_ax, label=r"$I_{Stokes}/\sigma_{I}$") - levelsI = np.linspace(SNRi_cut, SNRi.max(), 20) - cont = ax.contour(SNRi, extent=[-SNRi.shape[1]/2.,SNRi.shape[1]/2.,-SNRi.shape[0]/2.,SNRi.shape[0]/2.], levels=levelsI, colors='grey', linewidths=0.5) - elif display.lower() in ['snrp']: - # Display polarization degree signal-to-noise map - vmin, vmax = SNRp_cut, np.max(SNRp[SNRp > 0.]) - im = ax.imshow(SNRp, extent=[-SNRp.shape[1]/2.,SNRp.shape[1]/2.,-SNRp.shape[0]/2.,SNRp.shape[0]/2.], vmin=vmin, vmax=vmax, aspect='auto', cmap='inferno', alpha=1.) - cbar = plt.colorbar(im, cax=cbar_ax, label=r"$P/\sigma_{P}$") - levelsP = np.linspace(SNRp_cut, np.max(SNRp[SNRp > 0.]), 10) - cont = ax.contour(SNRp, extent=[-SNRp.shape[1]/2.,SNRp.shape[1]/2.,-SNRp.shape[0]/2.,SNRp.shape[0]/2.], levels=levelsP, colors='grey', linewidths=0.5) - else: - # Defaults to intensity map - vmin, vmax = 0., np.max(stkI.data[stkI.data > 0.]*convert_flux) - im = ax.imshow(stkI.data*convert_flux,extent=[-stkI.data.shape[1]/2.,stkI.data.shape[1]/2.,-stkI.data.shape[0]/2.,stkI.data.shape[0]/2.], vmin=vmin, vmax=vmax, aspect='auto', cmap='inferno', alpha=1.) - cbar = plt.colorbar(im, cax=cbar_ax, label=r"$F_{\lambda}$ [$ergs \cdot cm^{-2} \cdot s^{-1} \cdot \AA$]") - levelsI = np.linspace(SNRi_cut, SNRi.max(), 10) - cont = ax.contour(SNRi, extent=[-SNRi.shape[1]/2.,SNRi.shape[1]/2.,-SNRi.shape[0]/2.,SNRi.shape[0]/2.], levels=levelsI, colors='grey', linewidths=0.5) - - px_size = wcs.wcs.get_cdelt()[0] - px_sc = AnchoredSizeBar(ax.transData, 1./px_size, '1 arcsec', 3, pad=0.5, sep=5, borderpad=0.5, frameon=False, size_vertical=0.005, color='w') - ax.add_artist(px_sc) - - X, Y = np.meshgrid(np.linspace(-stkI.data.shape[0]/2.,stkI.data.shape[0]/2.,stkI.data.shape[0]), np.linspace(-stkI.data.shape[1]/2.,stkI.data.shape[1]/2.,stkI.data.shape[1])) - U, V = pol.data*np.cos(np.pi/2.+pang.data*np.pi/180.), pol.data*np.sin(np.pi/2.+pang.data*np.pi/180.) - Q = ax.quiver(X[::step_vec,::step_vec],Y[::step_vec,::step_vec],U[::step_vec,::step_vec],V[::step_vec,::step_vec],units='xy',angles='uv',scale=50.,scale_units='xy',pivot='mid',headwidth=0.,headlength=0.,headaxislength=0.,width=0.1,color='w') - pol_sc = AnchoredSizeBar(ax.transData, 2., r"$P$= 100 %", 4, pad=0.5, sep=5, borderpad=0.5, frameon=False, size_vertical=0.005, color='w') - ax.add_artist(pol_sc) - - # Compute integrated parameters and associated errors - I_int = stkI.data[mask].sum() - Q_int = stkQ.data[mask].sum() - U_int = stkU.data[mask].sum() - I_int_err = np.sqrt(np.sum(stk_cov.data[0,0][mask])) - Q_int_err = np.sqrt(np.sum(stk_cov.data[1,1][mask])) - U_int_err = np.sqrt(np.sum(stk_cov.data[2,2][mask])) - IQ_int_err = np.sqrt(np.sum(stk_cov.data[0,1][mask]**2)) - IU_int_err = np.sqrt(np.sum(stk_cov.data[0,2][mask]**2)) - QU_int_err = np.sqrt(np.sum(stk_cov.data[1,2][mask]**2)) - - P_int = np.sqrt(Q_int**2+U_int**2)/I_int*100. - P_int_err = np.sqrt(2.)*(I_int)**(-0.5)*100.#(100./I_int)*np.sqrt((Q_int**2*Q_int_err**2 + U_int**2*U_int_err**2 + 2.*Q_int*U_int*QU_int_err)/(Q_int**2 + U_int**2) + ((Q_int/I_int)**2 + (U_int/I_int)**2)*I_int_err**2 - 2.*(Q_int/I_int)*IQ_int_err - 2.*(U_int/I_int)*IU_int_err) - - PA_int = (90./np.pi)*np.arctan2(U_int,Q_int)+90. - PA_int_err = P_int_err/(P_int)*180./np.pi#(90./(np.pi*(Q_int**2 + U_int**2)))*np.sqrt(U_int**2*Q_int_err**2 + Q_int**2*U_int_err**2 - 2.*Q_int*U_int*QU_int_err) - - ax.annotate(r"$F_{{\lambda}}^{{int}}$({0:.0f} $\AA$) = {1:.1e} $\pm$ {2:.1e} $ergs \cdot cm^{{-2}} \cdot s^{{-1}} \cdot \AA^{{-1}}$".format(pivot_wav,I_int*convert_flux,I_int_err*convert_flux)+"\n"+r"$P^{{int}}$ = {0:.2f} $\pm$ {1:.2f} %".format(P_int,P_int_err)+"\n"+r"$\theta_{{P}}^{{int}}$ = {0:.2f} $\pm$ {1:.2f} °".format(PA_int,PA_int_err), color='white', fontsize=11, xy=(0.01, 0.94), xycoords='axes fraction') - - ax.coords.grid(True, color='white', ls='dotted', alpha=0.5) - ax.coords[0].set_axislabel('Right Ascension (J2000)') - ax.coords[0].set_axislabel_position('t') - ax.coords[0].set_ticklabel_position('t') - ax.coords[1].set_axislabel('Declination (J2000)') - ax.coords[1].set_axislabel_position('l') - ax.coords[1].set_ticklabel_position('l') - ax.axis('equal') - - if not savename is None: - fig.suptitle(savename) - fig.savefig(plots_folder+savename+".png",bbox_inches='tight',dpi=200) - - plt.show() - return 0 diff --git a/src/lib/reduction.py b/src/lib/reduction.py index 656b99e..027809b 100755 --- a/src/lib/reduction.py +++ b/src/lib/reduction.py @@ -45,6 +45,7 @@ import copy import numpy as np import matplotlib.pyplot as plt import matplotlib.dates as mdates +from matplotlib.patches import Rectangle from datetime import datetime from scipy.ndimage import rotate as sc_rotate from scipy.ndimage import shift as sc_shift @@ -166,7 +167,8 @@ def bin_ndarray(ndarray, new_shape, operation='sum'): return ndarray -def crop_array(data_array, error_array=None, step=5, null_val=None, inside=False): +def crop_array(data_array, headers, error_array=None, step=5, null_val=None, + inside=False, display=False, savename=None, plots_folder=""): """ Homogeneously crop an array: all contained images will have the same shape. 'inside' parameter will decide how much should be cropped. @@ -175,6 +177,8 @@ def crop_array(data_array, error_array=None, step=5, null_val=None, inside=False data_array : numpy.ndarray Array containing the observation data (2D float arrays) to homogeneously crop. + headers : header list + Headers associated with the images in data_array. error_array : numpy.ndarray, optional Array of images (2D floats, aligned and of the same shape) containing the error in each pixel of the observation images in data_array. @@ -197,6 +201,10 @@ def crop_array(data_array, error_array=None, step=5, null_val=None, inside=False inside the image. If False, the cropped image will be the minimum rectangle in which the whole image is included. Defaults to False. + display : boolean, optional + If True, data_array will be displayed with a rectangle around the + sub-image selected for region of interest. + Defaults to False. ---------- Returns: cropped_array : numpy.ndarray @@ -225,6 +233,46 @@ def crop_array(data_array, error_array=None, step=5, null_val=None, inside=False v_array[3] = np.max(vertex[:,3]).astype(int) new_shape = np.array([v_array[1]-v_array[0],v_array[3]-v_array[2]]) + rectangle = [v_array[2], v_array[0], new_shape[1], new_shape[0], 'b'] + if display: + fig, ax = plt.subplots() + data = data_array[0] + instr = headers[0]['instrume'] + rootname = headers[0]['rootname'] + exptime = headers[0]['exptime'] + filt = headers[0]['filtnam1'] + #plots + im = ax.imshow(data, vmin=data.min(), vmax=data.max(), origin='lower') + x, y, width, height, color = rectangle + ax.add_patch(Rectangle((x, y),width,height,edgecolor=color,fill=False)) + #position of centroid + ax.plot([data.shape[1]/2, data.shape[1]/2], [0,data.shape[0]-1], lw=1, + color='black') + ax.plot([0,data.shape[1]-1], [data.shape[1]/2, data.shape[1]/2], lw=1, + color='black') + ax.annotate(instr+":"+rootname, color='white', fontsize=5, + xy=(0.02, 0.95), xycoords='axes fraction') + ax.annotate(filt, color='white', fontsize=10, xy=(0.02, 0.02), + xycoords='axes fraction') + ax.annotate(exptime, color='white', fontsize=5, xy=(0.80, 0.02), + xycoords='axes fraction') + ax.set(title="Location of cropped image.", + xlabel='pixel offset', + ylabel='pixel offset') + + fig.subplots_adjust(hspace=0, wspace=0, right=0.85) + cbar_ax = fig.add_axes([0.9, 0.12, 0.02, 0.75]) + fig.colorbar(im, cax=cbar_ax) + + if not(savename is None): + fig.suptitle(savename+'_'+filt+'_crop_region') + fig.savefig(plots_folder+savename+'_'+filt+'_crop_region.png', + bbox_inches='tight') + plot_obs(data_array, headers, vmin=data_array.min(), + vmax=data_array.max(), rectangle=[rectangle,]*len(headers), + savename=savename+'_crop_region',plots_folder=plots_folder) + plt.show() + crop_array = np.zeros((data_array.shape[0],new_shape[0],new_shape[1])) crop_error_array = np.zeros((data_array.shape[0],new_shape[0],new_shape[1])) for i,image in enumerate(data_array): @@ -360,7 +408,7 @@ def get_error(data_array, sub_shape=(15,15), display=False, headers=None, Only returned if return_background is True. """ # Crop out any null edges - data, error = crop_array(data_array, step=5, null_val=0., inside=False) + data, error = crop_array(data_array, headers, step=5, null_val=0., inside=False) sub_shape = np.array(sub_shape) # Make sub_shape of odd values @@ -371,7 +419,7 @@ def get_error(data_array, sub_shape=(15,15), display=False, headers=None, diff = (sub_shape-1).astype(int) temp = np.zeros((shape[0],shape[1]-diff[0],shape[2]-diff[1])) error_array = np.ones(data_array.shape) - rectangle = np.zeros((shape[0],4)) + rectangle = [] background = np.zeros((shape[0])) for i,image in enumerate(data): @@ -384,7 +432,7 @@ def get_error(data_array, sub_shape=(15,15), display=False, headers=None, minima = np.unravel_index(np.argmin(temp.sum(axis=0)),temp.shape[1:]) for i, image in enumerate(data): - rectangle[i] = minima[1], minima[0], sub_shape[1], sub_shape[0] + rectangle.append([minima[1], minima[0], sub_shape[1], sub_shape[0], 'r']) # Compute error : root mean square of the background sub_image = image[minima[0]:minima[0]+sub_shape[0],minima[1]:minima[1]+sub_shape[1]] #error = np.std(sub_image) # Previously computed using standard deviation over the background @@ -398,6 +446,7 @@ def get_error(data_array, sub_shape=(15,15), display=False, headers=None, if display: + convert_flux = headers[0]['photflam'] date_time = np.array([headers[i]['date-obs']+';'+headers[i]['time-obs'] for i in range(len(headers))]) date_time = np.array([datetime.strptime(d,'%Y-%m-%d;%H:%M:%S') @@ -406,12 +455,13 @@ def get_error(data_array, sub_shape=(15,15), display=False, headers=None, dict_filt = {"POL0":'r', "POL60":'g', "POL120":'b'} c_filt = np.array([dict_filt[f] for f in filt]) - fig,ax = plt.subplots(figsize=(10,6),constrained_layout=True) + fig,ax = plt.subplots(figsize=(10,6), constrained_layout=True) for f in np.unique(filt): mask = [fil==f for fil in filt] - ax.scatter(date_time[mask], background[mask], color=dict_filt[f], - label="Filter : {0:s}".format(f)) - ax.errorbar(date_time, background, yerr=error_array[:,0,0], fmt='+k', + ax.scatter(date_time[mask], background[mask]*convert_flux, + color=dict_filt[f],label="Filter : {0:s}".format(f)) + ax.errorbar(date_time, background*convert_flux, + yerr=error_array[:,0,0]*convert_flux, fmt='+k', markersize=0, ecolor=c_filt) # Date handling locator = mdates.AutoDateLocator() @@ -424,12 +474,12 @@ def get_error(data_array, sub_shape=(15,15), display=False, headers=None, plt.legend() if not(savename is None): - fig.suptitle(savename+"_background_flux.png") + fig.suptitle(savename+"_background_flux") fig.savefig(plots_folder+savename+"_background_flux.png", bbox_inches='tight') vmin = np.min(np.log10(data[data > 0.])) vmax = np.max(np.log10(data[data > 0.])) - plot_obs(np.log10(data), headers, vmin=vmin, vmax=vmax, + plot_obs(data, headers, vmin=data.min(), vmax=data.max(), rectangle=rectangle, savename=savename+"_background_location", plots_folder=plots_folder) @@ -555,8 +605,8 @@ def rebin_array(data_array, error_array, headers, pxsize, scale, return rebinned_data, rebinned_error, rebinned_headers, Dxy -def align_data(data_array, error_array=None, upsample_factor=1., ref_data=None, - ref_center=None, return_shifts=True): +def align_data(data_array, headers, error_array=None, upsample_factor=1., + ref_data=None, ref_center=None, return_shifts=True): """ Align images in data_array using cross correlation, and rescale them to wider images able to contain any rotation of the reference image. @@ -565,6 +615,8 @@ def align_data(data_array, error_array=None, upsample_factor=1., ref_data=None, Inputs: data_array : numpy.ndarray Array containing the data to align (2D float arrays). + headers : header list + List of headers corresponding to the images in data_array. error_array : numpy.ndarray, optional Array of images (2D floats, aligned and of the same shape) containing the error in each pixel of the observation images in data_array. @@ -626,7 +678,7 @@ def align_data(data_array, error_array=None, upsample_factor=1., ref_data=None, full_array = np.concatenate((data_array,[ref_data]),axis=0) err_array = np.concatenate((error_array,[np.zeros(ref_data.shape)]),axis=0) - full_array, err_array = crop_array(full_array, err_array, step=5, + full_array, err_array = crop_array(full_array, headers, err_array, step=5, inside=False) data_array, ref_data = full_array[:-1], full_array[-1] @@ -649,6 +701,7 @@ def align_data(data_array, error_array=None, upsample_factor=1., ref_data=None, res_shape = int(np.ceil(np.sqrt(2.5)*np.max(shape[1:]))) rescaled_image = np.zeros((shape[0],res_shape,res_shape)) rescaled_error = np.ones((shape[0],res_shape,res_shape)) + rescaled_mask = np.ones((shape[0],res_shape,res_shape),dtype=bool) res_center = (np.array(rescaled_image.shape[1:])/2).astype(int) shifts, errors = [], [] @@ -665,9 +718,12 @@ def align_data(data_array, error_array=None, upsample_factor=1., ref_data=None, res_shift[1]:res_shift[1]+shape[2]] = copy.deepcopy(image) rescaled_error[i,res_shift[0]:res_shift[0]+shape[1], res_shift[1]:res_shift[1]+shape[2]] = copy.deepcopy(error_array[i]) + rescaled_mask[i,res_shift[0]:res_shift[0]+shape[1], + res_shift[1]:res_shift[1]+shape[2]] = False # Shift images to align rescaled_image[i] = sc_shift(rescaled_image[i], shift, cval=0.) rescaled_error[i] = sc_shift(rescaled_error[i], shift, cval=background[i]) + rescaled_mask[i] = sc_shift(rescaled_mask[i], shift, cval=True) rescaled_image[i][rescaled_image[i] < 0.] = 0. @@ -678,13 +734,13 @@ def align_data(data_array, error_array=None, upsample_factor=1., ref_data=None, errors = np.array(errors) if return_shifts: - return rescaled_image, rescaled_error, shifts, errors + return rescaled_image, rescaled_error, rescaled_mask.any(axis=0), shifts, errors else: - return rescaled_image, rescaled_error + return rescaled_image, rescaled_error, rescaled_mask.any(axis=0) -def smooth_data(data_array, error_array, headers, FWHM=1., scale='pixel', - smoothing='gaussian'): +def smooth_data(data_array, error_array, data_mask, headers, FWHM=1., + scale='pixel', smoothing='gaussian'): """ Smooth a data_array using selected function. ---------- @@ -746,6 +802,7 @@ def smooth_data(data_array, error_array, headers, FWHM=1., scale='pixel', #Define gaussian stdev stdev = FWHM/(2.*np.sqrt(2.*np.log(2))) + fmax = np.finfo(np.float64).max if smoothing.lower() in ['combine','combining']: # Smooth using N images combination algorithm @@ -761,11 +818,15 @@ def smooth_data(data_array, error_array, headers, FWHM=1., scale='pixel', for r in range(smoothed.shape[0]): for c in range(smoothed.shape[1]): # Compute distance from current pixel - dist_rc = np.sqrt((r-xx)**2+(c-yy)**2) + dist_rc = np.where(data_mask, fmax, np.sqrt((r-xx)**2+(c-yy)**2)) g_rc = np.array([np.exp(-0.5*(dist_rc/stdev)**2),]*len(data_array)) # Apply weighted combination - smoothed[r,c] = np.sum(data_array*weight*g_rc)/np.sum(weight*g_rc) - error[r,c] = np.sqrt(np.sum(weight*g_rc**2))/np.sum(weight*g_rc) + if data_mask[r,c]: + smoothed[r,c] = 0. + error[r,c] = 1. + else: + smoothed[r,c] = np.sum(data_array*weight*g_rc)/np.sum(weight*g_rc) + error[r,c] = np.sqrt(np.sum(weight*g_rc**2))/np.sum(weight*g_rc) elif smoothing.lower() in ['gauss','gaussian']: #Convolution with gaussian function @@ -775,10 +836,14 @@ def smooth_data(data_array, error_array, headers, FWHM=1., scale='pixel', xx, yy = np.indices(image.shape) for r in range(image.shape[0]): for c in range(image.shape[1]): - dist_rc = np.sqrt((r-xx)**2+(c-yy)**2) + dist_rc = np.where(data_mask, fmax, np.sqrt((r-xx)**2+(c-yy)**2)) g_rc = np.exp(-0.5*(dist_rc/stdev)**2)/(2.*np.pi*stdev**2) - smoothed[i][r,c] = np.sum(image*g_rc) - error[i][r,c] = np.sum(error_array*g_rc**2) + if data_mask[r,c]: + smoothed[r,c] = 0. + error[r,c] = 1. + else: + smoothed[r,c] = np.sum(data_array*weight*g_rc)/np.sum(weight*g_rc) + error[r,c] = np.sqrt(np.sum(weight*g_rc**2))/np.sum(weight*g_rc) else: raise ValueError("{} is not a valid smoothing option".format(smoothing)) @@ -786,8 +851,8 @@ def smooth_data(data_array, error_array, headers, FWHM=1., scale='pixel', return smoothed, error -def polarizer_avg(data_array, error_array, headers, FWHM=None, scale='pixel', - smoothing='gaussian'): +def polarizer_avg(data_array, error_array, data_mask, headers, FWHM=None, + scale='pixel', smoothing='gaussian'): """ Make the average image from a single polarizer for a given instrument. ----------- @@ -862,11 +927,11 @@ def polarizer_avg(data_array, error_array, headers, FWHM=None, scale='pixel', if not(FWHM is None) and (smoothing.lower() in ['combine','combining']): # Smooth by combining each polarizer images - pol0, err0 = smooth_data(pol0_array, err0_array, headers0, + pol0, err0 = smooth_data(pol0_array, err0_array, data_mask, headers0, FWHM=FWHM, scale=scale, smoothing=smoothing) - pol60, err60 = smooth_data(pol60_array, err60_array, headers60, + pol60, err60 = smooth_data(pol60_array, err60_array, data_mask, headers60, FWHM=FWHM, scale=scale, smoothing=smoothing) - pol120, err120 = smooth_data(pol120_array, err120_array, headers120, + pol120, err120 = smooth_data(pol120_array, err120_array, data_mask, headers120, FWHM=FWHM, scale=scale, smoothing=smoothing) else: @@ -908,7 +973,7 @@ def polarizer_avg(data_array, error_array, headers, FWHM=None, scale='pixel', if not(FWHM is None) and (smoothing.lower() in ['gaussian','gauss']): # Smooth by convoluting with a gaussian each polX image. pol_array, polerr_array = smooth_data(pol_array, polerr_array, - headers_array, FWHM=FWHM, scale=scale) + data_mask, headers_array, FWHM=FWHM, scale=scale) pol0, pol60, pol120 = pol_array err0, err60, err120 = polerr_array @@ -931,8 +996,8 @@ def polarizer_avg(data_array, error_array, headers, FWHM=None, scale='pixel', return polarizer_array, polarizer_cov -def compute_Stokes(data_array, error_array, headers, FWHM=None, - scale='pixel', smoothing='gaussian_after'): +def compute_Stokes(data_array, error_array, data_mask, headers, + FWHM=None, scale='pixel', smoothing='gaussian_after'): """ Compute the Stokes parameters I, Q and U for a given data_set ---------- @@ -989,8 +1054,8 @@ def compute_Stokes(data_array, error_array, headers, FWHM=None, # Routine for the FOC instrument if instr == 'FOC': # Get image from each polarizer and covariance matrix - pol_array, pol_cov = polarizer_avg(data_array, error_array, headers, - FWHM=FWHM, scale=scale, smoothing=smoothing) + pol_array, pol_cov = polarizer_avg(data_array, error_array, data_mask, + headers, FWHM=FWHM, scale=scale, smoothing=smoothing) pol0, pol60, pol120 = pol_array if (pol0 < 0.).any() or (pol60 < 0.).any() or (pol120 < 0.).any(): @@ -1012,10 +1077,10 @@ def compute_Stokes(data_array, error_array, headers, FWHM=None, if mask.any(): print("WARNING : I_pol > I_stokes : ", len(I_stokes[mask])) - plt.imshow(np.sqrt(Q_stokes**2+U_stokes**2)/I_stokes*mask, origin='lower') - plt.colorbar() - plt.title(r"$I_{pol}/I_{tot}$") - plt.show() + #plt.imshow(np.sqrt(Q_stokes**2+U_stokes**2)/I_stokes*mask, origin='lower') + #plt.colorbar() + #plt.title(r"$I_{pol}/I_{tot}$") + #plt.show() #I_stokes[mask]=0. #Q_stokes[mask]=0. @@ -1107,11 +1172,12 @@ def compute_pol(I_stokes, Q_stokes, U_stokes, Stokes_cov, headers): #Compute the total exposure time so that #I_stokes*exp_tot = N_tot the total number of events exp_tot = np.array([header['exptime'] for header in headers]).sum() + print("Total exposure time : {} sec".format(exp_tot)) N_obs = I_stokes*exp_tot #Errors on P, PA supposing Poisson noise s_P_P = np.sqrt(2.)/np.sqrt(N_obs)*100. - s_PA_P = s_P_P/(2.*P/100.)*180./np.pi + s_PA_P = s_P_P/(2.*P)*180./np.pi # Nan handling : fmax = np.finfo(np.float64).max @@ -1126,7 +1192,7 @@ def compute_pol(I_stokes, Q_stokes, U_stokes, Stokes_cov, headers): return P, debiased_P, s_P, s_P_P, PA, s_PA, s_PA_P -def rotate_data(data_array, error_array, headers, ang): +def rotate_data(data_array, error_array, data_mask, headers, ang): """ Use scipy.ndimage.rotate to rotate I_stokes to an angle, and a rotation matrix to rotate Q, U of a given angle in degrees and update header @@ -1164,6 +1230,7 @@ def rotate_data(data_array, error_array, headers, ang): new_error_array.append(sc_rotate(error_array[i], ang, reshape=False, cval=error_array.mean())) new_data_array = np.array(new_data_array) + new_data_mask = sc_rotate(data_mask, ang, reshape=False, cval=True) new_error_array = np.array(new_error_array) for i in range(len(new_data_array)): @@ -1192,10 +1259,10 @@ def rotate_data(data_array, error_array, headers, ang): new_headers.append(new_header) - return new_data_array, new_error_array, new_headers + return new_data_array, new_error_array, new_data_mask, new_headers -def rotate_Stokes(I_stokes, Q_stokes, U_stokes, Stokes_cov, headers, ang, SNRi_cut=None): +def rotate_Stokes(I_stokes, Q_stokes, U_stokes, Stokes_cov, data_mask, headers, ang, SNRi_cut=None): """ Use scipy.ndimage.rotate to rotate I_stokes to an angle, and a rotation matrix to rotate Q, U of a given angle in degrees and update header @@ -1266,16 +1333,14 @@ def rotate_Stokes(I_stokes, Q_stokes, U_stokes, Stokes_cov, headers, ang, SNRi_c new_Stokes_cov[1,2] = new_Stokes_cov[2,1] = np.cos(2.*alpha)*np.sin(2.*alpha)*(Stokes_cov[2,2] - Stokes_cov[1,1]) + (np.cos(2.*alpha)**2 - np.sin(2.*alpha)**2)*Stokes_cov[1,2] #Rotate original images using scipy.ndimage.rotate - new_I_stokes = sc_rotate(new_I_stokes, ang, reshape=False, - cval=0.0*np.sqrt(new_Stokes_cov[0,0][0,0])) - new_Q_stokes = sc_rotate(new_Q_stokes, ang, reshape=False, - cval=0.0*np.sqrt(new_Stokes_cov[1,1][0,0])) - new_U_stokes = sc_rotate(new_U_stokes, ang, reshape=False, - cval=0.0*np.sqrt(new_Stokes_cov[2,2][0,0])) + new_I_stokes = sc_rotate(new_I_stokes, ang, reshape=False, cval=0.) + new_Q_stokes = sc_rotate(new_Q_stokes, ang, reshape=False, cval=0.) + new_U_stokes = sc_rotate(new_U_stokes, ang, reshape=False, cval=0.) + new_data_mask = sc_rotate(data_mask, ang, reshape=False, cval=True) for i in range(3): for j in range(3): - new_Stokes_cov[i,j] = sc_rotate(new_Stokes_cov[i,j], ang, reshape=False, - cval=0.0*new_Stokes_cov[i,j].mean()) + new_Stokes_cov[i,j] = sc_rotate(new_Stokes_cov[i,j], ang, + reshape=False, cval=0.) #Update headers to new angle new_headers = [] @@ -1310,10 +1375,10 @@ def rotate_Stokes(I_stokes, Q_stokes, U_stokes, Stokes_cov, headers, ang, SNRi_c new_U_stokes[np.isnan(new_U_stokes)] = 0. new_Stokes_cov[np.isnan(new_Stokes_cov)] = fmax - return new_I_stokes, new_Q_stokes, new_U_stokes, new_Stokes_cov, new_headers + return new_I_stokes, new_Q_stokes, new_U_stokes, new_Stokes_cov, new_data_mask, new_headers -def rotate2_Stokes(I_stokes, Q_stokes, U_stokes, Stokes_cov, headers, ang): +def rotate2_Stokes(I_stokes, Q_stokes, U_stokes, Stokes_cov, data_mask, headers, ang): """ Use scipy.ndimage.rotate to rotate I_stokes to an angle, and a rotation matrix to rotate Q, U of a given angle in degrees and update header @@ -1443,4 +1508,4 @@ def rotate2_Stokes(I_stokes, Q_stokes, U_stokes, Stokes_cov, headers, ang): 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 + return new_I_stokes, new_Q_stokes, new_U_stokes, new_Stokes_cov, data_mask, P, debiased_P, s_P, s_P_P, PA, s_PA, s_PA_P, new_headers diff --git a/src/lib/reduction_ELR.py b/src/lib/reduction_ELR.py deleted file mode 100755 index 9eaae6f..0000000 --- a/src/lib/reduction_ELR.py +++ /dev/null @@ -1,1515 +0,0 @@ -""" -Library function computing various steps of the reduction pipeline. - -prototypes : - - bin_ndarray(ndarray, new_shape, operation) -> ndarray - Bins an ndarray to new_shape. - - - crop_array(data_array, error_array, step, null_val, inside) -> crop_data_array, crop_error_array - Homogeneously crop out null edges off a data array. - - - deconvolve_array(data_array, psf, FWHM, iterations) -> deconvolved_data_array - Homogeneously deconvolve a data array using Richardson-Lucy iterative algorithm - - - get_error(data_array, sub_shape, display, headers, savename, plots_folder) -> data_array, error_array - Compute the error (noise) on each image of the input array. - - - rebin_array(data_array, error_array, headers, pxsize, scale, operation) -> rebinned_data, rebinned_error, rebinned_headers, Dxy - Homegeneously rebin a data array given a target pixel size in scale units. - - - align_data(data_array, error_array, upsample_factor, ref_data, ref_center, return_shifts) -> data_array, error_array (, shifts, errors) - Align data_array on ref_data by cross-correlation. - - - smooth_data(data_array, error_array, FWHM, scale, smoothing) -> smoothed_array - Smooth data by convoluting with a gaussian or by combining weighted images - - - polarizer_avg(data_array, error_array, headers, FWHM, scale, smoothing) -> polarizer_array, pol_error_array - Average images in data_array on each used polarizer filter. - - - compute_Stokes(data_array, error_array, headers, FWHM, scale, smoothing) -> I_stokes, Q_stokes, U_stokes, Stokes_cov - Compute Stokes parameters I, Q and U and their respective errors from data_array. - - - compute_pol(I_stokes, Q_stokes, U_stokes, Stokes_cov, headers) -> P, debiased_P, s_P, s_P_P, PA, s_PA, s_PA_P - Compute polarization degree (in %) and angle (in degree) and their - respective errors - - - rotate_sc_Stokes(I_stokes, Q_stokes, U_stokes, Stokes_cov, headers, ang) -> I_stokes, Q_stokes, U_stokes, Stokes_cov, headers - Rotate I, Q, U given an angle in degrees using scipy functions. - - - rotate_PIL_Stokes(I_stokes, Q_stokes, U_stokes, Stokes_cov, headers, ang) -> I_stokes, Q_stokes, U_stokes, Stokes_cov, headers - Rotate I, Q, U given an angle in degrees using Pillow function. - - - rotate2_sc_Stokes(I_stokes, Q_stokes, U_stokes, Stokes_cov, headers, ang) -> I_stokes, Q_stokes, U_stokes, Stokes_cov, P, debiased_P, s_P, s_P_P, PA, s_PA, s_PA_P, headers - Rotate I, Q, U, P, PA and associated errors given an angle in degrees - using scipy functions. - - - rotate2_PIL_Stokes(I_stokes, Q_stokes, U_stokes, Stokes_cov, headers, ang) -> I_stokes, Q_stokes, U_stokes, Stokes_cov, P, debiased_P, s_P, s_P_P, PA, s_PA, s_PA_P, headers - Rotate I, Q, U, P, PA and associated errors given an angle in degrees - using Pillow function. -""" - -import copy -import numpy as np -import matplotlib.pyplot as plt -import matplotlib.dates as mdates -from datetime import datetime -from scipy.ndimage import rotate as sc_rotate -from scipy.ndimage import shift as sc_shift -from PIL import Image -from astropy.wcs import WCS -from lib.deconvolve import deconvolve_im, gaussian_psf -from lib.convex_hull import image_hull -from lib.plots import plot_obs -from lib.cross_correlation import phase_cross_correlation - - -def PIL_rotate(ndarray, angle, reshape=False, cval=0.): - """ - Define Function with similar parameters as scipy.ndimage.rotate making use - of the Pillow library. - ---------- - Inputs: - ndarray : numpy.ndarray - 2D float array to be rotated using Pillow library functions. - angle : float - Counter-clockwise ngle in degrees that the input array should be - rotated to. - reshape : boolean, optional - If True, output image will be of shape such that the full rotated - input array is displayed. If False, output array will be of same - shape than input array, cutting rotated edges. - Defaults to False. - cval : float, optional - Values with which will be filled pixels entering the output array by - rotation of the input array. - Dafaults to 0. - ---------- - Returns: - rotated_array : numpy.ndarray - Rotated array using Pillow functions. - """ - image = Image.fromarray(ndarray) - rotated = image.rotate(angle, expand=reshape, fillcolor=cval) - return np.asarray(rotated) - - -def get_row_compressor(old_dimension, new_dimension, operation='sum'): - """ - Return the matrix that allows to compress an array from an old dimension of - rows to a new dimension of rows, can be done by summing the original - components or averaging them. - ---------- - Inputs: - old_dimension, new_dimension : int - Number of rows in the original and target matrices. - operation : str, optional - Set the way original components of the matrix are put together - between summing ('sum') and averaging ('average', 'avg', 'mean') them. - Defaults to 'sum'. - ---------- - Returns: - dim_compressor : numpy.ndarray - 2D matrix allowing row compression by matrix multiplication to the left - of the original matrix. - """ - dim_compressor = np.zeros((new_dimension, old_dimension)) - bin_size = float(old_dimension) / new_dimension - next_bin_break = bin_size - which_row, which_column = 0, 0 - - while which_row < dim_compressor.shape[0] and which_column < dim_compressor.shape[1]: - if round(next_bin_break - which_column, 10) >= 1: - dim_compressor[which_row, which_column] = 1 - which_column += 1 - elif next_bin_break == which_column: - - which_row += 1 - next_bin_break += bin_size - else: - partial_credit = next_bin_break - which_column - dim_compressor[which_row, which_column] = partial_credit - which_row += 1 - dim_compressor[which_row, which_column] = 1 - partial_credit - which_column += 1 - next_bin_break += bin_size - - if operation.lower() in ["mean", "average", "avg"]: - dim_compressor /= bin_size - - return dim_compressor - - -def get_column_compressor(old_dimension, new_dimension, operation='sum'): - """ - Return the matrix that allows to compress an array from an old dimension of - columns to a new dimension of columns, can be done by summing the original - components or averaging them. - ---------- - Inputs: - old_dimension, new_dimension : int - Number of columns in the original and target matrices. - operation : str, optional - Set the way original components of the matrix are put together - between summing ('sum') and averaging ('average', 'avg', 'mean') them. - Defaults to 'sum'. - ---------- - Returns: - dim_compressor : numpy.ndarray - 2D matrix allowing columns compression by matrix multiplication to the - right of the original matrix. - """ - return get_row_compressor(old_dimension, new_dimension, operation).transpose() - - -def bin_ndarray(ndarray, new_shape, operation='sum'): - """ - Bins an ndarray in all axes based on the target shape, by summing or - averaging. - - Number of output dimensions must match number of input dimensions. - - Example - ------- - >>> m = np.arange(0,100,1).reshape((10,10)) - >>> n = bin_ndarray(m, new_shape=(5,5), operation='sum') - >>> print(n) - - [[ 22 30 38 46 54] - [102 110 118 126 134] - [182 190 198 206 214] - [262 270 278 286 294] - [342 350 358 366 374]] - - """ - if not operation.lower() in ['sum', 'mean', 'average', 'avg']: - raise ValueError("Operation not supported.") - if ndarray.ndim != len(new_shape): - raise ValueError("Shape mismatch: {} -> {}".format(ndarray.shape, - new_shape)) - if (np.array(ndarray.shape)%np.array(new_shape) == np.array([0.,0.])).all(): - compression_pairs = [(d, c//d) for d,c in zip(new_shape, ndarray.shape)] - flattened = [l for p in compression_pairs for l in p] - ndarray = ndarray.reshape(flattened) - - for i in range(len(new_shape)): - if operation.lower() == "sum": - ndarray = ndarray.sum(-1*(i+1)) - elif operation.lower() in ["mean", "average", "avg"]: - ndarray = ndarray.mean(-1*(i+1)) - else: - row_comp = np.mat(get_row_compressor(ndarray.shape[0], new_shape[0], operation)) - col_comp = np.mat(get_column_compressor(ndarray.shape[1], new_shape[1], operation)) - ndarray = np.array(row_comp * np.mat(ndarray) * col_comp) - - return ndarray - - -def crop_array(data_array, error_array=None, step=5, null_val=None, inside=False): - """ - Homogeneously crop an array: all contained images will have the same shape. - 'inside' parameter will decide how much should be cropped. - ---------- - Inputs: - data_array : numpy.ndarray - Array containing the observation data (2D float arrays) to - homogeneously crop. - error_array : numpy.ndarray, optional - Array of images (2D floats, aligned and of the same shape) containing - the error in each pixel of the observation images in data_array. - If None, will be initialized to zeros. - Defaults to None. - step : int, optional - For images with straight edges, not all lines and columns need to be - browsed in order to have a good convex hull. Step value determine - how many row/columns can be jumped. With step=2 every other line will - be browsed. - Defaults to 5. - null_val : float or array-like, optional - Pixel value determining the threshold for what is considered 'outside' - the image. All border pixels below this value will be taken out. - If None, will be put to 75% of the mean value of the associated error - array. - Defaults to None. - inside : boolean, optional - If True, the cropped image will be the maximum rectangle included - inside the image. If False, the cropped image will be the minimum - rectangle in which the whole image is included. - Defaults to False. - ---------- - Returns: - cropped_array : numpy.ndarray - Array containing the observationnal data homogeneously cropped. - """ - if error_array is None: - error_array = np.zeros(data_array.shape) - if null_val is None: - null_val = [1.00*error.mean() for error in error_array] - elif type(null_val) is float: - null_val = [null_val,]*len(error_array) - - vertex = np.zeros((data_array.shape[0],4),dtype=int) - for i,image in enumerate(data_array): - vertex[i] = image_hull(image,step=step,null_val=null_val[i],inside=inside) - v_array = np.zeros(4,dtype=int) - if inside: - v_array[0] = np.max(vertex[:,0]).astype(int) - v_array[1] = np.min(vertex[:,1]).astype(int) - v_array[2] = np.max(vertex[:,2]).astype(int) - v_array[3] = np.min(vertex[:,3]).astype(int) - else: - v_array[0] = np.min(vertex[:,0]).astype(int) - v_array[1] = np.max(vertex[:,1]).astype(int) - v_array[2] = np.min(vertex[:,2]).astype(int) - v_array[3] = np.max(vertex[:,3]).astype(int) - - new_shape = np.array([v_array[1]-v_array[0],v_array[3]-v_array[2]]) - crop_array = np.zeros((data_array.shape[0],new_shape[0],new_shape[1])) - crop_error_array = np.zeros((data_array.shape[0],new_shape[0],new_shape[1])) - for i,image in enumerate(data_array): - crop_array[i] = image[v_array[0]:v_array[1],v_array[2]:v_array[3]] - crop_error_array[i] = error_array[i][v_array[0]:v_array[1],v_array[2]:v_array[3]] - - return crop_array, crop_error_array - - -def deconvolve_array(data_array, headers, psf='gaussian', FWHM=1., scale='px', - shape=(9,9), iterations=20): - """ - Homogeneously deconvolve a data array using Richardson-Lucy iterative algorithm. - ---------- - Inputs: - data_array : numpy.ndarray - Array containing the observation data (2D float arrays) to - homogeneously deconvolve. - headers : header list - Headers associated with the images in data_array. - psf : str or numpy.ndarray, optionnal - String designing the type of desired Point Spread Function or array - of dimension 2 corresponding to the weights of a PSF. - Defaults to 'gaussian' type PSF. - FWHM : float, optional - Full Width at Half Maximum for desired PSF in 'scale units. Only used - for relevant values of 'psf' variable. - Defaults to 1. - scale : str, optional - Scale units for the FWHM of the PSF between 'pixel' and 'arcsec'. - Defaults to 'pixel'. - shape : tuple, optional - Shape of the kernel of the PSF. Must be of dimension 2. Only used for - relevant values of 'psf' variable. - Defaults to (9,9). - iterations : int, optional - Number of iterations of Richardson-Lucy deconvolution algorithm. Act as - as a regulation of the process. - Defaults to 20. - ---------- - Returns: - deconv_array : numpy.ndarray - Array containing the deconvolved data (2D float arrays) using given - point spread function. - """ - # If chosen FWHM scale is 'arcsec', compute FWHM in pixel scale - if scale.lower() in ['arcsec','arcseconds']: - pxsize = np.zeros((data_array.shape[0],2)) - for i,header in enumerate(headers): - # Get current pixel size - w = WCS(header).deepcopy() - if w.wcs.has_cd(): - del w.wcs.cd - keys = list(w.to_header().keys())+['CD1_1','CD1_2','CD2_1','CD2_2'] - for key in keys: - header.remove(key, ignore_missing=True) - w.wcs.cdelt = 3600.*np.sqrt(np.sum(w.wcs.get_pc()**2,axis=1)) - if (w.wcs.cdelt == np.array([1., 1.])).all() and \ - (w.array_shape in [(512, 512),(1024,512),(512,1024),(1024,1024)]): - # Update WCS with relevant information - HST_aper = 2400. # HST aperture in mm - f_ratio = header['f_ratio'] - px_dim = np.array([25., 25.]) # Pixel dimension in µm - if header['pxformt'].lower() == 'zoom': - px_dim[0] = 50. - w.wcs.cdelt = 206.3*px_dim/(f_ratio*HST_aper) - header.update(w.to_header()) - pxsize[i] = np.round(w.wcs.cdelt,5) - if (pxsize != pxsize[0]).any(): - raise ValueError("Not all images in array have same pixel size") - FWHM /= pxsize[0].min() - - # Define Point-Spread-Function kernel - if psf.lower() in ['gauss','gaussian']: - kernel = gaussian_psf(FWHM=FWHM, shape=shape) - elif (type(psf) == np.ndarray) and (len(psf.shape) == 2): - kernel = psf - else: - raise ValueError("{} is not a valid value for 'psf'".format(psf)) - - # Deconvolve images in the array using given PSF - deconv_array = np.zeros(data_array.shape) - for i,image in enumerate(data_array): - deconv_array[i] = deconvolve_im(image, kernel, iterations=iterations, - clip=True, filter_epsilon=None) - - return deconv_array - - -def get_error(data_array, sub_shape=(15,15), display=False, headers=None, - savename=None, plots_folder="", return_background=False): - """ - Look for sub-image of shape sub_shape that have the smallest integrated - flux (no source assumption) and define the background on the image by the - standard deviation on this sub-image. - ---------- - Inputs: - data_array : numpy.ndarray - Array containing the data to study (2D float arrays). - sub_shape : tuple, optional - Shape of the sub-image to look for. Must be odd. - Defaults to (15,15). - display : boolean, optional - If True, data_array will be displayed with a rectangle around the - sub-image selected for background computation. - Defaults to False. - headers : header list, optional - Headers associated with the images in data_array. Will only be used if - display is True. - Defaults to None. - savename : str, optional - Name of the figure the map should be saved to. If None, the map won't - be saved (only displayed). Only used if display is True. - Defaults to None. - plots_folder : str, optional - Relative (or absolute) filepath to the folder in wich the map will - be saved. Not used if savename is None. - Defaults to current folder. - return_background : boolean, optional - If True, the pixel background value for each image in data_array is - returned. - Defaults to False. - ---------- - Returns: - data_array : numpy.ndarray - Array containing the data to study minus the background. - error_array : numpy.ndarray - Array containing the background values associated to the images in - data_array. - background : numpy.ndarray - Array containing the pixel background value for each image in - data_array. - Only returned if return_background is True. - """ - # Crop out any null edges - data, error = crop_array(data_array, step=5, null_val=0., inside=False) - - sub_shape = np.array(sub_shape) - # Make sub_shape of odd values - if not(np.all(sub_shape%2)): - sub_shape += 1-sub_shape%2 - - shape = np.array(data.shape) - diff = (sub_shape-1).astype(int) - temp = np.zeros((shape[0],shape[1]-diff[0],shape[2]-diff[1])) - error_array = np.ones(data_array.shape) - rectangle = np.zeros((shape[0],4)) - background = np.zeros((shape[0])) - - for i,image in enumerate(data): - # Find the sub-image of smallest integrated flux (suppose no source) - #sub-image dominated by background - for r in range(temp.shape[1]): - for c in range(temp.shape[0]): - temp[i][r,c] = image[r:r+diff[0],c:c+diff[1]].sum() - - minima = np.unravel_index(np.argmin(temp.sum(axis=0)),temp.shape[1:]) - - for i, image in enumerate(data): - rectangle[i] = minima[0], minima[1], sub_shape[0], sub_shape[1] - # Compute error : root mean square of the background - sub_image = image[minima[0]:minima[0]+sub_shape[0],minima[1]:minima[1]+sub_shape[1]] - #error_array[i] *= np.std(sub_image) # Previously computed using standard deviation over the background - error_array[i] *= np.sqrt(np.sum(sub_image**2)/sub_image.size) - background[i] = sub_image.sum() - #data_array[i] = np.abs(data_array[i] - sub_image.mean()) - - if display: - - date_time = np.array([headers[i]['date-obs']+';'+headers[i]['time-obs'] - for i in range(len(headers))]) - date_time = np.array([datetime.strptime(d,'%Y-%m-%d;%H:%M:%S') - for d in date_time]) - filt = np.array([headers[i]['filtnam1'] for i in range(len(headers))]) - dict_filt = {"POL0":'r', "POL60":'g', "POL120":'b'} - c_filt = np.array([dict_filt[f] for f in filt]) - - fig,ax = plt.subplots(figsize=(10,6),constrained_layout=True) - for f in np.unique(filt): - mask = [fil==f for fil in filt] - ax.scatter(date_time[mask], background[mask], color=dict_filt[f], - label="Filter : {0:s}".format(f)) - ax.errorbar(date_time, background, yerr=error_array[:,0,0], fmt='+k', - markersize=0, ecolor=c_filt) - # Date handling - locator = mdates.AutoDateLocator() - formatter = mdates.ConciseDateFormatter(locator) - ax.xaxis.set_major_locator(locator) - ax.xaxis.set_major_formatter(formatter) - ax.set_xlabel("Observation date and time") - ax.set_ylabel(r"Flux [$ergs \cdot cm^{-2} \cdot s^{-1} \cdot \AA^{-1}$]") - ax.set_title("Background flux and error computed for each image") - plt.legend() - - if not(savename is None): - fig.suptitle(savename+"_background_flux.png") - fig.savefig(plots_folder+savename+"_background_flux.png", - bbox_inches='tight') - vmin = np.min(np.log10(data[data > 0.])) - vmax = np.max(np.log10(data[data > 0.])) - plot_obs(np.log10(data), headers, vmin=vmin, vmax=vmax, - rectangle=rectangle, - savename=savename+"_background_location", - plots_folder=plots_folder) - - else: - vmin = np.min(np.log10(data[data > 0.])) - vmax = np.max(np.log10(data[data > 0.])) - plot_obs(np.log10(data), headers, vmin=vmin, vmax=vmax, - rectangle=rectangle) - - plt.show() - - if return_background: - return data_array, error_array, np.array([error_array[i][0,0] for i in range(error_array.shape[0])]) - else: - return data_array, error_array - - -def rebin_array(data_array, error_array, headers, pxsize, scale, - operation='sum'): - """ - Homogeneously rebin a data array to get a new pixel size equal to pxsize - where pxsize is given in arcsec. - ---------- - Inputs: - data_array, error_array : numpy.ndarray - Arrays containing the images (2D float arrays) and their associated - errors that will be rebinned. - headers : header list - List of headers corresponding to the images in data_array. - pxsize : float - Physical size of the pixel in arcseconds that should be obtain with - the rebinning. - scale : str, optional - Scale units for the FWHM between 'pixel' and 'arcsec'. - Defaults to 'pixel'. - operation : str, optional - Set the way original components of the matrix are put together - between summing ('sum') and averaging ('average', 'avg', 'mean') them. - Defaults to 'sum'. - ---------- - Returns: - rebinned_data, rebinned_error : numpy.ndarray - Rebinned arrays containing the images and associated errors. - rebinned_headers : header list - Updated headers corresponding to the images in rebinned_data. - Dxy : numpy.ndarray - Array containing the rebinning factor in each direction of the image. - """ - # Check that all images are from the same instrument - ref_header = headers[0] - instr = ref_header['instrume'] - same_instr = np.array([instr == header['instrume'] for header in headers]).all() - if not same_instr: - raise ValueError("All images in data_array are not from the same\ - instrument, cannot proceed.") - if not instr in ['FOC']: - raise ValueError("Cannot reduce images from {0:s} instrument\ - (yet)".format(instr)) - - rebinned_data, rebinned_error, rebinned_headers = [], [], [] - Dxy = np.array([1, 1],dtype=int) - - # Routine for the FOC instrument - if instr == 'FOC': - HST_aper = 2400. # HST aperture in mm - for i, enum in enumerate(list(zip(data_array, error_array, headers))): - image, error, header = enum - # Get current pixel size - w = WCS(header).deepcopy() - if w.wcs.has_cd(): - del w.wcs.cd - keys = list(w.to_header().keys())+['CD1_1','CD1_2','CD2_1','CD2_2'] - for key in keys: - header.remove(key, ignore_missing=True) - w.wcs.cdelt = 3600.*np.sqrt(np.sum(w.wcs.get_pc()**2,axis=1)) - if (w.wcs.cdelt == np.array([1., 1.])).all() and \ - (w.array_shape in [(512, 512),(1024,512),(512,1024),(1024,1024)]): - # Update WCS with relevant information - f_ratio = header['f_ratio'] - px_dim = np.array([25., 25.]) # Pixel dimension in µm - if header['pxformt'].lower() == 'zoom': - px_dim[0] = 50. - w.wcs.cdelt = 206.3*px_dim/(f_ratio*HST_aper) - header.update(w.to_header()) - - # Compute binning ratio - if scale.lower() in ['px', 'pixel']: - Dxy = np.array([pxsize,]*2) - elif scale.lower() in ['arcsec','arcseconds']: - Dxy = np.floor(pxsize/w.wcs.cdelt).astype(int) - else: - raise ValueError("'{0:s}' invalid scale for binning.".format(scale)) - - if (Dxy <= 1.).any(): - raise ValueError("Requested pixel size is below resolution.") - new_shape = (image.shape//Dxy).astype(int) - - # Rebin data - rebinned_data.append(bin_ndarray(image, new_shape=new_shape, - operation=operation)) - - # Propagate error - rms_image = np.sqrt(bin_ndarray(image**2, new_shape=new_shape, - operation='average')) - #std_image = np.sqrt(bin_ndarray(image**2, new_shape=new_shape, - # operation='average') - bin_ndarray(image, new_shape=new_shape, - # operation='average')**2) - new_error = np.sqrt(Dxy[0]*Dxy[1])*bin_ndarray(error, - new_shape=new_shape, operation='average') - rebinned_error.append(np.sqrt(rms_image**2 + new_error**2)) - - # Update header - w = w.slice((np.s_[::Dxy[0]], np.s_[::Dxy[1]])) - header['NAXIS1'],header['NAXIS2'] = w.array_shape - header.update(w.to_header()) - rebinned_headers.append(header) - - - rebinned_data = np.array(rebinned_data) - rebinned_error = np.array(rebinned_error) - - return rebinned_data, rebinned_error, rebinned_headers, Dxy - - -def align_data(data_array, error_array=None, upsample_factor=1., ref_data=None, - ref_center=None, return_shifts=True): - """ - Align images in data_array using cross correlation, and rescale them to - wider images able to contain any rotation of the reference image. - All images in data_array must have the same shape. - ---------- - Inputs: - data_array : numpy.ndarray - Array containing the data to align (2D float arrays). - error_array : numpy.ndarray, optional - Array of images (2D floats, aligned and of the same shape) containing - the error in each pixel of the observation images in data_array. - If None, will be initialized to zeros. - Defaults to None. - upsample_factor : float, optional - Oversampling factor for the cross-correlation, will allow sub- - pixel alignement as small as one over the factor of a pixel. - Defaults to one (no over-sampling). - ref_data : numpy.ndarray, optional - Reference image (2D float array) the data_array should be - aligned to. If "None", the ref_data will be the first image - of the data_array. - Defaults to None. - ref_center : numpy.ndarray, optional - Array containing the coordinates of the center of the reference - image or a string in 'max', 'flux', 'maxflux', 'max_flux'. If None, - will fallback to the center of the image. - Defaults to None. - return_shifts : boolean, optional - If False, calling the function will only return the array of - rescaled images. If True, will also return the shifts and - errors. - Defaults to True. - ---------- - Returns: - rescaled : numpy.ndarray - Array containing the aligned data from data_array, rescaled to wider - image with margins of value 0. - rescaled_error : numpy.ndarray - Array containing the errors on the aligned images in the rescaled array. - shifts : numpy.ndarray - Array containing the pixel shifts on the x and y directions from - the reference image. - Only returned if return_shifts is True. - errors : numpy.ndarray - Array containing the relative error computed on every shift value. - Only returned if return_shifts is True. - """ - if ref_data is None: - # Define the reference to be the first image of the inputed array - #if None have been specified - ref_data = data_array[0] - same = 1 - for array in data_array: - # Check if all images have the same shape. If not, cross-correlation - #cannot be computed. - same *= (array.shape == ref_data.shape) - if not same: - raise ValueError("All images in data_array must have same shape as\ - ref_data") - if error_array is None: - _, error_array, background = get_error(data_array, return_background=True) - else: - _, _, background = get_error(data_array, return_background=True) - - # Crop out any null edges - #(ref_data must be cropped as well) - full_array = np.concatenate((data_array,[ref_data]),axis=0) - err_array = np.concatenate((error_array,[np.zeros(ref_data.shape)]),axis=0) - - #full_array, err_array = crop_array(full_array, err_array, step=5, - # inside=False) - - data_array, ref_data = full_array[:-1], full_array[-1] - error_array = err_array[:-1] - - if ref_center is None: - # Define the center of the reference image to be the center pixel - #if None have been specified - ref_center = (np.array(ref_data.shape)/2).astype(int) - elif ref_center.lower() in ['max', 'flux', 'maxflux', 'max_flux']: - # Define the center of the reference image to be the pixel of max flux. - ref_center = np.unravel_index(np.argmax(ref_data),ref_data.shape) - else: - # Default to image center. - ref_center = (np.array(ref_data.shape)/2).astype(int) - - # Create a rescaled null array that can contain any rotation of the - #original image (and shifted images) - shape = data_array.shape - res_shape = int(np.ceil(np.sqrt(2)*np.max(shape[1:]))) - rescaled_image = np.ones((shape[0],res_shape,res_shape)) - cropped_image = np.ones(shape) - rescaled_error = np.ones((shape[0],res_shape,res_shape)) - cropped_error = np.ones(shape) - res_center = (np.array(rescaled_image.shape[1:])/2).astype(int) - - shifts, errors = [], [] - for i,image in enumerate(data_array): - # Initialize rescaled images to background values - rescaled_image[i] *= 0.1*background[i] - rescaled_error[i] *= background[i] - # Get shifts and error by cross-correlation to ref_data - shift, error, phase_diff = phase_cross_correlation(ref_data, image, - upsample_factor=upsample_factor) - # Rescale image to requested output - center = np.fix(ref_center-shift).astype(int) - res_shift = res_center-ref_center - rescaled_image[i,res_shift[0]:res_shift[0]+shape[1], - res_shift[1]:res_shift[1]+shape[2]] = copy.deepcopy(image) - rescaled_error[i,res_shift[0]:res_shift[0]+shape[1], - res_shift[1]:res_shift[1]+shape[2]] = copy.deepcopy(error_array[i]) - # Shift images to align - rescaled_image[i] = sc_shift(rescaled_image[i], shift, cval=0.1*background[i]) - rescaled_error[i] = sc_shift(rescaled_error[i], shift, cval=background[i]) - - cropped_image[i] = rescaled_image[i,res_center[0]-int(shape[1]/2):res_center[0]+int(shape[1]/2),res_center[1]-int(shape[2]/2):res_center[1]+int(shape[2]/2)] - cropped_error[i] = rescaled_error[i,res_center[0]-int(shape[1]/2):res_center[0]+int(shape[1]/2),res_center[1]-int(shape[2]/2):res_center[1]+int(shape[2]/2)] - - shifts.append(shift) - errors.append(error) - - shifts = np.array(shifts) - errors = np.array(errors) - - if return_shifts: - return cropped_image, cropped_error, shifts, errors - else: - return cropped_image, cropped_error - - -def smooth_data(data_array, error_array, headers, FWHM=1., scale='pixel', - smoothing='gaussian'): - """ - Smooth a data_array using selected function. - ---------- - Inputs: - data_array : numpy.ndarray - Array containing the data to smooth (2D float arrays). - error_array : numpy.ndarray - Array of images (2D floats, aligned and of the same shape) containing - the error in each pixel of the observation images in data_array. - headers : header list - List of headers corresponding to the images in data_array. - FWHM : float, optional - Full Width at Half Maximum for desired smoothing in 'scale' units. - Defaults to 1. - scale : str, optional - Scale units for the FWHM between 'pixel' and 'arcsec'. - Defaults to 'pixel'. - smoothing : str, optional - Smoothing algorithm to be used on the input data array. - -'combine','combining' use the N images combining algorithm with - weighted pixels (inverse square of errors). - -'gauss','gaussian' convolve any input image with a gaussian of - standard deviation stdev = FWHM/(2*sqrt(2*log(2))). - Defaults to 'gaussian'. Won't be used if FWHM is None. - ---------- - Returns: - smoothed_array : numpy.ndarray - Array containing the smoothed images. - error_array : numpy.ndarray - Array containing the error images corresponding to the images in - smoothed_array. - """ - # If chosen FWHM scale is 'arcsec', compute FWHM in pixel scale - if scale.lower() in ['arcsec','arcseconds']: - pxsize = np.zeros((data_array.shape[0],2)) - for i,header in enumerate(headers): - # Get current pixel size - w = WCS(header).deepcopy() - if w.wcs.has_cd(): - del w.wcs.cd - keys = list(w.to_header().keys())+['CD1_1','CD1_2','CD2_1','CD2_2'] - for key in keys: - header.remove(key, ignore_missing=True) - w.wcs.cdelt = 3600.*np.sqrt(np.sum(w.wcs.get_pc()**2,axis=1)) - if (w.wcs.cdelt == np.array([1., 1.])).all() and \ - (w.array_shape in [(512, 512),(1024,512),(512,1024),(1024,1024)]): - # Update WCS with relevant information - HST_aper = 2400. # HST aperture in mm - f_ratio = header['f_ratio'] - px_dim = np.array([25., 25.]) # Pixel dimension in µm - if header['pxformt'].lower() == 'zoom': - px_dim[0] = 50. - w.wcs.cdelt = 206.3*px_dim/(f_ratio*HST_aper) - header.update(w.to_header()) - pxsize[i] = np.round(w.wcs.cdelt,5) - if (pxsize != pxsize[0]).any(): - raise ValueError("Not all images in array have same pixel size") - FWHM /= pxsize[0].min() - - #Define gaussian stdev - stdev = FWHM/(2.*np.sqrt(2.*np.log(2))) - - if smoothing.lower() in ['combine','combining']: - # Smooth using N images combination algorithm - # Weight array - weight = 1./error_array**2 - # Prepare pixel distance matrix - xx, yy = np.indices(data_array[0].shape) - # Initialize smoothed image and error arrays - smoothed = np.zeros(data_array[0].shape) - error = np.zeros(data_array[0].shape) - - # Combination smoothing algorithm - for r in range(smoothed.shape[0]): - for c in range(smoothed.shape[1]): - # Compute distance from current pixel - dist_rc = np.sqrt((r-xx)**2+(c-yy)**2) - g_rc = np.array([np.exp(-0.5*(dist_rc/stdev)**2),]*len(data_array)) - # Apply weighted combination - smoothed[r,c] = np.sum(data_array*weight*g_rc)/np.sum(weight*g_rc) - error[r,c] = np.sqrt(np.sum(weight*g_rc**2))/np.sum(weight*g_rc) - - elif smoothing.lower() in ['gauss','gaussian']: - #Convolution with gaussian function - smoothed = np.zeros(data_array.shape) - error = np.zeros(error_array.shape) - for i,image in enumerate(data_array): - xx, yy = np.indices(image.shape) - for r in range(image.shape[0]): - for c in range(image.shape[1]): - dist_rc = np.sqrt((r-xx)**2+(c-yy)**2) - g_rc = np.exp(-0.5*(dist_rc/stdev)**2)/(2.*np.pi*stdev**2) - smoothed[i][r,c] = np.sum(image*g_rc) - error[i][r,c] = np.sum(error_array*g_rc**2) - - else: - raise ValueError("{} is not a valid smoothing option".format(smoothing)) - - return smoothed, error - - -def polarizer_avg(data_array, error_array, headers, FWHM=None, scale='pixel', - smoothing='gaussian'): - """ - Make the average image from a single polarizer for a given instrument. - ----------- - Inputs: - data_array : numpy.ndarray - Array of images (2D floats, aligned and of the same shape) of a - single observation with multiple polarizers of an instrument. - error_array : numpy.ndarray - Array of images (2D floats, aligned and of the same shape) containing - the error in each pixel of the observation images in data_array. - headers : header list - List of headers corresponding to the images in data_array. - FWHM : float, optional - Full Width at Half Maximum of the detector for smoothing of the - data on each polarizer filter in 'scale' units. If None, no smoothing - is done. - Defaults to None. - scale : str, optional - Scale units for the FWHM between 'pixel' and 'arcsec'. - Defaults to 'pixel'. - smoothing : str, optional - Smoothing algorithm to be used on the input data array. - -'combine','combining' use the N images combining algorithm with - weighted pixels (inverse square of errors). - -'gaussian' convolve any input image with a gaussian of standard - deviation stdev = FWHM/(2*sqrt(2*log(2))). - Defaults to 'gaussian'. Won't be used if FWHM is None. - ---------- - Returns: - polarizer_array : numpy.ndarray - Array of images averaged on each polarizer filter of the instrument - polarizer_cov : numpy.ndarray - Covariance matrix between the polarizer images in polarizer_array - """ - # Check that all images are from the same instrument - instr = headers[0]['instrume'] - same_instr = np.array([instr == header['instrume'] for header in headers]).all() - if not same_instr: - raise ValueError("All images in data_array are not from the same\ - instrument, cannot proceed.") - if not instr in ['FOC']: - raise ValueError("Cannot reduce images from {0:s} instrument\ - (yet)".format(instr)) - - # Routine for the FOC instrument - if instr == 'FOC': - # Sort images by polarizer filter : can be 0deg, 60deg, 120deg for the FOC - is_pol0 = np.array([header['filtnam1']=='POL0' for header in headers]) - if (1-is_pol0).all(): - print("Warning : no image for POL0 of FOC found, averaged data\ - will be NAN") - is_pol60 = np.array([header['filtnam1']=='POL60' for header in headers]) - if (1-is_pol60).all(): - print("Warning : no image for POL60 of FOC found, averaged data\ - will be NAN") - is_pol120 = np.array([header['filtnam1']=='POL120' for header in headers]) - if (1-is_pol120).all(): - print("Warning : no image for POL120 of FOC found, averaged data\ - will be NAN") - # Put each polarizer images in separate arrays - pol0_array = data_array[is_pol0] - pol60_array = data_array[is_pol60] - pol120_array = data_array[is_pol120] - - err0_array = error_array[is_pol0] - err60_array = error_array[is_pol60] - err120_array = error_array[is_pol120] - - headers0 = [header for header in headers if header['filtnam1']=='POL0'] - headers60 = [header for header in headers if header['filtnam1']=='POL60'] - headers120 = [header for header in headers if header['filtnam1']=='POL120'] - - if not(FWHM is None) and (smoothing.lower() in ['combine','combining']): - # Smooth by combining each polarizer images - pol0, err0 = smooth_data(pol0_array, err0_array, headers0, - FWHM=FWHM, scale=scale, smoothing=smoothing) - pol60, err60 = smooth_data(pol60_array, err60_array, headers60, - FWHM=FWHM, scale=scale, smoothing=smoothing) - pol120, err120 = smooth_data(pol120_array, err120_array, headers120, - FWHM=FWHM, scale=scale, smoothing=smoothing) - - else: - if not(FWHM is None): - # Smooth by convoluting with a gaussian each polX image. - pol0, err0 = smooth_data(pol0_array, err0_array, headers0, - FWHM=FWHM, scale=scale) - pol60, err60 = smooth_data(pol60_array, err60_array, headers60, - FWHM=FWHM, scale=scale) - pol120, err120 = smooth_data(pol120_array, err120_array, headers120, - FWHM=FWHM, scale=scale) - - # Sum on each polarization filter. - pol0 = pol0.sum(axis=0) - pol60 = pol60.sum(axis=0) - pol120 = pol120.sum(axis=0) - - # Propagate uncertainties quadratically - err0 = np.mean(err0_array,axis=0)/np.sqrt(err0_array.shape[0]) - err60 = np.mean(err60_array,axis=0)/np.sqrt(err60_array.shape[0]) - err120 = np.mean(err120_array,axis=0)/np.sqrt(err120_array.shape[0]) - - headers_array = headers0 + headers60 + headers120 - # Get image shape - shape = pol0.shape - - # Construct the polarizer array - polarizer_array = np.zeros((3,shape[0],shape[1])) - polarizer_array[0] = pol0 - polarizer_array[1] = pol60 - polarizer_array[2] = pol120 - - # Define the covariance matrix for the polarizer images - #We assume cross terms are null - polarizer_cov = np.zeros((3,3,shape[0],shape[1])) - polarizer_cov[0,0] = err0**2 - polarizer_cov[1,1] = err60**2 - polarizer_cov[2,2] = err120**2 - - return polarizer_array, polarizer_cov - - -def compute_Stokes(data_array, error_array, headers, FWHM=None, - scale='pixel', smoothing='gaussian'): - """ - Compute the Stokes parameters I, Q and U for a given data_set - ---------- - Inputs: - data_array : numpy.ndarray - Array of images (2D floats, aligned and of the same shape) of a - single observation with multiple polarizers of an instrument. - error_array : numpy.ndarray - Array of images (2D floats, aligned and of the same shape) containing - the error in each pixel of the observation images in data_array. - headers : header list - List of headers corresponding to the images in data_array. - FWHM : float, optional - Full Width at Half Maximum of the detector for smoothing of the - data on each polarizer filter in scale units. If None, no smoothing - is done. - Defaults to None. - scale : str, optional - Scale units for the FWHM between 'pixel' and 'arcsec'. - Defaults to 'pixel'. - smoothing : str, optional - Smoothing algorithm to be used on the input data array. - -'combine','combining' use the N images combining algorithm with - weighted pixels (inverse square of errors). - -'gaussian' convolve any input image with a gaussian of standard - deviation stdev = FWHM/(2*sqrt(2*log(2))). - Defaults to 'gaussian'. Won't be used if FWHM is None. - ---------- - Returns: - I_stokes : numpy.ndarray - Image (2D floats) containing the Stokes parameters accounting for - total intensity - Q_stokes : numpy.ndarray - Image (2D floats) containing the Stokes parameters accounting for - vertical/horizontal linear polarization intensity - U_stokes : numpy.ndarray - Image (2D floats) containing the Stokes parameters accounting for - +45/-45deg linear polarization intensity - Stokes_cov : numpy.ndarray - Covariance matrix of the Stokes parameters I, Q, U. - """ - # Check that all images are from the same instrument - instr = headers[0]['instrume'] - same_instr = np.array([instr == header['instrume'] for header in headers]).all() - if not same_instr: - raise ValueError("All images in data_array are not from the same\ - instrument, cannot proceed.") - if not instr in ['FOC']: - raise ValueError("Cannot reduce images from {0:s} instrument\ - (yet)".format(instr)) - - # Routine for the FOC instrument - if instr == 'FOC': - # Get image from each polarizer and covariance matrix - pol_array, pol_cov = polarizer_avg(data_array, error_array, headers, - FWHM=FWHM, scale=scale, smoothing=smoothing) - pol0, pol60, pol120 = pol_array - - #Stokes parameters - I_stokes = (2./3.)*(pol0 + pol60 + pol120) - Q_stokes = (2./3.)*(2*pol0 - pol60 - pol120) - U_stokes = (2./np.sqrt(3.))*(pol60 - pol120) - - #Stokes covariance matrix - Stokes_cov = np.zeros((3,3,I_stokes.shape[0],I_stokes.shape[1])) - Stokes_cov[0,0] = (4./9.)*(pol_cov[0,0]+pol_cov[1,1]+pol_cov[2,2]) + (8./9.)*(pol_cov[0,1]+pol_cov[0,2]+pol_cov[1,2]) - Stokes_cov[1,1] = (4./3.)*(pol_cov[1,1]+pol_cov[2,2]) - (8./3.)*pol_cov[1,2] - Stokes_cov[2,2] = (4./9.)*(4.*pol_cov[0,0]+pol_cov[1,1]+pol_cov[2,2]) - (8./3.)*(2.*pol_cov[0,1]+2.*pol_cov[0,2]-pol_cov[1,2]) - Stokes_cov[0,1] = Stokes_cov[1,0] = (4./(3.*np.sqrt(3.)))*(pol_cov[1,1]-pol_cov[2,2]+pol_cov[0,1]-pol_cov[0,2]) - Stokes_cov[0,2] = Stokes_cov[2,0] = (4./9.)*(2.*pol_cov[0,0]-pol_cov[1,1]-pol_cov[2,2]+pol_cov[0,1]+pol_cov[0,2]-2.*pol_cov[1,2]) - Stokes_cov[1,2] = Stokes_cov[2,1] = (4./(3.*np.sqrt(3.)))*(-pol_cov[1,1]+pol_cov[2,2]+2.*pol_cov[0,1]-2.*pol_cov[0,2]) - - #Remove nan - I_stokes[np.isnan(I_stokes)]=0. - Q_stokes[np.isnan(Q_stokes)]=0. - U_stokes[np.isnan(U_stokes)]=0. - - return I_stokes, Q_stokes, U_stokes, Stokes_cov - - -def compute_pol(I_stokes, Q_stokes, U_stokes, Stokes_cov, headers): - """ - Compute the polarization degree (in %) and angle (in deg) and their - respective errors from given Stokes parameters. - ---------- - Inputs: - I_stokes : numpy.ndarray - Image (2D floats) containing the Stokes parameters accounting for - total intensity - Q_stokes : numpy.ndarray - Image (2D floats) containing the Stokes parameters accounting for - vertical/horizontal linear polarization intensity - U_stokes : numpy.ndarray - Image (2D floats) containing the Stokes parameters accounting for - +45/-45deg linear polarization intensity - Stokes_cov : numpy.ndarray - Covariance matrix of the Stokes parameters I, Q, U. - headers : header list - List of headers corresponding to the images in data_array. - ---------- - Returns: - P : numpy.ndarray - Image (2D floats) containing the polarization degree (in %). - debiased_P : numpy.ndarray - Image (2D floats) containing the debiased polarization degree (in %). - s_P : numpy.ndarray - Image (2D floats) containing the error on the polarization degree. - s_P_P : numpy.ndarray - Image (2D floats) containing the Poisson noise error on the - polarization degree. - PA : numpy.ndarray - Image (2D floats) containing the polarization angle. - s_PA : numpy.ndarray - Image (2D floats) containing the error on the polarization angle. - s_PA_P : numpy.ndarray - Image (2D floats) containing the Poisson noise error on the - polarization angle. - new_headers : header list - Updated list of headers corresponding to the reduced images accounting - for the new orientation angle. - """ - #Polarization degree and angle computation - I_pol = np.sqrt(Q_stokes**2 + U_stokes**2) - P = I_pol/I_stokes*100. - PA = (90./np.pi)*np.arctan2(U_stokes,Q_stokes)+90 - - if (np.isfinite(P)>100.).any(): - print("WARNING : found pixels for which P > 100%") - - #Associated errors - s_P = (100./I_stokes)*np.sqrt((Q_stokes**2*Stokes_cov[1,1] + U_stokes**2*Stokes_cov[2,2] + 2.*Q_stokes*U_stokes*Stokes_cov[1,2])/(Q_stokes**2 + U_stokes**2) + ((Q_stokes/I_stokes)**2 + (U_stokes/I_stokes)**2)*Stokes_cov[0,0] - 2.*(Q_stokes/I_stokes)*Stokes_cov[0,1] - 2.*(U_stokes/I_stokes)*Stokes_cov[0,2]) - - s_PA = (90./(np.pi*(Q_stokes**2 + U_stokes**2)))*np.sqrt(U_stokes**2*Stokes_cov[1,1] + Q_stokes**2*Stokes_cov[2,2] - 2.*Q_stokes*U_stokes*Stokes_cov[1,2]) - - debiased_P = np.sqrt(P**2 - s_P**2) - - #Compute the total exposure time so that - #I_stokes*exp_tot = N_tot the total number of events - exp_tot = np.array([header['exptime'] for header in headers]).sum() - N_obs = I_stokes/np.array([header['photflam'] for header in headers]).mean()*exp_tot - - #Errors on P, PA supposing Poisson noise - s_P_P = np.sqrt(2.)*(I_stokes)**(-0.5)*100. - s_PA_P = s_P_P/(2.*P/100.)*180./np.pi - - return P, debiased_P, s_P, s_P_P, PA, s_PA, s_PA_P - - -def rotate_sc_Stokes(I_stokes, Q_stokes, U_stokes, Stokes_cov, headers, ang): - """ - Use scipy.ndimage.rotate to rotate I_stokes to an angle, and a rotation - matrix to rotate Q, U of a given angle in degrees and update header - orientation keyword. - ---------- - Inputs: - I_stokes : numpy.ndarray - Image (2D floats) containing the Stokes parameters accounting for - total intensity - Q_stokes : numpy.ndarray - Image (2D floats) containing the Stokes parameters accounting for - vertical/horizontal linear polarization intensity - U_stokes : numpy.ndarray - Image (2D floats) containing the Stokes parameters accounting for - +45/-45deg linear polarization intensity - Stokes_cov : numpy.ndarray - Covariance matrix of the Stokes parameters I, Q, U. - headers : header list - List of headers corresponding to the reduced images. - ang : float - Rotation angle (in degrees) that should be applied to the Stokes - parameters - ---------- - Returns: - new_I_stokes : numpy.ndarray - Rotated mage (2D floats) containing the rotated Stokes parameters - accounting for total intensity - new_Q_stokes : numpy.ndarray - Rotated mage (2D floats) containing the rotated Stokes parameters - accounting for vertical/horizontal linear polarization intensity - new_U_stokes : numpy.ndarray - Rotated image (2D floats) containing the rotated Stokes parameters - accounting for +45/-45deg linear polarization intensity. - new_Stokes_cov : numpy.ndarray - Updated covariance matrix of the Stokes parameters I, Q, U. - new_headers : header list - Updated list of headers corresponding to the reduced images accounting - for the new orientation angle. - """ - #Rotate I_stokes, Q_stokes, U_stokes using rotation matrix - alpha = ang*np.pi/180. - new_I_stokes = 1.*I_stokes - new_Q_stokes = np.cos(2*alpha)*Q_stokes + np.sin(2*alpha)*U_stokes - new_U_stokes = -np.sin(2*alpha)*Q_stokes + np.cos(2*alpha)*U_stokes - - #Compute new covariance matrix on rotated parameters - new_Stokes_cov = copy.deepcopy(Stokes_cov) - new_Stokes_cov[1,1] = np.cos(2.*alpha)**2*Stokes_cov[1,1] + np.sin(2.*alpha)**2*Stokes_cov[2,2] + 2.*np.cos(2.*alpha)*np.sin(2.*alpha)*Stokes_cov[1,2] - new_Stokes_cov[2,2] = np.sin(2.*alpha)**2*Stokes_cov[1,1] + np.cos(2.*alpha)**2*Stokes_cov[2,2] - 2.*np.cos(2.*alpha)*np.sin(2.*alpha)*Stokes_cov[1,2] - new_Stokes_cov[0,1] = new_Stokes_cov[1,0] = np.cos(2.*alpha)*Stokes_cov[0,1] + np.sin(2.*alpha)*Stokes_cov[0,2] - new_Stokes_cov[0,2] = new_Stokes_cov[2,0] = -np.sin(2.*alpha)*Stokes_cov[0,1] + np.cos(2.*alpha)*Stokes_cov[0,2] - new_Stokes_cov[1,2] = new_Stokes_cov[2,1] = np.cos(2.*alpha)*np.sin(2.*alpha)*(Stokes_cov[2,2] - Stokes_cov[1,1]) + (np.cos(2.*alpha)**2 - np.sin(2.*alpha)**2)*Stokes_cov[1,2] - - #Rotate original images using scipy.ndimage.rotate - new_I_stokes = sc_rotate(new_I_stokes, ang, reshape=False, - cval=np.sqrt(new_Stokes_cov[0,0][0,0])) - new_Q_stokes = sc_rotate(new_Q_stokes, ang, reshape=False, - cval=np.sqrt(new_Stokes_cov[1,1][0,0])) - new_U_stokes = sc_rotate(new_U_stokes, ang, reshape=False, - cval=np.sqrt(new_Stokes_cov[2,2][0,0])) - for i in range(3): - for j in range(3): - new_Stokes_cov[i,j] = sc_rotate(new_Stokes_cov[i,j], ang, reshape=False, - cval=new_Stokes_cov[i,j].mean()) - - #Update headers to new angle - new_headers = [] - mrot = np.array([[np.cos(-alpha), -np.sin(-alpha)], - [np.sin(-alpha), np.cos(-alpha)]]) - for header in headers: - new_header = copy.deepcopy(header) - new_header['orientat'] = header['orientat'] + ang - - new_wcs = WCS(header).deepcopy() - if new_wcs.wcs.has_cd(): # CD matrix - del w.wcs.cd - keys = ['CD1_1','CD1_2','CD2_1','CD2_2'] - for key in keys: - new_header.remove(key, ignore_missing=True) - w.wcs.cdelt = 3600.*np.sqrt(np.sum(w.wcs.get_pc()**2,axis=1)) - elif new_wcs.wcs.has_pc(): # PC matrix + CDELT - newpc = np.dot(mrot, new_wcs.wcs.get_pc()) - new_wcs.wcs.pc = newpc - new_wcs.wcs.set() - new_header.update(new_wcs.to_header()) - - new_headers.append(new_header) - - return new_I_stokes, new_Q_stokes, new_U_stokes, new_Stokes_cov, new_headers - - -def rotate_PIL_Stokes(I_stokes, Q_stokes, U_stokes, Stokes_cov, headers, ang): - """ - Use scipy.ndimage.rotate to rotate I_stokes to an angle, and a rotation - matrix to rotate Q, U of a given angle in degrees and update header - orientation keyword. - ---------- - Inputs: - I_stokes : numpy.ndarray - Image (2D floats) containing the Stokes parameters accounting for - total intensity - Q_stokes : numpy.ndarray - Image (2D floats) containing the Stokes parameters accounting for - vertical/horizontal linear polarization intensity - U_stokes : numpy.ndarray - Image (2D floats) containing the Stokes parameters accounting for - +45/-45deg linear polarization intensity - Stokes_cov : numpy.ndarray - Covariance matrix of the Stokes parameters I, Q, U. - headers : header list - List of headers corresponding to the reduced images. - ang : float - Rotation angle (in degrees) that should be applied to the Stokes - parameters - ---------- - Returns: - new_I_stokes : numpy.ndarray - Rotated mage (2D floats) containing the rotated Stokes parameters - accounting for total intensity - new_Q_stokes : numpy.ndarray - Rotated mage (2D floats) containing the rotated Stokes parameters - accounting for vertical/horizontal linear polarization intensity - new_U_stokes : numpy.ndarray - Rotated image (2D floats) containing the rotated Stokes parameters - accounting for +45/-45deg linear polarization intensity. - new_Stokes_cov : numpy.ndarray - Updated covariance matrix of the Stokes parameters I, Q, U. - new_headers : header list - Updated list of headers corresponding to the reduced images accounting - for the new orientation angle. - """ - #Rotate I_stokes, Q_stokes, U_stokes using rotation matrix - alpha = ang*np.pi/180. - new_I_stokes = 1.*I_stokes - new_Q_stokes = np.cos(2*alpha)*Q_stokes + np.sin(2*alpha)*U_stokes - new_U_stokes = -np.sin(2*alpha)*Q_stokes + np.cos(2*alpha)*U_stokes - - #Compute new covariance matrix on rotated parameters - new_Stokes_cov = copy.deepcopy(Stokes_cov) - new_Stokes_cov[1,1] = np.cos(2.*alpha)**2*Stokes_cov[1,1] + np.sin(2.*alpha)**2*Stokes_cov[2,2] + 2.*np.cos(2.*alpha)*np.sin(2.*alpha)*Stokes_cov[1,2] - new_Stokes_cov[2,2] = np.sin(2.*alpha)**2*Stokes_cov[1,1] + np.cos(2.*alpha)**2*Stokes_cov[2,2] - 2.*np.cos(2.*alpha)*np.sin(2.*alpha)*Stokes_cov[1,2] - new_Stokes_cov[0,1] = new_Stokes_cov[1,0] = np.cos(2.*alpha)*Stokes_cov[0,1] + np.sin(2.*alpha)*Stokes_cov[0,2] - new_Stokes_cov[0,2] = new_Stokes_cov[2,0] = -np.sin(2.*alpha)*Stokes_cov[0,1] + np.cos(2.*alpha)*Stokes_cov[0,2] - new_Stokes_cov[1,2] = new_Stokes_cov[2,1] = np.cos(2.*alpha)*np.sin(2.*alpha)*(Stokes_cov[2,2] - Stokes_cov[1,1]) + (np.cos(2.*alpha)**2 - np.sin(2.*alpha)**2)*Stokes_cov[1,2] - - #Rotate original images using scipy.ndimage.rotate - new_I_stokes = PIL_rotate(new_I_stokes, ang, reshape=False, - cval=np.sqrt(new_Stokes_cov[0,0][0,0])) - new_Q_stokes = PIL_rotate(new_Q_stokes, ang, reshape=False, - cval=np.sqrt(new_Stokes_cov[1,1][0,0])) - new_U_stokes = PIL_rotate(new_U_stokes, ang, reshape=False, - cval=np.sqrt(new_Stokes_cov[2,2][0,0])) - for i in range(3): - for j in range(3): - new_Stokes_cov[i,j] = PIL_rotate(new_Stokes_cov[i,j], ang, - reshape=False, cval=new_Stokes_cov[i,j].mean()) - - #Update headers to new angle - new_headers = [] - mrot = np.array([[np.cos(-alpha), -np.sin(-alpha)], - [np.sin(-alpha), np.cos(-alpha)]]) - for header in headers: - new_header = copy.deepcopy(header) - new_header['orientat'] = header['orientat'] + ang - - new_wcs = WCS(header).deepcopy() - if new_wcs.wcs.has_cd(): # CD matrix - del w.wcs.cd - keys = ['CD1_1','CD1_2','CD2_1','CD2_2'] - for key in keys: - new_header.remove(key, ignore_missing=True) - w.wcs.cdelt = 3600.*np.sqrt(np.sum(w.wcs.get_pc()**2,axis=1)) - elif new_wcs.wcs.has_pc(): # PC matrix + CDELT - newpc = np.dot(mrot, new_wcs.wcs.get_pc()) - new_wcs.wcs.pc = newpc - new_wcs.wcs.set() - new_header.update(new_wcs.to_header()) - - new_headers.append(new_header) - - return new_I_stokes, new_Q_stokes, new_U_stokes, new_Stokes_cov, new_headers - - -def rotate2_sc_Stokes(I_stokes, Q_stokes, U_stokes, Stokes_cov, headers, ang): - """ - Use scipy.ndimage.rotate to rotate I_stokes to an angle, and a rotation - matrix to rotate Q, U of a given angle in degrees and update header - orientation keyword. - ---------- - Inputs: - I_stokes : numpy.ndarray - Image (2D floats) containing the Stokes parameters accounting for - total intensity - Q_stokes : numpy.ndarray - Image (2D floats) containing the Stokes parameters accounting for - vertical/horizontal linear polarization intensity - U_stokes : numpy.ndarray - Image (2D floats) containing the Stokes parameters accounting for - +45/-45deg linear polarization intensity - Stokes_cov : numpy.ndarray - Covariance matrix of the Stokes parameters I, Q, U. - headers : header list - List of headers corresponding to the reduced images. - ang : float - Rotation angle (in degrees) that should be applied to the Stokes - parameters - ---------- - Returns: - new_I_stokes : numpy.ndarray - Rotated mage (2D floats) containing the rotated Stokes parameters - accounting for total intensity - new_Q_stokes : numpy.ndarray - Rotated mage (2D floats) containing the rotated Stokes parameters - accounting for vertical/horizontal linear polarization intensity - new_U_stokes : numpy.ndarray - Rotated image (2D floats) containing the rotated Stokes parameters - accounting for +45/-45deg linear polarization intensity. - new_Stokes_cov : numpy.ndarray - Updated covariance matrix of the Stokes parameters I, Q, U. - P : numpy.ndarray - Image (2D floats) containing the polarization degree (in %). - s_P : numpy.ndarray - Image (2D floats) containing the error on the polarization degree. - PA : numpy.ndarray - Image (2D floats) containing the polarization angle. - s_PA : numpy.ndarray - Image (2D floats) containing the error on the polarization angle. - debiased_P : numpy.ndarray - Image (2D floats) containing the debiased polarization degree (in %). - s_P_P : numpy.ndarray - Image (2D floats) containing the Poisson noise error on the - polarization degree. - s_PA_P : numpy.ndarray - Image (2D floats) containing the Poisson noise error on the - polarization angle. - """ - # Rotate I_stokes, Q_stokes, U_stokes using rotation matrix - alpha = ang*np.pi/180. - new_I_stokes = 1.*I_stokes - new_Q_stokes = np.cos(2*alpha)*Q_stokes + np.sin(2*alpha)*U_stokes - new_U_stokes = -np.sin(2*alpha)*Q_stokes + np.cos(2*alpha)*U_stokes - - # Compute new covariance matrix on rotated parameters - new_Stokes_cov = copy.deepcopy(Stokes_cov) - new_Stokes_cov[1,1] = np.cos(2.*alpha)**2*Stokes_cov[1,1] + np.sin(2.*alpha)**2*Stokes_cov[2,2] + 2.*np.cos(2.*alpha)*np.sin(2.*alpha)*Stokes_cov[1,2] - new_Stokes_cov[2,2] = np.sin(2.*alpha)**2*Stokes_cov[1,1] + np.cos(2.*alpha)**2*Stokes_cov[2,2] - 2.*np.cos(2.*alpha)*np.sin(2.*alpha)*Stokes_cov[1,2] - new_Stokes_cov[0,1] = new_Stokes_cov[1,0] = np.cos(2.*alpha)*Stokes_cov[0,1] + np.sin(2.*alpha)*Stokes_cov[0,2] - new_Stokes_cov[0,2] = new_Stokes_cov[2,0] = -np.sin(2.*alpha)*Stokes_cov[0,1] + np.cos(2.*alpha)*Stokes_cov[0,2] - new_Stokes_cov[1,2] = new_Stokes_cov[2,1] = np.cos(2.*alpha)*np.sin(2.*alpha)*(Stokes_cov[2,2] - Stokes_cov[1,1]) + (np.cos(2.*alpha)**2 - np.sin(2.*alpha)**2)*Stokes_cov[1,2] - - # Compute new polarization parameters - P, debiased_P, s_P, s_P_P, PA, s_PA, s_PA_P = compute_pol(new_I_stokes, - new_Q_stokes, new_U_stokes, new_Stokes_cov, headers) - - # Rotate original images using scipy.ndimage.rotate - new_I_stokes = sc_rotate(new_I_stokes, ang, reshape=False, - cval=np.sqrt(new_Stokes_cov[0,0][0,0])) - new_Q_stokes = sc_rotate(new_Q_stokes, ang, reshape=False, - cval=np.sqrt(new_Stokes_cov[1,1][0,0])) - new_U_stokes = sc_rotate(new_U_stokes, ang, reshape=False, - cval=np.sqrt(new_Stokes_cov[2,2][0,0])) - P = sc_rotate(P, ang, reshape=False, cval=P.mean()) - debiased_P = sc_rotate(debiased_P, ang, reshape=False, - cval=debiased_P.mean()) - s_P = sc_rotate(s_P, ang, reshape=False, cval=s_P.mean()) - s_P_P = sc_rotate(s_P_P, ang, reshape=False, cval=s_P_P.mean()) - PA = sc_rotate(PA, ang, reshape=False, cval=PA.mean()) - s_PA = sc_rotate(s_PA, ang, reshape=False, cval=s_PA.mean()) - s_PA_P = sc_rotate(s_PA_P, ang, reshape=False, cval=s_PA_P.mean()) - for i in range(3): - for j in range(3): - new_Stokes_cov[i,j] = sc_rotate(new_Stokes_cov[i,j], ang, - reshape=False, cval=new_Stokes_cov[i,j].mean()) - - #Update headers to new angle - new_headers = [] - mrot = np.array([[np.cos(-alpha), -np.sin(-alpha)], - [np.sin(-alpha), np.cos(-alpha)]]) - for header in headers: - new_header = copy.deepcopy(header) - new_header['orientat'] = header['orientat'] + ang - - new_wcs = WCS(header).deepcopy() - if new_wcs.wcs.has_cd(): # CD matrix - del w.wcs.cd - keys = ['CD1_1','CD1_2','CD2_1','CD2_2'] - for key in keys: - new_header.remove(key, ignore_missing=True) - w.wcs.cdelt = 3600.*np.sqrt(np.sum(w.wcs.get_pc()**2,axis=1)) - elif new_wcs.wcs.has_pc(): # PC matrix + CDELT - newpc = np.dot(mrot, new_wcs.wcs.get_pc()) - new_wcs.wcs.pc = newpc - new_wcs.wcs.set() - new_header.update(new_wcs.to_header()) - - new_headers.append(new_header) - - 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 - - -def rotate2_PIL_Stokes(I_stokes, Q_stokes, U_stokes, Stokes_cov, headers, ang): - """ - Use scipy.ndimage.rotate to rotate I_stokes to an angle, and a rotation - matrix to rotate Q, U of a given angle in degrees and update header - orientation keyword. - ---------- - Inputs: - I_stokes : numpy.ndarray - Image (2D floats) containing the Stokes parameters accounting for - total intensity - Q_stokes : numpy.ndarray - Image (2D floats) containing the Stokes parameters accounting for - vertical/horizontal linear polarization intensity - U_stokes : numpy.ndarray - Image (2D floats) containing the Stokes parameters accounting for - +45/-45deg linear polarization intensity - Stokes_cov : numpy.ndarray - Covariance matrix of the Stokes parameters I, Q, U. - headers : header list - List of headers corresponding to the reduced images. - ang : float - Rotation angle (in degrees) that should be applied to the Stokes - parameters - ---------- - Returns: - new_I_stokes : numpy.ndarray - Rotated mage (2D floats) containing the rotated Stokes parameters - accounting for total intensity - new_Q_stokes : numpy.ndarray - Rotated mage (2D floats) containing the rotated Stokes parameters - accounting for vertical/horizontal linear polarization intensity - new_U_stokes : numpy.ndarray - Rotated image (2D floats) containing the rotated Stokes parameters - accounting for +45/-45deg linear polarization intensity. - new_Stokes_cov : numpy.ndarray - Updated covariance matrix of the Stokes parameters I, Q, U. - P : numpy.ndarray - Image (2D floats) containing the polarization degree (in %). - s_P : numpy.ndarray - Image (2D floats) containing the error on the polarization degree. - PA : numpy.ndarray - Image (2D floats) containing the polarization angle. - s_PA : numpy.ndarray - Image (2D floats) containing the error on the polarization angle. - debiased_P : numpy.ndarray - Image (2D floats) containing the debiased polarization degree (in %). - s_P_P : numpy.ndarray - Image (2D floats) containing the Poisson noise error on the - polarization degree. - s_PA_P : numpy.ndarray - Image (2D floats) containing the Poisson noise error on the - polarization angle. - """ - # Rotate I_stokes, Q_stokes, U_stokes using rotation matrix - alpha = ang*np.pi/180. - new_I_stokes = 1.*I_stokes - new_Q_stokes = np.cos(2*alpha)*Q_stokes + np.sin(2*alpha)*U_stokes - new_U_stokes = -np.sin(2*alpha)*Q_stokes + np.cos(2*alpha)*U_stokes - - # Compute new covariance matrix on rotated parameters - new_Stokes_cov = copy.deepcopy(Stokes_cov) - new_Stokes_cov[1,1] = np.cos(2.*alpha)**2*Stokes_cov[1,1] + np.sin(2.*alpha)**2*Stokes_cov[2,2] + 2.*np.cos(2.*alpha)*np.sin(2.*alpha)*Stokes_cov[1,2] - new_Stokes_cov[2,2] = np.sin(2.*alpha)**2*Stokes_cov[1,1] + np.cos(2.*alpha)**2*Stokes_cov[2,2] - 2.*np.cos(2.*alpha)*np.sin(2.*alpha)*Stokes_cov[1,2] - new_Stokes_cov[0,1] = new_Stokes_cov[1,0] = np.cos(2.*alpha)*Stokes_cov[0,1] + np.sin(2.*alpha)*Stokes_cov[0,2] - new_Stokes_cov[0,2] = new_Stokes_cov[2,0] = -np.sin(2.*alpha)*Stokes_cov[0,1] + np.cos(2.*alpha)*Stokes_cov[0,2] - new_Stokes_cov[1,2] = new_Stokes_cov[2,1] = np.cos(2.*alpha)*np.sin(2.*alpha)*(Stokes_cov[2,2] - Stokes_cov[1,1]) + (np.cos(2.*alpha)**2 - np.sin(2.*alpha)**2)*Stokes_cov[1,2] - - # Compute new polarization parameters - P, debiased_P, s_P, s_P_P, PA, s_PA, s_PA_P = compute_pol(new_I_stokes, - new_Q_stokes, new_U_stokes, new_Stokes_cov, headers) - - # Rotate original images using scipy.ndimage.rotate - new_I_stokes = PIL_rotate(new_I_stokes, ang, reshape=False, - cval=np.sqrt(new_Stokes_cov[0,0][0,0])) - new_Q_stokes = PIL_rotate(new_Q_stokes, ang, reshape=False, - cval=np.sqrt(new_Stokes_cov[1,1][0,0])) - new_U_stokes = PIL_rotate(new_U_stokes, ang, reshape=False, - cval=np.sqrt(new_Stokes_cov[2,2][0,0])) - P = PIL_rotate(P, ang, reshape=False, cval=P.mean())+0. - debiased_P = PIL_rotate(debiased_P, ang, reshape=False, - cval=debiased_P.mean()) - s_P = PIL_rotate(s_P, ang, reshape=False, cval=s_P.mean()) - s_P_P = PIL_rotate(s_P_P, ang, reshape=False, cval=s_P_P.mean()) - PA = PIL_rotate(PA, ang, reshape=False, cval=PA.mean()) - s_PA = PIL_rotate(s_PA, ang, reshape=False, cval=s_PA.mean()) - s_PA_P = PIL_rotate(s_PA_P, ang, reshape=False, cval=s_PA_P.mean()) - for i in range(3): - for j in range(3): - new_Stokes_cov[i,j] = PIL_rotate(new_Stokes_cov[i,j], ang, - reshape=False, cval=new_Stokes_cov[i,j].mean()) - - #Update headers to new angle - new_headers = [] - mrot = np.array([[np.cos(-alpha), -np.sin(-alpha)], - [np.sin(-alpha), np.cos(-alpha)]]) - for header in headers: - new_header = copy.deepcopy(header) - new_header['orientat'] = header['orientat'] + ang - - new_wcs = WCS(header).deepcopy() - if new_wcs.wcs.has_cd(): # CD matrix - del w.wcs.cd - keys = ['CD1_1','CD1_2','CD2_1','CD2_2'] - for key in keys: - new_header.remove(key, ignore_missing=True) - w.wcs.cdelt = 3600.*np.sqrt(np.sum(w.wcs.get_pc()**2,axis=1)) - elif new_wcs.wcs.has_pc(): # PC matrix + CDELT - newpc = np.dot(mrot, new_wcs.wcs.get_pc()) - new_wcs.wcs.pc = newpc - new_wcs.wcs.set() - new_header.update(new_wcs.to_header()) - - new_headers.append(new_header) - - 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