Author Topic: Sum/Moon Graphic  (Read 5398 times)

hcorrin and 1 Guest are viewing this topic.

Offline Vasco

  • Forecaster
  • *****
  • Posts: 491
    • PWS
Re: Sun/Moon Graphic
« Reply #50 on: August 24, 2024, 01:13:33 PM »
Ken has discovered that the problem lies with the GD library on my ISP's SunOS server: the GD image function imagecolortransparent() used in sunposa.php is not working as expected.

But now I have PHP 8.2.20 with GD 2.3.3 on Debian it works, and my sun has a transparent background  :grin:

Thanks, Ken, for all the help -- again!
Ecowitt GW1102 (with GW2000) + Weather Display in Windows 10

Offline Vasco

  • Forecaster
  • *****
  • Posts: 491
    • PWS
Re: Sum/Moon Graphic
« Reply #51 on: August 24, 2024, 02:30:57 PM »
I had to edit the code to convert the moonrise time from 12hr clock to 24hr as it is extracted from the US site which only supplies the 12hr time, the new code only converts the sun times not the moonrise.

Using USNO calculations, moonrise seems to show in 24hr OK here  :???:
« Last Edit: August 24, 2024, 02:41:17 PM by Vasco »
Ecowitt GW1102 (with GW2000) + Weather Display in Windows 10

Offline broadstairs

  • Forecaster
  • *****
  • Posts: 926
Re: Sum/Moon Graphic
« Reply #52 on: August 24, 2024, 04:42:36 PM »
I had to edit the code to convert the moonrise time from 12hr clock to 24hr as it is extracted from the US site which only supplies the 12hr time, the new code only converts the sun times not the moonrise.

Using USNO calculations, moonrise seems to show in 24hr OK here  :???:

I'll have a play some more but it comes up as 12hr clock without my addition. Are you using WD because if you are it uses your clientraw data?

Apologies I'm not having a good day today! I had fixed it it the old version and forgot to make the same change in 3.03 with the $dateMDY variable in the new one  ](*,)  ](*,)

Stuart
« Last Edit: August 24, 2024, 04:58:44 PM by broadstairs »
Ecowitt GW1003 with ultrasonic wind gauge, lightning sensor and PM2.5 sensor with Personal Weather Tablet as a console.

Offline Vasco

  • Forecaster
  • *****
  • Posts: 491
    • PWS
Re: Sun/Moon Graphic
« Reply #53 on: August 28, 2024, 06:52:16 PM »
Have to say I'm not terribly impressed with the moon images. . . today is 24% illuminated and looks more like 10% (or less).

Illumination's looked low on the images ever since I installed sunposa.
« Last Edit: August 28, 2024, 06:58:50 PM by Vasco »
Ecowitt GW1102 (with GW2000) + Weather Display in Windows 10

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9538
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Sum/Moon Graphic
« Reply #54 on: August 28, 2024, 07:31:16 PM »
True.. I've not curated the images.. just used the ones that were supplied with the original sunposa.php from long ago.

I'll do that and release an updated set of Northern and Southern images that better display what we think the %illumination should be.

In other news.. I just released on GitHub (https://github.com/ktrue/SunMoon-graph ) version 3.50 of sunposa.php.  This version allows translation to 22 languages and auto-changes in a Base-World/Base-Canada Saratoga template.  A updated wxastronomy.php is also included in the distribution.  I'm updating the main doc to include stuff on the extra programs now included in the distribution.

I hope to release it generally as a part of the Saratoga template set soon, but you're free to play around with it.
My sample is at https://saratoga-weather.org/wxtemplates/World/wxastronomy.php
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Vasco

  • Forecaster
  • *****
  • Posts: 491
    • PWS
Re: Sum/Moon Graphic
« Reply #55 on: August 28, 2024, 07:44:59 PM »
True.. I've not curated the images.. just used the ones that were supplied with the original sunposa.php from long ago.

I'll do that and release an updated set of Northern and Southern images that better display what we think the %illumination should be.

Thanks, Ken.

Meantime I've been forced to alter my personal elevation and standard azimuth axes to accommodate the upcoming major lunistice. . .
Ecowitt GW1102 (with GW2000) + Weather Display in Windows 10

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9538
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Sum/Moon Graphic
« Reply #56 on: August 28, 2024, 10:59:19 PM »
The new sunposa script set is now on the Saratoga distribution and I've updated the GitHub docs too.  Whew, long day...
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline zmarfak

  • Contributor
  • ***
  • Posts: 136
    • Matar
Re: Sum/Moon Graphic
« Reply #57 on: August 29, 2024, 02:48:14 AM »
The new sunposa script set is now on the Saratoga distribution and I've updated the GitHub docs too.  Whew, long day...

Thanks Ken, for the work you put into this.
Patrick
Davis Vantage Pro2 with a Meteobridge NANO SD and WL (6.04) on a GMKtec NucBox G3.
https://www.matar.be

Offline tigerbait

  • Senior Member
  • **
  • Posts: 55
    • Ellerbe Weather
Re: Sum/Moon Graphic
« Reply #58 on: August 29, 2024, 09:40:24 AM »
The new sunposa script set is now on the Saratoga distribution and I've updated the GitHub docs too.  Whew, long day...
Thanks Ken, 
I think I installed everything as needed.  Did the Earth view with cloud cover & sunrise go away.  My Sun/moon sky position is now an error.  I uploaded the moonimg to its own directory.  Was that supposed to be in the AJAX/moon directory?

https://www.sporttiger.com/wxastronomy.php

Thanks for all you do,
Alan
https://www.sporttiger.com
Davis VP2 Weather Display
Saratoga scripts

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9538
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Sum/Moon Graphic
« Reply #59 on: August 29, 2024, 10:02:30 AM »
You also need to upload the ./jpgraph-4.4.2-src-only/ directory (and all the subdirectories/files in it)

The two NEW directories are ./jpgraph-4.4.2-src-only/ and ./moonimg/ -- they need to be fully uploaded (files and any subdirectories/files)

Two images in ./cache/ need to be uploaded ./cache/jpsun.png and ./cache/jpmoon.png

Four scripts to upload to document root:

check-fetch-times.php
sunposa-lang.php
sunposa.php
wxastronomy.php

Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline tigerbait

  • Senior Member
  • **
  • Posts: 55
    • Ellerbe Weather
Re: Sum/Moon Graphic
« Reply #60 on: August 29, 2024, 11:18:02 AM »
You also need to upload the ./jpgraph-4.4.2-src-only/ directory (and all the subdirectories/files in it)

The two NEW directories are ./jpgraph-4.4.2-src-only/ and ./moonimg/ -- they need to be fully uploaded (files and any subdirectories/files)

Two images in ./cache/ need to be uploaded ./cache/jpsun.png and ./cache/jpmoon.png

Four scripts to upload to document root:

check-fetch-times.php
sunposa-lang.php
sunposa.php
wxastronomy.php

Thanks Ken,
The Sun/moon sky position now working.  But the Earth with cloud cover Sun/Moons season gone.

What I use to have:
https://csraweather.net/wxastronomy.php
« Last Edit: August 29, 2024, 11:23:33 AM by tigerbait »
https://www.sporttiger.com
Davis VP2 Weather Display
Saratoga scripts

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9538
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Sum/Moon Graphic
« Reply #61 on: August 29, 2024, 12:07:59 PM »
You're using the alternative wxastronomy.php page (with include-wxastronomy.php as the main source).

That page used sunposa.php for the sun/moon graph and the new sunposa.php will work there too.. just don't replace the wxastronomy.php with the one in the distribution and keep the wxastronomy.php you have (but install the rest of the update).
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9538
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Sum/Moon Graphic
« Reply #62 on: August 29, 2024, 12:26:15 PM »
For folks in the Southern Hemisphere (Australia, New Zealand, etc.), I know the graph looks wonky -- I'll have to adjust the JPGraph directives to make it look like the Northern Hemisphere graphs.

I did check the calculated data v.s. the USNO and it looks good
Quote
check-sunmoon-data.php V1.00 - 26-Aug-2024
..using sunposa.php/USNO data for local times at
  lat='-41.428945' lon='148.272474' tz='Australia/Hobart'.

Note: only USNO times coresponding to sunposa.php generated times
      are displayed in the following tables

----- Sun data compare -----
Data values are azimuth,elevation

Date:   2024-08-30           2024-08-30         
Time    USNO data            Calc data           
-----   --------------       --------------     
06:00   84.5,-7.3            84.7,-7.3           
07:00   74.6,3.9             74.8,3.7           
08:00   64.0,14.3            64.2,14.3           
09:00   52.0,23.8            52.2,23.8           
10:00   37.9,31.8            38,31.8             
11:00   21.2,37.4            21.2,37.4           
12:00   2.4,39.7             2.4,39.7           
13:00   343.4,38.3           343.3,38.3         
14:00   326.0,33.5           325.9,33.5         
15:00   311.2,26.1           311.1,26.1         
16:00   298.7,16.9           298.6,16.9         
17:00   287.8,6.7            287.7,6.5           
18:00   277.8,-4.4           277.6,-4.4         


----- Moon data compare -----
Data values are azimuth,elevation[,illumination if available]

Date:   2024-08-30           2024-08-30         
Time    USNO data            Calc data           
-----   --------------       --------------     
04:00   59.0,-7.4,0.17       54.4,-7.5           
05:00   49.7,1.8,0.17        45.6,1.4           
06:00   39.3,9.2,0.17        36.5,9.1           
07:00   27.6,15.2,0.16       26.5,15.1           
08:00   14.7,19.3,0.16       14.6,19.2           
09:00   1.1,20.9,0.16        1.1,20.8           
10:00   347.3,19.8,0.16      347.3,19.7         
11:00   334.1,16.3,0.15      335,16.2           
12:00   322.1,10.7,0.15      324.7,10.6         
13:00   311.4,3.5,0.15       315.3,3.2           
14:00   301.7,-5.4,0.14      306.2,-5.4         
it's just that the azimuth map to a X scale that is not 40 to 320 but centered instead on zero.  I'll keep trying to make it adapt, meanwhile, I suggest holding off on the update (at least the wxastronomy.php) until I can get sunposa.php fixed.
« Last Edit: August 29, 2024, 12:28:22 PM by saratogaWX »
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline tigerbait

  • Senior Member
  • **
  • Posts: 55
    • Ellerbe Weather
Re: Sum/Moon Graphic
« Reply #63 on: August 29, 2024, 12:36:15 PM »
You're using the alternative wxastronomy.php page (with include-wxastronomy.php as the main source).

That page used sunposa.php for the sun/moon graph and the new sunposa.php will work there too.. just don't replace the wxastronomy.php with the one in the distribution and keep the wxastronomy.php you have (but install the rest of the update).

Thanks Ken,
I'll dig around & find the file as I replaced mine with this update ](*,)
https://www.sporttiger.com
Davis VP2 Weather Display
Saratoga scripts

Offline griffo42

  • Contributor
  • ***
  • Posts: 106
    • Carina Weather
Re: Sum/Moon Graphic
« Reply #64 on: August 29, 2024, 04:34:19 PM »
From Brisbane in Australia.

This is what my graph looks like:
 [ You are not allowed to view attachments ]

if that helps.  All the data is correct.

Waiting to hear of a fix.

Keith
https://www.kstwx.net/index.php
Davis Vantage Pro2 Model #6152AU
CumulusMX latest version
Saratoga Weather World template Cumulus plugin
Carina Weather, Brisbane.

Offline zeppline

  • Senior Member
  • **
  • Posts: 85
    • Las Vegas Weather Guy
Re: Sum/Moon Graphic
« Reply #65 on: August 31, 2024, 02:46:01 PM »
I have a problem with sunposa I loaded 4.4.2-src-only the problem is src/*.php it errors the slash src is the folder or is it a file? or do I make file under 4.4.2 ? Also do I need the include wxastronomy file. Having a senior moment. (lasvegaswx.com/wxastronomy) 

Offline Vasco

  • Forecaster
  • *****
  • Posts: 491
    • PWS
Re: Sum/Moon Graphic
« Reply #66 on: August 31, 2024, 03:16:20 PM »
You upload the whole directory /jpgraph-4.4.2-src-only. There is a subdirectory /src that has lots of scripts *.php.

I don't think you need include-wxastronomy.php with the standard template, just wxastronomy.php.

« Last Edit: August 31, 2024, 03:27:12 PM by Vasco »
Ecowitt GW1102 (with GW2000) + Weather Display in Windows 10

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9538
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Sum/Moon Graphic
« Reply #67 on: August 31, 2024, 04:26:21 PM »
Here's the file tree view of ./jpgraph-4.4.2-src-only/ directory.. It needs to be uploaded in full to your site.

Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline powerline

  • Member
  • *
  • Posts: 39
    • Oak Ridge North Weather
Re: Sum/Moon Graphic
« Reply #68 on: August 31, 2024, 05:45:10 PM »
I'm looking for help, please.  I thought I uploaded everything correctly.  Obviously something is not quite right.  My Sun/Moon position is showing the moon as full.  However, the text below shows that its illumination should be 4%.  The 4% is correct.  I see other web sites showing a new moon icon which would be correct or very close to it.  Where did I go wrong?  Thank you.

Ron
Ron

Davis Vantage Pro2.  Meteobridge Pro
CWOP:  CW2840
WU:  KTXOAKRI1
http://www.oakridgewx.net

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9538
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Sum/Moon Graphic
« Reply #69 on: August 31, 2024, 06:54:35 PM »
When you first install,you'll see a full moon image.  Run https://www.oakridgewx.net/sunposa.php?force=1 to refresh the moon image (I did on your site).. it now shows a almost-new moon image.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline powerline

  • Member
  • *
  • Posts: 39
    • Oak Ridge North Weather
Re: Sum/Moon Graphic
« Reply #70 on: August 31, 2024, 07:12:45 PM »
Many thanks, Ken!

Ron
Ron

Davis Vantage Pro2.  Meteobridge Pro
CWOP:  CW2840
WU:  KTXOAKRI1
http://www.oakridgewx.net

Offline zeppline

  • Senior Member
  • **
  • Posts: 85
    • Las Vegas Weather Guy
Re: Sum/Moon Graphic
« Reply #71 on: August 31, 2024, 08:11:21 PM »
Ken thank you for the tree, I have all the files, but I don't know how to put the /*.php  in src file. the path to sunpose. thank You

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9538
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Sum/Moon Graphic
« Reply #72 on: August 31, 2024, 09:17:32 PM »
I don't know which FTP software you're using.  If it's FileZilla, I think you can just select /jpgraph-4.4.2-src-only directory in the local file browser and PUT the entire directory (and subdirectories) to your site.

I use Dreamweaver, and just selecting the local file directory and PUT does the job.. other FTP software should have that capability too.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline weatherdoc

  • Senior Contributor
  • ****
  • Posts: 222
    • Weather Doc's Weather
Re: Sum/Moon Graphic
« Reply #73 on: September 01, 2024, 08:53:37 AM »
I'm guessing I did something wrong with the update. I thought I followed Ken's readme files and uploaded the correct folders and files to my server but my wxastronomy.php page has some strangeness to it.

At the top of the page, the moon image has a partial white box/background but I believe it should look like the second image below. In the third image, there is a black box on the upper right and a non-clickable "Data font/colour" button. And the data boxes have a white background instead of transparent. Any thoughts?

 [ You are not allowed to view attachments ]


 [ You are not allowed to view attachments ]


 [ You are not allowed to view attachments ]
« Last Edit: September 01, 2024, 08:57:41 AM by weatherdoc »

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9538
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Sum/Moon Graphic
« Reply #74 on: September 01, 2024, 09:36:08 AM »
The image you cited is Weather-Display's https://wxdoc.info/moonicon.gif

I think that you changed the Data font/color from yellow on black to black on white and that's causing WD to use a white surround on the moon image.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

 

anything