How to use the sunpy.Spatial.getdzf function in sunpy

To help you get started, we’ve selected a few sunpy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ofringer / suntanspy / SUNTANS / sunslice.py View on Github external
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
github ofringer / suntanspy / SUNTANS / sunslice.py View on Github external
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,:]