Hi all,
I am trying to write a function that will query the DTM2000 density model given a position (ECI) and a time.
def query_dtm2000(position, datetime):
absolute_date = datetime_to_absolutedate(datetime)
frame = FramesFactory.getEME2000()
wgs84Ellipsoid = ReferenceEllipsoid.getWgs84(FramesFactory.getITRF(IERSConventions.IERS_2010, True))
sun = CelestialBodyFactory.getSun()
utc = TimeScalesFactory.getUTC()
atmosphere = DTM2000(PythonDTM2000InputParameters(), sun, wgs84Ellipsoid)
position_vector = Vector3D(float(position[0]), float(position[1]), float(position[2]))
density = atmosphere.getDensity(absolute_date, position_vector, frame)
return density
At the moment I get the following error and I am not really sure what to make of it
File "query_models.py", line 24, in append_dtm2000_density
dens = query_dtm2000(r, date_val)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "orekit_tools.py", line 73, in query_dtm2000
density = atmosphere.getDensity(absolute_date, position_vector, frame)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
orekit.JavaError: <super: <class 'JavaError'>, <JavaError object>>
Java stacktrace:
java.lang.RuntimeException: AttributeError
at org.orekit.models.earth.atmosphere.PythonDTM2000InputParameters.getMaxDate(Native Method)
at org.orekit.models.earth.atmosphere.DTM2000.getDensity(DTM2000.java:331)
It seems like the getMaxDate()
function is not correctly returning the date ?
I had this working fine when I was using the CSSI data provider as such:
cssi_sw_data = CssiSpaceWeatherData(CssiSpaceWeatherData.DEFAULT_SUPPORTED_NAMES)
atmosphere = DTM2000(cssi_sw_data, sun, wgs84Ellipsoid)
But I wanted to make sure the correct data provider is being used (since the Kp index is supposed to be shifted by 3-hours in time).
Does anyone have insights into what might be causing this issue or suggestions on how to resolve it?
Any help much appreciated