public class SunRelativePosition extends java.lang.Object
|
![]() |
The approximations used in these programs are very good for years between 1800 and 2100. Results should still be sufficiently accurate for the range from -1000 to 3000. Outside of this range, results will be given, but the potential for error is higher.
Modifier and Type | Field and Description |
---|---|
static double |
ASTRONOMICAL_TWILIGHT
Elevation angle of astronomical twilight, in degrees.
|
private double |
azimuth
Azimuth du soleil, en degrés dans le sens des
aiguilles d'une montre depuis le nord.
|
static double |
CIVIL_TWILIGHT
Elevation angle of civil twilight, in degrees.
|
private static double |
DARK
Valeur affectée lorsque un resultat n'est pas calculable du
fait de la nuit.
|
private static int |
DAY_MILLIS
Number of milliseconds in a day.
|
private double |
elevation
Elévation du soleil, en degrés par rapport a l'horizon.
|
(package private) double |
eqTime |
private double |
jddate |
private double |
julianDay |
private double |
latitude
Geographic coordinate where current elevation and azimuth were computed.
|
private double |
longitude
Geographic coordinate where current elevation and azimuth were computed.
|
static double |
NAUTICAL_TWILIGHT
Elevation angle of nautical twilight, in degrees.
|
private long |
noonTime
Heure à laquelle le soleil est au plus haut dans la journée en millisecondes
écoulées depuis le 1er janvier 1970.
|
(package private) double |
solarDec |
private long |
time
Date and time when the current elevation and azimuth were computed.
|
private boolean |
timeUpdated |
private double |
twilight
Sun's elevation angle at twilight, in degrees.
|
private boolean |
updated
true is the elevation and azimuth are computed, or false
if they need to be computed. |
Constructor and Description |
---|
SunRelativePosition()
Constructs a sun relative position calculator.
|
SunRelativePosition(double twilight)
Constructs a sun relative position calculator with the specified value
for the sun elevation at twilight.
|
Modifier and Type | Method and Description |
---|---|
private void |
compute()
Calculates solar position for the current date, time and location.
|
private static double |
eccentricityEarthOrbit(double t)
Calculate the eccentricity of earth's orbit.
|
private static double |
equationOfTime(double t)
Calculate the difference between true solar time and mean.
|
double |
getAzimuth()
Retourne l'azimuth en degrés.
|
java.awt.geom.Point2D |
getCoordinate()
|
static void |
getCosSolarZenith(float[] longitudes,
float[] latitudes,
java.util.Date dateTime,
visad.FlatField output) |
java.util.Date |
getDate()
|
double |
getElevation()
Retourne l'élévation en degrés.
|
java.util.Date |
getNoonDate()
Retourne la date à laquelle le soleil est au plus haut dans la journée.
|
long |
getNoonTime()
Retourne l'heure à laquelle le soleil est au plus haut.
|
double |
getSolarZenith() |
static void |
getSolarZenith(float[] longitudes,
float[] latitudes,
java.util.Date dateTime,
visad.FlatField output) |
static float[] |
getSolarZenith(float[] longitudes,
float[] latitudes,
java.util.Date dateTime,
float[] solzen) |
double |
getTwilight()
Returns the sun's elevation angle at twilight, in degrees.
|
static void |
main(java.lang.String[] args)
Affiche la position du soleil à la date et coordonnées spécifiée.
|
private static double |
meanObliquityOfEcliptic(double t)
Calculate the mean obliquity of the ecliptic.
|
private static double |
obliquityCorrected(double t)
Calculate the corrected obliquity of the ecliptic.
|
private static double |
refractionCorrection(double zenith)
Computes the refraction correction angle.
|
void |
setCoordinate(double longitude,
double latitude)
|
void |
setCoordinate(java.awt.geom.Point2D point)
|
void |
setDate(java.util.Date date)
|
void |
setTwilight(double twilight)
Set the sun's elevation angle at twilight, in degrees.
|
private static double |
solarNoonTime(double lon,
double eqTime)
Calculate the Universal Coordinated Time (UTC) of solar noon for the given day
at the given location on earth.
|
private static double |
sunApparentLongitude(double t)
Calculate the apparent longitude of the sun.
|
private static double |
sunDeclination(double t)
Calculate the declination of the sun.
|
private static double |
sunEquationOfCenter(double t)
Calculate the equation of center for the sun.
|
private static double |
sunGeometricMeanAnomaly(double t)
Calculate the Geometric Mean Anomaly of the Sun.
|
private static double |
sunGeometricMeanLongitude(double t)
Calculate the Geometric Mean Longitude of the Sun.
|
private static double |
sunRadiusVector(double t)
Calculate the distance to the sun in Astronomical Units (AU).
|
private static double |
sunRightAscension(double t)
Calculate the right ascension of the sun.
|
private static double |
sunTrueAnomaly(double t)
Calculate the true anamoly of the sun.
|
private static double |
sunTrueLongitude(double t)
Calculate the true longitude of the sun.
|
private static final int DAY_MILLIS
private static final double DARK
elevation
et azimuth
.public static final double ASTRONOMICAL_TWILIGHT
public static final double NAUTICAL_TWILIGHT
public static final double CIVIL_TWILIGHT
private double twilight
CIVIL_TWILIGHT
.private long noonTime
private double azimuth
private double elevation
private double latitude
private double longitude
private long time
private double julianDay
private double jddate
double solarDec
double eqTime
private boolean timeUpdated
private boolean updated
true
is the elevation and azimuth are computed, or false
if they need to be computed. This flag is set to false
when the date
and/or the coordinate change.public SunRelativePosition()
public SunRelativePosition(double twilight) throws java.lang.IllegalArgumentException
twilight
- The new sun elevation at twilight, or Double.NaN
if no twilight value should be taken in account.java.lang.IllegalArgumentException
- if the twilight value is illegal.private static double sunEquationOfCenter(double t)
t
- number of Julian centuries since J2000.private static double sunGeometricMeanLongitude(double t)
t
- number of Julian centuries since J2000.private static double sunTrueLongitude(double t)
t
- number of Julian centuries since J2000.private static double sunApparentLongitude(double t)
t
- number of Julian centuries since J2000.private static double sunGeometricMeanAnomaly(double t)
t
- number of Julian centuries since J2000.private static double sunTrueAnomaly(double t)
t
- number of Julian centuries since J2000.private static double eccentricityEarthOrbit(double t)
(a-b)/a
where a is the semi-major axis
length and b is the semi-minor axis length. Value
is 0 for a circular orbit.t
- number of Julian centuries since J2000.private static double sunRadiusVector(double t)
t
- number of Julian centuries since J2000.private static double meanObliquityOfEcliptic(double t)
t
- number of Julian centuries since J2000.private static double obliquityCorrected(double t)
t
- number of Julian centuries since J2000.private static double sunRightAscension(double t)
t
- number of Julian centuries since J2000.private static double sunDeclination(double t)
t
- number of Julian centuries since J2000.private static double solarNoonTime(double lon, double eqTime)
lon
- longitude of observer in degrees.eqTime
- Equation of time.private static double equationOfTime(double t)
t
- number of Julian centuries since J2000.private static double refractionCorrection(double zenith)
zenith
- The sun zenith angle in degrees.private void compute()
public void setCoordinate(double longitude, double latitude)
longitude
- The longitude in degrees. Positive values are East; negative values are West.latitude
- The latitude in degrees. Positive values are North, negative values are South.public void setCoordinate(java.awt.geom.Point2D point)
point
- The geographic coordinates in degrees of longitude and latitude.public java.awt.geom.Point2D getCoordinate()
setCoordinate(...)
method.public void setDate(java.util.Date date)
date
- The date and time.public java.util.Date getDate()
setDate(java.util.Date)
.public void setTwilight(double twilight) throws java.lang.IllegalArgumentException
CIVIL_TWILIGHT
.twilight
- The new sun elevation at twilight, or Double.NaN
if no twilight value should be taken in account.java.lang.IllegalArgumentException
- if the twilight value is illegal.public double getTwilight()
setTwilight(double)
.public double getAzimuth()
public double getElevation()
public double getSolarZenith()
public long getNoonTime()
public java.util.Date getNoonDate()
getNoonTime()
mais inclue le jour
de la date qui avait été spécifiée à la méthode compute()
.public static void getCosSolarZenith(float[] longitudes, float[] latitudes, java.util.Date dateTime, visad.FlatField output) throws java.lang.Exception
longitudes
- float[] of degreeslatitudes
- float[] of degreesdateTime
- java.util.Dateoutput
- FlatField of which computed angles (degrees) will be written into the rangejava.lang.Exception
public static void getSolarZenith(float[] longitudes, float[] latitudes, java.util.Date dateTime, visad.FlatField output) throws java.lang.Exception
longitudes
- float[] of degreeslatitudes
- float[] of degreesdateTime
- java.util.Dateoutput
- FlatField of which computed angles (degrees) will be written into the rangejava.lang.Exception
public static float[] getSolarZenith(float[] longitudes, float[] latitudes, java.util.Date dateTime, float[] solzen) throws java.lang.Exception
longitudes
- float[] of degreeslatitudes
- float[] of degreesdateTime
- java.util.Datesolzen
- float[] of computed solar zenith angle (degrees). If null, array will be allocated.java.lang.Exception
public static void main(java.lang.String[] args) throws java.text.ParseException
SunRelativePosition [longitude] [latitude] [date]où date est un argument optionel spécifiant la date et l'heure. Si cet argument est omis, la date et heure actuelles seront utilisées.
java.text.ParseException