Skip to content

Commit

Permalink
Merge e79853a into 2db28ca
Browse files Browse the repository at this point in the history
  • Loading branch information
astrojuanlu committed Oct 30, 2019
2 parents 2db28ca + e79853a commit d9b4ff1
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions orbit_predictor/groundtrack.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
class BaseElevationAPI:
def get_elevation(self, *, longitude, latitude):
raise NotImplementedError

def get_ground_point(self, position):
latitude, longitude, _ = position.position_llh
return (
longitude,
latitude,
self.get_elevation(longitude=longitude, latitude=latitude),
)

def get_groundtrack(self, positions):
return [self.get_ground_point(position) for position in positions]


class ZeroElevation(BaseElevationAPI):
def get_elevation(self, *, longitude, latitude):
return 0.0


def compute_groundtrack(predictor, times, elevation_api=ZeroElevation()):
positions = [predictor.get_position(time) for time in times]
return elevation_api.get_groundtrack(positions)

0 comments on commit d9b4ff1

Please sign in to comment.