Skip to content
This repository was archived by the owner on Oct 14, 2023. It is now read-only.
This repository was archived by the owner on Oct 14, 2023. It is now read-only.

Unrelated errors in latitude detection (sometimes) #1290

@Yash-10

Description

@Yash-10

Since the latitude detector uses the cartesian_to_ellipsoidal method directly and also because cartesian_to_ellipsoidal calculates the longitude and height at the same time, sometimes the latitude detector returns a zero division error in this line:

h = z / np.sin(lat) - (1 - e2) * v

Since this is not an error due to latitude calculation but an error in a different calculation (here, h the height), it might be confusing and/or unnecessary to raise this error when using the latitude event.

Reproducible example

tofs = [10, 1000, 3000, 4000] << u.s
orbit = Orbit.circular(Earth, 150 * u.km)

thresh_lat = 60 * u.deg
latitude_cross_event = LatitudeCrossEvent(orbit, thresh_lat, terminal=False)
events = [latitude_cross_event]

rr, _ = cowell(
    Earth.k,
    orbit.r,
    orbit.v,
    tofs,
    events=events,
    f=f,
)

Possible ideas

  • Make three separate methods, each for lat, lon, and h to prevent unrelated error pop-up
  • Also, if spheroid locations can be converted into a "class", it could be easy to access the lat, on, and h attributes.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    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