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

First Pass Zonal Average #82

Open
wants to merge 30 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
e2a6d50
First pass zonal average
mgrover1 Mar 18, 2021
c09eadf
update environments and make suggested changes
mgrover1 Mar 19, 2021
ff4bc68
Restrict dimensions of variables
mgrover1 Mar 19, 2021
6fcd961
Update pop_tools/zonal_average.py
mgrover1 Mar 19, 2021
3e6b24c
Update pop_tools/zonal_average.py
mgrover1 Mar 19, 2021
8a0bd6d
Update pop_tools/zonal_average.py
mgrover1 Mar 19, 2021
4732c90
Update pop_tools/zonal_average.py
mgrover1 Mar 19, 2021
15488ca
Make suggested changes, use 3D region mask.
mgrover1 Mar 22, 2021
f950017
Add average DZT
mgrover1 Apr 1, 2021
acf689c
Move to regrid module, break up to_uniform_grid
mgrover1 Apr 2, 2021
db5c0d2
Update pop_tools/regrid.py
mgrover1 Aug 11, 2021
886790c
Update pop_tools/regrid.py
mgrover1 Aug 11, 2021
d4bb79c
Update pop_tools/regrid.py
mgrover1 Aug 11, 2021
31698c1
Merge branch 'master' into zonal_average
mgrover1 Aug 12, 2021
4fceca6
add revised version of zonal average with tests
mgrover1 Aug 12, 2021
2a9a0a9
update environment
mgrover1 Aug 12, 2021
6e14014
Apply suggestions from Deepak
mgrover1 Aug 13, 2021
b6623f1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 13, 2021
284997e
Update pop_tools/regrid.py
mgrover1 Aug 14, 2021
8a831a3
Update pop_tools/regrid.py
mgrover1 Aug 14, 2021
9726975
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 14, 2021
eba88b3
Update pop_tools/regrid.py
mgrover1 Aug 14, 2021
424c05f
address suggestions from anderson and deepak
mgrover1 Aug 14, 2021
69e4193
fix underscore in cf_xarray
mgrover1 Aug 14, 2021
2d017cc
fix missing check for TLAT
mgrover1 Aug 16, 2021
68a2a10
Update pop_tools/regrid.py
mgrover1 Aug 16, 2021
bbeeecb
remove remaining else block
mgrover1 Aug 16, 2021
4ff8a80
Apply suggestions from Deepak
mgrover1 Aug 17, 2021
d415190
fix names of variables, fix linting
mgrover1 Aug 17, 2021
8d54ba7
update tests, remove unncessary function
mgrover1 Aug 17, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update pop_tools/zonal_average.py
Co-authored-by: Deepak Cherian <[email protected]>
  • Loading branch information
mgrover1 and dcherian authored Mar 19, 2021
commit 3e6b24c37b1d609c3e8eb77d6b0e7ef2ff27c6e1
5 changes: 2 additions & 3 deletions pop_tools/zonal_average.py
Original file line number Diff line number Diff line change
@@ -210,9 +210,8 @@ def regrid(self, obj, **kwargs):

# Make sure the variable has the correct dimensions, is not a coordinate, and is not a velocity
if (
('nlat' and 'nlon' in obj[var].dims)
and (var not in list(obj.coords))
and ('velocity' not in obj[var].long_name.lower())
('nlat' in obj[var].dims and 'nlon' in obj[var].dims)
and ('ULONG' not in obj[var].attrs["coordinates"] and 'ULAT' not in obj[var].attrs["coordinates"])
):
ds_list.append(obj[var])
return xr.merge(ds_list).map(self._regrid_dataarray, keep_attrs=True, **kwargs)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead build a list of variables names and then ds[list_of_varnames].map(...)