Sun synchronous orbits with Python wrapper

Hi,

Can sun synchronous orbits be simulated using the orekit Python wrapper? Someone asked about it using Java (Orbital Elements of a Sun Synchronous Orbit) and was redirected to the Phasing tutorial (src/main/java/org/orekit/tutorials/bodies/Phasing.java · master · Orekit / Orekit Tutorials · GitLab). Is there a Python equivalent?

Many thanks,

Alex

@alexarnstein To my knowledge there is no specific class for generating a sun-synch orbit, but a special class is not necessary. Whether a satellite is sun-synch is dependent on the combination of semi-major axis, eccentricity, and inclination, and you can create a sun-synch orbit using the ordinary KeplerianOrbit class.

# Import Orekit
import orekit
vm = orekit.initVM()
 
# Import the Orekit data from the master folder
from orekit.pyhelpers import setup_orekit_curdir
setup_orekit_curdir('orekit-data-master')

from org.orekit.frames import FramesFactory
from org.orekit.orbits import KeplerianOrbit
from org.orekit.orbits import PositionAngleType
from org.orekit.propagation.analytical import KeplerianPropagator
from org.orekit.utils import Constants
from org.orekit.time import AbsoluteDate, TimeScalesFactory

start_time = AbsoluteDate(date_string, TimeScalesFactory.getUTC())
  
keplerOrbit = KeplerianOrbit(a, e, inclin, argperigee, raan, trueAnom, \
                             PositionAngleType.TRUE, FramesFactory.getEME2000(), \
                             start_time, Constants.IERS2010_EARTH_MU)
prop = KeplerianPropagator(keplerOrbit)

This code snippet might not be perfect (I put it together on the fly) but it should get you started. For the calculations on how to make sure your orbit is sun-synch, check Vallado or any other reference book.

Hello @alexarnstein and welcome to the community,

There is currently no python implementation of the Phasing tutorial and as @baubin pointed out, no specific implementation exists to easily generate a sun synchronous orbit.

You can open an issue here to request this in the python wrapper examples : Issues · Orekit Labs / Orekit Python Wrapper · GitLab.

Thank you @baubin for providing an example for Keplerian orbit and sources to check :slight_smile: !

Cheers,
Vincent

@alexarnstein Sorry but I flaked a bit yesterday. Yes you can set up a sun-synch orbit with keplerian orbit elements, but if you put it in a KeplerianPropagator it won’t stay sun-synch because that property depends on the J2 factor. You’ll need to use a BrouwerLyddanePropagator which takes into account the basic gravitational harmonics.

from org.orekit.forces.gravity.potential import GravityFieldFactory
from org.orekit.propagation.analytical import BrouwerLyddanePropagator

gravityField = GravityFieldFactory.getUnnormalizedProvider(6, 6)
keplerOrbit = KeplerianOrbit(a, e, inclin, argperigee, raan, trueAnom, \
                             PositionAngleType.TRUE, FramesFactory.getEME2000(), \
                             start_time, Constants.IERS2010_EARTH_MU)

BrouwerLyddanePropagator(keplerOrbit, gravityField, 0.0)
3 Likes

Indeed ! Thank you @baubin :sweat_smile:

@baubin thank you so much for your help! I’ll give this a shot :slight_smile:

@Vincent thanks for confirming there isn’t a specific implementation. @baubin’s method looks quite straightforward :crossed_fingers: so perhaps one isn’t necessary? That being said, it’s a very common orbit for Earth Observation satellites so it might be popular.

Many thanks again,
Alex