Module: trajectory_generator#
- class kbmod.trajectory_generator.EclipticCenteredSearch(velocities=[0.0, 0.0, 0], angles=[0.0, 0.0, 0], angle_units='radian', velocity_units='pix / d', given_ecliptic=None, work_unit=None, **kwargs)[source]#
Search a grid defined by velocities and angles relative to the ecliptic.
- Parameters:
- velocitieslist
A triplet of the minimum velocity to use (in pixels per day), and the maximum velocity magnitude (in pixels per day), and the number of velocity steps to try.
- angleslist
A triplet of the minimum angle offset (in the units defined in
angle_units), the maximum angle offset (in the units defined inangle_units), and the number of angles to try.- angle_unitsstr
The units for the angle. Default: ‘radian’
- velocity_unitsstr
The units for the angle. Default: ‘pix / d’
- given_eclipticfloat, optional
An override for the ecliptic as given in the config (in the units defined in
angle_units). This angle takes precedence overcomputed_ecliptic.- work_unitWorkUnit, optional
A WorkUnit to provide additional information about the data that can be used to derive parameters that depend on the input.
- Attributes:
- ecliptic_anglefloat
The angle to use for the ecliptic in the image (in the units defined in
angle_units).- velocitieslist
A triplet of the minimum velocity to use (in pixels per day), and the maximum velocity magnitude (in pixels per day), and the number of velocity steps to try.
- angleslist
A triplet of the minimum angle offset (in radians), and the maximum angle offset (in radians), and the number of angles to try.
- min_angfloat
The minimum search angle in the image (ecliptic_angle + min_ang_offset) in radians.
- max_angfloat
The maximum search angle in the image (ecliptic_angle + max_ang_offset) in radians.
Methods
close(*args, **kwargs)Performs any cleanup needed for this generator
generate(*args, **kwargs)Produces a single candidate trajectory to test.
initialize(*args, **kwargs)Performs any setup needed for this generator
to_table()Generate the trajectories and put them into an astropy table for analysis.
- class kbmod.trajectory_generator.KBMODV1Search(vel_steps, min_vel, max_vel, ang_steps, min_ang, max_ang, **kwargs)[source]#
Search a grid defined by velocities and angles as parameterized KBMOD v1.
- Parameters:
- vel_stepsint
The number of velocity steps.
- min_velfloat
The minimum velocity magnitude (in pixels per day)
- max_velfloat
The maximum velocity magnitude (in pixels per day)
- ang_stepsint
The number of angle steps.
- min_angfloat
The minimum angle (in radians)
- max_angfloat
The maximum angle (in radians)
Methods
close(*args, **kwargs)Performs any cleanup needed for this generator
generate(*args, **kwargs)Produces a single candidate trajectory to test.
initialize(*args, **kwargs)Performs any setup needed for this generator
to_table()Generate the trajectories and put them into an astropy table for analysis.
- class kbmod.trajectory_generator.KBMODV1SearchConfig(v_arr, ang_arr, average_angle=None, work_unit=None, **kwargs)[source]#
Search a grid defined by velocities and angles in the format and parameterization of the legacy KBMOD v1 configuration file.
- Parameters:
- v_arrlist
A triplet of the minimum velocity to use (in pixels per day), and the maximum velocity magnitude (in pixels per day), and the number of velocity steps to try.
- ang_arrlist
A triplet of the minimum angle offset (in radians), and the maximum angle offset (in radians), and the number of angles to try.
- average_anglefloat, optional
The central angle to search around. Should align with the ecliptic in most cases.
- work_unitWorkUnit, optional
A WorkUnit to provide additional information about the data that can be used to derive parameters that depend on the input.
Methods
close(*args, **kwargs)Performs any cleanup needed for this generator
generate(*args, **kwargs)Produces a single candidate trajectory to test.
initialize(*args, **kwargs)Performs any setup needed for this generator
to_table()Generate the trajectories and put them into an astropy table for analysis.
- class kbmod.trajectory_generator.PencilSearch(vx, vy, max_ang_offset=0.2618, ang_step=0.035, max_vel_offset=10.0, vel_step=0.5, **kwargs)[source]#
A search in a small cone around a given velocity.
The search varies the given velocity’s angle and magnitude. The angle includes the range: original angle +/- max_ang_offset. The velocity magnitude includes the range: original magnitude +/- max_vel_offset
- Parameters:
- vxfloat
The center velocity in the x dimension (in pixels per day)
- vyfloat
The center velocity in the y dimension (in pixels per day)
- 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)
Methods
close(*args, **kwargs)Performs any cleanup needed for this generator
generate(*args, **kwargs)Produces a single candidate trajectory to test.
initialize(*args, **kwargs)Performs any setup needed for this generator
to_table()Generate the trajectories and put them into an astropy table for analysis.
- class kbmod.trajectory_generator.RandomVelocitySearch(min_vx, max_vx, min_vy, max_vy, max_samples=1000000, **kwargs)[source]#
Search uniformly sampled random velocities within given bounds (vx and vy).
- Parameters:
- min_vxfloat
The minimum velocity magnitude (in pixels per day)
- max_vxfloat
The maximum velocity magnitude (in pixels per day)
- min_vyfloat
The minimum velocity magnitude (in pixels per day)
- max_vyfloat
The maximum velocity magnitude (in pixels per day)
- max_samplesint
The maximum number of samples to generate. Used to avoid infinite loops in KBMOD code.
Methods
close(*args, **kwargs)Performs any cleanup needed for this generator
generate(*args, **kwargs)Produces a single candidate trajectory to test.
initialize(*args, **kwargs)Performs any setup needed for this generator
reset_sample_count(max_samples)Reset the counter of samples left.
to_table()Generate the trajectories and put them into an astropy table for analysis.
- class kbmod.trajectory_generator.SingleVelocitySearch(vx, vy, **kwargs)[source]#
Search a single velocity from each pixel.
- Parameters:
- vxfloat
The velocity in x pixels (pixels per day).
- vyfloat
The velocity in y pixels (pixels per day).
Methods
close(*args, **kwargs)Performs any cleanup needed for this generator
generate(*args, **kwargs)Produces a single candidate trajectory to test.
initialize(*args, **kwargs)Performs any setup needed for this generator
to_table()Generate the trajectories and put them into an astropy table for analysis.
- class kbmod.trajectory_generator.TrajectoryGenerator(work_unit=None, **kwargs)[source]#
A base class for defining search strategies by generating candidate trajectories for each pixel.
Implementations of TrajectoryGenerator must: 1) override generate() to provide new samples, 2) cannot be infinite
Methods
close(*args, **kwargs)Performs any cleanup needed for this generator
generate(*args, **kwargs)Produces a single candidate trajectory to test.
initialize(*args, **kwargs)Performs any setup needed for this generator
to_table()Generate the trajectories and put them into an astropy table for analysis.
- class kbmod.trajectory_generator.VelocityGridSearch(vx_steps, min_vx, max_vx, vy_steps, min_vy, max_vy, **kwargs)[source]#
Search a grid defined by steps in velocity space.
- Parameters:
- vx_stepsint
The number of velocity steps in the x direction.
- min_vxfloat
The minimum velocity in the x-dimension (pixels per day).
- max_vxfloat
The maximum velocity in the x-dimension (pixels per day).
- vy_stepsint
The number of velocity steps in the y direction.
- min_vyfloat
The minimum velocity in the y-dimension (pixels per day).
- max_vyfloat
The maximum velocity in the y-dimension (pixels per day).
Methods
close(*args, **kwargs)Performs any cleanup needed for this generator
generate(*args, **kwargs)Produces a single candidate trajectory to test.
initialize(*args, **kwargs)Performs any setup needed for this generator
to_table()Generate the trajectories and put them into an astropy table for analysis.
- kbmod.trajectory_generator.create_trajectory_generator(config, work_unit=None, **kwargs)[source]#
Create a TrajectoryGenerator object given a dictionary of configuration options. The generator class is specified by the ‘name’ entry, which must exist and match the class name of one of the subclasses of
TrajectoryGenerator.- Parameters:
- configdict or SearchConfiguration
The dictionary of generator parameters.
- work_unitWorkUnit, optional
A WorkUnit to provide additional information about the data that can be used to derive parameters that depend on the input.
- Returns:
- genTrajectoryGenerator
A TrajectoryGenerator object.
- Raises:
- Raises a
KeyErrorif the name entry is missing or the correct parameters - do not exist.
- Raises a
- kbmod.trajectory_generator.describe_trajectory_generator(name=None)[source]#
Provide a description of either a given trajectory generator class or all available trajectory generator classes.
- Parameters:
- namestr, optional
The name of the trajectory generator class to describe. If not provided, descriptions of all available trajectory generator classes will be returned.