dirac-institute / kbmod

KBMOD (Kernel-Based Moving Object Detection)
BSD 2-Clause "Simplified" License
46 stars 14 forks source link

add Visualizer and visualizer_utils #691

Closed maxwest-uw closed 2 months ago

maxwest-uw commented 2 months ago

current usage:

import kbmod as kb
from kbmod.analysis.visualizer import Visualizer

wu_path = "/path/to/wu.fits" 
res_path = "/path/to/results/table.ecsv"

wu = kb.work_unit.WorkUnit.from_fits(wu_path)
stack = wu.im_stack
results = kb.results.Results.read_table(res_path))

vis = Visualizer(stack, results)

# maybe this should be done as part of the __init__,
# but these methods/columns might not be needed
# with other visualizations, curious what you think
vis.generate_all_stamps()
vis.count_num_days()

# plots result 0
vis.plot_daily_coadds(0)

# saves plot to png
vis.plot_daily_coadds(0, filename="result_0.png")

# plots all coadds with more than one days worth of day
idxs = np.where(results.table["num_days"] > 1)
for idx in idxs:
    vis.plot_daily_coadds(idx)