Cruisers Forum
 


Reply
  This discussion is proudly sponsored by:
Please support our sponsors and let them know you heard about their products on Cruisers Forums. Advertise Here
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 12-02-2012, 21:22   #1
Registered User

Join Date: Nov 2009
Posts: 45
Tide Units

Is there a way to set the units for the tide data? Patos Island, WA displays in meters, while others nearby display in feet. Is there a way to make the default feet or edit a file so that Patos will display in feet instead of meters?
StargazerWA is offline   Reply With Quote
Old 13-02-2012, 00:27   #2
Registered User

Join Date: Dec 2005
Location: Helsingborg
Boat: Dufour 35
Posts: 3,891
Re: tide units

Yes it's possible to change default to feet.
Here is what you have to do:
Find the HARMONIC file. On Linux you find it in /usr/local/share/opencpn/tcdata/. On Win Program Files/openCPN/tcdata.

Open the file in a text editor (not words or similar) and search for "Patos".
At about line 400570 (quite a few lines!) you will see this
Quote:
# Merged from harmonics.canadian.
#
# rel_pedigree: 1250000000 (Via LaPointe)
# !units: meters
# !longitude: -122.9667
# !latitude: 48.7833
Patos Island, Washington
-08:00 :America/Los_Angeles
2.5390 meters
Replace the last line with
Quote:
#2.5390 meters
8.32459016393 feet
Save! Close down OpenCPN and IF IT EXISTS Delete "station_mru.dat" in opencpn's configuration folder. To find that folder read this Installing OpenCPN | Official OpenCPN Homepage

Restart OpenCPN and check the result!

Thomas
cagney is offline   Reply With Quote
Old 13-02-2012, 21:57   #3
Registered User

Join Date: Nov 2009
Posts: 45
Re: Tide Units

For some crazy reason it didn't work. It still reports in meters. I searched for a second older version of HARMONIC and found none. I also searched for station_mru.dat with no luck. I can't figure out why it didn't work. Thoughts?
StargazerWA is offline   Reply With Quote
Old 14-02-2012, 02:10   #4
Registered User

Join Date: Dec 2005
Location: Helsingborg
Boat: Dufour 35
Posts: 3,891
Re: Tide Units

Quote:
Originally Posted by StargazerWA View Post
For some crazy reason it didn't work. It still reports in meters. I searched for a second older version of HARMONIC and found none. I also searched for station_mru.dat with no luck. I can't figure out why it didn't work. Thoughts?
It seems like Windows is a bit tricky. I have just tested on an XP box.
You have to find and delete the "station_mru.dat" which is a cache.
This file is in the same folder as config.ini. OpenCPN must be closed when you delete this file. One problem could be that there is a delay in writing this file. I have also had problems finding it, but today it popped up where it was supposed to be. It is also important that you set Explorer to show all files. Tick "Show Hidden Files and folders" and un-tick "Hide protected operatingsystem Files". Once this is done, the search program should find the file.

Thomas
cagney is offline   Reply With Quote
Old 14-02-2012, 05:03   #5
Registered User

Join Date: Feb 2011
Posts: 1,102
Re: Tide Units

In Windows 7, would that be the following file:- tcmgr.cpp
At least that is the one showing the unit.
Regards
Pdub
P_Dub is offline   Reply With Quote
Old 14-02-2012, 08:27   #6
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,423
Re: Tide Units

I can confirm it works on XP. Is that what makes you so smart,Thomas? fermented Herring brainfood?
HappySeagull is offline   Reply With Quote
Old 14-02-2012, 09:26   #7
Registered User

Join Date: Dec 2005
Location: Helsingborg
Boat: Dufour 35
Posts: 3,891
Re: Tide Units

Well....
Talking about smart. I took the conversion factor 1 foot = 0.305 m from the top of my head. Looking into the matter I find that it's actually 0.3048 m.
The correct replacement line, should be
Quote:
8.33005249344 feet
As for fermented herrings - can't stand it! (the smell !!)

Thomas
cagney is offline   Reply With Quote
Old 14-02-2012, 11:58   #8
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,423
Re: Tide Units

Darn! I guess I'll stick to my "kippers" then.

But that's a cool hack to know!...There are some BC tides that have no foot equivalent so I canadd a special named entry in HARMONIC and then a reference to it in Harmonic.idx without wrecking the originals overmuch...
...I'm going to try from foot-->metric too and see ...
HappySeagull is offline   Reply With Quote
Old 14-02-2012, 12:17   #9
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,423
Re: Tide Units

Click image for larger version

Name:	compare_cr2.png
Views:	187
Size:	14.3 KB
ID:	37392

Click image for larger version

Name:	compare.png
Views:	142
Size:	30.3 KB
ID:	37393

HappySeagull is offline   Reply With Quote
Old 14-02-2012, 18:25   #10
Registered User

Join Date: Nov 2009
Posts: 45
Re: Tide Units

Finally found the file. Opencpn is installed on my D drive, but for some Windows reason the file was in the C:\Program files directory ! Works great now, thanks everyone.
StargazerWA is offline   Reply With Quote
Old 15-02-2012, 04:55   #11
Registered User

Join Date: Dec 2005
Location: Helsingborg
Boat: Dufour 35
Posts: 3,891
Re: Tide Units

All!
If I could delete my earlier posts in this thread I would - To much crap.

First the short version. The lines below needs to replace the corresponding lines in HARMONICS file.

Code:
Patos Island, Washington
-08:00 :America/Los_Angeles
#2.5390 meters
8.32459016393 feet
J1             0.1476  198.90
K1             2.5919  165.30
K2             0.1608  177.80
L2             0.6562  171.60
x 0 0
M2             2.2310  153.10
M3             0.0066  353.40
M4             0.4593  313.30
M6             0.0033 332.00
M8             0.0033  245.80
N2             0.4692  126.70
2N2            0.0558   61.90
O1             1.4928  150.60
x 0 0
P1             0.8038  164.90
Q1             0.2559  146.00
2Q1            0.0098  230.00
x 0 0
x 0 0
S2             0.5479  174.80
x 0 0
x 0 0
T2             0.0328  173.90
LDA2           0.0098  158.90
MU2            0.0459   48.70
NU2            0.0755 129.30
RHO1           0.0361  146.60
MK3            0.0098  346.30
x 0 0
MN4            0.0197  289.50
MS4            0.0262  346.20
2SM2           0.0033  119.20
x 0 0
MSF            0.0262 141.40
MM             0.0853  203.40
x 0 0
x 0 0
x 0 0
MF-IOS         0.0755  146.00
x 0 0
OO1-IOS        0.3337  197.70
R2-IOS         0.0033  175.70
x 0 0
x 0 0
x 0 0
x 0 0
2MN6           0.0033  325.50
x 0 0
x 0 0
x 0 0
2SM6           0.0033   96.50
x 0 0
x 0 0
x 0 0
x 0 0
x 0 0
x 0 0
x 0 0
CHI1           0.0098   11.30
x 0 0
x 0 0
x 0 0
ETA2           0.0164  357.70
x 0 0
x 0 0
x 0 0
x 0 0
MK4            0.0064   47.00
MKS2           0.0164  165.40
x 0 0
EPS2           0.0164  324.50
MO3            0.0262   17.70
x 0 0
TAU1           0.0525  259.10
x 0 0
x 0 0
x 0 0
MSN2           0.2230   72.50
MSN6           0.0033  38.00
x 0 0
NO1            0.1181  186.60
OP2            0.0328   97.30
OQ2            0.0033   80.80
x 0 0
x 0 0
x 0 0
x 0 0
x 0 0
x 0 0
x 0 0
SIG1           0.0033  223.00
SK3            0.0164   73.30
x 0 0
x 0 0
x 0 0
SO1            0.0656  256.60
SO3            0.0131  348.80
THE1           0.0459  192.60
Copy and paste. Be careful to change just these lines. Then delete station_mru.dat etc as above.
Please test and confirm.

Long version:
The line
Quote:
2.5390 meters
represents the datum level for the tide and the units.
Pure luck that just this change worked for a given time. Just look at the heights for Low water today and it's obviously not correct.
There is more to it - to change from meters to feet, or vice versa.

Quote:
J1 0.1476 198.90
This line is one of the harmonic constants, the first number, in this case 0.1476 represents the amplitude and must also be converted.
For meters to feet multiply with 1/0.3048, for feet to meters multiply with 0.3048. This must be done for all the Harmonic constants.

For secondary stations in HARMONIC.IDX, the base station must first be converted. Then in the second line describing the station values 3 and 6 representing "Hoff" and Loff" must also be converted. I have not tested this.

@Happy Seagull

Still a lot of crap in these files that needs sorting out.
Many base station doubles on the same position with different values, for example Denman Island and Cape Alava. We should keep the correct one and get rid of the other.

Thomas
cagney is offline   Reply With Quote
Old 15-02-2012, 08:51   #12
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,423
Re: Tide Units

@Cagney,
I have already made a shifted version that shows double stations , metric and imperial so they don't overide each other. I'll go find it and test it against the newest HARMONIC...
Metric is the second station (2) that is on the same position and corrupts display ,as a general rule) in Canada...but some don't have both.
But, it's easier to just # out one or the other for a metric version or an imperial version... the trouble is choosing which? The Yanks and old Imperial Canadians like me prefer feet. So I made two versions of Harmonic.idx metric and Imperial but they need testing against the worldwide stations too and it'd be better to make new versions...?
meters
http://www.cruisersforum.com/forums/...tml#post837579
feet
http://www.cruisersforum.com/forums/...tml#post839989

I'll test your conversion above on some BC stations that have both feet and metric and see!

I'd be happy to choose just one station on position.That'd help a lot. Most of the problematic repeats often have reasons that could be dispensed with, in my opinion and they could be # out of harmonic idx and HARMONIC too.


The (2),(3) 's in the US are different depths, I think you said. Or different versions in the HARMONIC of the same place.I know a lot were fixed on both American coasts but yes, there's soooo many!
HappySeagull is offline   Reply With Quote
Old 15-02-2012, 09:14   #13
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,423
Re: Tide Units

HARMONICfeetandMeters.zip.doc

here Metric and feet moved apart...but It needs testing in worldwide stations...One problem I've seen in various versions of Harmonic.idx and HARMONIC out there are keyboard issues...as in : "Hornafjörður"- aargh. or even
"Quebec"- see? no accent over the e.This is as in OpenCPNs version but not in the various others floating around out there, which have accents, just in case anyone's wondering if there is really a complete version anywhere.
HappySeagull is offline   Reply With Quote
Old 15-02-2012, 10:22   #14
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,423
Re: Tide Units

Click image for larger version

Name:	test rewritemeter2FEET.png
Views:	148
Size:	15.1 KB
ID:	37430
compared...Version 3 is the Harmonic rewritten from metric entry.
Much Better! but it's a lot of work to find a tool I have which will do the "copy->do math->paste back" quicker than just typing!
HappySeagull is offline   Reply With Quote
Old 15-02-2012, 12:12   #15
Registered User

Join Date: Dec 2005
Location: Helsingborg
Boat: Dufour 35
Posts: 3,891
Re: Tide Units

It would be possible to script this.........but.
I think another approach would be better. OpenCPN can convert the data just before writing to screen. A choice between all metric and all imperial/US measurements would then be possible thorough some user settings.

To start from the beginning. I don't know if there is much point in editing to much before we know what Dave intends to do in the future regarding tides. He is considering to change to xtides binary format, which seems to be some kind of industry standard.

If it is possible to separate the code, I think there is a good argument for making the tides into a plugins, or maybe an Tide& Current Manager, that accepts input in different formats.
*The old format ( we use presently) could be one plugin. All the existing versions of HARMONIC & HARMONC.IDX can still be used.
*The standard xtide binary format could be one plugin.
*Possibility for an up to date commercial tide plugin. For areas where tidal data are not provided by governments or other institutions for free, existing data are getting very old. For some users this could be an attractive solution.

Regarding "Hornafjörður" and similar names. These names now works, as the tidal files are pure UTF-8. (except for comments in the beginning of the files that I did not bother with.) All editing needs to be done in this format as well! A lot of the tidal files floating around on this and other forums are not UTF-8 and the "tides" for "Hornafjörður" would probably only be displayed as a vertical red line in the middle of the dialog.

Thomas
cagney is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenCPN Route Planning with Time and Tide PjotrC OpenCPN 14 28-11-2011 12:11
Berthing with Less than Adequate Draft at Low Tide waterside Monohull Sailboats 14 10-11-2011 22:05
Tide / Current Predictions in Caribbean kiltym Navigation 0 04-09-2011 09:39
Wiring Brookhouse AISC to two E-120 RM units C Skip R Marine Electronics 2 03-07-2011 14:27

Advertise Here


All times are GMT -7. The time now is 20:24.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.