SolarPosition (Solar Position)

The SolarPosition instruction is used to calculate solar position from program inputs.

Syntax

SolarPosition ( Dest, TimeArray, TimeOffset, Latitude, Longitude, Altitude, Pressure, AirTemp )

Remarks

The SolarPosition instruction makes use of the Solpos algorithm developed by the National Renewable Energy Laboratory (NREL). The instruction has a minimum uncertainty of 0.01 degrees in both the zenith and azimuth angles. This level of accuracy is more than adequate for most engineering applications.

The instruction returns five elements into the Destination (Dest) array: 

The output from SolarPosition can also be used to calculate the following parameters for the site:

The HourAngle is a negative number in the morning before solar noon; it is positive in the afternoon after solar noon. HourAngle can be used to calculate Local Solar Noon as well as sunrise and sunset time for the location. The example program includes these calculations.

Parameters

Dest (Destination)

The variable array in which the results of the instruction will be written. Dest must be dimensioned to 5 or a compilation error will occur. The following 5 values are returned:

TimeArray (Time Array)

A variable array dimensioned to 9 that holds the following values:  (1) year, (2) month, (3) day of month, (4) hour of day, (5) minutes, (6) seconds, (7) microseconds, (8) day of week (1-7; Sunday = 1), and (9) day of year. These values can be derived from the RealTime instruction. If TimeArray is not dimensioned to 9, a compilation error will occur.

Type: Variable array

TimeOffset (Time Offset)

The local time offset, in seconds, from UTC. The TimeOffset parameter is ignored if the "UTC Offset" setting in the datalogger is a value other than -1 (disabled). In other words, the UTCOffset setting in the datalogger overrides this instruction parameter. The UTCOffset setting can be found in the Settings table. For more information, see Settings Available Using SetSetting

NOTE: For the GPS() instruction, in order to use GPS coordinates without setting the datalogger clock, set the TimeOffset parameter to -1.

Type: Constant

Latitude

A constant or variable that provides the latitude for the datalogger station. The range for Latitude is 0 to ±90 (positive value for Northern hemisphere and negative value for Southern hemisphere).

Type: Constant or variable

Longitude

A constant or variable that provides the longitude for the datalogger station, expressed in decimal degrees east of the Greenwich meridian. For longitudes measured going west from the Greenwich meridian, a negative value can be entered or a corrected value (360 – WestDegrees) can be used. For example, Tokyo, Japan has a longitude of 220.3 when measured going west. This could be entered as -220.3, or the corrected longitude value of 139.7 degrees East could be used.

Type: Constant or variable

Altitude

A constant or variable that provides the altitude above sea level for the datalogger station. This value must be in meters.

Type: Constant or variable

Pressure (Atmospheric Pressure)

The variable that holds the local annual average barometric pressure (not current measurement) in millibars, that will be used in calculating the solar position. If Pressure is defined as -1, AirTemp will be used to calculate an estimate of barometric pressure.

Type: Variable or constant

AirTemp (Air Temperature)

The variable that holds a temperature measurement in degrees C that will be used in calcuating the solar position.

NANs may occur in the output array for Zenith angles if a temperature measurement is not used. If temperature is unavailable, consider using the datalogger's panel temperature (though this may affect accuracy of the instruction).

Type: Variable