Author Topic: Is there a wxastronomy update  (Read 13541 times)

0 Members and 2 Guests are viewing this topic.

Offline Weerstation

  • Member
  • *
  • Posts: 43
    • Westland De Poel
Re: Is there a wxastronomy update
« Reply #25 on: October 09, 2022, 03:49:23 AM »
Thanks for all the help.

jpgraph-4.4.1

I am getting a message Can't read background image : "./cache/jpsun.png

I changed following line in jpg-config.inc.php from false to true

define('USE_CACHE',true);

https://www.westland-depoel.nl/vantagevue/ws/wxastronomy.php



« Last Edit: October 09, 2022, 03:51:04 AM by Weerstation »

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Is there a wxastronomy update
« Reply #26 on: October 09, 2022, 11:01:24 AM »
The likely cause is that your webserver cannot access https://umbra.nascom.nasa.gov/images/latest_solisHe_thumbnail.gif to get the sun image to cache.  It's not a jpgraph caching issue .. it's an access issue from your webserver to umbra.nascom.nasa.gov service.

Unfortunately, the original sunposa.php script didn't have any debugging code to help diagnose this issue.  I'll try to add some code later today and post it here for you to try.
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 Weerstation

  • Member
  • *
  • Posts: 43
    • Westland De Poel
Re: Is there a wxastronomy update
« Reply #27 on: October 09, 2022, 02:10:13 PM »
Ok.

I did not change anything but the graph is loading now.
That's strange.

Is it because the sun image is not needed because of sunset already.
« Last Edit: October 09, 2022, 02:12:22 PM by Weerstation »

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Is there a wxastronomy update
« Reply #28 on: October 09, 2022, 04:49:49 PM »
No, the sun image is fetched when more than 3600 seconds old.

Try the attached version.. it has debugging features added so when that happens again, better diagnostic messages will result.
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 Weerstation

  • Member
  • *
  • Posts: 43
    • Westland De Poel
Re: Is there a wxastronomy update
« Reply #29 on: October 09, 2022, 06:50:35 PM »
Thanks.

Downloaded and uploaded.

It's late already, I am off to bed.
Working all day tomorrow untill 18:00 so I won't be able to respond untill then.

TIA

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Is there a wxastronomy update
« Reply #30 on: October 09, 2022, 07:03:42 PM »
You can see the error now by running https://www.westland-depoel.nl/vantagevue/ws/sunposa.php?force=1

Quote
Warning: getimagesize(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /home/fordkno9/public_html/vantagevue/ws/sunposa.php on line 618

Warning: getimagesize(https://umbra.nascom.nasa.gov/images/latest_solisHe_thumbnail.gif): Failed to open stream: no suitable wrapper could be found in /home/fordkno9/public_html/vantagevue/ws/sunposa.php on line 618
-- error fetching image size from https://umbra.nascom.nasa.gov/images/latest_solisHe_thumbnail.gif. Unable to continue.

You need to add
Code: [Select]
allow_url_fopen = 1 to your php.ini (or enable it in your cPanel.

Then the script should be able to fetch the sun image and work correctly.
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: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Is there a wxastronomy update
« Reply #31 on: October 10, 2022, 12:09:48 PM »
Here's another update with improved diagnostics (?debug=y now shows state of allow_url_fopen)
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 Weerstation

  • Member
  • *
  • Posts: 43
    • Westland De Poel
Re: Is there a wxastronomy update
« Reply #32 on: October 10, 2022, 12:11:10 PM »
Yes  :grin: It's working now.  [tup]
Thanks

I hate to ask but I have another minor problem and that is that the monthnames are in English. :oops:
I like them to be in Dutch.
Is that possible.

I think I had that problem a long time ago also and you seemed to have fixed that too.

Offline Weerstation

  • Member
  • *
  • Posts: 43
    • Westland De Poel
Re: Is there a wxastronomy update
« Reply #33 on: October 10, 2022, 12:12:32 PM »
ooh you replied when I was posting.
Will download that file.

Offline Weerstation

  • Member
  • *
  • Posts: 43
    • Westland De Poel
Re: Is there a wxastronomy update
« Reply #34 on: October 10, 2022, 12:19:08 PM »
 [tup]

sunposa.php Version 2.02 - 10-Oct-2022
..debug=y debugging output for sunposa.php.  PHP version 8.1.10
  php.ini setting 'allow_url_fopen = true;'  (Note: this enables fetch of sun image).

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Is there a wxastronomy update
« Reply #35 on: October 10, 2022, 12:34:37 PM »
Alas, the author of the enhanced astronomy page didn't include the auto-translation of text month names in the code.

I suggest you change include-wxastronomy.php entry
Code: [Select]
$SITE['dateOnlyFormat'] = 'd M Y'; to
Code: [Select]
$SITE['dateOnlyFormat'] = 'd/m/Y'; to be consistent and avoid the English month names.  Sorry...

Glad that the sunposa.php issue was fixed by you having allow_url_fopen = true so the sun image could be fetched/resized/cached.
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: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Is there a wxastronomy update
« Reply #36 on: October 10, 2022, 10:22:27 PM »
And.. you're missing one (or more files).  sunposa.php?force=1 is showing
Quote
Warning: getimagesize(./ajax-images/moon/w/NH-moon16.gif): Failed to open stream: No such file or directory in /home/fordkno9/public_html/vantagevue/ws/sunposa.php on line 617

Warning: imagecreatefromgif(./ajax-images/moon/w/NH-moon16.gif): Failed to open stream: No such file or directory in /home/fordkno9/public_html/vantagevue/ws/sunposa.php on line 618
Make sure you have ALL the NH-moon*.gif files on your site (there are 28 of them)
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 Weerstation

  • Member
  • *
  • Posts: 43
    • Westland De Poel
Re: Is there a wxastronomy update
« Reply #37 on: October 11, 2022, 04:55:07 PM »
Working now, path to moon images was wrong.  :oops:

Offline hcorrin

  • Contributor
  • ***
  • Posts: 128
    • Ballaugh Weather
Re: Is there a wxastronomy update
« Reply #38 on: October 12, 2022, 05:43:21 PM »
I tried this one but i got a red not secure and although it worked ok in edge the ipad did not display the sunspot image
So went through the scripts and changed all http to https and that sorted the red not secure not even a grey one
https://www.hc-iom.co.uk/WD-AJAX1/wxastronomy.php and the missing sunspot image showed on the ipad

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Is there a wxastronomy update
« Reply #39 on: October 12, 2022, 10:00:17 PM »
That's a good catch.. thanks.

I think that removal of the <script> entries for invoking the world daylight map sets should likely be removed.. I get some major CORS errors with Firefox and could likely do without the error messages in the console log.  The 'big earth' view already shows the day/night terminator on the globe.
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 hcorrin

  • Contributor
  • ***
  • Posts: 128
    • Ballaugh Weather
Re: Is there a wxastronomy update
« Reply #40 on: October 13, 2022, 04:30:58 PM »
the only thing i have not figured out is what is causing the Equinox/Solstice globes showing night on the left instead of the right side and have not found a setting in the include-wxastronomy.php that effects it
https://www.hc-iom.co.uk/WD-AJAX1/wxastronomy.php

tmabell reworked version shows them ok
https://mymishawakaweather.com/Wxastronomy.php

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Is there a wxastronomy update
« Reply #41 on: October 13, 2022, 08:30:58 PM »
mymishawakaweather is using the ./ajax-images/ versions of the season images.
The include-wxastronomy.php uses the fourmilab.ch dynamically generated images.

The fourmilab earth viewer (https://www.fourmilab.ch/earthview/custom.html) uses lat,long and UTC time of the season change to display the view
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 hcorrin

  • Contributor
  • ***
  • Posts: 128
    • Ballaugh Weather
Re: Is there a wxastronomy update
« Reply #42 on: October 14, 2022, 02:46:48 PM »
i got this working with the images from the ajax-images folder but updated the images for my location and using the times on the web page using the link Ken posted above and this is the result https://www.hc-iom.co.uk/WD-AJAX1/wxastronomy.php

Offline andro700

  • Chuck
  • Forecaster
  • *****
  • Posts: 420
    • Gobles Weather Page
Re: Is there a wxastronomy update
« Reply #43 on: October 15, 2022, 04:08:08 AM »
For some reason I can not get my graphics-sunchart.php to work. I am getting a http 500 error. I have attached all scripts.

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

Chuck

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Is there a wxastronomy update
« Reply #44 on: October 15, 2022, 09:07:04 AM »
You’re missing the semicolon at the line ending. 
Code: [Select]
$SITE['latitude' ]      = 47.462625 should be
Code: [Select]
$SITE['latitude' ]      = 47.462625;
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 andro700

  • Chuck
  • Forecaster
  • *****
  • Posts: 420
    • Gobles Weather Page
Re: Is there a wxastronomy update
« Reply #45 on: October 15, 2022, 11:54:33 AM »
Thanks Ken for the assistance. It works now.

Chuck

Offline Weerstation

  • Member
  • *
  • Posts: 43
    • Westland De Poel
Re: Is there a wxastronomy update
« Reply #46 on: October 16, 2022, 10:24:47 AM »
Hi,

I have always had a problem with the moontransit time showing.
I have edited this code
 
Code: [Select]
echo '
         <span style="color:'.$mC[0].'">'.langtransstr($mN[0]).': '.$mS[0].'</span><br />
         <span style="color:'.$mC[1].'">'.langtransstr($mN[1]).': '.$mS[1].'</span><br />
         <span style="color:'.$mC[2].'">'.langtransstr($mN[2]).': '.$mS[2].'</span><br /><br />
         <span style="color:gray;">';

to

Code: [Select]
echo '
         <span style="color:'.$mC[0].'">'.langtransstr($mN[0]).': '.$moontransittime.'</span><br />
         <span style="color:'.$mC[1].'">'.langtransstr($mN[1]).': '.$mS[1].'</span><br />
         <span style="color:'.$mC[2].'">'.langtransstr($mN[2]).': '.$mS[2].'</span><br /><br />
         <span style="color:gray;">';

$mS[0] subtituted by $moontransittime
The time is showing now but would this piece of code be a problem or incorrect?

*****
One other error that I got is the date for the beginning of spring.
It says March 20 2009

TIA

Offline hcorrin

  • Contributor
  • ***
  • Posts: 128
    • Ballaugh Weather
Re: Is there a wxastronomy update
« Reply #47 on: October 17, 2022, 06:15:17 PM »
that date for start of spring is the default if the testtags.php is not found or the "$marchequinox =  '%marchequinox%';" is missing from the testtags.txt that creates the php this is assuming you have WD generating it

Offline andro700

  • Chuck
  • Forecaster
  • *****
  • Posts: 420
    • Gobles Weather Page
Re: Is there a wxastronomy update
« Reply #48 on: October 18, 2022, 02:50:24 PM »
This section of the include-wxastronomy is not working. It worked before I updated to the newest update to the script. [ You are not allowed to view attachments ]

Code: [Select]
<?php
if($includeDayNightMap) { ?>

<!-- DAY / NIGHT MAP -->

<div align="center">
<h2>Current Sunlight Map</h2>

<script src="http://www.gmodules.com/ig/ifr?url=http://static.die.net/earth/gadget.xml&amp;up_clouds=1&amp;up_proj=mercator&amp;synd=open&amp;w=800&amp;h=443&amp;title=World+Sunlight+Map&amp;border=%23ffffff%7C3px%2C1px+solid+%23999999&amp;output=js" type="text/javascript">
</script>

<script src="http://www.gmodules.com/ig/ifr?url=http://static.die.net/earth/gadget.xml&amp;up_clouds=1&amp;up_proj=hemisphere&amp;synd=open&amp;w=800&amp;h=387&amp;title=World+Sunlight+Map&amp;border=%23ffffff%7C3px%2C1px+solid+%23999999&amp;output=js" type="text/javascript"></script>
<script src="http://www.gmodules.com/ig/ifr?url=http://static.die.net/moon/gadget.xml&amp;up_size=large&amp;up_info=1&amp;up_date=0&amp;synd=open&amp;w=350&amp;h=364&amp;title=Moon+Phase&amp;border=%23ffffff%7C3px%2C1px+solid+%23999999&amp;output=js" type="text/javascript"></script>
<!--
<table align="center" width="656" cellpadding="0" border="0" cellspacing="0" style="border: 2px solid gray; margin-top: 14px; background: black; color: white; font: 12px Arial;">
   <tr><td align="center">
      <b><big><?php echo strtoupper(langtransstr(&#39;Current Day / Night Map&#39;)); ?></big></b><br />
      <img src="<?php echo $daynightURL.$daynightImg?>" width="656" height="328" border="0" alt="Day / Night Map">
   </td></tr>
</table>
-->
<?php }

Chuck

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Is there a wxastronomy update
« Reply #49 on: October 18, 2022, 04:20:11 PM »
Yes, that wouldn't work for me either (in https), so I just turned it off.  Made for a busy page and was somewhat redundant with the earth globe showing clouds and day/night terminator.

I just set $includeDayNightMap = false; in the settings and it cleared up some http/https issues.
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