solarGeom¶
Solar geometery
A set of methods that compute solar geometry objects. This is a Python implementation of Javier Corripio’s R-package ‘insol’. Documented here:
https://doi.org/10.1080/713811744
validated against original R-package code from Corripio
Example:
Attributes:
Todo:
-
solarGeom.
declination
(jd)[source]¶ Computes the declination of the Sun for a given Julian Day.
jd: Julian Day and decimal fraction. cat(“USAGE: declination(jd)
“)
-
solarGeom.
eqtime
(jd)[source]¶ Computes the equation of time for a given Julian Day.
jd: Julian Day and decimal fraction. cat(“USAGE: eqtime(jd)
“)
-
solarGeom.
hourangle
(jd, longitude, timezone)[source]¶ Hour angle, internal function for solar position.
jd: Julian Day and decimal fraction. latitude: Latitude of observer in degrees and decimal fraction. longitude: Longitude of observer in degrees and decimal fraction. timezone: in hours, west of Greenwich is negative eg CH is “1”
cat(“USAGE: hourangle(jd,longitude,timezone)
- julian day, degrees, hours.
- Return radians
“)
-
solarGeom.
hourangleMD
(jd, longitude, timezone, statsize, timesize)[source]¶ Hour angle, internal function for solar position.
THIS IS MLTIDIMENSIONAL VERSION LONGITUDE/TIMEZONE are vectors (of stations) not scalars
jd: Julian Day and decimal fraction. latitude: Latitude of observer in degrees and decimal fraction. longitude: Longitude of observer in degrees and decimal fraction. timezone: in hours, west of Greenwich is negative eg CH is “1”
cat(“USAGE: hourangle(jd,longitude,timezone)
- julian day, degrees, hours.
- Return radians
“)
-
solarGeom.
normalvector
(slope, aspect)[source]¶ Calculates a unit vector normal to a surface defined by slope inclination and slope orientation.
slope: slope of position in degrees aspect: aspect of position in degrees print(“USAGE: normalvector(slope,aspect)
“)
-
solarGeom.
sunpos
(sunv)[source]¶ Returns a matrix of azimuth and zenith angles of the sun given the unit vectors from the observer to the direction of the sun. Plus sun elevation.
sunv: sunvector #print(“USAGE: sunpos(sunvector) 3D vector”)
-
solarGeom.
sunposMD
(sunx, suny, sunz)[source]¶ Returns a matrix of azimuth and zenith angles of the sun given the unit vectors from the observer to the direction of the sun. Plus sun elevation.
sunv: sunvector #print(“USAGE: sunpos(sunvector) 3D vector”)
-
solarGeom.
sunvector
(jd, latitude, longitude, timezone)[source]¶ Calculates a unit vector in the direction of the sun from the observer position
jd: Julian Day and decimal fraction. latitude: Latitude of observer in degrees and decimal fraction. longitude: Longitude of observer in degrees and decimal fraction. timezone: Time zone in hours, west is negative. # cat(“USAGE: sunvector(jd,latitude,longitude,timezone)
values in jd, degrees, hours
“)
-
solarGeom.
sunvectorMD
(jd, latitude, longitude, timezone, statsize, timesize)[source]¶ Calculates a unit vector in the direction of the sun from the observer position
jd: Julian Day and decimal fraction. latitude: Latitude of observer in degrees and decimal fraction. longitude: Longitude of observer in degrees and decimal fraction. timezone: Time zone in hours, west is negative. # cat(“USAGE: sunvector(jd,latitude,longitude,timezone)
values in jd, degrees, hours
“)
-
solarGeom.
to_jd
(dt)[source]¶ dt: python dattime object Converts a given datetime object (dt) to Julian date. Algorithm is copied from https://en.wikipedia.org/wiki/Julian_day All variable names are consistentdatetime.datetime.now() with the notation on the wiki page.
cite:https://github.com/dannyzed/julian/blob/master/julian/julian.py
test : dt = datetime.datetime.now()
Parameters: - fmt –
- dt (datetime) – Datetime object to convert to MJD
- Returns –
- ------- –
- jd (float) –