-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/** | ||
* Calculates a tidal curve for a given location | ||
* According to "TIME & HEIGHT DIFFERENCES FOR PREDICTING THE TIDE AT SECONDARY PORTS" (https://assets.admiralty.co.uk/public/2022-04/5609%202022%20Feb.pdf) | ||
* For Milford Haven: | ||
* MHWS 7.0 | ||
* MHWN 5.2 | ||
* MLWN 2.5 | ||
* MLWS 0.7 | ||
* Midpoint therefore 3.85 (calculated as average of MHWS-((MHWS-MLWS)/2) & MHWN-((MHWN-MLWN)/2) ) | ||
* | ||
* For Criccieth: | ||
* MHWS -2 5.0 | ||
* MHWN -1.8 3.4 | ||
* MLWN -0.7 1.8 | ||
* MLWS -0.3 0.4 | ||
* Midpoint therefore = 2.65 | ||
* | ||
* For Porthmadog: | ||
* MHWS -1.9 5.1 | ||
* MHWN -1.8 3.4 | ||
* MLWN ??? so we assume 1.8 | ||
* MLWS ??? so we assume 0.3 | ||
* Midpoint therefore assumed = 2.65 | ||
* | ||
* Using the midpoint we can derive the lowest height for a given time and high tide to be MIDPOINT - (HEIGHT - MIDPOINT) | ||
* | ||
* This isn't very acurate because of the river Glaslyn, so the admiralty do not therefore publish tidal curves for this location, or low tide times - we have just derived them from their data | ||
* | ||
*/ | ||
import { TidesJson_ScheduleObject } from "../../types"; | ||
// According to "TIME & HEIGHT DIFFERENCES FOR PREDICTING THE TIDE AT SECONDARY PORTS" | ||
const generateTideGraphData = (tideData: Array<{ date: Date, height: number }>): Array<{ timestamp: number, height: number }> => { | ||
return [] | ||
} |