Module: stamp_filters#

A series of Filter subclasses for processing basic stamp information.

The filters in this file all operate over simple statistics based on the stamp pixels.

kbmod.filters.stamp_filters.append_all_stamps(result_data, im_stack, stamp_radius)[source]#

Get the stamps for the final results from a kbmod search. These are appended onto the corresponding entries in a ResultList.

Parameters:
result_dataResult

The current set of results. Modified directly.

im_stackImageStack

The stack of images.

stamp_radiusint

The radius of the stamps to create.

kbmod.filters.stamp_filters.append_coadds(result_data, im_stack, coadd_types, radius, valid_only=True)[source]#

Append one or more stamp coadds to the results data without filtering.

result_dataResults

The current set of results. Modified directly.

im_stackImageStack

The images from which to build the co-added stamps.

coadd_typeslist

A list of coadd types to generate. Can be “sum”, “mean”, and “median”.

radiusint

The stamp radius to use.

valid_onlybool

Only use stamps from the timesteps marked valid for each trajectory.

kbmod.filters.stamp_filters.filter_stamps_by_cnn(result_data, model_path, coadd_type='mean', stamp_radius=10, verbose=False)[source]#

Given a set of results data, run the the requested coadded stamps through a provided convolutional neural network and assign a new column that contains the stamp classification, i.e. whether or not the result passed the CNN filter.

Parameters:
result_dataResult

The current set of results. Modified directly.

model_pathstr

Path to the the tensorflow model and weights file.

coadd_typestr

Which coadd type to use in the filtering. Depends on how the model was trained. Default is ‘mean’, will grab stamps from the ‘coadd_mean’ column.

stamp_radiusint

The radius used to generate the stamps. The dimension of the stamps should be (stamp_radius * 2) + 1.

verbosebool

Verbosity option for the CNN predicition. Off by default.