Module: trajectory_explorer#
- class kbmod.trajectory_explorer.TrajectoryExplorer(im_stack, config=None, preload_data=False)[source]#
A class to interactively run test trajectories through KBMOD.
- Attributes:
- clipperSigmaGClipping
The sigma-G clipping object.
- configSearchConfiguration
The configuration parameters.
- im_stackImageStackPy
The images to search.
- preload_databool
If
Truepreload all the image data into memory.- searchkb.StackSearch
The search object (with cached data).
Methods
apply_sigma_g(result)Apply sigma G clipping to a single ResultRow.
evaluate_angle_trajectory(ra, dec, v_ra, ...)Evaluate a single linear trajectory in angle space.
evaluate_around_linear_trajectory(x, y, vx, vy)Evaluate all the trajectories within a local neighborhood of the given trajectory.
evaluate_linear_trajectory(x, y, vx, vy, ...)Evaluate a single linear trajectory in pixel space.
initialize_data([config])Initialize the data, including applying the configuration parameters.
refine_linear_trajectory(x, y, vx, vy, *[, ...])Evaluate all trajectories within a local neighborhood of the given trajectory (applying standard filtering) and return the best one.
- apply_sigma_g(result)[source]#
Apply sigma G clipping to a single ResultRow. Modifies the row in-place.
- Parameters:
- resultResults
A table of results to test.
- evaluate_angle_trajectory(ra, dec, v_ra, v_dec, wcs, use_kernel)[source]#
Evaluate a single linear trajectory in angle space. Skips all the filtering steps and returns the raw data.
- Parameters:
- rafloat
The right ascension at time t0 (in degrees)
- decfloat
The declination at time t0 (in degrees)
- v_rafloat
The velocity in RA at t0 (in degrees/day)
- v_decfloat
The velocity in declination at t0 (in degrees/day)
- wcsastropy.wcs.WCS
The WCS for the images.
- use_kernelbool
Force the use of the exact kernel code (including on GPU-sigma G).
- Returns:
- resultResults
The results table with a single row and all the columns filled out.
- evaluate_around_linear_trajectory(x, y, vx, vy, pixel_radius=5, max_ang_offset=0.2618, ang_step=0.035, max_vel_offset=10.0, vel_step=0.5, use_gpu=True)[source]#
Evaluate all the trajectories within a local neighborhood of the given trajectory. No filtering is done at all.
- Parameters:
- xint
The starting x pixel of the trajectory.
- yint
The starting y pixel of the trajectory.
- vxfloat
The x velocity of the trajectory in pixels per day.
- vyfloat
The y velocity of the trajectory in pixels per day.
- pixel_radiusint
The number of pixels to evaluate to each side of the Trajectory’s starting pixel.
- max_ang_offsetfloat
The maximum offset of a candidate trajectory from the original (in radians)
- ang_stepfloat
The step size to explore for each angle (in radians)
- max_vel_offsetfloat
The maximum offset of the velocity’s magnitude from the original (in pixels per day)
- vel_stepfloat
The step size to explore for each velocity magnitude (in pixels per day)
- use_gpubool
Run the search on GPU.
- Returns:
- resultResults
The results table with a single row and all the columns filled out.
- evaluate_linear_trajectory(x, y, vx, vy, use_kernel)[source]#
Evaluate a single linear trajectory in pixel space. Skips all the filtering steps and returns the raw data.
- Parameters:
- xint
The starting x pixel of the trajectory.
- yint
The starting y pixel of the trajectory.
- vxfloat
The x velocity of the trajectory in pixels per day.
- vyfloat
The y velocity of the trajectory in pixels per day.
- use_kernelbool
Force the use of the exact kernel code (including on GPU-sigma G).
- Returns:
- resultResults
The results table with a single row and all the columns filled out.
- initialize_data(config=None)[source]#
Initialize the data, including applying the configuration parameters.
- Parameters:
- configSearchConfiguration, optional
Any custom configuration parameters to use for this run. If
Noneuses the default configuration parameters.
- refine_linear_trajectory(x, y, vx, vy, *, pixel_radius=50, max_dv=10.0, dv_steps=21, max_results=1, use_gpu=True)[source]#
Evaluate all trajectories within a local neighborhood of the given trajectory (applying standard filtering) and return the best one.
- Parameters:
- xint
The starting x pixel of the trajectory.
- yint
The starting y pixel of the trajectory.
- vxfloat
The x velocity of the trajectory in pixels per day.
- vyfloat
The y velocity of the trajectory in pixels per day.
- pixel_radiusint
The number of pixels to evaluate to each side of the Trajectory’s starting pixel.
- max_dvfloat
The maximum change in per-coordinate pixel velocity to explore (in pixels/day)
- dv_steps: `int`
The number of steps to explore in each velocity dimension.
- max_resultsint
The maximum number of results to return.
- use_gpubool
Run the search on GPU.
- Returns:
- resultResults
The results table with a single row and all the columns filled out.
- kbmod.trajectory_explorer.refine_all_results(results, im_stack, config, *, deduplicate=True, pixel_radius=50, max_dv=10.0, dv_steps=21)[source]#
Refine the trajectories in results by re-running the search in a small neighborhood around each trajectory.
- Parameters:
- resultsResults
The current table of results including the per-pixel trajectories. This is modified in-place.
- im_stackImageStackPy
The stack of image data.
- configSearchConfiguration
The configuration parameters
- deduplicatebool, optional
If True, remove duplicate trajectories after refinement (this includes any trajectories whose start and end points are within the pixel radius).
- pixel_radiusint
The number of pixels to evaluate to each side of the Trajectory’s starting pixel.
- max_dvfloat
The maximum change in per-coordinate pixel velocity to explore (in pixels/day)
- dv_steps: `int`
The number of steps to explore in each velocity dimension.
- Returns:
- refinedResults
A new Results object with the refined trajectories.