Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def getdzf(self,eta):
""" Get the cell thickness along each edge of the slice"""
dzf = Spatial.getdzf(self,eta,j=self.j)
dzf[self.maskslice]=0
return dzf
def ncload(nc,variable,tt):
if variable=='agemean':
ac = nc.variables['agec'][tt,klayer,:]
aa = nc.variables['agealpha'][tt,klayer,:]
tmp = aa/ac
tmp[ac<1e-12]=0.
return tmp/86400.
if variable=='area':
eta = nc.variables['eta'][tt,:]
dzf = self.getdzf(eta)
dzf = Spatial.getdzf(self,eta)
return self.df*dzf
else:
if self.hasDim(variable,self.griddims['Nk']): # 3D
return nc.variables[variable][tt,klayer,:]
else:
return nc.variables[variable][tt,:]