algorithm for sunshine duration v0906
algorithm for sunshine duration v0906
from pyranometer
data v0906
according to WMO
Contents
1 Introduction..................................................................................... 3
2 Estimating potential solar radiation..................................................5
3 Totalising sunshine hours.................................................................7
4 Results............................................................................................. 8
5 References....................................................................................... 9
6 Example program........................................................................... 10
1 Introduction
For many years sunshine hours have been recorded using manually operated
meteorological instruments, for example the Campbell-Stokes sunshine
recorder. This measurement was originally developed as a means of recording
integrated global solar radiation, before the advent of electronics. By using
modern instruments and datalogging systems, there are now more
appropriate ways of recording global solar radiation. Nowadays pyranometers
or combinations of pyranometers, trackers and pyrheliometers are used for
this. However, because there is an archive of historical sunshine data,
and also because sunshine hours are now commonly used as a measure which
the public can relate to (normally in weather forecasts and tourist brochures),
there is a requirement to continue making these measurements.
The most complex (and most accurate) of instruments that are suitable to
perform this measurement are tracking pyrheliometers, where a collimated
sensor automatically moves to track the movement of the sun. This reads the
direct beam radiation only. Any reading over 120 Wm-2 is defined as being
sunshine.
Other motorised sensors have been developed which, rather than tracking the
sun, have quickly rotating shade bands. These sensors detect the direct beam
component of radiation by measuring the maximum difference in measured
radiation as the shade band rotates. However, as this type of sensor does not
truly track the sun it requires regular adjustment to take into account the
seasonal changes in solar declination. In particular this instrument is quite
sensitive to the exact directional response of the detector.
Both of the above types of sensor are relatively expensive and have moving
parts requiring extra power. An alternative technique which does not involve
any moving parts is to estimate sunshine hours from a single pyranometer of
the type normally installed on most weather stations. As these sensors
measure total global radiation the normal definition of ‘sunshine’ cannot be
used. Simple fixed thresholds, as often used in low grade weather stations, do
not give reliable answers either, as diffuse radiation from a completely cloudy
sky in the summer will often exceed direct beam radiation in the winter.
Figure 1.1 The WMO Guide has now approved of this method, as expressed in
Chapter 8 of the Guide to Instruments and observation, 2008, as
“pyranometric method”, according to annex to chapter 8 “algorithm to
estimate sunshine duration from direct global irradiance measurements”.
While this might appear to give rather poor accuracy compared to that one
would expect for totalized solar radiation, they consider it accurate enough.
The justification is in the fact that the historical records are made by
inaccurate sensors anyhow, and that the WMO limit of 120 Wm -2 does not
represent an accurate transition to this historical record. In addition the
parameter “sunshine hours” does not represent any meteorologically
meaningful or physically meaningful parameter, so the priority of getting an
accurate measurement is low. Scientific use of the sunshine hour data is not
recommended. Using a pyranometer as a sunshine direction sensor, it can
also be used to make accurate solar irradiance measurements, and
scientifically meaningful data can be collected at the same time.
This report has been made by Hukseflux, using the text of Campbell Scientific
application note 18 for CR10X, as well as the KNMI report.
The remainder of this report describes how the direct correlation algorithm,
proposed by the KNMI, might be programmed into the Campbell Scientific
datalogger CR1000.
Where r and r0 are the actual and mean earth-sun distance, respectively, and
θz the zenith angle of the sun. Cos(θz) is computed from:
Where dec is the solar declination angle, lat is the latitude of the site (north of
equator is positive) and ha is the hour angle of the sun. For the calculation of
the solar declination and hour angle the solar position algorithm of Michalsky
[3] is used. The date (daynumber), Greenwich Mean Time (GMT), longitude
and latitude for each measurement are needed as input parameters. This
algorithm uses the position of the sun at noon 1 January 2000 as a reference
point. From this point it calculates the position of the sun in different
coordinate systems.
Where year, days, hours, minutes and seconds are the local date and time
(days are the number of days in this year, e.g., 1 feb = 32). GMTdif is the
difference with the GMT wintertime in hours, where west of Greenwich is
positive. Leap is the number of leap days since 1949, calculated as the integer
portion of ((year-1949)/4).
With this time the mean longitude, mean anomaly, ecliptic longitude and
obliquity of the ecliptic can be calculated. The solar right ascension and
declination are calculated from:
Where ra is the solar right ascension, EcOblq is the obliquity of the ecliptic,
and EcLon is the ecliptic longitude.
For calculation of the hour angle, the local mean sidereal time should be
known. The Greenwich mean sidereal time can be computed from the time
since noon 1 january 2000, from which the local mean sidereal time can be
computed:
Where LMST and GMST are the local and Greenwich mean sidereal time,
respectively, and lon is the longitude of the site (west of Greenwich is
positive). The hour angle can now be computed from:
Ha = LMST - ra (7)
Due to the refracting atmosphere the zenith angle is slightly different then
now calculated. The corrections for the refraction are calculated for the U.S.
standard atmosphere on the elevation angle φ (φ = 90 – θz). The U.S.
standard atmosphere model is the same as the international standard
atmosphere model for altitudes up to 32 km.
The ratio between the actual and mean earth-sun distance are computed from
the mean anomaly:
To totalise sunshine hours per day or minutes per hour the program compares
the current solar radiation with the current value of G0. The correlation
algorithm, suggested by the KNMI, discriminates the situations where cos(θ z)
is greater and smaller than 0,3. For each situation there are two limits for the
ratio between the measured radiation and G 0. One where a ratio below this
limit gives a zero fraction of sunshine and one where a ratio above this limit
gives a fraction of one. The fraction of sunshine between these limits follows a
linear function. The limits for the ratio between the measured radiation and G 0
chosen by the KNMI and used in this algorithm are 0.4 and 0.5 for
cos(θz)<0,3 and 0.45 and 0.6 for cos(θz)>0,3. For every scan the fraction of
sunshine can be determined and can be averaged over days, hours or any
other time interval.
One of the limitations in the above theory is that G 0 can become very small at
low sun angles when the radiation is low. However, most radiation sensors
used do not have a perfect cosine response (in other words a large directional
error) to variations in sun angle especially at low elevation angles. They can
also suffer from zero offsets (especially when temperature is changing rapidly
as it can do at dawn and dusk). Furthermore errors in leveling the sensor can
cause proportionally large errors in the estimate of solar radiation at low
angles. This makes this technique subject to large errors at low solar
elevations.
4 Results
The above proposed algorithm is used to calculate the sunshine hours per day
on the roof of the Hukseflux building in Delft with a pyranometer. The
pyrheliometer next to the pyranometer is used as a reference measurement.
In the figures 1 and 2 the results of these measurements in the period
between 12 September and 12 October 2009 are shown.
Figure 4.2 Pyranometer calculations of sunshine hours per day versus the
pyrheliometer measured sunshine hours per day. The dotted line shows the
linear regression of the pyranometer calculations. The green line shows the
desired one-to-one relation.
5 References
[1] C. Frohlich and J. London, 1986, Revised instruction manual on radiation
instruments and measurements, WMO/TD-No. 149, Geneva Switzerland.
[2] Y.B.L. Hinssen and W.H. Knap, 2007, Comparison of Pyranometric and
Pyrheliometric Methods for the Determination of Sunshine Duration, Journal of
atmospheric and oceanic technology, Vol. 24, pp 835-846.
[3] J.J. Michalsky, 1988, The astronomical almanac’s algorithm for
approximate solar position (1950-2050), Solar Energy, Vol. 40, No. 3, pp
227-235.
Acknowledgements
Part of the theory and text used in this report was originally produced by
Campbell Scientific.
6 Example program
WARNING: The user must input the “input parameters” for every
individual station. The latitude, longitude and difference with GMT
(wintertime) are different from station to station. In the rare cases that the
station is not running GMT time, but local time which is also corrected for
wintertime/summertime, the difference with GMT should be changed along
with the change from summertime to wintertime and wintertime to
summertime.
'Note: Because this program averages over certain periods (10 minutes,
hours and days), it will give wrong data for the first measurement of each
period (it extrapolates the measured fraction, e.g., if you start your
measurements at 6 minutes before 1 o'clock and you measure 4 minutes of
sunshine, the datatable SDhour gives 40 min/hour as the measurement at 1
o'clock)
'================================================
'Input parameters:
'Note: the clock of the datalogger needs to be correct, because it is the time
input.
'================================================
Units Batt_Volt = V
Units raw = mV
Units FracTen = min/10min
Units FracHour = min/hour
Units FracDay = hour/day
'Constant numbers
Const pi = 2*ACOS(0)
Const ToRad = pi/180 'Conversion from degrees to radians
Const ToDeg = 180/pi 'Conversion from radians to degrees
'Solar constant
Const I0 = 1366
'Main Program
BeginProg
Scan (1,Sec,1,0)
Battery (Batt_volt)
VoltDiff (raw,1,mV25,1,True,0,_50Hz,1,0)
If raw < 0 Then raw = 0 'All negative voltagemeasurements are set to zero
'Calculate right ascension and use the numerator and denominator to get it
between 0 and 2*Pi
Num = COS(OblqEc)*SIN(EcLon)
Den = COS(Eclon)
Ra = ATN(Num/Den)
If Den < 0 Then
Ra = Ra + pi
ElseIf Num < 0 Then
Ra = Ra + 2*pi
EndIf
'Calculate elevation
Latrad = Lat*ToRad
El = ASIN(SIN(Dec)*SIN(Latrad) + COS(Dec)*COS(Latrad)*COS(Ha))
El = El + Refrac
'Elevation is now in degrees
'Solar zenith angle in degrees and mu0 (the cosine of the zenith angle)
Zenith = (90 - El)
mu0 = COS(Zenith*ToRad)
'Calculate the ratio between the actual and mean earth-sun distance
EarthSun = ES1 - ES2*COS(MnAnom) - ES3*COS(2*MnAnom)
'Calculate the fraction sunlight (different values for small and large angles)
If mu0 < 0.3 Then
If GoverG0 < Lower1 Then
Fraction = 0
ElseIf GoverG0 >= Lower1 AND GoverG0 <= Upper1 Then
Fraction = (GoverG0 - Lower1)/(Upper1 - Lower1)
ElseIf GoverG0 > Upper1 Then
Fraction = 1
EndIf
EndIf
If mu0 >= 0.3 Then
If GoverG0 < Lower2 Then
Fraction = 0
ElseIf GoverG0 >= Lower2 AND GoverG0 <= Upper2 Then
Fraction = (GoverG0 - Lower2)/(Upper2 - Lower2)
ElseIf GoverG0 > Upper2 Then
Fraction = 1
EndIf
EndIf
'Call Datatables
CallTable Rawdata
CallTable Voltage
CallTable SD10min
CallTable SDhour
CallTable SDday
NextScan
EndProg