Access getFootprint data

Hello, everyone,
I am continuing my exploration of wonderful Orekit package. I have some problems with accessing the coordinates using getFootprint method. I am trying to find visilibily circle footprints for a ground station with a certain elevation angle. I have used the following post as a starting point Discrepancy Between FieldOfView Results and used CircularFieldOfView and getFootprint method to get the footprints for the visibility circle.

import orekit
vm = orekit.initVM()
print (‘Java version:’,vm.java_version)
print (‘Orekit version:’, orekit.VERSION)

from orekit.pyhelpers import setup_orekit_curdir, absolutedate_to_datetime
setup_orekit_curdir()
from org.hipparchus.geometry.euclidean.threed import Vector3D, RotationOrder, SphericalCoordinates, RotationConvention
from org.hipparchus.ode.events import Action
from org.orekit.models.earth import EarthITU453AtmosphereRefraction

from org.orekit.attitudes import AttitudeProvider, AttitudesSequence, LofOffset, CelestialBodyPointed
from org.orekit.data import DataProvidersManager, ZipJarCrawler
from org.orekit.propagation import SpacecraftState,Propagator
from org.orekit.propagation.sampling import OrekitFixedStepHandler, PythonOrekitFixedStepHandler
from org.orekit.propagation.analytical import KeplerianPropagator, EcksteinHechlerPropagator
from org.orekit.propagation.analytical.tle import TLE, TLEPropagator
from org.orekit.propagation.events import EclipseDetector, EventsLogger, GeographicZoneDetector,LatitudeCrossingDetector, ElevationDetector, LatitudeExtremumDetector
from org.orekit.propagation.events.handlers import PythonEventHandler, ContinueOnEvent, RecordAndContinue, StopOnDecreasing, StopOnEvent, StopOnIncreasing
from org.orekit.orbits import KeplerianOrbit, CartesianOrbit, PositionAngle, OrbitType
from org.orekit.frames import FramesFactory, TopocentricFrame, LOFType, StaticTransform
from org.orekit.bodies import OneAxisEllipsoid, GeodeticPoint, CelestialBodyFactory
from org.orekit.time import TimeScalesFactory, AbsoluteDate, DateComponents, TimeComponents
from org.orekit.utils import IERSConventions, Constants, PVCoordinates, PVCoordinatesProvider
from org.orekit.utils import AngularDerivativesFilter
from org.orekit.geometry.fov import CircularFieldOfView
from math import radians, pi
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import datetime
import cartopy
import cartopy.crs as ccrs
import cartopy.feature as cfeature
from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER
import matplotlib.pyplot as plt
import matplotlib.ticker as mticker
import plotly
import plotly.express as px
import plotly.io as pio
import math
from java.util import ArrayList, toArray

utc = TimeScalesFactory.getUTC()
tt = TimeScalesFactory.getTT()

inertialFrame = FramesFactory.getGCRF()

#Overall duration in seconds for extrapolation
duration = 24 * 60 * 60
step_time = 1
h=600000.0
Re=Constants.WGS84_EARTH_EQUATORIAL_RADIUS
initialDate = AbsoluteDate(2023, 12, 20, 0, 0, 0.000, utc)
finalDate=initialDate.shiftedBy(float(duration))
mu=Constants.WGS84_EARTH_MU
ITRF = FramesFactory.getITRF(IERSConventions.IERS_2010, True)
earth = OneAxisEllipsoid(Re,
# 0.0,
Constants.WGS84_EARTH_FLATTENING,
ITRF)
##GStation latitude (rad), longitude (rad), altitude (m)
AST_point = GeodeticPoint(radians(51.1605227), radians(71.4703558), 341.0)
SVB_point = GeodeticPoint(radians(78.1347), radians(15.2428), 426.0)
sta1Frame = TopocentricFrame(earth, AST_point, “Esrange”)
sta2Frame = TopocentricFrame(earth, SVB_point, “Esrange”)

##GS stations and their visibility angles in degrees
GStations=[[TopocentricFrame(earth, AST_point, “Esrange”),10.0],
[TopocentricFrame(earth, SVB_point, “Esrange”),10.0]]

cof=CircularFieldOfView(Vector3D.MINUS_K, radians(90 - GStations[0][1]), 0.0)
topoToBody = GStations[0][0].getTransformTo(ITRF,initialDate)
GS_circle_ft = cof.getFootprint(topoToBody, earth, 0.05)

However I can’t access the data stored in GS_circle_ft. Exactly the same problem was encountered 2 years ago Coverage analysis - getFootprint method Issue - #6 by misanthrope. I can see what is inside but can’t access it. I tried the solution in the post, but casting Object to GeodeticPoint.cast_() did’t work for me.

<List: [[{lat: 51,143124469 deg, lon: 71,4703558 deg, alt: 0}, {lat: 51,1431460884 deg, lon: 71,4717344564 deg, alt: 0}, {lat: 51,1432108928 deg, lon: 71,4731096891 deg, alt: 0}, {lat: 51,1433187213 deg, lon: 71,4744780828 deg, alt: 0}, {lat: 51,1434693062 deg, lon: 71,4758362391 deg, alt: 0}, {lat: 51,1436622735 deg, lon: 71,4771807851 deg, alt: 0},

type(GS_circle_ft)
java.util.List
type(GS_circle_ft.get(0))
java.lang.Object

Perhaps there were changes in the python wrapper which makes the previous solution unapplicable to my case, so accessing the data stored in Java ArrayList using python is difficult for me. I would appreciate help from the more experienced users. Thanks in advance!

Hi @spaceman,

Sorry for the (very long) delay.
Did you manage to solve your issue?

I must admit I don’t know how to solve it but I’m answering just to “up” your question.
Maybe a proficient Python user will have time to help you.

Best,
Maxime

Hi, Maxime!
Nope, I am still open for suggestions and help :laughing:

Hello everyone,

I stumbled upon this thread because i came across the same issue.

I managed to solve this using casting :

from java.util import List
...
footprint = fieldOfView.getFootprint(...)
footprint = list(footprint)
footprint = [list(List.cast_(points)) for points in footprint]
for points in footprint:
        for point in points:
                point = GeodeticPoint.cast_(point)

As you can see, you first transform your footprint into a list and then cast each value inside to a java List this time. You then need to cast each of the point inside the java List to a GeodeticPoint

I’m using Pycharm but it did not like the import even though it worked so do not always trust the IDE :sweat_smile: !

Cheers,
Vincent

3 Likes

Thank you very much!

1 Like

You’re welcome :+1:

Thank you very much!

1 Like