Problems in setting timespan in rugged builder


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 =

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)

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.setDigitalElevationModel(None, 0)
ruggedbuilder.setEllipsoid(EllipsoidId.WGS84, BodyRotatingFrameId.ITRF)
ruggedbuilder.setTimeSpan(acquisitionStartDate, acquisitionStopDate, tStep, timeTolerance)
satellitePVList, nbPVPoints, CartesianDerivativesFilter.USE_P,
satelliteQList, nbQPoints, AngularDerivativesFilter.USE_R)

rugged =


*******The errors are:

JavaError Traceback (most recent call last)
21 ruggedbuilder.addLineSensor(lineSensor)
—> 23 rugged =

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.(
at org.orekit.rugged.api.RuggedBuilder.createInterpolator(
at org.orekit.rugged.api.RuggedBuilder.createInterpolatorIfNeeded(

The satelllitePVList list should contain several points and should at list cover the time span of your locatios requests. This list is used for interpolating sensor position and orientation. I would suggest having at least 8 points or so, to have an accurate interpolation.

Hi Luc,

Thanks a lot for your message. It worked now and it gives a location (lat-lon) for number of pixels. But I am also curious to know, if rugged can provide four corners of the ground pixel (i,j)?. I shall be thankful for your response.

Also, I am not able to import PythonTileUpdater from “org.orekit.rugged.raster”. How can I get it?. I am using python wrapper of orekit (provided by conda).

Thanks and regards

If you want the four corners, you can use a trick: shift you pixels by half width and half length,
then the center of a shifted pixel corresponds to the corner of four unshifted pixels.

I am not sure about Python. Beware that TileUpdater is an interface, and I think you can’t import a Java interface, I think you can only import a class that implements the interface. As TileUpdater is really bound to the tile data format, it is not provided directly by Rugged as it would add hard dependencies (like gdal for example) and we thought users would rather manage these dependencies and their versioning by themselves.

Thanks again Luc for the quick response.