Skip to content

Commit

Permalink
Reduce image size
Browse files Browse the repository at this point in the history
  • Loading branch information
AlecThomson committed May 14, 2024
1 parent dff384a commit 4150d41
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
4 changes: 3 additions & 1 deletion arrakis/imager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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]]
Expand Down
2 changes: 1 addition & 1 deletion arrakis/makecat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions arrakis/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -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"
)
Expand All @@ -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"
)
Expand Down
2 changes: 1 addition & 1 deletion scripts/casda_prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down

0 comments on commit 4150d41

Please sign in to comment.