Sky View Café - Java

org.shetline.astronomy
Class SkyObserver

java.lang.Object
  extended by org.shetline.astronomy.SkyObserver
All Implemented Interfaces:
Cloneable, Comparable

public class SkyObserver
extends Object
implements Cloneable, Comparable


Nested Class Summary
protected static class SkyObserver.LMTZone
           
 
Field Summary
protected  boolean badTimeZone
           
protected  int cachedHashCode
           
protected  Angle cachedHourAngle
           
protected  double cacheTimeHourAngle
           
protected  String country
           
static int COUNTRY
           
protected static Pattern COUNTRY_SPECIFIER
           
static int DAYLIGHT_TIME
           
static int DEFAULT_TIME
           
protected  Ecliptic ecliptic
           
protected  double elevation
           
static int ELEVATION
           
protected  Angle latitude
           
static int LATITUDE
           
protected static TimeZone lmtProxyZone
           
static String LOCAL_MEAN_TIME
           
protected  Angle longitude
           
static int LONGITUDE
           
protected  String name
           
static int NAME
           
static int NO_DST
           
protected static Pattern OBSERVER_PATTERN
           
static int OS_BASED_DST
           
static String OS_TIME
           
protected static TimeZone osZone
           
protected  boolean questionableTimeZone
           
protected  int rank
           
static int RANK
           
protected static Pattern RANK_SPECIFIER
           
protected  double rho_cos_gcl
           
protected  double rho_sin_gcl
           
protected static Ecliptic sharedEcliptic
           
protected static SolarSystem sharedSolarSystem
           
protected  SolarSystem solarSystem
           
protected  String source
           
static int SOURCE
           
protected static Pattern SOURCE_SPECIFIER
           
static int STANDARD_TIME
           
protected static short STREAM_VERSION
           
protected  TimeDateUtil tdu
           
static int TIME_DATE_UTIL
           
static int TIME_ZONE
           
protected  TimeZone timeZone
           
static int WORLD_DST
           
 
Constructor Summary
SkyObserver()
           
SkyObserver(double longitudeDegrees, double latitudeDegrees)
           
SkyObserver(double longitudeDegrees, double latitudeDegrees, double elevation)
           
SkyObserver(double longitudeDegrees, double latitudeDegrees, double elevation, int zoneOffsetInMinutes, int dstType, int dstSubtype)
           
SkyObserver(double longitudeDegrees, double latitudeDegrees, double elevation, int zoneOffsetInMinutes, int dstType, int dstSubtype, String name)
           
SkyObserver(double longitudeDegrees, double latitudeDegrees, double elevation, int zoneOffsetInMinutes, int dstType, int dstSubtype, String name, TimeDateUtil timeDateUtil)
           
SkyObserver(double longitudeDegrees, double latitudeDegrees, double elevation, TimeZone timeZone, String name)
           
SkyObserver(double longitudeDegrees, double latitudeDegrees, double elevation, TimeZone timeZone, String name, TimeDateUtil timeDateUtil)
           
SkyObserver(double longitudeDegrees, double latitudeDegrees, int zoneOffsetInMinutes, int dstType, int dstSubtype)
           
SkyObserver(double longitudeDegrees, double latitudeDegrees, int zoneOffsetInMinutes, int dstType, int dstSubtype, String name)
           
SkyObserver(double longitudeDegrees, double latitudeDegrees, TimeZone timeZone, String name)
           
 
Method Summary
protected  Calendar calendarFromDateTime(int year, int month, int day, int hour, int minute, boolean asDST)
           
 Object clone()
           
 Object clone(boolean setFree)
           
 int compareTo(Object obj)
           
 boolean equals(Object obj)
           
 boolean equalsAsString(Object obj)
           
 SphericalPosition equatorialToHorizontal(SphericalPosition pos, double time_JDU, int flags)
           
 SphericalPosition3D equatorialToHorizontal3D(SphericalPosition3D pos, double time_JDU, int flags)
           
protected  SphericalPosition equatorialToHorizontalAux(SphericalPosition pos, double distance, double time_JDU, int flags)
           
 SphericalPosition3D equatorialTopocentricAdjustment(SphericalPosition3D pos, double time_JDE, int flags)
           
 boolean equivalentTo(SkyObserver obj)
           
 AstroEvent eventFromTime(double time_JDU)
           
 String formattedLocalTimeFromTime(double time_JDU)
           
 String formattedLocalTimeFromTime(double time_JDU, int whichFormat)
           
 void free()
           
 Angle getApparentSolarTime(double time_JDU)
           
 String getCountry()
           
 int getDSTChangeInMinutes(int year, int month)
           
 int getDSTOffset(int year, int month, int day)
           
 double getElevation()
           
 double getHorizonAltitude()
           
 Angle getLatitude()
           
 String getLatitudeString()
           
static String getLatitudeString(Angle latitude)
           
 Angle getLocalHourAngle(double time_JDU, boolean apparent)
           
 String getLocationString()
           
static String getLocationString(Angle latitude, Angle longitude)
           
 Angle getLongitude()
           
 String getLongitudeString()
           
static String getLongitudeString(Angle longitude)
           
protected static TimeZone getMatchingTimeZone(String zoneID)
           
 int getMinutesInDay(int year, int month, int day)
           
 String getName()
           
 SphericalPosition getPosition()
           
 int getRank()
           
 String getSource()
           
 TimeDateUtil getTimeDateUtil()
           
 TimeZone getTimeZone()
           
 String getTimeZoneName()
           
 String getTimeZoneName(boolean extend)
           
 int getTimeZoneOffset()
           
 double getUTAtStartOfDay(int year, int month, int day)
           
 double getUTFromLocalTime(int year, int month, int day)
           
 double getUTFromLocalTime(int year, int month, int day, int hour, int minute, double second)
           
 int hashCode()
           
 SphericalPosition horizontalToEquatorial(SphericalPosition pos, double time_JDU, int flags)
           
 boolean isBadTimeZone()
           
 boolean isDuringDST(double time_JDU)
           
 boolean isDuringDST(int year, int month, int day, int hour, int minute, boolean asDST)
           
static boolean isLMTZone(TimeZone zone)
           
static boolean isOSZone(TimeZone zone)
           
 boolean isQuestionableZone()
           
 int[] localIntTimeArrayFromTime(double time_JDU)
           
 int[] localIntTimeArrayFromTime(double time_JDU, boolean round, boolean includeSeconds)
           
 int[] localIntTimeArrayFromTime(int year, int month, int day, double hours, boolean round, boolean includeSeconds)
           
 SkyObserver modifySkyObserver(int property, double value)
           
 SkyObserver modifySkyObserver(int property, int value)
           
 SkyObserver modifySkyObserver(int property, Object value)
           
protected static SkyObserver parseOldStyleString(String ws)
           
static SkyObserver parseString(String ws)
           
protected  void syncLocalMeanTime()
           
 String toString()
           
 boolean usesDST()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_TIME

public static final int DEFAULT_TIME
See Also:
Constant Field Values

STANDARD_TIME

public static final int STANDARD_TIME
See Also:
Constant Field Values

DAYLIGHT_TIME

public static final int DAYLIGHT_TIME
See Also:
Constant Field Values

LONGITUDE

public static final int LONGITUDE
See Also:
Constant Field Values

LATITUDE

public static final int LATITUDE
See Also:
Constant Field Values

ELEVATION

public static final int ELEVATION
See Also:
Constant Field Values

TIME_ZONE

public static final int TIME_ZONE
See Also:
Constant Field Values

NAME

public static final int NAME
See Also:
Constant Field Values

TIME_DATE_UTIL

public static final int TIME_DATE_UTIL
See Also:
Constant Field Values

COUNTRY

public static final int COUNTRY
See Also:
Constant Field Values

RANK

public static final int RANK
See Also:
Constant Field Values

SOURCE

public static final int SOURCE
See Also:
Constant Field Values

LOCAL_MEAN_TIME

public static final String LOCAL_MEAN_TIME
See Also:
Constant Field Values

OS_TIME

public static final String OS_TIME
See Also:
Constant Field Values

badTimeZone

protected boolean badTimeZone

cachedHashCode

protected int cachedHashCode

country

protected String country

ecliptic

protected Ecliptic ecliptic

elevation

protected double elevation

latitude

protected Angle latitude

longitude

protected Angle longitude

name

protected String name

questionableTimeZone

protected boolean questionableTimeZone

rank

protected int rank

rho_cos_gcl

protected double rho_cos_gcl

rho_sin_gcl

protected double rho_sin_gcl

solarSystem

protected SolarSystem solarSystem

source

protected String source

tdu

protected TimeDateUtil tdu

timeZone

protected TimeZone timeZone

cachedHourAngle

protected Angle cachedHourAngle

cacheTimeHourAngle

protected double cacheTimeHourAngle

STREAM_VERSION

protected static final short STREAM_VERSION
See Also:
Constant Field Values

sharedEcliptic

protected static Ecliptic sharedEcliptic

sharedSolarSystem

protected static SolarSystem sharedSolarSystem

osZone

protected static TimeZone osZone

lmtProxyZone

protected static TimeZone lmtProxyZone

OBSERVER_PATTERN

protected static final Pattern OBSERVER_PATTERN

COUNTRY_SPECIFIER

protected static final Pattern COUNTRY_SPECIFIER

RANK_SPECIFIER

protected static final Pattern RANK_SPECIFIER

SOURCE_SPECIFIER

protected static final Pattern SOURCE_SPECIFIER

NO_DST

public static final int NO_DST
See Also:
Constant Field Values

OS_BASED_DST

public static final int OS_BASED_DST
See Also:
Constant Field Values

WORLD_DST

public static final int WORLD_DST
See Also:
Constant Field Values
Constructor Detail

SkyObserver

public SkyObserver()

SkyObserver

public SkyObserver(double longitudeDegrees,
                   double latitudeDegrees)

SkyObserver

public SkyObserver(double longitudeDegrees,
                   double latitudeDegrees,
                   double elevation)

SkyObserver

public SkyObserver(double longitudeDegrees,
                   double latitudeDegrees,
                   int zoneOffsetInMinutes,
                   int dstType,
                   int dstSubtype)

SkyObserver

public SkyObserver(double longitudeDegrees,
                   double latitudeDegrees,
                   double elevation,
                   int zoneOffsetInMinutes,
                   int dstType,
                   int dstSubtype)

SkyObserver

public SkyObserver(double longitudeDegrees,
                   double latitudeDegrees,
                   int zoneOffsetInMinutes,
                   int dstType,
                   int dstSubtype,
                   String name)

SkyObserver

public SkyObserver(double longitudeDegrees,
                   double latitudeDegrees,
                   double elevation,
                   int zoneOffsetInMinutes,
                   int dstType,
                   int dstSubtype,
                   String name)

SkyObserver

public SkyObserver(double longitudeDegrees,
                   double latitudeDegrees,
                   double elevation,
                   int zoneOffsetInMinutes,
                   int dstType,
                   int dstSubtype,
                   String name,
                   TimeDateUtil timeDateUtil)

SkyObserver

public SkyObserver(double longitudeDegrees,
                   double latitudeDegrees,
                   TimeZone timeZone,
                   String name)

SkyObserver

public SkyObserver(double longitudeDegrees,
                   double latitudeDegrees,
                   double elevation,
                   TimeZone timeZone,
                   String name)

SkyObserver

public SkyObserver(double longitudeDegrees,
                   double latitudeDegrees,
                   double elevation,
                   TimeZone timeZone,
                   String name,
                   TimeDateUtil timeDateUtil)
Method Detail

clone

public Object clone()
Overrides:
clone in class Object

clone

public Object clone(boolean setFree)

getTimeDateUtil

public TimeDateUtil getTimeDateUtil()

free

public void free()

getLongitude

public Angle getLongitude()

getLatitude

public Angle getLatitude()

getPosition

public SphericalPosition getPosition()

getElevation

public double getElevation()

getHorizonAltitude

public double getHorizonAltitude()

isBadTimeZone

public boolean isBadTimeZone()

isQuestionableZone

public boolean isQuestionableZone()

usesDST

public boolean usesDST()

getTimeZoneOffset

public int getTimeZoneOffset()

getTimeZone

public TimeZone getTimeZone()

getTimeZoneName

public String getTimeZoneName()

getTimeZoneName

public String getTimeZoneName(boolean extend)

getDSTOffset

public int getDSTOffset(int year,
                        int month,
                        int day)

getMinutesInDay

public int getMinutesInDay(int year,
                           int month,
                           int day)

isDuringDST

public boolean isDuringDST(double time_JDU)

isDuringDST

public boolean isDuringDST(int year,
                           int month,
                           int day,
                           int hour,
                           int minute,
                           boolean asDST)

getDSTChangeInMinutes

public int getDSTChangeInMinutes(int year,
                                 int month)

getName

public String getName()

calendarFromDateTime

protected Calendar calendarFromDateTime(int year,
                                        int month,
                                        int day,
                                        int hour,
                                        int minute,
                                        boolean asDST)

modifySkyObserver

public SkyObserver modifySkyObserver(int property,
                                     double value)

modifySkyObserver

public SkyObserver modifySkyObserver(int property,
                                     int value)

modifySkyObserver

public SkyObserver modifySkyObserver(int property,
                                     Object value)

getLocalHourAngle

public Angle getLocalHourAngle(double time_JDU,
                               boolean apparent)

getApparentSolarTime

public Angle getApparentSolarTime(double time_JDU)

equatorialTopocentricAdjustment

public SphericalPosition3D equatorialTopocentricAdjustment(SphericalPosition3D pos,
                                                           double time_JDE,
                                                           int flags)

equatorialToHorizontal

public SphericalPosition equatorialToHorizontal(SphericalPosition pos,
                                                double time_JDU,
                                                int flags)

equatorialToHorizontal3D

public SphericalPosition3D equatorialToHorizontal3D(SphericalPosition3D pos,
                                                    double time_JDU,
                                                    int flags)

equatorialToHorizontalAux

protected SphericalPosition equatorialToHorizontalAux(SphericalPosition pos,
                                                      double distance,
                                                      double time_JDU,
                                                      int flags)

horizontalToEquatorial

public SphericalPosition horizontalToEquatorial(SphericalPosition pos,
                                                double time_JDU,
                                                int flags)

getUTFromLocalTime

public double getUTFromLocalTime(int year,
                                 int month,
                                 int day)

getUTFromLocalTime

public double getUTFromLocalTime(int year,
                                 int month,
                                 int day,
                                 int hour,
                                 int minute,
                                 double second)

getUTAtStartOfDay

public double getUTAtStartOfDay(int year,
                                int month,
                                int day)

eventFromTime

public AstroEvent eventFromTime(double time_JDU)

localIntTimeArrayFromTime

public int[] localIntTimeArrayFromTime(double time_JDU)

localIntTimeArrayFromTime

public int[] localIntTimeArrayFromTime(double time_JDU,
                                       boolean round,
                                       boolean includeSeconds)

localIntTimeArrayFromTime

public int[] localIntTimeArrayFromTime(int year,
                                       int month,
                                       int day,
                                       double hours,
                                       boolean round,
                                       boolean includeSeconds)

formattedLocalTimeFromTime

public String formattedLocalTimeFromTime(double time_JDU)

formattedLocalTimeFromTime

public String formattedLocalTimeFromTime(double time_JDU,
                                         int whichFormat)

getLocationString

public String getLocationString()

getLocationString

public static String getLocationString(Angle latitude,
                                       Angle longitude)

getLatitudeString

public String getLatitudeString()

getLatitudeString

public static String getLatitudeString(Angle latitude)

getLongitudeString

public String getLongitudeString()

getLongitudeString

public static String getLongitudeString(Angle longitude)

getRank

public int getRank()

getCountry

public String getCountry()

getSource

public String getSource()

toString

public String toString()
Overrides:
toString in class Object

parseString

public static SkyObserver parseString(String ws)

parseOldStyleString

protected static SkyObserver parseOldStyleString(String ws)

getMatchingTimeZone

protected static TimeZone getMatchingTimeZone(String zoneID)

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equalsAsString

public boolean equalsAsString(Object obj)

equivalentTo

public boolean equivalentTo(SkyObserver obj)

compareTo

public int compareTo(Object obj)
Specified by:
compareTo in interface Comparable

syncLocalMeanTime

protected void syncLocalMeanTime()

isOSZone

public static boolean isOSZone(TimeZone zone)

isLMTZone

public static boolean isLMTZone(TimeZone zone)

Sky View Café - Java