Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grid spacing in xarray example area calculation #3

Open
NickMortimer opened this issue May 10, 2019 · 1 comment
Open

grid spacing in xarray example area calculation #3

NickMortimer opened this issue May 10, 2019 · 1 comment

Comments

@NickMortimer
Copy link

@jmunroe going through the example the latitude spacing is 2 degrees not 1 so area calculation is compromised

probably should be something like

dϕ = np.deg2rad(sst.lat.pointwidth)
dλ = np.deg2rad(sst.lon.pointwidth)
dA = R**2 * dϕ * dλ * np.cos(np.deg2rad(ds.lat.rename('area')))
dA.attrs['units'] ='m^2'
dA.plot()

Kind of want to do my first pull request for the pangeo community but need to find the source of this notebook

@jmunroe
Copy link
Owner

jmunroe commented May 10, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants