Predict tides at various places around New Zealand tide from LINZ tide data.
- Decide on the prediction dates. I usually allow 1 day before and 2--3 days after the planned travel.
- Decide on the region that you will be travelling, and the primary and secondary ports in that region that you want predictions for.
- Create a 'trip', with a name that ties together the region you will be travelling in and the dates of the trip.
- Download tide tables for the primary ports involved over the dates of travel.
- Ensure that the secondary ports data is up-to-date.
- Number of ports: 250 (15 primary, 220 secondary)
- Number of events: 1460 per year per port
- Number of events per year: 365000
However, we only create secondary tide events when we create a trip, for the ports in the region where the trip occurs, and for the dates associated with the trip.
So the database is relatively small.
- Read tide predictions for primary ports from a CSV file downloaded from LINZ -- DONE
- Adjust to NZDT when appropriate -- DONE
- Calculate tide time prediction for secondary ports -- DONE -- read data from LINZ data file..
- Calculate tide height predicition for secondary ports -- DONE
- Set up a number of different regions, with ports in that region -- DONE
- Set up a number of trips, with a region that the trip will take place, a start date and an end date -- DONE
Find timezone library, rather than using my own.
Choose port and time range to generate output for
Format output for easy import into spreadsheet:
Date Nelson Motueka Astrolabeā¦ Sun Moon 2013-12-27 0506 H 3.3 0511 H 3.3 0446 H 3.7 R 0129 Friday 1111 L 1.4 1130 L 1.5 1051 L 1.4 S 1458 1744 H 3.4 1749 H 3.4 1724 H 3.8 2353 L 1.2 2333 L 1.1 2013-12-28 0012 L 1.3 R 0554 R 0203 Saturday 0615 H 3.3 0620 H 3.3 0555 H 3.7 S 2102 S 1603 1228 L 1.3 1247 L 1.4 1208 L 1.3 1851 H 3.4 1856 H 3.4 1831 H 3.8 2013-12-29 0059 L 1.1 0118 L 1.2 0039 L 1.0 R 0243 Sunday 0729 H 3.5 0734 H 3.5 0709 H 3.9 S 1710 1340 L 1.2 1359 L 1.3 1320 L 1.1 1955 H 3.6 2000 H 3.6 1935 H 4.0
Use a view for the secondary tide events rather than a table. Don't think this is possible, as we have to do a cartesian product of
secondary_ports x primary_tide_events