From 4150d41d1d4587f0673388d8806bca6a71331514 Mon Sep 17 00:00:00 2001 From: "Thomson, Alec (CASS, Kensington)" Date: Tue, 14 May 2024 17:01:36 +1000 Subject: [PATCH] Reduce image size --- arrakis/imager.py | 4 +++- arrakis/makecat.py | 2 +- arrakis/validate.py | 6 +++--- scripts/casda_prepare.py | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/arrakis/imager.py b/arrakis/imager.py index bed2b923..9b07314a 100644 --- a/arrakis/imager.py +++ b/arrakis/imager.py @@ -144,7 +144,7 @@ def make_validation_plots(prefix: Path, pols: str) -> None: fig.subplots_adjust(wspace=0, hspace=0) fig_name = Path(f"{prefix.name}_abs_stokes_{stokes}.png") - fig.savefig(fig_name, bbox_inches="tight", dpi=300) + fig.savefig(fig_name, bbox_inches="tight", dpi=72) plt.close(fig) uuid = upload_image_as_artifact_task.fn( @@ -652,6 +652,8 @@ def smooth_imageset( logger.info(f"Loading common beam from {common_beam_pkl}") common_beam = pickle.load(f) + logger.info(f"{common_beam=}") + logger.info(f"Smooting {image_set.ms} images") images_to_smooth: Dict[str, List[str]] diff --git a/arrakis/makecat.py b/arrakis/makecat.py index 8f9c8b3f..8d0ef879 100644 --- a/arrakis/makecat.py +++ b/arrakis/makecat.py @@ -576,7 +576,7 @@ def cuts_and_flags( high_snr_cut=leakage_snr, ) figname = Path("leakage_fit.png") - fig.savefig(figname, bbox_inches="tight", dpi=300) + fig.savefig(figname, bbox_inches="tight", dpi=72) uuid = upload_image_as_artifact_task(image_path=figname, description="Leakage fit") logger.info(f"Uploaded leakage fit plot to {uuid}") leakage_flag = is_leakage( diff --git a/arrakis/validate.py b/arrakis/validate.py index 6321b4d2..f1746978 100644 --- a/arrakis/validate.py +++ b/arrakis/validate.py @@ -444,7 +444,7 @@ def main( map_size=map_size * u.deg, ) rms_bkg_path = outdir / "validation_rms_bkg.png" - rms_bkg_fig.savefig(rms_bkg_path, bbox_inches="tight", dpi=300) + rms_bkg_fig.savefig(rms_bkg_path, bbox_inches="tight", dpi=72) rms_bkg_uuid = upload_image_as_artifact_task( rms_bkg_path, description="Noise and background validation maps" ) @@ -458,7 +458,7 @@ def main( map_size=map_size * u.deg, ) leakage_path = outdir / "validation_leakage.png" - leakage_fig.savefig(leakage_path, bbox_inches="tight", dpi=300) + leakage_fig.savefig(leakage_path, bbox_inches="tight", dpi=72) leakage_uuid = upload_image_as_artifact_task( leakage_path, description="Leakage validation maps" ) @@ -470,7 +470,7 @@ def main( map_size=map_size * u.deg, ) rm_path = outdir / "validation_rm.png" - rm_fig.savefig(rm_path, bbox_inches="tight", dpi=300) + rm_fig.savefig(rm_path, bbox_inches="tight", dpi=72) rm_uuid = upload_image_as_artifact_task( rm_path, description="Rotation measure validation maps" ) diff --git a/scripts/casda_prepare.py b/scripts/casda_prepare.py index eb52532a..17170379 100755 --- a/scripts/casda_prepare.py +++ b/scripts/casda_prepare.py @@ -69,7 +69,7 @@ def make_thumbnail(cube_f: str, cube_dir: str): fig.colorbar(im, ax=ax, label=f"{convert_bunit(head['BUNIT']):latex_inline}") outf = os.path.join(cube_dir, os.path.basename(cube_f).replace(".fits", ".png")) logger.info(f"Saving thumbnail to {outf}") - fig.savefig(outf, dpi=300) + fig.savefig(outf, dpi=72) plt.close(fig)