Hi,
I am new to use rugged module (in python environment) and was testing a simple case of getting a direct location (mainly given in the tutorial) on ground. I am facing errors related to the “date is out of time span”. I could not find the reason of errors or how to fix it?. Any help will be highly appreciated.
Following are my lines of code and errors:
fov_angle = 20.0 # in degrees
Npixel = 200
delta = FastMath.toRadians(fov_angle) / Npixel
rawDirs = ArrayList()
for i in range(Npixel):
sc = (i - Npixel / 2.) * delta
rawDirs.add(Vector3D( 0.0, math.sin(sc), math.cos(sc) ))
losBuilder = LOSBuilder(rawDirs)
losBuilder.addTransform(FixedRotation(“10-degrees-rotation”, Vector3D.PLUS_I, radians(10.)))
lineOfSight = losBuilder.build()
gpsDateAsString = “2020-01-01T00:00:00.000”
absDate = AbsoluteDate(gpsDateAsString, TimeScalesFactory.getGPS())
lineDatation = LinearLineDatation(absDate, 1., 20.)
lineSensor = LineSensor(“mySensor”, lineDatation, Vector3D.ZERO, lineOfSight)
satelliteQList = ArrayList()
attitudeDate = AbsoluteDate(gpsDateAsString, TimeScalesFactory.getGPS())
rotation = Rotation(0., 0., 0., radians(10.), True) # q0 is the scalar term.
rotationRate = Vector3D.ZERO
rotationAccleration = Vector3D.ZERO
pair = TimeStampedAngularCoordinates(attitudeDate, rotation, rotationRate, rotationAccleration)
satelliteQList.add(pair)
satellitePVList = ArrayList()
ephemerisDate = AbsoluteDate(gpsDateAsString, TimeScalesFactory.getGPS())
position = Vector3D(6,644,881.750862456; 806,960.6174752496; 2,406,138.8029101086) # in ITRF, unit: m
velocity = Vector3D(-2,342.5567256115; -1,468.2756079966; 6,961.6640667119); # in ITRF, unit: m/s
pvITRF = PVCoordinates(position, velocity)
transform = ITRF.getTransformTo(inertialFrame, ephemerisDate)
pvEME2000 = transform.transformPVCoordinates(pvITRF)
satellitePVList.add(TimeStampedPVCoordinates(ephemerisDate, pvEME2000.getPosition(), pvEME2000.getVelocity(), Vector3D.ZERO))
acquisitionStartDate = absDate
acquisitionStopDate = absDate.shiftedBy(1.)
tStep = 0.1
timeTolerance = 5 / lineSensor.getRate(0.)
nbPVPoints = 1
nbQPoints = 1
ruggedbuilder = RuggedBuilder()
ruggedbuilder.setAlgorithm(AlgorithmId.IGNORE_DEM_USE_ELLIPSOID)
ruggedbuilder.setDigitalElevationModel(None, 0)
ruggedbuilder.setEllipsoid(EllipsoidId.WGS84, BodyRotatingFrameId.ITRF)
ruggedbuilder.setTimeSpan(acquisitionStartDate, acquisitionStopDate, tStep, timeTolerance)
ruggedbuilder.setTrajectory(InertialFrameId.EME2000,
satellitePVList, nbPVPoints, CartesianDerivativesFilter.USE_P,
satelliteQList, nbQPoints, AngularDerivativesFilter.USE_R)
ruggedbuilder.addLineSensor(lineSensor)
rugged = ruggedbuilder.build()
---------------------------------------------------
*******The errors are:
JavaError Traceback (most recent call last)
in
21 ruggedbuilder.addLineSensor(lineSensor)
22
—> 23 rugged = ruggedbuilder.build()
JavaError: <super: <class ‘JavaError’>, >
Java stacktrace:
org.orekit.rugged.errors.RuggedException: date 2019-12-31T23:59:43.000 is out of time span [2019-12-31T23:59:42.000, 2019-12-31T23:59:42.000] (UTC)
at org.orekit.rugged.utils.SpacecraftToObservedBody.(SpacecraftToObservedBody.java:110)
at org.orekit.rugged.api.RuggedBuilder.createInterpolator(RuggedBuilder.java:702)
at org.orekit.rugged.api.RuggedBuilder.createInterpolatorIfNeeded(RuggedBuilder.java:663)
at org.orekit.rugged.api.RuggedBuilder.build(RuggedBuilder.java:989)