Skip to content

Commit

Permalink
Add velocity() function
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexeyPechnikov committed Apr 26, 2024
1 parent 3d93878 commit 2aef4e6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pygmtsar/pygmtsar/Stack_stl.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@

class Stack_stl(Stack_tidal):

def velocity(self, data):
years = ((data.date.max() - data.date.min()).dt.days/365.25).item()
#print ('years', np.round(years, 3))
velocity = data.mean('date')/years
return velocity

def trend(self, data, deg=1):
import xarray as xr

Expand Down

0 comments on commit 2aef4e6

Please sign in to comment.