varwg.meteo.meteox2y.sunshine

varwg.meteo.meteox2y.sunshine(sw, date, lat=48.738, longt=9.099, in_format='%Y-%m-%dT%H:%M', tz_mer=15.0, wog=-1)[source]

sunshine or not?

calculates maximum potential solar radiation depending on latitude, longitude, and time and compares it to actual solar radiation. Sunshine if actual solar radiation > 0.4*maximum potential solar radiation accurate enough for normal non-scientific use of sunshine hour data

Parameters:
swnumpy.array of floats

solar (short wave) radiation in W/m^2

datenumpy.array of time strings

date and time in format in_format

latfloat, optional

latitude of station in decimal degrees, default: Stuttgart Lauchaecker

longtfloat, optional

longitude of station in decimal degrees, default: Stuttgart Lauchaecker

in_formattime format string, optional

format of date, default ‘%Y-%m-%dT%H:%M’

tz_merint, optional

central meridian of time zone, default: 15 (CET)

wog{-1, 1}, optional

west of greenwich, 1 if west, -1 if east, default = -1

Returns:
shiningnumpy.array containing 0 and 1

1: sun is shining in corresponding time step, 0: sun is not shining in corresponding time step

Examples

>>> sunshine(np.array([450]),np.array(["2011-09-28T11:27"]))
array([1])
>>> sunshine(np.array([200]),np.array(["2011-09-28T11:27"]))
array([0])