Preprocessing Tasks¶
ecoscope.platform.tasks.preprocessing ¶
Classes¶
TrajectorySegmentFilter ¶
Bases: BaseModel
Attributes¶
max_length_meters
class-attribute
instance-attribute
¶
max_length_meters: Annotated[float, AdvancedField(default=100000, title='Maximum Segment Length (Meters)', gt=0.001, json_schema_extra={exclusiveMinimum: 0.001})] = 100000
max_speed_kmhr
class-attribute
instance-attribute
¶
max_speed_kmhr: Annotated[float, AdvancedField(default=500, title='Maximum Segment Speed (Kilometers per Hour)', gt=0.001, json_schema_extra={exclusiveMinimum: 0.001})] = 500
max_time_secs
class-attribute
instance-attribute
¶
max_time_secs: Annotated[float, AdvancedField(default=172800, title='Maximum Segment Duration (Seconds)', gt=1, json_schema_extra={exclusiveMinimum: 1})] = 172800
min_length_meters
class-attribute
instance-attribute
¶
min_length_meters: Annotated[float, AdvancedField(default=0.001, title='Minimum Segment Length (Meters)', ge=0.001, json_schema_extra={minimum: 0.001})] = 0.001
min_speed_kmhr
class-attribute
instance-attribute
¶
min_speed_kmhr: Annotated[float, AdvancedField(default=0.01, title='Minimum Segment Speed (Kilometers per Hour)', gt=0.001, json_schema_extra={exclusiveMinimum: 0.001})] = 0.01
min_time_secs
class-attribute
instance-attribute
¶
min_time_secs: Annotated[float, AdvancedField(default=1, title='Minimum Segment Duration (Seconds)', ge=1, json_schema_extra={minimum: 1})] = 1
Methods:¶
validate_filter_values ¶
validate_filter_values() -> TrajectorySegmentFilter
Source code in ecoscope/platform/tasks/preprocessing/_preprocessing.py
Functions:¶
process_relocations ¶
process_relocations(observations: PatrolObservationsGDF | SubjectGroupObservationsGDF, filter_point_coords: Annotated[list[Coordinate], Field()], relocs_columns: Annotated[list[str], Field(description='A list of column names to retain in the relocations dataframe.')]) -> PatrolObservationsGDF | SubjectGroupObservationsGDF
Source code in ecoscope/platform/tasks/preprocessing/_preprocessing.py
relocations_to_trajectory ¶
relocations_to_trajectory(relocations: PatrolObservationsGDF | SubjectGroupObservationsGDF, trajectory_segment_filter: Annotated[TrajectorySegmentFilter | SkipJsonSchema[None], AdvancedField(default=TrajectorySegmentFilter(), title=' ', description='Filter track data by setting limits on track segment length, duration, and speed. Segments outside these bounds are removed, reducing noise and to focus on meaningful movement patterns.')] = None) -> TrajectoryGDF