Tide Graphics - time to next tide

As an Easter present, I am releasing some Tide code and graphics to the WD community that I had programmed for me.

It displays in graphics and words the time until the next tide which I find easier to interpret than a table of tides. You can see it in operation on this page, as well as a 'mini" version on my Ajax dashboard on my home page.

http://wx.theshackbythebeach.com/wx/wxtides.php

The code including graphics and instructions can be downloaded from here:

http://wx.theshackbythebeach.com/wx/wxtides.zip

If you find it useful, please add a link to my site in your “Links” page.
Cheers

Edit: Instructions updated to include using “Short Time” in WX32TIDE for this to work

Ian


Which tidal basin are/is it using or is it good any wherers including places that have only one tide per day. Think you need to say little more about it in those tems rather then download and it not work.

John
KL7IFP

It uses the data generated by the WX32TIDE program that is integrated into WD … if your tides are displayed correctly in WD then this will work too …

Thanks Ian for sharing the code.
Great stuff.

This is exactly what Ive been looking for…but I ve just tried it out and I’m running into problems…

When I first uploaded the script it parsed OK and generated an image: but it said that it would be 17 hours to the next full tide - which is impossible!

I realised I’d set the tideprediction.hmtl up wrongly (it was showing the default Florida station) so I set it up for a local station (Newlyn, Cornwall, UK) and now its saying that its 0 hours till the next tide and theres no graphic…

http://www.rupertwhite.co.uk/weatherstation/timetonexttide.php

I will persevere with it but at this stage cant quite work out what the issue is…

Thanks anyway

Hi Jossiejojo,

I see that your page is currently saying it is 25 hours to teh next high tide, so something isn’t right :slight_smile:

I noticed the format of your tideprediction.html page is a little different to mine in relation to the dates displayed, have you set the following to “yes” as the default is no.

// If your tide dates include years (Monday 2008-09-10) change this to “yes” //
$yearDate = “no”;//

If that doesn’t work, I changed the date and time format within WX32Tide so that the year doesn’t display and neither does the time-zone. My dates display as follows:

Tuesday 04-14 Sunrise 0616, Sunset 1733 Moonset 1038, Moonrise 2023 Low Tide: 0532 0.4 High Tide: 1123 1.1 Low Tide: 1650 0.6 High Tide: 2327 1.5

Yours display as:

Monday 2009-04-13 Sunrise 6:33 AM GMTST, Sunset 8:13 PM GMTST Moonrise 12:12 AM GMTST, Moonset 7:50 AM GMTST Low Tide: 3:01 AM GMTST 1.0 High Tide: 8:32 AM GMTST 5.2 Low Tide: 3:16 PM GMTST 1.2 High Tide: 8:49 PM GMTST 5.2

Maybe try the WX32TIDE options so that year and timezone don’t display?

Let me know how you go?
cheers

hi everybody
I seem to be struggling with the tide script

could somebody have a look at the following page to see if they can work out where I’m going wrong

http://www.weather-above.com/tideprediction.html

mick

Hi

I was having some of the same problems.

I went into WXTIDE and changed the settings so the times were 24hr clock and the year didnt show and that sorted it…

Ive experimented with my own little graphic that looks rubbish at the moment but will look better if/when I animate it! The idea of course is that the page fills with water as the tide comes in…

Thanks for a great script! :smiley:

http://www.rupertwhite.co.uk/weatherstation/timetonexttide.php

Which brings me to my next question: presumably it is possible to use .gifs not .jpegs…I just wonder how the code would need rewriting…I’ll have a look later.

hi everybody

seemed to be having a problem with the tide program

when I start the program up manually it displays the graph with the correct time on,

following the instructions in weather display it says to exit the program, I have set the settings please see image

but I get a total different date on the graph please see Web Link
http://www.weather-above.com/tideprediction.html


Cant advise re the graph as I dont use them on my site

Ive got some animated gifs working for anyone thats interested:

http://www.rupertwhite.co.uk/weatherstation/timetonexttide2.php

The issue for me is that it would be nice if I could get the page to autorefresh. I understand this code should be sufficient but I’m not sure where it should go in the document…

header("Refresh: 60;");

Sorry I’m answering myself here…but Ive realised the html metatag is just as good…so Ive added it

but Ive noticed another problem: the script predicted the high tide at 9.30 this evening, but is now missing the next low tide and high tide and predicting the low tide tomorrow afternoon (in 18hrs and 15 mins - which isnt much good…)

Regarding the incorrect time to the next tide being displayed, it may be because your server is in a different time-zone to you? The script uses the internal time from the server, so if your are in the UK and the server is in the USA for example, you need to apply the offset as mentioned in my instructions. Can you check that and let us know?

Regarding the meta refresh, did you realise the time is in seconds, so your page is refreshing every 10 seconds? Not sure if you thought it was minutes?
Cheers

Ian

Hello again Ian

I dont think this can be the issue can it?..I’ll try and double-check but the script predicted the high tide this evening and there is a low tide tomorrow afternoon…the problem is that there is a low tide before that which it should also be recognising…

Hi, Yes that will definitely cause a problem :wink:

Think of it this way: My script takes the current server time and looks at the next tide as calculated by WX32TIDE. If your server is in a different timezone then it will look up the “wrong” tide from the WX32TIDE table.

Do you have any offset in the script ?
Cheers

OK I see what you mean - hence jumping a few hours

There is no time offset at the moment…I’m with UK2NET…not sure where their servers are…

hi everybody

I think I’m nearly there

ccould somebody just check the following web link
http://www.weather-above.com/tideprediction1.php

thank you for the script I have checked the tide against on another website on approximately 17 minutes difference

mick

Do you have the following as your tides now don’t have the year

$yearDate = “no”;//

I just looked at your site, it says that there are 16 hours 27 minutes to the next low tide at 4:18pm … although this isn’t the next tide, the number of hours is correct between the time now and 4:18pm, so I’m guessing you need a negative offset. Your next tide is 4:05am so I would try a negative 12 offset and see how that looks?

Hi Mick,

I think you are having the same issue as jossiejojo because the time to the next tide isn’t being picked up properly … its currently saying your next tide is a low tide in 14 hours 56 minutes which is not right, your next tide is about three hours away so I’d also try a negative 12 offset. Let us know how you go?

Cheers

http://www.rupertwhite.co.uk/weatherstation/timetonexttide2.php

The -12 offset seems to have worked for me. Thanks Ian!! You’ll see the black waves have receded on the page above!!

:smiley: :smiley: :smiley:

I’m still not sure if it’s right as your tide tables say the next low tide is 4:05am … your tidepredict page says the next tide is 4:18am and before you did the -12 offset it was 4:18PM …

http://www.rupertwhite.co.uk/weatherstation/tideprediction.html