0% found this document useful (0 votes)
2 views

algorithm for sunshine duration v0906

The document outlines an algorithm for estimating sunshine hours from pyranometer data, as approved by the World Meteorological Organization (WMO). It discusses the transition from traditional sunshine recorders to modern pyranometers and presents a method for calculating sunshine duration based on global solar radiation measurements. The report includes a detailed explanation of the algorithm, potential solar radiation calculations, and an example program for implementation in a CR1000 datalogger.

Uploaded by

mosesgula84
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

algorithm for sunshine duration v0906

The document outlines an algorithm for estimating sunshine hours from pyranometer data, as approved by the World Meteorological Organization (WMO). It discusses the transition from traditional sunshine recorders to modern pyranometers and presents a method for calculating sunshine duration based on global solar radiation measurements. The report includes a detailed explanation of the algorithm, potential solar radiation calculations, and an example program for implementation in a CR1000 datalogger.

Uploaded by

mosesgula84
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

sunshine hours

from pyranometer
data v0906
according to WMO

algorithm for sunshine duration v0906.doc

Edited & Copyright by:

Hukseflux Thermal Sensors


http://www.hukseflux.com
e-mail: [email protected]
Hukseflux Thermal Sensors

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

sunshine hours from pyranometer data v0906 2/14


Hukseflux Thermal Sensors

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.

Traditionally the measurement of sunshine duration has been performed using


a Campbell-Stokes recorder, which consists of a glass sphere with a piece of
card held at a defined distance behind the glass. The card is graduated with
time intervals which match the movement of the image of the sun as it tracks
across the sky. If the sun is strong enough then the focused beam carbonizes
the card leaving a trace. The length of the trace equates to sunshine duration.
However, reading the cards always involves a degree of subjectivity and the
design does not lend itself to automation. Also the measurement is reported
to be sensitive to wind.

A relatively recent formal definition of sunshine duration by the World


Meteorological Organisation [1] has allowed the development of automatic
instruments for measuring sunshine hours. This defines sunshine hours as
‘the sum of the time intervals (in hours) during which the direct (normal)
solar irradiance exceeds a threshold of 120 Wm-2 ’.

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.

sunshine hours from pyranometer data v0906 3/14


Hukseflux Thermal Sensors

An alternative algorithm has recently been suggested by workers at the Royal


Dutch Meteorological Institute (KNMI) [2]. They have proposed and tested
several algorithms which define sunshine by means of comparing the 10-
minute mean measured global radiation (G) with the potential solar radiation
outside the earth’s atmosphere on a horizontal surface (G 0).
One long term test of these algorithms showed that estimates of sunshine
hours were typical within 0.5-0.7 hours of the daily total.

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.

sunshine hours from pyranometer data v0906 4/14


Hukseflux Thermal Sensors

2 Estimating potential solar


radiation
The solar radiation outside the earth’s atmosphere is well defined and is
known as the solar constant. This constant varies slightly over the year due to
the ecliptic orbit of the earth around the sun. The accepted average value is
1366 Wm-2. This radiation is for a surface normal to the sun’s rays, as
opposed to the horizontal exposure of a pyranometer. The potential solar
radiation (G0) on a horizontal surface outside the earth’s atmosphere is
calculated in W.m-2 from:

G0 = 1366 (r/r0)² cos(θz) (1)

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:

Cos(θz) = sin(dec)sin(lat) + cos(dec)cos(lat)cos(ha) (2)

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.

The time since noon 1 January 2000 is calculated from:

Time = 365*year + days + (hours + GMTdif + minutes/60 +


seconds/3600)/24 + leap – 730013.5 (3)

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:

Tan(ra) = cos(EcOblq)sin(EcLon)/cos(Eclon) (4)


Sin(dec) = sin(EcOblq)sin(EcLon) (5)

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:

sunshine hours from pyranometer data v0906 5/14


Hukseflux Thermal Sensors

LMST = GMST – lon/15 (6)

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:

r/r0 = 1.00014 – 0.01671*cos(MnAnom) – 0.00014*cos(2*MnAnom) (8)

Where MnAnom is the mean anomaly.

sunshine hours from pyranometer data v0906 6/14


Hukseflux Thermal Sensors

3 Totalising sunshine hours


Using the above equations G0 can be calculated at any instant. The program
example that follows shows how these equations can be entered in a CR1000
datalogger program.

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.

To overcome this problem an additional refinement can be made to ignore


‘sunshine’ when the elevation is very low. In the program below, this is
incorporated by setting a limit to the elevation angle to and from where
sunshine can be measured. The exact cut-off point is, however, a subjective
decision. For instance, you may choose to ignore readings if the site layout
prevents the sensor ‘seeing’ the direct beam at low elevations. It is
recommended to set this angle to at least 5 degrees.

sunshine hours from pyranometer data v0906 7/14


Hukseflux Thermal Sensors

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.1 Comparison of calculated sunshine hours per day with a


pyranometer and measured sunshine hours per day with a pyrheliometer in
the period between 12 September and 12 October 2009.

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.

sunshine hours from pyranometer data v0906 8/14


Hukseflux Thermal Sensors

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.

sunshine hours from pyranometer data v0906 9/14


Hukseflux Thermal Sensors

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.

'CR1000 Series Datalogger

'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:

Public Sensitivity 'sensitivity pyranometer in uV/W.m^-2


Public Lat 'latitude in degrees (north of equator is positive)
Public Lon 'longitude in degrees (west of Greenwich is positive)
Public GMT_dif 'difference with GMT (wintertime) in hours (west of
Greenwich is positive)
Public Limit 'limit angle with the horizontal from and to where the
measurements could count as sunshine

'Note: the clock of the datalogger needs to be correct, because it is the time
input.
'================================================

'Correlation algorithm constants (can be changed on own discretion)


Const Lower1 = 0.4
Const Upper1 = 0.5
Const Lower2 = 0.45
Const Upper2 = 0.6

'Declare Public Variables and Units


Public Batt_Volt, raw
Public Clock(9), GMT, Leap, Time
Public MnLon, MnAnom, Eclon, OblqEc, Num, Den, Ra, Dec, GMST, LMST, Ha,
El, Latrad, Refrac, Zenith
Public mu0, EarthSun, G0, GoverG0, Fraction, FracTen, FracHour, FracDay

Units Batt_Volt = V
Units raw = mV
Units FracTen = min/10min
Units FracHour = min/hour
Units FracDay = hour/day

sunshine hours from pyranometer data v0906 10/14


Hukseflux Thermal Sensors

'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

'Constants for solar time/location equations


Const C1 = 280.463 'This constant varies by +/- 0.004 per year, but does
Const C2 = .9856474 not change the final values greatly
Const C3 = 357.528
Const C4 = .9856003
Const C5 = 1.915
Const C6 = 23.44
Const C7 = .0000004
Const C8 = 6.697375
Const C9 = .0657098242
Const C10 = .02

'Constants for refraction equation


Const EC1 = -.56
Const EC2 = 3.51561
Const EC3 = .1594
Const EC4 = .0196
Const EC5 = .00002
Const EC6 = .505
Const EC7 = .0845

'Constants for Earth-Sun distance equation


Const ES1 = 1.00014
Const ES2 = 0.01671
Const ES3 = 0.00014

'Solar constant
Const I0 = 1366

sunshine hours from pyranometer data v0906 11/14


Hukseflux Thermal Sensors

'Define Data Tables


DataTable (Rawdata,True,-1) 'Rawdata gives every minute the data
DataInterval (0,1,Min,10) output of the pyranometer in mV
Sample (1,raw,FP2)
EndTable

DataTable (Voltage,True,-1) 'Voltage gives every day the minimum


DataInterval (0,1440,Min,10) battery voltage
Minimum (1,Batt_Volt,FP2,False,False)
EndTable

DataTable (SD10min,True,-1) 'SD10min gives every 10 minutes the


DataInterval (0,10,Min,10) sunshine duration in min/10min for the
Average (1,FracTen,FP2,0) last 10 minutes
EndTable

DataTable (SDhour,True,-1) 'SDhour gives every hour the sunshine


DataInterval (0,60,Min,10) duration in min/hour for the last hour
Average (1,FracHour,FP2,0)
EndTable

DataTable (SDday,True,-1) 'SDday gives every day the sunshine


DataInterval (0,1440,Min,10) duration in hours/day for the last day
Average (1,FracDay,FP2,0)
EndTable

'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

'Get the current time from the datalogger


RealTime (Clock) 'This returns an array with year, month, day, hour, minute,
second, microsecond, day of week, and day of year

'Calculate the time in days since noon 1 jan 2000


Leap = FIX ((Clock(1) - 1949)/4)
GMT = Clock(4) + Clock(5)/60 + Clock(6)/3600 + GMT_dif
Time = 365*Clock(1) + Clock(9) + (GMT)/24 + Leap - 730013.5

'Mean longitude between 0 and 360 degrees


MnLon = C1 + C2*Time
MnLon = MnLon MOD 360

'Mean anomaly in radians between 0 and 2*Pi


MnAnom = C3 + C4*Time
MnAnom = MnAnom MOD 360
MnAnom = MnAnom*ToRad

sunshine hours from pyranometer data v0906 12/14


Hukseflux Thermal Sensors

'Compute ecliptic longitude and obliquity of ecliptic in radians


EcLon = MnLon + C5*SIN(MnAnom) + C10*SIN(2*MnAnom)
EcLon = EcLon MOD 360
OblqEc = C6 - C7*Time
EcLon = EcLon*ToRad
OblqEc = OblqEc*ToRad

'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 declination in radians


Dec = ASIN(SIN(OblqEc)*SIN(EcLon))

'Calculate Greenwich mean sidereal time in hours


GMST = C8 + C9*Time + GMT
GMST = GMST MOD 24

'Calculate local mean sidereal time in radians


LMST = GMST - Lon/15
LMST = LMST MOD 24
LMST = LMST*15*ToRad

'Calculate hour angle in radians between -Pi and Pi


Ha = LMST - Ra
If Ha < -pi Then Ha = Ha + 2*pi
If Ha > pi Then Ha = Ha - 2*pi

'Calculate elevation
Latrad = Lat*ToRad
El = ASIN(SIN(Dec)*SIN(Latrad) + COS(Dec)*COS(Latrad)*COS(Ha))

'Calculate refraction correction for US standard atmosphere


El = El*ToDeg
If El > EC1 Then
Refrac = EC2*(EC3 + EC4*El + EC5*El*El)
Refrac = Refrac/(1 + EC6*El + EC7*El*El)
Else
Refrac = -EC1
EndIf

sunshine hours from pyranometer data v0906 13/14


Hukseflux Thermal Sensors

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 radiation on a horizontal plane outside the atmosphere (G0)


G0 = mu0*EarthSun*EarthSun*I0

'Calculate which percentage of G0 is reached with the measurement


GoverG0 = raw*1000/(Sensitivity*G0)

'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

'Neglect the measurements for small angles up to the given limit


If El > Limit Then Fraction = 0

'Calculate products of the fraction for the different averages


FracTen = 10*Fraction
FracHour = 60*Fraction
FracDay = 24*Fraction

'Call Datatables
CallTable Rawdata
CallTable Voltage
CallTable SD10min
CallTable SDhour
CallTable SDday

NextScan
EndProg

sunshine hours from pyranometer data v0906 14/14

You might also like