JNISpice
version 2.0.0

spice.basic
Class LocalSolarTime

java.lang.Object
  extended by spice.basic.LocalSolarTime

public class LocalSolarTime
extends java.lang.Object

Class LocalSolarTime supports local solar time computations.

Particulars

This class computes the local solar time at a user specified location on a user specified body.

Let SUNLNG be the planetocentric longitude (in degrees) of the sun as viewed from the center of the body of interest.

Let SITLNG be the planetocentric longitude (in degrees) of the site for which local time is desired.

We define local time to be

   12 + (SITLNG - SUNLNG)/15
   
(where appropriate care is taken to map ( SITLNG - SUNLNG ) into the range from -180 to 180).

Using this definition, we see that from the point of view of this class, local solar time is simply a measure of angles between meridians on the surface of a body. Consequently, this class is not appropriate for computing "local times" in the sense of Pacific Standard Time. For computing times relative to standard time zones on earth, see the class TDBTime.

Regarding planetographic longitude

In the planetographic coordinate system, longitude is defined using the spin sense of the body. Longitude is positive to the west if the spin is prograde and positive to the east if the spin is retrograde. The spin sense is given by the sign of the first degree term of the time-dependent polynomial for the body's prime meridian Euler angle "W": the spin is retrograde if this term is negative and prograde otherwise. For the sun, planets, most natural satellites, and selected asteroids, the polynomial expression for W may be found in a SPICE PCK kernel.

The earth, moon, and sun are exceptions: planetographic longitude is measured positive east for these bodies.

If you wish to override the default sense of positive planetographic longitude for a particular body, you can do so by defining the kernel variable


      BODY_PGR_POSITIVE_LON
   

where represents the NAIF ID code of the body. This variable may be assigned either of the values

      'WEST'
      'EAST'
   

For example, you can have this routine treat the longitude of the earth as increasing to the west using the kernel variable assignment

      BODY399_PGR_POSITIVE_LON = 'WEST'
   

Normally such assignments are made by placing them in a text kernel and loading that kernel via KernelDatabase.load(java.lang.String).

Version 1.0.0 18-DEC-2009 (NJB)


Field Summary
static java.lang.String PLANETOCENTRIC
           
static java.lang.String PLANETOGRAPHIC
           
 
Constructor Summary
LocalSolarTime(Time time, Body body, double longitude, java.lang.String longitudeType)
          Create a local solar time instance.
 
Method Summary
 int getHour()
          Return the hour component of the local solar time.
 java.lang.String getLocalSolarTime12Hr()
          Return the local solar time as a string on a 12 hour clock.
 java.lang.String getLocalSolarTime24Hr()
          Return the local solar time as a string on 24 hour clock.
 int getMinute()
          Return the minute component of the local solar time.
 int getSecond()
          Return the second component of the local solar time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PLANETOCENTRIC

public static final java.lang.String PLANETOCENTRIC
See Also:
Constant Field Values

PLANETOGRAPHIC

public static final java.lang.String PLANETOGRAPHIC
See Also:
Constant Field Values
Constructor Detail

LocalSolarTime

public LocalSolarTime(Time time,
                      Body body,
                      double longitude,
                      java.lang.String longitudeType)
               throws SpiceException
Create a local solar time instance.

Longitude has units of radians. Longitude type must be either of

       PLANETOCENTRIC
       PLANETOGRAPHIC
   

Throws:
SpiceException
Method Detail

getLocalSolarTime24Hr

public java.lang.String getLocalSolarTime24Hr()
Return the local solar time as a string on 24 hour clock.


getLocalSolarTime12Hr

public java.lang.String getLocalSolarTime12Hr()
Return the local solar time as a string on a 12 hour clock.


getHour

public int getHour()
Return the hour component of the local solar time.


getMinute

public int getMinute()
Return the minute component of the local solar time.


getSecond

public int getSecond()
Return the second component of the local solar time.


JNISpice
version 2.0.0

JNISpice Alpha Test Version 2.0.0 28-JAN-2017 (NJB)