Page 1 of 3

Solar settings - observations

Posted: Tue 17 Feb 2015 9:04 pm
by BCJKiwi
After much trial and error, I arrived at the Cumulus1 settings of;
Sun Threshold 75%
Sun Min 50 W/m2
Trans Factor 0.87
These settings came across to MX.

When switching back and forth between C1 and MX I noticed MX produced a lower theoretical curve than C1.
Have increased Trans Factor to 0.89 which is still very slightly lower than C1 @ 0.87. Tried setting it to 0.9 but that produced a much greater change.

So, presumably with the change to MX the code for calculating trans factor is different so an adjustment to your settings may be required.
Puzzled by the (relatively) big step between 0.89 and 0.9 (did not try 0.90).

Re: Solar settings - observations

Posted: Tue 17 Feb 2015 9:11 pm
by mcrossley
Is your latitude set exactly the same?

Re: Solar settings - observations

Posted: Tue 17 Feb 2015 9:13 pm
by steve
I wrote the Cumulus 1 code to do the Ryan-Stolzenbach calculation, so I was able to translate that myself for MX. I didn't write the vastly more complicated code to determine the sun position at any given time and place, I used a third party library, so I didn't translate that, I just used a different library. It's likely that any difference is down to using a different library for the sun position. It's also possible that I made an error in translating my code somewhere.

Re: Solar settings - observations

Posted: Tue 17 Feb 2015 11:47 pm
by BCJKiwi
Yes, all settings the same.

It is not a problem - just a slight adjustment required.
If you look here http://silveracorn.co.nz/cumulusmx/trends.php you can see the effect of a 0.9 setting.
The area with sunshine is C1 with trans at 0.87
The step up is with MX trans at 0.90 (gets reset to 0.9) and the step down is after changing MX trans to 0.89.
If MX is set to 0.87 it has a step down from the C1 line of similar magnitude to the step up to 0.9.

Re: Solar settings - observations

Posted: Wed 18 Feb 2015 9:58 am
by steve
Here, the MX theoretical max is currently slightly higher than the Cumulus 1 figure. When I get time, I'll have a look to see if I can determine whether it's down to the library difference or a bug in my code.

The Cumulus 1 figure is very close to the result from the spreadsheet that I took the R-S formula from originally, so it's apparently MX which is aberrant.

Re: Solar settings - observations

Posted: Wed 18 Feb 2015 11:15 am
by steve
The code I'm using in MX to determine solar elevation gives a slightly higher figure (at my location now) than the code in Cumulus 1. The code I'm using in MX is from this blog post:

http://guideving.blogspot.co.uk/2010/08 ... -in-c.html

The author says it gives results close to some reference sites, so perhaps I'm using it incorrectly, but it's hard to see how.

Re: Solar settings - observations

Posted: Wed 18 Feb 2015 11:25 am
by mcrossley
How does the Sun position that code produces compare with the spreadsheet? The Spreadsheet has a pretty comprehensive calculation.

Re: Solar settings - observations

Posted: Wed 18 Feb 2015 12:02 pm
by steve
Just now (1200 UTC):

That code (as implemented in MX): 20.01

Cumulus 1: 18.94

Spreadsheet: 18.99

Re: Solar settings - observations

Posted: Wed 18 Feb 2015 12:37 pm
by steve
Hmm. It looks like I have introduced an error myself. Revised figures coming up...

Re: Solar settings - observations

Posted: Wed 18 Feb 2015 1:01 pm
by mcrossley
Actually, looking at that linked code, it has no correction for refraction, so it is going to be inaccurate towards the beginning or end of the day - or all day in Winter at northern latitudes.

Re: Solar settings - observations

Posted: Wed 18 Feb 2015 1:11 pm
by steve
Corrected figures at 1300:

MX: 19.50
C1: 18.76
Spreadsheet: 18.81

With the correction, MX has the theoretical solar max at 1305 at 338, and C1 at 323. The spreadsheet has 326. All using my settings.

Re: Solar settings - observations

Posted: Wed 18 Feb 2015 1:52 pm
by mcrossley
The spreadsheet solar elevation agrees with the 'accurate' on-line calculators.

BTW, was that Sanday on the TV last night - Digging for Britain? - I had it on the in background in the hotel.

Re: Solar settings - observations

Posted: Wed 18 Feb 2015 2:06 pm
by steve
mcrossley wrote:The spreadsheet solar elevation agrees with the 'accurate' on-line calculators.
I just need a more accurate version already in C# or that I can easily convert to C#. Or I suppose that given the algorithm, I could write the code from scratch...
BTW, was that Sanday on the TV last night - Digging for Britain? - I had it on the in background in the hotel.
According to The Orcadian, it was the Ness of Brodgar on the (Orkney) mainland.

Re: Solar settings - observations

Posted: Wed 18 Feb 2015 2:12 pm
by mcrossley
I have a cpp library if that is any use?


Re Digging for Britain, I just heard the name Sanday mentioned, I wasn't really watching it but is amazing how your brain picks out key words in the background 'noise'.

Re: Solar settings - observations

Posted: Wed 18 Feb 2015 2:39 pm
by steve
mcrossley wrote:I have a cpp library if that is any use?
Possibly; I suspect there's a lot of code involved though, because of the way these things are built.

Re Digging for Britain, I just heard the name Sanday mentioned,
Yes, it seems Sanday was also featured.