Module JNISpice
Package spice.basic

Class 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&ltbody ID&gt_PGR_POSITIVE_LON
       

    where &ltbody ID&gt 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

      Fields 
      Modifier and Type Field Description
      (package private) java.lang.String ampm  
      (package private) int hour  
      (package private) java.lang.String localSolarTime  
      (package private) int minute  
      static java.lang.String PLANETOCENTRIC  
      static java.lang.String PLANETOGRAPHIC  
      (package private) int second  
    • Constructor Summary

      Constructors 
      Constructor Description
      LocalSolarTime​(Time time, Body body, double longitude, java.lang.String longitudeType)
      Create a local solar time instance.
    • Method Summary

      Modifier and Type Method Description
      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

      • hour

        int hour
      • minute

        int minute
      • second

        int second
      • localSolarTime

        java.lang.String localSolarTime
      • ampm

        java.lang.String ampm
    • 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
           
        Parameters:
        time - Time
        longitudeType - String
        body - Body
        longitude - double
        Throws:
        SpiceException - exception exeption
    • Method Detail

      • getLocalSolarTime24Hr

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

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

        public int getHour()
        Return the hour component of the local solar time.
        Returns:
        int
      • getMinute

        public int getMinute()
        Return the minute component of the local solar time.
        Returns:
        int
      • getSecond

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