Hi there!
I need a help.
is that possible to add sushine per day to a program via CRBasic?
If yess how to do? Please send an example.
Thank you
Regards
OJ
Hello OJ,
I apologize for not getting back with you a few months ago, but the answer to your question is yes. Do you still need an example program?
Best,
OJ,
Check out ShortCut it has an option to write code for sunshine hours. The option is located under the 'Calculations' section.
Best,
Thank you Karl.
i did it through a crbasic code, do you still need it?
You can use ShortCut or CRBasic, either works. I would test the code to make sure it is working as expected - sometimes testing extremes are good tests.
Yes I do need it.
do you have a step by step or video showing how to add this functionality to a working program?
Thank you
regards
OJ
Hi,
Here you have an example:
RealTime(RTime(1))
'Calculate solar position
SolarPosition(SolPos(),RTime(),1*3600,your latitude,your longitude,0,BP_mbar,AirTC)
'Calculate potential radiation for time & position (multiply sine of solar elevation angle by solar constant 1373)
PotSlrW=SIN(SunElevation)*1373
If PotSlrW<0 Then PotSlrW=0
'If the measured value (W/m^2) is greater than 0.4 * the potential solar radiation (W/m^2)
'and the sine of the sun elevation angle (degrees) is great than 0.1 (elevation angle of 6 degrees)
'than it has been sunny for the current scan.
If SlrW>0.4*PotSlrW And SIN(SunElevation)>0.1 Then
'Calculate sun hours for scan time in seconds
SunHrs=1/3600
Else
'Set sun hours for scan time in seconds to 0
SunHrs=0
EndIf
cool, this is it.
Thank Dear Makada for the help.
regards
Osvaldo José
Makada
The sunelevation parameter will depend on the latitude , longitude and the season of the year right?
See:
Public solar_information(5)
Alias solar_information(1) = solar_azimuth
Alias solar_information(2) = sun_elevation
Alias solar_information(3) = hour_angle
Alias solar_information(4) = declination
Alias solar_information(5) = air_mass
SolarPosition(SolPos(),RTime(),1*3600,your latitude,your longitude,0,BP_mbar,AirTC)
Makada
Did you invoked the noaa parameters?
Or just , calculate any value yourself?
No, i just used the instruction from CS Shortcut.
Calculations
Sunshine Hours
Heres a short description from the Sunshine hours instruction from CS Shortcut:
Sunshine HoursUnits for Sunshine Hours: Hours
Estimates if current weather is sunny by checking if current global radiation is higher than 0.4 times the current potential solar radiation outside the earth's atmosphere.
Sunshine Hours holds the hours of sunshine since the last scan. Totalise this value to give the total number of sunshine hours over any given period.
A solar radiation measurement (flux density) is required for this calculation, therefore, a solar radiation sensor must be selected and configured prior to selecting and configuring this calculation. The datalogger clock must be set to standard time, not daylight savings time.
You must specify latitude and longitude in decimal degrees. The range for Latitude is 0 to +90 (a positive value for the Northern hemisphere and a negative value for the Southern hemisphere). Longitude is also 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 (e.g., 360 - West Degrees) can be used. For example, Tokyo, Japan has a longitude of 220.3 when measured going west which could be entered as -220.3 or the corrected longitude value of 139.7 degrees East could be used.
TimeOffset is the local time offset, in hours, from UTC. If the datalogger setting "UTC Offset" is a value other than -1 (disabled), this offset will be ignored and the UTC Offset value from the datalogger will be used. (Note that UTC Offset is found in the datalogger's Settings table and is in seconds.
Or other posts about the subject: