Module: run_search#
- class kbmod.run_search.SearchRunner(config=None)[source]#
A class to run the KBMOD grid search.
- Attributes:
- phase_timesdict
A dictionary mapping the search phase to the timing information, a list of [starting time, ending time] in seconds.
- phase_memorydict
A dictionary mapping the search phase the memory information, a list of [starting memory, ending memory] in bytes.
Methods
Output the statistics for each phase.
do_core_search
(config, stack, trj_generator)Performs search on the GPU.
load_and_filter_results
(search, config[, ...])This function loads results that are output by the grid search.
run_search
(config, stack[, trj_generator, ...])This function serves as the highest-level python interface for starting a KBMOD search given an ImageStack and SearchConfiguration.
Run a KBMOD search from a WorkUnit object.
- do_core_search(config, stack, trj_generator)[source]#
Performs search on the GPU.
- Parameters:
- configSearchConfiguration
The configuration parameters
- stackImageStackPy
The stack of image data.
- trj_generatorTrajectoryGenerator
The object to generate the candidate trajectories for each pixel.
- Returns:
- keepResults
The results.
- load_and_filter_results(search, config, batch_size=100000)[source]#
This function loads results that are output by the grid search. It can then generate psi + phi curves and perform sigma-G filtering (depending on the parameter settings).
- Parameters:
- searchkbmod.search
The search function object.
- configSearchConfiguration
The configuration parameters
- batch_sizeint
The number of results to load at once. This is used to limit the memory usage when loading results. Default is 100000.
- Returns:
- keepResults
A Results object containing values from trajectories.
- run_search(config, stack, trj_generator=None, workunit=None, extra_meta=None)[source]#
This function serves as the highest-level python interface for starting a KBMOD search given an ImageStack and SearchConfiguration.
- Parameters:
- configSearchConfiguration
The configuration parameters
- stackImageStackPy
The stack of image data.
- trj_generatorTrajectoryGenerator, optional
The object to generate the candidate trajectories for each pixel. If None uses the default EclipticCenteredSearch
- workunitWorkUnit, optional
An optional WorkUnit with additional meta-data, including the per-image WCS.
- extra_metadict, optional
Any additional metadata to save as part of the results file.
- Returns:
- keepResults
The results.
- kbmod.run_search.append_positions_to_results(workunit, results)[source]#
Append predicted (x, y) and (RA, dec) positions in the original images. If the images were reprojected, also appends the (RA, dec) in the common frame.
- Parameters:
- workunitWorkUnit
The WorkUnit with all the WCS information.
- resultsResults
The current table of results including the per-pixel trajectories. This is modified in-place.
- kbmod.run_search.check_gpu_memory(config, stack, trj_generator=None)[source]#
Check whether we can run this search on the GPU.
- Parameters:
- configSearchConfiguration
The configuration parameters
- stackImageStackPy
The stack of image data.
- trj_generatorTrajectoryGenerator, optional
The object to generate the candidate trajectories for each pixel.
- Returns:
- validbool
Returns True if the search will fit on GPU and False otherwise.