From 900389601ebf5551abbb37f5464c7e75c901a76f Mon Sep 17 00:00:00 2001 From: Josh Dillon Date: Thu, 11 Jul 2024 14:18:33 -0700 Subject: [PATCH] manage pol convention and vis units in file_postprocessing --- notebooks/file_postprocessing.ipynb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/notebooks/file_postprocessing.ipynb b/notebooks/file_postprocessing.ipynb index 015a11c..e4af3c7 100644 --- a/notebooks/file_postprocessing.ipynb +++ b/notebooks/file_postprocessing.ipynb @@ -233,9 +233,11 @@ "# Load calibration solutions and gain flags\n", "hc_smooth = io.HERACal(SMOOTH_CAL_FILE)\n", "smooth_gains, cal_flags, _, _ = hc_smooth.read()\n", + "pol_convention = hc_smooth.pol_convention\n", "\n", "hc_abs = io.HERACal(ABS_CAL_FILE)\n", - "abs_gains, abs_cal_flags, _, _ = hc_abs.read()" + "abs_gains, abs_cal_flags, _, _ = hc_abs.read()\n", + "assert pol_convention == hc_abs.pol_convention, f'{pol_convention} != {hc_abs.pol_convention}'" ] }, { @@ -712,6 +714,8 @@ " hd_out.empty_arrays()\n", " hd_out.history += add_to_history\n", " hd_out.update(flags=red_avg_flags, nsamples=red_avg_nsamples)\n", + " hd_out.pol_convention = pol_convention\n", + " hd_out.vis_units = 'Jy'\n", " if ALL_FLAGGED:\n", " # put back in all the flags that we had been ignoring up to this point\n", " hd_out.flag_array = np.ones_like(hd_out.flag_array)\n", @@ -773,6 +777,8 @@ " hd_out.read(bls=set([bl[0:2] for bl in avg_abs_data]), polarizations=['ee', 'nn'])\n", " hd_out.empty_arrays()\n", " hd_out.update(data=avg_abs_data, flags=avg_flags, nsamples=avg_nsamples)\n", + " hd_out.pol_convention = pol_convention\n", + " hd_out.vis_units = 'Jy' \n", " if ALL_FLAGGED:\n", " # put back in all the flags that we had been ignoring up to this point\n", " hd_out.flag_array = np.ones_like(hd_out.flag_array) \n", @@ -864,7 +870,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.6" + "version": "3.10.12" }, "toc": { "base_numbering": 1,