Last active
June 25, 2021 06:25
-
-
Save Thomas-Moore-Creative/8e4f6d37423ceab7594dfed5cc6697eb to your computer and use it in GitHub Desktop.
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 calc_EKE(u, v): | |
''' | |
Author1 = {"name": "Thomas Moore", "affiliation": "CSIRO", "email": "thomas.moore@csiro.au", "orcid": "0000-0003-3930-1946"} | |
u,v are x and y currents as an xarray data array | |
''' | |
u_mean = u.mean('time') | |
v_mean = v.mean('time') | |
MKE = 0.5*(u_mean**2 + v_mean**2).rename('MKE') # currents | |
EKE = ( 0.5 * ((u-u_mean)**2 + (v-v_mean)**2) ).rename('EKE') # eddies | |
return EKE, MKE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment