Module: run_search#
- class kbmod.run_search.SearchRunner(config=None)[source]#
A class to run the KBMOD grid search.
- Attributes:
- configSearchConfiguration
The configuration parameters.
- debugbool
If True, enable debug logging (and additional computation).
- 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.
- timeoutfloat or None
The time at which the search should timeout, in seconds since the epoch. This is a soft timeout that will not interrupt during a processing stage. None means no timeout is set.
Methods
apply_config(config)Apply the configuration parameters to the search runner.
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.
- apply_config(config)[source]#
Apply the configuration parameters to the search runner.
This function is designed to be called at multiple points allow it to be used regardless of which level of the search is being run.
- Parameters:
- configSearchConfiguration
The configuration parameters
- 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]#
Appends predicted RA, Dec positions to the results table.
- 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.