Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
Think about Loose Coupling
 
PerlMonks  

Re^3: Ocean tides in Perl

by GrandFather (Cardinal)
on Nov 01, 2011 at 11:13 UTC ( #935093=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Ocean tides in Perl
in thread Ocean tides in Perl

Well, I have about 500 lines of C that uses a 37 coefficient set to perform tide prediction calculations but it's not code I can release to the public domain (I don't have ownership of it) and I'm not sure I could legally derive a Perl equivalent from it. However, it's pretty much solid calculation so the equivalent Perl wouldn't be a heck of a lot smaller. You can gauge from that the size of the coding task. Oh, and I don't know how compatible that set of parameters may be with publicly available tide parameter sets so the whole thing could be a complete waste of time in any case.

To be of any practical use a tide calculation module would need to use a set of parameters for which data is publicly available. It's about 10 years since I worked on any of this stuff so maybe things are different now, but then the data was considered valuable and was hard to come by. Because of the potential difficulty in getting data I'd think there would be little call for such a module in CPAN. My involvement in such calculations has long since passed so I have no particular current interest in creating such a module.

True laziness is hard work


Comment on Re^3: Ocean tides in Perl
Re^4: Ocean tides in Perl
by flexvault (Vicar) on Nov 01, 2011 at 17:28 UTC

    About 20+ years ago, I wrote a small basic program for a Yacht Club. The data was available from a US government agency for a specific geographic location. The Yacht Club knew that their location was 1 hour 22 minutes behind the tide for that specific geographic location. With that information the program produced a chart something like the following for the entire year:

    Tides for ____________________ starting with November 1, 2011. Day High Tide Height Sunrise Moon Time % Moon /Low Time Feet Sunset Visible Tu 1 High 3:41 AM 3.0 7:43 AM Rise 1:23 PM 31 1 Low 11:14 AM 0.2 6:47 PM 1 High 5:57 PM 2.2 1 Low 11:06 PM 1.1

    The only calculations the program made was to adjust the 'Tide Time'. For perl to do this the script would be trivial.

    From this discussion, it sounds like I needed to account for a lot more. Isn't tide predicting mostly an approximation?

    "Well done is better than well said." - Benjamin Franklin

      For approximate times that technique is ok but gets worse the further separated the reference station and the point of interest are. The error is also a strong function of local sea floor topology. However if you are interested in tide height rather than just times of slack water then this technique can degrade rapidly over fairly short distances.

      True laziness is hard work
      Has been 20 years, but do you still have the code that generated that chart?
Re^4: Ocean tides in Perl
by pvaldes (Hermit) on Nov 02, 2011 at 15:56 UTC
    I can understand the reasons of any monk to be reluctant to show any code that is the result of many hours of hard work and I'm sure that the other monks think the same; in any case your reply sheds a lot of light on the subject and I think it points the OP in the right direction. In short, excelent advice, very illustrative to me, thank you.

      You misunderstand. It's not my code to give. It was someone else's code I used to solve a problem for yet another person. The person I was solving the problem for obtained the code (legally) for the express purpose of solving a specific problem from the company that owned the code.

      True laziness is hard work

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://935093]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2014-04-19 11:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (480 votes), past polls