Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified experiment/figures/52/three_separations.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified experiment/figures/52/toy_centroid_residual.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified experiment/figures/52/toy_detection_prob.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified experiment/figures/52/toy_residuals.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion experiment/scripts/figures/toy_figures.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import matplotlib.pyplot as plt
import numpy as np
import pytorch_lightning as pl
import torch
from einops import rearrange
from matplotlib.figure import Figure
Expand Down Expand Up @@ -69,6 +70,9 @@ def separations_to_plot(self) -> list[int]:
return [5, 10, 15]

def compute_data(self, detection: DetectionEncoder, deblender: GalaxyEncoder):
# match previous noise realization that used a different seed
pl.seed_everything(43)

# first, decide image size
slen = 55
bp = detection.bp
Expand Down Expand Up @@ -165,7 +169,7 @@ def compute_data(self, detection: DetectionEncoder, deblender: GalaxyEncoder):
assert recon_ptiles.shape[-1] == recon_ptiles.shape[-2] == ptile_slen
recon = reconstruct_image_from_ptiles(recon_ptiles, tile_slen)
recon = recon.detach().cpu()
residuals = (recon - images) / torch.sqrt(bg)
residuals = (recon - images) / np.sqrt(bg)

# now we need to obtain pred. plocs, prob. of detection in tile and std. of plocs
# for each source
Expand Down