This Julia notebook uses several files generated by running the galsim.ipynb Python notebook. So run this one after running that one.
In [1]:
Pkg.status("Celeste")
In [2]:
import Celeste: AccuracyBenchmark, ParallelRun, GalsimBenchmark, Config, Model
using DataFrames
import PyPlot
In [3]:
extensions = AccuracyBenchmark.read_fits("three_sources_two_overlap.fits");
In [4]:
data = extensions[2].pixels'
m, s = mean(data), std(data)
PyPlot.imshow(data, interpolation="nearest", cmap="gray", vmin=m-s, vmax=m+s, origin="lower");
In [5]:
header = extensions[1].header
this_test_case_name = header["CLDESCR"]
num_sources = header["CLNSRC"]
images = AccuracyBenchmark.make_images(extensions)
truth_catalog_df = GalsimBenchmark.extract_catalog_from_header(header)
catalog_entries = AccuracyBenchmark.make_initialization_catalog(truth_catalog_df, false)
target_sources = collect(1:num_sources)
config = Config(min_radius_pix = 40.0)
patches = Model.get_sky_patches(images, catalog_entries)
neighbor_map = Dict(i=>Model.find_neighbors(patches, i) for i in target_sources);
In [6]:
results = ParallelRun.one_node_joint_infer(catalog_entries,
patches,
target_sources,
neighbor_map,
images,
config=config)
prediction_df = AccuracyBenchmark.celeste_to_df(results)
Out[6]:
"The single biggest failure mode of the deblender occurs when three or more peaks in a blend appear in a straight line"
In [7]:
extensions = AccuracyBenchmark.read_fits("three_sources_in_a_row.fits");
data = extensions[2].pixels'
m, s = mean(data), std(data)
PyPlot.imshow(data, interpolation="nearest", cmap="gray", vmin=m-s, vmax=m+s, origin="lower");
In [8]:
header = extensions[1].header
this_test_case_name = header["CLDESCR"]
num_sources = header["CLNSRC"]
images = AccuracyBenchmark.make_images(extensions)
truth_catalog_df = GalsimBenchmark.extract_catalog_from_header(header)
catalog_entries = AccuracyBenchmark.make_initialization_catalog(truth_catalog_df, false)
target_sources = collect(1:num_sources)
config = Config(min_radius_pix = 40.0)
patches = Model.get_sky_patches(images, catalog_entries)
neighbor_map = Dict(i=>Model.find_neighbors(patches, i) for i in target_sources);
In [9]:
results = ParallelRun.one_node_joint_infer(catalog_entries,
patches,
target_sources,
neighbor_map,
images,
config=config)
prediction_df = AccuracyBenchmark.celeste_to_df(results)
Out[9]: