Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Make propagation faster #16

Description

@astrojuanlu

Hi! I'm the creator and lead developer of poliastro, one of spacetech-ssa dependencies. I am thrilled to see it being used in this project 😍

I noticed that predict_orbit is using .apply on a function that repeatedly calls the cowell method for a given value of elapsed_seconds:

def _propagate_orbit(elapsed_seconds):
"""Propagates the closed over orbit into the future by
`elapsed_seconds` and returns the resulting state vector
of the new orbit with the position measured in meters and the
velocity measured in meters per second.
:param elapsed_seconds: The number of seconds into the future to
propagate the orbit to
:type elapsed_seconds: float
:return: The 6 element state vector of the propagated orbit
:rtype: pd.Series
"""
prop_orbit = orbit.propagate(elapsed_seconds*u.s,
method=cowell,
ad=J2_perturbation,
J2=Earth.J2.value,
R=Earth.R.to(u.km).value)

future_rows[physics_cols] = future_rows.elapsed_seconds.apply(orbit_propagator)

Instead of using Orbit.propagate, poliastro.twobody.propagation.propagate offers a lower level interface that accepts an array of times, and calls the propagator in a tight loop:

https://docs.poliastro.space/en/stable/api/safe/twobody/propagation.html#poliastro.twobody.propagation.propagate

This is just some low hanging fruit I noticed while skimming at the code, but there are probably other things that could be optimized, some of which are already in our roadmap. Would be happy to collaborate with the project :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions