How can I perform rotation of my satellite sensor in relation to nadir?

Hello, @Vincent

Thanks a lot for the explanations, examples and sources. They are going to be very useful to me.

It turns out that I was capable of applying the rotation to my satellite sensor based on the angle generated from the Quaternions. I learned that the convention for rotating with Orekit is the opposite from what one would expect.

As a result, I could geolocate my pixels. For now, it works for me, but I could not geolocate using Rugged and obtain the coordinate elevation, which makes things more precise.

I will put here the workflow for geolocation without DEM, so other people can profit from it:

1. - Get satellite position
2.- Transform vectors from ECEF to ECI
3.- Convert time to UTC AbsoluteDate
4. - Define LOS. I used los_body_nadir = Vector3D(0.,0.,1.), since my satellite points to nadir.
5. - Generate rotation from the Quaternions
6. - Rotate the LOS based on the rotation
7. - Transform LOS from ECI to ECEF, and then convert to StaticTransform seeking the transform of the LOS vector.
8. - Perform intersection with Earth by building a line

#Setting Earth ellipsoid
earth = OneAxisEllipsoid(
                        Constants.WGS84_EARTH_EQUATORIAL_RADIUS,
                        Constants.WGS84_EARTH_FLATTENING,
                        itrf
)

#Building the line for intersection
line = Line(pos_ecef,
            pos_ecef.add(los_body_rotated_itrf),
            1e-10
) 

#Intersecting with Earth
intersection = earth.getIntersectionPoint(
                                        line, #the line
                                        pos_ecef, #sat pos
                                        itrf, #frame
                                        date #date
)

#Coordinates
latitude = math.degrees(intersection.getLatitude())
longitude = math.degrees(intersection.getLongitude())
altitude = math.degrees(intersection.getAltitude()) 

With that, I could geolocate the 1st pixel of my image, falling exactly where it should be.

Make sure that, when you apply the rotation to your vectors, always check whether you should use applyTo() or applyInverseTo().

I think that, by finding this solution, I can see that my original post was not clear enough. But still I appreciate the help from you all! It was not in vain, since I’m still going to use it. For next time, I’ll try to be more accurate.

All the best,

Rodrigo.