Propagator add drag Force error

Hi,
I am preparing for a propagator and adding the perturbation model, but just When adding the drag force, running the line

msafe = MarshallSolarActivityFutureEstimation(
    '(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\p{Digit}\p{Digit}\p{Digit}\p{Digit}F10\.(?:txt|TXT)',
    MarshallSolarActivityFutureEstimation.StrengthLevel.AVERAGE)

orekit_filename = 'orekit-data'
manager = DataContext.getDefault().getDataProvidersManager()

datafile = File(orekit_filename)
if not datafile.exists():
    print('Directory :', datafile.absolutePath, ' not found')
    
crawler = DirectoryCrawler(datafile)
manager.clearProviders()
manager.addProvider(crawler)

manager.feed(msafe.getSupportedNames(), msafe)  # Feeding the F10.7 bulletins to Orekit's data manager

atmosphere = NRLMSISE00(msafe, sun, wgs84Ellipsoid)

#atmosphere = DTM2000(msafe, sun, wgs84Ellipsoid)

isotropicDrag = IsotropicDrag(A, cd)

dragForce = DragForce(atmosphere, isotropicDrag)

propagator_num.addForceModel(dragForce)
state1 = [propagator_num.propagate(tt).getPVCoordinates() for tt in t]

It returns with:

state1 = [propagator_num.propagate(tt).getPVCoordinates() for tt in t]

JavaError: <super: <class 'JavaError'>, <JavaError object>>
    Java stacktrace:
java.lang.NullPointerException
	at org.orekit.time.AbsoluteDate.isEqualTo(AbsoluteDate.java:1210)
	at org.orekit.time.AbsoluteDate.isBetweenOrEqualTo(AbsoluteDate.java:1299)
	at org.orekit.models.earth.atmosphere.NRLMSISE00.getDensity(NRLMSISE00.java:1156)
	at org.orekit.forces.drag.DragForce.acceleration(DragForce.java:80)
	at org.orekit.forces.ForceModel.addContribution(ForceModel.java:108)
	at org.orekit.propagation.numerical.NumericalPropagator$Main.computeDerivatives(NumericalPropagator.java:899)
	at org.orekit.propagation.integration.AbstractIntegratedPropagator$ConvertedMainStateEquations.computeDerivatives(AbstractIntegratedPropagator.java:755)
	at org.hipparchus.ode.ExpandableODE.computeDerivatives(ExpandableODE.java:134)
	at org.hipparchus.ode.AbstractIntegrator.computeDerivatives(AbstractIntegrator.java:265)
	at org.hipparchus.ode.AbstractIntegrator.initIntegration(AbstractIntegrator.java:217)
	at org.hipparchus.ode.nonstiff.EmbeddedRungeKuttaIntegrator.integrate(EmbeddedRungeKuttaIntegrator.java:196)
	at org.orekit.propagation.integration.AbstractIntegratedPropagator.integrateDynamics(AbstractIntegratedPropagator.java:474)
	at org.orekit.propagation.integration.AbstractIntegratedPropagator.propagate(AbstractIntegratedPropagator.java:422)
	at org.orekit.propagation.integration.AbstractIntegratedPropagator.propagate(AbstractIntegratedPropagator.java:385)

My orekit version is 11.1. I have checked the other perturbations, such as earth gravity, three-body gravity, and solar pressure. Just adding the above drag model can lead to such an error. I am not sure whether it was the space weather data loaded file. because run the loading line it goes fine.
just run the propagate line come to this error
If you could tell me the reason, I would be very thankful!!

Thank you, Roint

Hi @ROINT , welcome

Could you temporarily add a call to manager.getLoadedDataNames(), after the call to manager.feed and check in the names it returns that it properly read the MSAFE files from your orekit-data folder?

1 Like

hi luc,
Thank you! I found it return
<Set: [D:\Desktop\OrbitalPropagator\1\orekit-data.zip!/orekit-data-master/CSSI-Space-Weather-Data/SpaceWeather-All-v1.2.txt]>
It must have something wrong in the workpath, because the ! should not be included there.
I am wondering whether is the java_jdk version cause that problem?

No, the β€œ!” means that you use directly a zip file without having expended it, and Orekit knows how to read it from within the zip file.

This works, but is really not recommended because it is is very slow. Every data you will need (even the small TAI-UTC history file) implies the full zip will be read. This is because the zip format put a table of content at the end of the file wo we need to read everything to reach it. Look at the explanation for the quick recommended setup

However, it seems you configured your atmosphere model to use MSAFE for importing the space weather data, but you loaded the CSSI space weather data, which is different. You should build your NRLMSISE00 with a CssiSpaceWeatherData instead of a MarshallSolarActivityFutureEstimation

2 Likes