Skip to content

Commit

Permalink
Return tide height as an integer value (instead of float)
Browse files Browse the repository at this point in the history
  • Loading branch information
hleroy committed Aug 17, 2019
1 parent 871d2c1 commit 2232c28
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__pycache__
6 changes: 3 additions & 3 deletions tmgpm.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def height(self, t):
t (float) -- Time expressed as a fractional number (e.g. 9.5 for 09h30m
Returns:
Tide height in mmillimeters
integer -- Tide height in millimeters
"""
# Initialize tide height at the station Z0 value
# Z0 is stored in cm and the tide calculations are done in millimeters,
Expand All @@ -167,8 +167,8 @@ def height(self, t):
phij = self.phi0[j] + t / 24.0 * (j * 360 + delta_j)
height += Rj * cos(radians(phij))

# and return the value
return height
# and return the value casted as an integer
return int(height)

def _init_harmonic_data(self):
self.A = [[0. for _ in range(11)] for _ in range(5)]
Expand Down

0 comments on commit 2232c28

Please sign in to comment.