Theoretical UV calculation tool

As promised…

https://beentheresailedthat.com/ws/server/uv.html

Just enter your Lat, Lon (decimal degrees, please) and select a Date/Time…
NOTE… changing to a past or future YEAR will have no affect, since this utilizes Monthly data, and assumes that a month will be the same year-to-year.

Have fun, and don’t shoot the developer!
–Sam

2 Likes

I think I crashed your script already, used time ‘the now button’
image

Warning: DateTime::setTimestamp() expects parameter 1 to be integer, string given in /home/beenth12/public_html/ws/server/php/getUvByCoordWeb.php on line 72

Warning: A non-numeric value encountered in /home/beenth12/public_html/ws/server/php/getUvByCoordWeb.php on line 77

Warning: date() expects parameter 2 to be integer, string given in /home/beenth12/public_html/ws/server/php/getUvByCoordWeb.php on line 458

Warning: Division by zero in /home/beenth12/public_html/ws/server/php/getUvByCoordWeb.php on line 461

Warning: date() expects parameter 2 to be integer, string given in /home/beenth12/public_html/ws/server/php/getUvByCoordWeb.php on line 470

Warning: date() expects parameter 2 to be integer, string given in /home/beenth12/public_html/ws/server/php/getUvByCoordWeb.php on line 522

Warning: date() expects parameter 2 to be integer, string given in /home/beenth12/public_html/ws/server/php/getUvByCoordWeb.php on line 548
1.06

Undocumented Feature…

Weird, as the ‘now’ button is not enabled on my end.

Working on it! Thanks @eric!

1 Like

Sorry, I’ve gone and broken it too. I live so close to the Greenwich Meridian that I often put my longitude as zero for testing. I don’t think the code likes that though…

Warning: Illegal string offset 'astronomical_twilight_begin' in /home/beenth12/public_html/ws/server/php/getUvByCoordWeb.php on line 495
Notice: Uninitialized string offset: 0 in /home/beenth12/public_html/ws/server/php/getUvByCoordWeb.php on line 495
Warning: Illegal string offset 'solar_noon' in /home/beenth12/public_html/ws/server/php/getUvByCoordWeb.php on line 496
Notice: Uninitialized string offset: 0 in /home/beenth12/public_html/ws/server/php/getUvByCoordWeb.php on line 496
Warning: Illegal string offset 'astronomical_twilight_end' in /home/beenth12/public_html/ws/server/php/getUvByCoordWeb.php on line 497
Notice: Uninitialized string offset: 0 in /home/beenth12/public_html/ws/server/php/getUvByCoordWeb.php on line 497
Notice: Undefined offset: 1 in /home/beenth12/public_html/ws/server/php/getUvByCoordWeb.php on line 499
Notice: Undefined offset: 1 in /home/beenth12/public_html/ws/server/php/getUvByCoordWeb.php on line 502
Notice: Undefined offset: 1 in /home/beenth12/public_html/ws/server/php/getUvByCoordWeb.php on line 505
Warning: Division by zero in /home/beenth12/public_html/ws/server/php/getUvByCoordWeb.php on line 517
1.06

But, if I set the longitude to my actual location (-0.0603) it doesn’t provide a UV value:

If I make my longitude positive, it gives me a UV of 301.54(!!!)

Ugh… EDGE CASES!
Working through those issues now.
Thanks for the feedback.

2 Likes

You’re awesome !

Quick question… I get 1.11 as UV for this time of day. Just checking if there’s something missing from the formula as the value should be closer to 7.

Ahhh edge cases… That would explain it :slight_smile:

What are you coordinates?

1 Like

Lat 46.493919
Long -80.995415
EST time. Index should be around 7 right now (noon)

… and a suggestion for your future versions… You have the “now” button. An auto-select per GPS button would be the icing on the cake for your app :slight_smile:

Yeah, thought of that… planning on adding in a ‘use my location’ option.
–Sam

1 Like

Yours is working now… showing a theoretical max of just over 9… remember only in clear skys.

1 Like

If you could also add a “bring on the sun/rain” button, that would be great. Might need some powerful software for that tho :slight_smile:

Well, Sky is showing 11.5 uncalibrated right now, so 9 is a big improvement.

Thank you ! (Can you fix taxes as easily as you can program ?)

Yours works now… showing a max of 5.8 for “now”.

2 Likes

Hm… still getting value of 1.07.

Ace! Thanks for the fix :+1:

1 Like

Showing 1.06 for you for that timeframe… sound about right?

1 Like

Yes your formula shows that.

I feel like I’ve pooped on your party :frowning: lol

1 Like