Last active
December 15, 2020 10:33
-
-
Save eiriks/108ee24df0fc75c2e1a47a8026bf8db8 to your computer and use it in GitHub Desktop.
draught adjustment factor pseudocode
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
def draught_adjustment_factor(hour_slice_of_ais_ts): | |
# # | |
# | |
# Things we are missing: | |
# - DraughtRatio for ballasted ship (DRb) | |
# - DraughtRatio for loaded ship (DRl) | |
# - DraughtRatio for non-ballasted ship (DRnbs) | |
# Are these in IHS Fairplay? | |
# Cannot see where they come from, or how they are computed. | |
# | |
# # | |
# | |
# Things we can compute: | |
# - assign AIS time series ballast/loaded labels pr voyage | |
# - percentage of ballast voyages (Pb) | |
# - percentage of loaded voyages (Pl) | |
# | |
# Draught Adjustmen Factor - non ballast ships | |
DAFnbs = ( | |
# Draught Ratio - non-ballasted ships | |
DRnbs ** (2/3) | |
) | |
# Draught Adjustment Factor - ballasted ship | |
DAFbs = ( | |
# DRb = draught ratio for ballasted ships during ballast condition | |
# Pb = percentage of ballast voyage annually for ballasted ships | |
(DRb ** (2/3) * Pb) | |
+ | |
# DRl = draught ratio for ballasted ships during loaded condition | |
# Pl = percentage of loaded voyage annually for ballasted ships | |
(DRl ** (2/3) * Pl) | |
) | |
if (hour_slice_of_ais_ts.ballast == True): | |
return DAFbs | |
else: | |
return DAFnbs | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment