[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orekit Users] Surface Illumination

The elevation and sun direction math is pretty straightforward; it was the physical model stuff I was hoping Orekit had available. The atmospheric refraction isn't entirely necessary but good to know about.

Is there a specific physical model that I should be looking for or is a phong-like illumination function adequate? I'm only looking for a way to imitate the following: http://facweb.bhc.edu/academics/science/harwoodr/geog101/study/Images/SubsolarPoint.jpg but with a mostly-accurate model for how bright or dim the surface is at a given location.

Thanks for the input!

On Tue, Jul 12, 2016 at 10:04 AM, MAISONOBE Luc <luc.maisonobe@c-s.fr> wrote:

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,

Thanks for the help!