Author Topic: SunPlot  (Read 15169 times)

mcrossley

  • Gale
  • ****
  • Posts: 273
  • Sorry, I'm not a WeatherCat user!
    • ICHESHIR25
    • Wilmslow Astro Weather
  • Station Details: Davis VP2 + home brew
SunPlot
« on: August 20, 2016, 04:12:43 PM »
I thought I'd start a new thread for the Sun Plot script as it was clogging up the Gauges thread....

You chaps may be interested in another little PHP script for your web pages I knocked up last week - Sun Plot.
You can see it in use on my home page (not much sun today  :( ), and the download is here



It doesn't matter if you don't have a database that stores the sunshine data, you can use the plot just to show the Suns position as the day progresses and the relative day/night length and changes in Suns elevation. It's self contained, no other libraries etc. required.

You should be able to embed it in a HTML page just like a PHP page (so long as the server is running PHP obviously). Just using a standard <img> tag, like...
Code: [Select]
<img src="sunplot.php" alt="Sun Plot" width="X" height="Y">
Where X and Y are the width height you also specify in the php.
Mark

mcrossley

  • Gale
  • ****
  • Posts: 273
  • Sorry, I'm not a WeatherCat user!
    • ICHESHIR25
    • Wilmslow Astro Weather
  • Station Details: Davis VP2 + home brew
Re: SunPlot
« Reply #1 on: August 20, 2016, 04:15:50 PM »
I almost did not dare to ask, but:

What about adding a time-line from 0 to 24 to the png?

 :-X

A bit like this?

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 #2 on: August 20, 2016, 04:27:33 PM »
Ohh Yesss, Sir!

 [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 #3 on: August 20, 2016, 04:33:54 PM »
Me too. I just downloaded version 1.1 but the timeline is not included.  :-\
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
Reinhard


mcrossley

  • Gale
  • ****
  • Posts: 273
  • Sorry, I'm not a WeatherCat user!
    • ICHESHIR25
    • Wilmslow Astro Weather
  • Station Details: Davis VP2 + home brew
Re: SunPlot
« Reply #5 on: August 20, 2016, 04:52:22 PM »
Me too. I just downloaded version 1.1 but the timeline is not included.  :-\
It will be in version 1.2 I want to do some more testing before releasing it.
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 #6 on: August 20, 2016, 04:58:16 PM »
 ::)

Time Line color and font customizable.

 :-*

 :) :) :)
Reinhard


mcrossley

  • Gale
  • ****
  • Posts: 273
  • Sorry, I'm not a WeatherCat user!
    • ICHESHIR25
    • Wilmslow Astro Weather
  • Station Details: Davis VP2 + home brew
Re: SunPlot
« Reply #7 on: August 20, 2016, 05:52:20 PM »
::)

Time Line color and font customizable.

 :-*

 :) :) :)
Well, they are if you edit the script ;)

It is black in the supplied script for both the ticks and numbers - but just change the RGB values of "$colHours". It doesn't draw a axis line, just tick marks down from the horizon.

It also uses a True Type font (arial.ttf by default), so you will need that font file on your web server somewhere - and don't forget to set the path/filename in the script. If it can't find the font you will get the tick marks but no numbers.

Version 1.2 now uploaded - go get it!
Mark

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 #8 on: August 20, 2016, 05:59:27 PM »
Quote
Time Line color and font customizable.
I think he just did that with an image editor. ;) But he can probably add it easily in the script. After all, coding is really just typing! [computer] [lol] Right now I don't see any 'echoing' in the script, but I'm sure he could 'write' the numbers in most any font, color, and size you'd like. I'd suggest that colors might need to be different depending on the background color. Colors don't show well on like-colored backgrounds. DOH!

I think "$colHours" must be in a later version? Don't see it in 1.0. Well, of course, flyboy! You need to type faster! Maybe using more than two fingers? [banghead]
But you proved my point about "coding"! [lol]
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system


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 #9 on: August 20, 2016, 06:05:53 PM »
Version 1.2 now uploaded - go get it!

You are ... great.

 ;D
Reinhard


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 #10 on: August 20, 2016, 06:24:28 PM »
Done the trick with the font (using DINAlternateBold.otf as that is the font I use mainly in my website).

I really would like to donate some bucks to you - anywhere possible?
Reinhard


mcrossley

  • Gale
  • ****
  • Posts: 273
  • Sorry, I'm not a WeatherCat user!
    • ICHESHIR25
    • Wilmslow Astro Weather
  • Station Details: Davis VP2 + home brew
Re: SunPlot
« Reply #11 on: August 20, 2016, 07:30:29 PM »
I saw you had used a custom font, it looks good.

I have a link for SteelSeries dontations, you could use that if you like. Don't feel obliged, I do this stuff for my own entertainment as much as anything...
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 #12 on: August 20, 2016, 07:55:16 PM »
Thanks a lot for all your work! Stay tuned and share your scripts!
Reinhard


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 #13 on: August 20, 2016, 07:55:27 PM »
Reinhard's site is too beautiful not to visit at least once a week! Here's his <page> with the Sunplot (just below half way down the page depending on how big a window you may have). He has cleverly labeled the spot "Sonne"! ;)
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system


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 #14 on: August 20, 2016, 07:58:00 PM »
 :-[

 :)
Reinhard