edu.pdx.starview.calc
Class SVTime

java.lang.Object
  extended byedu.pdx.starview.calc.SVTime

public class SVTime
extends java.lang.Object

This is for doing general purpose time calculations of Julian Dates and Sidreal Times

Author:
Dave Camarillo

Constructor Summary
SVTime(java.util.Date d)
           
SVTime(double JD)
          Constructor
SVTime(int year, int month, int day, int hour, int minute, int second)
          Constructor
 
Method Summary
 int getDay()
           
 int getHour()
           
 double getJ2000Centuries()
           
 double getJD()
           
static double getJD(int year, int month, int day, int hour, int min, double sec, int offsetFromUT, int daylightSavingsTimeValue)
          Deprecated.  
 double getJulianCenturies()
           
static SVAngle getLocalSidrealTime(double julianDate, SVAngle longitude)
          TODO Make this compensate for nutation in longitude, the web page tells how to do this Note: Setting longitude to 0 (zero) will return greenwhich sidreal time http://aa.usno.navy.mil/faq/docs/GAST.html This is accurate to +/- 1.5 arcseconds
 int getMinute()
           
 double getMJD()
           
 int getMonth()
           
 int getSecond()
           
 int getYear()
           
 void setDate(int year, int month, int day, int hour, int minute, int second)
          Sets the date for this object for (as it would be for greenwhich time, not accounting for timezone or daylight savings time)
 void setJD(double JD)
          Sets the time based on the julian date specified in JD.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SVTime

public SVTime(double JD)
Constructor

Parameters:
JD - the julian date that this time represents.

SVTime

public SVTime(java.util.Date d)

SVTime

public SVTime(int year,
              int month,
              int day,
              int hour,
              int minute,
              int second)
Constructor

Parameters:
year -
month -
day -
hour -
minute -
second -
Method Detail

setJD

public void setJD(double JD)
Sets the time based on the julian date specified in JD.

Parameters:
JD - The date to set the object to.

setDate

public void setDate(int year,
                    int month,
                    int day,
                    int hour,
                    int minute,
                    int second)
Sets the date for this object for (as it would be for greenwhich time, not accounting for timezone or daylight savings time)

Parameters:
year - Year to set it to.
month - Month to set it to
day - Day to set it to
hour - Hour to set it to
minute - Minute to set it to
second - Second to set it to

getJulianCenturies

public double getJulianCenturies()
Returns:
Number of julian centuries that this time object represents.

getJ2000Centuries

public double getJ2000Centuries()
Returns:
The number of julian centuries since J2000

getMJD

public double getMJD()
Returns:
The modified julian date that this time represents.

getJD

public double getJD()
Returns:
The julian date that this time represents

toString

public java.lang.String toString()

getYear

public int getYear()

getMonth

public int getMonth()

getDay

public int getDay()

getHour

public int getHour()

getMinute

public int getMinute()

getSecond

public int getSecond()

getLocalSidrealTime

public static SVAngle getLocalSidrealTime(double julianDate,
                                          SVAngle longitude)
TODO Make this compensate for nutation in longitude, the web page tells how to do this Note: Setting longitude to 0 (zero) will return greenwhich sidreal time http://aa.usno.navy.mil/faq/docs/GAST.html This is accurate to +/- 1.5 arcseconds

Parameters:
julianDate - The julian date for the Local Side Real time that is to be calculated
longitude - The number of degrees from the prime maridian that the LST is to be calculated for
Returns:
The Local Sidreal time for that longitude, on the given julian Date

getJD

public static double getJD(int year,
                           int month,
                           int day,
                           int hour,
                           int min,
                           double sec,
                           int offsetFromUT,
                           int daylightSavingsTimeValue)
Deprecated.  

TODO make this private This will work for all AD dates in the Gregorian callendar http://scienceworld.wolfram.com/astronomy/JulianDate.html

Parameters:
year - Year of julian date
month - Month of julain date
day - Day of julian date
hour - Hour of julian date
min - Minute of julian date
sec - Second of Julian date
offsetFromUT - The time offset from UT i.e. Pacific = +8
daylightSavingsTimeValue - If daylight savings time is in affect, 1, else 0
Returns:
The julian date of the date in question.