[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Orekit Users] Surface Illumination
Stephen Ranger <sanosuke001@gmail.com> a écrit :
Hi Stephen,
Hello Users,
Thanks for the info about the inertial frame the other day. Another
question as I can't seem to find anything through Google. I'm looking to
mark a map based on time of day to show day/night/twilight/etc. Is there
any way using Orekit to get the illumination level at a specific point on
Earth? If not, any idea where I should start looking?
You will need the following items:
- a OneAxisEllipsoid for Earth model
- a GeodeticPoint for each point in the map you want to consider
- an AbsoluteDate for the current date
- a CelestialBody for the Sun, considered as a moving point
(use CelestialBodyFactory.getSun() to get it)
Then you first compute the Sun position in Earth rotating frame:
Vector3D sunPos = sun.getPVCoordinates(date,
earth.getBodyFrame()).getPosition();
For each of your geodetic points, compute its Cartesian coordinates:
Vector3D groundPointPos = earth.transform(geodeticPoint);
You can now compute the direction from ground point to Sun:
Vector3D sunDirection = sunPos.subtract(groundPointPos);
And finally the elevation angle of the Sun can be computed as:
double elevation = 0.5 * FastMath.PI - Vector3D.angle(sunDirection,
geodeticPoint.getZenith());
Now you have to convert between this elevation angle and illumination
using some
physical model.
The algorithm above does not consider atmospheric refraction. If you want to
consider it, you will also need an implementation of
AtmosphericRefractionModel
interface (Orekit provides both EarthStandardAtmosphereRefraction and
EarthITU453AtmosphereRefraction). The getRefraction() method provides the
necessary correction as a function of the elevation angle.
Considering refraction is important if you are interested in twilight, because
the refraction is important near the horizon.
best regards,
Luc
Thanks for the help!
Stephen