Using pyTMD to generate a week's worth of tidal readings #550
|
Several years ago I wrote a Ideally I would find another source; so far, no such luck. The current (extremely dissatisfactory) solution requires the end-user to write a Looking at After lots more reading/thinking, I have questions...
I feel that using Thoughts, miracles, most welcome! Thanks, Bernard. |
Replies: 5 comments 10 replies
|
Hey @Bernmeister, Great questions and I'm glad @robbibt was able to get you going! I use a library called for a week of hourly predictions. I tinkered around with Alternative 1: could use the Alternative 2: could extract constituents at some locations by interpolating from a "good" global model. You would just need to save the outputs (which should hopefully be pretty small). Alternative 3: could use a model saved in a cloud-native format and run the analysis in the cloud (e.g. I have some zarr-ified versions of models stored in an s3 bucket). Happy to also think a little bit more on this :) |
|
Thanks for the suggestions @tsutterley and @robbibt; I will go with Alternative 2. In broad strokes:
(I'm tempted to pass this to an AI engine and see what it gives back ;-)) Using the example in the Programs section as a start, I'm getting an error (unsure if it's a configuration issue or beginner's luck)... Given the following layout: My script Error: The last line of the error message suggests Help! |
|
@tsutterley Thank you for the code; got a pretty graph! Despite having done I ran two iterations: 2020-01-01 - 2020-01-10 and 2025-01-01 - 2025-01-10 (both at hourly intervals) and dumped the output using Comparing the first line of output of each, there are no matches... I had assumed the harmonic constituents for a given latitude/longitude would not change over time. What am I missing here? My (naive) expectation was that I could to obtain (synthetic) harmonic constituents for a given latitude/longitude from a model ( Had I not seen these differences, my next step would have been to compare the harmonic constituents from |
|
So far, so good: thanks to @tsutterley et al, I've gotten further (I think)... From Plot Tide Forecasts, I grabbed the section of code which I believe gives the indices for the high tide values and low tide values. Looking at a plot of the tidal predictions, the highs and lows oscillate between 80 cm and -60 cm (for late April 2026). This is where I figure some sort of datum calculation comes into play to give the actual tide level that a tide table would report. From Compare NOAA Tides, I see which suggests this plan of attack will only work for gauges in the US. Looking in the source data I suspect that to go from the tidal levels to a tide table reading, I need this Any ideas for the next step please? |
|
Made it to the finish line, despite unexpected side quests and learning more about tides and dataframes than I anticipated! A tremendous thank you to @tsutterley for keeping me on the straight and narrow and thank you to the others who contributed along the way with suggestions and advice. Greatly appreciated and ultimately all I had to do was take some data and call an API! So what have I done...?
|
Made it to the finish line, despite unexpected side quests and learning more about tides and dataframes than I anticipated! A tremendous thank you to @tsutterley for keeping me on the straight and narrow and thank you to the others who contributed along the way with suggestions and advice. Greatly appreciated and ultimately all I had to do was take some data and call an API!
So what have I done...?
Created a script to whittle
TICON-4down from 47MB to 4MB. I threw out lines which had reported data issues and dropped tide gauges for which there appeared to be duplicates. Each line/entry comprises one of the remaining tide gauges with the harmonic constituents in tow.Retro-fitted my ex…