Author Topic: SunPlot  (Read 15170 times)

Blicj11

  • Storm
  • *****
  • Posts: 3941
    • EW3808
    • KUTHEBER6
    • Timber Lakes Weather
  • Station Details: Davis Vantage Pro2 Plus | WeatherLinkIP Data Logger | iMac (2019), 3.6 GHz Intel Core i9, 40 GB RAM, macOS Ventura 13.6 | Sharx SCNC2900 Webcam | WeatherCat 3.3 | Supportive Wife
Re: SunPlot
« Reply #30 on: August 24, 2016, 02:08:39 AM »
Alan: I like it on your site.

Mark: WeatherCat tracks total sunshine hours so I know it's in the database somewhere.
Blick


wurzelmac

  • Storm
  • *****
  • Posts: 1361
    • ITIROLPR2
    • Wetterstation Pr?graten am Gro?venediger
  • Station Details: Davis Vantage PRO2 Plus (24h fan aspirated, wireless) with UV/Solar | Weather Envoy Data Logger | Mac mini 2023 M2 8/256 | 1x Canon EOS 1300D | macOS Sonoma 14.2
Re: SunPlot
« Reply #31 on: August 24, 2016, 05:54:30 AM »
Mark,

we are able to indicate sun shining now in SteelGauges, so the data for taht must be somewhere, or it is computed by the script somehow:

Code: [Select]
showSunshineLed    : true,                   //Show 'sun shining now' LED on solar gauge
Reinhard


Blicj11

  • Storm
  • *****
  • Posts: 3941
    • EW3808
    • KUTHEBER6
    • Timber Lakes Weather
  • Station Details: Davis Vantage Pro2 Plus | WeatherLinkIP Data Logger | iMac (2019), 3.6 GHz Intel Core i9, 40 GB RAM, macOS Ventura 13.6 | Sharx SCNC2900 Webcam | WeatherCat 3.3 | Supportive Wife
Re: SunPlot
« Reply #32 on: August 24, 2016, 02:09:43 PM »
Reinhard, I believe the LED to display sun shining now on the SteelSereies Gauges is a calculation done by the Gauges software. There are two lines in the gauges.js where you can experiment with the parameters so you can tweak that LED to be more accurate depending on your specific location. But I assume that some kind of similar calculation exists in WeatherCat in order for the 'Cat to calculate total sunshine hours.
Blick


mcrossley

  • Gale
  • ****
  • Posts: 273
  • Sorry, I'm not a WeatherCat user!
    • ICHESHIR25
    • Wilmslow Astro Weather
  • Station Details: Davis VP2 + home brew
Re: SunPlot
« Reply #33 on: August 24, 2016, 02:31:47 PM »
The script does do the calculation as not all the weather programs provide the "IsShining" data, so as the calculation is simple I do it on the fly.

Mark

Blicj11

  • Storm
  • *****
  • Posts: 3941
    • EW3808
    • KUTHEBER6
    • Timber Lakes Weather
  • Station Details: Davis Vantage Pro2 Plus | WeatherLinkIP Data Logger | iMac (2019), 3.6 GHz Intel Core i9, 40 GB RAM, macOS Ventura 13.6 | Sharx SCNC2900 Webcam | WeatherCat 3.3 | Supportive Wife
Re: SunPlot
« Reply #34 on: August 24, 2016, 02:35:29 PM »
The WeatherCat data should be more accurate as it is based on readings from the Solar Radiation sensor.
Blick


mcrossley

  • Gale
  • ****
  • Posts: 273
  • Sorry, I'm not a WeatherCat user!
    • ICHESHIR25
    • Wilmslow Astro Weather
  • Station Details: Davis VP2 + home brew
Re: SunPlot
« Reply #35 on: August 24, 2016, 07:30:08 PM »
Well, the script uses the data supplied by WC too ;) The key is the percentage threshold, and any absolute cutoff value (the WMO uses 120 W/m2 as the minimum threshold required for sunshine - I think to maintain consistency in readings with the Campbell-Stokes recorders which need a minimum level to burn the card)
Mark

wurzelmac

  • Storm
  • *****
  • Posts: 1361
    • ITIROLPR2
    • Wetterstation Pr?graten am Gro?venediger
  • Station Details: Davis Vantage PRO2 Plus (24h fan aspirated, wireless) with UV/Solar | Weather Envoy Data Logger | Mac mini 2023 M2 8/256 | 1x Canon EOS 1300D | macOS Sonoma 14.2
Re: SunPlot
« Reply #36 on: August 24, 2016, 07:42:47 PM »
...so as the calculation is simple I do it on the fly...

 :)  [tup]
Reinhard


Blicj11

  • Storm
  • *****
  • Posts: 3941
    • EW3808
    • KUTHEBER6
    • Timber Lakes Weather
  • Station Details: Davis Vantage Pro2 Plus | WeatherLinkIP Data Logger | iMac (2019), 3.6 GHz Intel Core i9, 40 GB RAM, macOS Ventura 13.6 | Sharx SCNC2900 Webcam | WeatherCat 3.3 | Supportive Wife
Re: SunPlot
« Reply #37 on: August 25, 2016, 02:57:09 PM »
I have my threshold set much lower because the light wasn't turning on when it should have been in the late afternoon, so I just stared playing around until I got it to where I felt it was reasonable accurate compared to what I saw looking out the window.
Blick


xairbusdriver

  • Storm
  • *****
  • Posts: 3126
    • EW7115 (E7115)
    • KTNGERMA20
    • Mid-South Weather
  • Station Details: Davis VP2 wireless + remote Anemometer/2014 Mac min - 10.15.7/WC 3.0.5
Re: SunPlot
« Reply #38 on: August 25, 2016, 03:38:23 PM »
Quote
compared to what I saw looking out the window.
HERETIC! BLASPHEMER!! I hope the Admins here take note of your lower moral behavior! [rockon] [rolleyes2]
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system


Blicj11

  • Storm
  • *****
  • Posts: 3941
    • EW3808
    • KUTHEBER6
    • Timber Lakes Weather
  • Station Details: Davis Vantage Pro2 Plus | WeatherLinkIP Data Logger | iMac (2019), 3.6 GHz Intel Core i9, 40 GB RAM, macOS Ventura 13.6 | Sharx SCNC2900 Webcam | WeatherCat 3.3 | Supportive Wife
Re: SunPlot
« Reply #39 on: January 30, 2021, 04:25:53 PM »
Mark or Reinhard:

I noticed starting this morning, the sunplot.php display has gone missing from my website. I haven't changed anything in the file and have verified it is in the same directory where it has resided since 2016. The font is sitting in the same directory. It was all working fine yesterday. I'm out of ideas. Would you mind taking a look and see if you can see something?

Thanks.

Here is the code from the main section, and as I said, I have not touched this for years.

######################## User Editable Variable Section ############################

// Set your station time zone (valid PHP/MySQL TZ string)
$tz = 'America/Denver';

// We need the decimal latitude and longitude of the station to calc sun position
$LAT = 40.1;  // +ve North
$LON = -111.2;  // +ve East

// Realtime database table name
$realtimeTableName = 'realtime';

// Path to TTF font - only required for Hour markers
// $fontFile = $_SERVER['DOCUMENT_ROOT'] . '/wp-content/uploads/Weather/PTSans.ttc';
$fontFile = $_SERVER['DOCUMENT_ROOT'] . '/wp-content/uploads/Weather/Arial_Bold.ttf';
// plot options - note these can be overridden by posted parameters
$sizeH        = 425;        // Horizontal image size
$sizeV        = 150;        // Vertical image size
$showGround   = false;       // Show the ground as shaded
$showSunshine = false;      // Plot sunshine from your MySQL database
$transparent  = true;      // Make the image background transparent
$showTwilight = false;      // Plot civil/nautical/astro twilight
$showHours    = true;      // Plot the hours 0-24 along the horizon axis

###################### END: User Editable Variable Section #########################
Blick


xairbusdriver

  • Storm
  • *****
  • Posts: 3126
    • EW7115 (E7115)
    • KTNGERMA20
    • Mid-South Weather
  • Station Details: Davis VP2 wireless + remote Anemometer/2014 Mac min - 10.15.7/WC 3.0.5
Re: SunPlot
« Reply #40 on: January 30, 2021, 05:47:57 PM »
I guess it's moot since the line is simply a comment... Is the suffix "ttc" correct for the "PTSans" font? Perhaps a typo in your post? [blush]

Other WAGS:
  I assume the PHP files are still in the correct directories at your web space and locally.
  Do you know what version of PHP the scripts used? Did your host recently change the default versions?
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system


mcrossley

  • Gale
  • ****
  • Posts: 273
  • Sorry, I'm not a WeatherCat user!
    • ICHESHIR25
    • Wilmslow Astro Weather
  • Station Details: Davis VP2 + home brew
Re: SunPlot
« Reply #41 on: January 30, 2021, 05:59:37 PM »
When I load your page, I'm getting an error 404 (file not found) for https://timberlakesutah.com/wp-content/uploads/Weather/sunplot.php
Mark

Blicj11

  • Storm
  • *****
  • Posts: 3941
    • EW3808
    • KUTHEBER6
    • Timber Lakes Weather
  • Station Details: Davis Vantage Pro2 Plus | WeatherLinkIP Data Logger | iMac (2019), 3.6 GHz Intel Core i9, 40 GB RAM, macOS Ventura 13.6 | Sharx SCNC2900 Webcam | WeatherCat 3.3 | Supportive Wife
Re: SunPlot
« Reply #42 on: January 30, 2021, 08:51:49 PM »
Thanks for checking Mark. I can't figure it out. That file is definitely in that directory, with Permissions 644. I can see it in CPanel and in my FTP client. I deleted it, downloaded from your website again, edited the script, uploaded it to that directory, and I still get a 404 error. That is the only PHP file in that directory. All the other files are jpg, png, or html, and each of them will open up, but when I try to open the sunplot in a browser tab it can't find it. I even got desperate and tried clearing cache and rebooting. Hahaha. It's got something to do with looking for a PHP file that's somehow different that everything else it can find. I'll keep thinking, but I'm just about out of ideas.
Blick


wurzelmac

  • Storm
  • *****
  • Posts: 1361
    • ITIROLPR2
    • Wetterstation Pr?graten am Gro?venediger
  • Station Details: Davis Vantage PRO2 Plus (24h fan aspirated, wireless) with UV/Solar | Weather Envoy Data Logger | Mac mini 2023 M2 8/256 | 1x Canon EOS 1300D | macOS Sonoma 14.2
Re: SunPlot
« Reply #43 on: January 31, 2021, 04:06:28 PM »
Hi Blick - very strange, indeed. I just compared your posted "User Editable Variable Section" and it looks exact as mine (except Time Zone and Lat Lon). My script is running on my main site (wetter.unterwurzacher.at) with this code:

Code: [Select]
<span style="text-align:center;">
<h2>Aktuelle Sonnenposition<br><?php echo date($dateFormat,time())?></h2>
<br>
</span>
<img src="https://wetter.unterwurzacher.at/meteo/scripts/sunplot.php" width="95%" alt="Sonnenplot" title="Aktuelle Sonnenposition">
<br>
<span style="text-align:center;">Script von <a href="http://weather.wilmslowastro.com/scripts.php">Mark Crossley</a></span>

The directory where I am hosting the script has permission 775, the script itself 640, maybe it is worth trying these permissions.  Sorry, but this is all I can say to this mystery. Hope you can solve the puzzle...
Reinhard


Blicj11

  • Storm
  • *****
  • Posts: 3941
    • EW3808
    • KUTHEBER6
    • Timber Lakes Weather
  • Station Details: Davis Vantage Pro2 Plus | WeatherLinkIP Data Logger | iMac (2019), 3.6 GHz Intel Core i9, 40 GB RAM, macOS Ventura 13.6 | Sharx SCNC2900 Webcam | WeatherCat 3.3 | Supportive Wife
Re: SunPlot
« Reply #44 on: February 01, 2021, 11:53:34 PM »
Thanks Reinhard, still no joy. :(

Oh well, it was great whilst it lasted.
Blick