Author Topic: SunPlot  (Read 15168 times)

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 #15 on: August 21, 2016, 02:40:07 PM »
xair:

I forgot to say: Thank you for the flowers.
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 #16 on: August 22, 2016, 05:51:49 AM »
How do I point the script to where the fonts are installed on my Mac?

This is what I thought should work because the font is located in library/fonts (not my user library, and not the system library but the "local" library where Apple recommends any use can add or modify fonts.

Code: [Select]
$fontFile = $_SERVER['DOCUMENT_ROOT'] . '/Library/Fonts/arial.ttf';
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 #17 on: August 22, 2016, 08:13:10 AM »
Here is how I did it:

Uploaded the desired font file into my webspace in exact the same directory where the sunplot.php is doing its job. Then pointed to this file.
Code: [Select]
$fontFile = $_SERVER['DOCUMENT_ROOT'] . 'DINAlternateBold.otf';Be sure to type the font file name exactly into the script and avoid spaces in this name.

Hope this helps,
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 #18 on: August 22, 2016, 10:18:04 AM »
How do I point the script to where the fonts are installed on my Mac?

This is what I thought should work because the font is located in library/fonts (not my user library, and not the system library but the "local" library where Apple recommends any use can add or modify fonts.

Code: [Select]
$fontFile = $_SERVER['DOCUMENT_ROOT'] . '/Library/Fonts/arial.ttf';

Blic, the "$_SERVER['DOCUMENT_ROOT']" bit starts the path in your web server root folder (typically). If you want to use a file elsewhere on the system then try...
Code: [Select]
$fontFile = '/Library/Fonts/arial.ttf';[/quote]

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 #19 on: August 22, 2016, 03:43:56 PM »
Still no joy for me.

First, tried pointing at the font where it is on my Mac. That didn't work.

Next I uploaded the font to the same directory where sunplot.php resides on my site and used the following line in the script:

Code: [Select]
$fontFile = $_SERVER['DOCUMENT_ROOT'] . 'Arial.ttf';
I tried this as well:

Code: [Select]
$fontFile = $_SERVER['DOCUMENT_ROOT'] . 'arial.ttf';
Still not working.

I have verified the font is there and spelled correctly.

Any ideas about what I am missing?
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 #20 on: August 22, 2016, 03:57:17 PM »
John,

use a .otf font - just for trying and just a shot in the blue. I first uploaded a .woff font and it didn't work, either. You may use this one as test:
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 #21 on: August 22, 2016, 04:05:20 PM »
Thanks, but still nothing for me.

Code: [Select]
$fontFile = $_SERVER['DOCUMENT_ROOT'] . 'DINAlternateBold.otf';
The font and the script are in the same directory. This should work.
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 #22 on: August 22, 2016, 04:10:23 PM »
Another idea: Maybe this dierctory is NOT your web server root folder? In my case it is. Try duplicating the font file and put it to your root folder as well.

Or alternatively point to this in your case:
Code: [Select]
$fontFile = $_SERVER['DOCUMENT_ROOT'] . '/wp-content/uploads/Weather/DINAlternateBold.otf';
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 #23 on: August 22, 2016, 04:45:49 PM »
Reinhard, you are genius. [cheer]

I am one of the few WeatherCatters using a WordPress site. In WordPress, all uploads go into a folder called uploads. On my site, I created a folder in uploads called Weather. All of my FTP for WeatherCat goes into the Weather folder. This is where sunplot.php and the font reside. I just needed to specify the full path name (Duh!!):

Code: [Select]
$fontFile = $_SERVER['DOCUMENT_ROOT'] . '/wp-content/uploads/Weather/DINAlternateBold.otf';
Thank you for patiently prompting me along on this.

Danke!
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 #24 on: August 22, 2016, 04:49:19 PM »
 [bounce]
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 #25 on: August 22, 2016, 08:48:38 PM »
Glad you got it sorted. The alternative is to drop the "$_SERVER['DOCUMENT_ROOT'] . " bit and just specify the full path to the file from the system drive root folder.

use a .otf font - just for trying and just a shot in the blue. I first uploaded a .woff font and it didn't work, either. You may use this one as test:
Yep, PHP GD will not work with .woff files, it requires a True Type format, either .ttf or .otf. Browsers understand .woff format bit not PHP.
Mark

awilltx

  • Guest
Re: SunPlot
« Reply #26 on: August 23, 2016, 03:11:52 PM »
Thanks for this script. I've been playing around with it and added it to my site just for grins:


http://www.eastdallasweather.com/wxastronomy.php


Alan

mcrossley

  • Gale
  • ****
  • Posts: 273
  • Sorry, I'm not a WeatherCat user!
    • ICHESHIR25
    • Wilmslow Astro Weather
  • Station Details: Davis VP2 + home brew
Re: SunPlot
« Reply #27 on: August 23, 2016, 03:19:13 PM »
Hi Alan, you may want to play around with the colours a bit to get a better match with the rest of the page. Turning off the 'ground' may look better as well?

Anywho, nice to see it working for other people.

Now, can WeatherCat supply the sunshine data....?
Mark

awilltx

  • Guest
Re: SunPlot
« Reply #28 on: August 23, 2016, 03:28:18 PM »
Hi Alan, you may want to play around with the colours a bit to get a better match with the rest of the page. Turning off the 'ground' may look better as well?

Anywho, nice to see it working for other people.

Now, can WeatherCat supply the sunshine data....?


Thanks for the suggestion. Turning off ground looks better.


WC certainly has the data. I'd have to see what the Cumulus database looks like to do the insert, retrieval, etc.


Cheers,
Alan

mcrossley

  • Gale
  • ****
  • Posts: 273
  • Sorry, I'm not a WeatherCat user!
    • ICHESHIR25
    • Wilmslow Astro Weather
  • Station Details: Davis VP2 + home brew
Re: SunPlot
« Reply #29 on: August 23, 2016, 03:56:10 PM »
Basically the plot just uses a 'realtime' table with a row inserted per minute (I keep a rolling 10 days of data in my realtime table), with a column 'IsSunny' which is set to 0 or 1 (no sun / sun). If you have something like that then the script should be easy to adapt to WC.

I also have as yet an unreleased version that reads a Blake-Larson sun detector log file. That has a line per sunshine 'event', with the start/end time of when the sun was shining.
Mark