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

Cannot regrid generic grids #26

Open
chaosphere2112 opened this issue Nov 15, 2016 · 5 comments
Open

Cannot regrid generic grids #26

chaosphere2112 opened this issue Nov 15, 2016 · 5 comments
Assignees

Comments

@chaosphere2112
Copy link
Contributor

import cdms2, vcs

f = cdms2.open(vcs.sample_data + "/sampleGenGrid3.nc")
f2 = cdms2.open(vcs.sample_data + "/clt.nc")
sample = f("sample")
clt = f("clt")
sample.regrid(clt.getGrid())

raises:

/Users/fries2/anaconda/envs/cdat_widgets/lib/python2.7/site-packages/cdms2/avariable.pyc in regrid(self, togrid, missing, order, mask, **keywords)
   1128                             dstGridMask = None,
   1129                             dstGridAreas = None,
-> 1130                             **keywords)
   1131             # now interpolate
   1132             return ro(self, **keywords)

/Users/fries2/anaconda/envs/cdat_widgets/lib/python2.7/site-packages/cdms2/mvCdmsRegrid.pyc in __init__(self, srcGrid, dstGrid, dtype, regridMethod, regridTool, srcGridMask, srcGridAreas, dstGridMask, dstGridAreas, **args)
    337         self.dstGrid = dstGrid
    338 
--> 339         srcCoords = _getCoordList(srcGrid)
    340         dstCoords = _getCoordList(dstGrid)
    341 

/Users/fries2/anaconda/envs/cdat_widgets/lib/python2.7/site-packages/cdms2/mvCdmsRegrid.pyc in _getCoordList(grid)
    216 
    217         # have axes, need to convert to curvilinear grid
--> 218         cgrid = grid.toCurveGrid()
    219 
    220         lats = cgrid.getLatitude()

AttributeError: 'TransientGenericGrid' object has no attribute 'toCurveGrid'

This is because the TransientGenericGrid object has no function to convert to a TransientCurveGrid. I tried switching toCurveGrid() to toGenericGrid(), but that leads to a lot of weird errors.

@durack1
Copy link
Member

durack1 commented Nov 15, 2016

@dnadeau4 @chaosphere2112 the ocean grids are a particularly good test target for this.. See CDAT/cdat#1707, CDAT/cdat#819 and CDAT/cdat#402 - these may be dupes if the grid issues are correctly resolved

@chaosphere2112
Copy link
Contributor Author

@durack1 Yup, I'm trying to plot MPAS data right now 😄

@durack1
Copy link
Member

durack1 commented Nov 15, 2016

@chaosphere2112 let me know if you want a bunch of the CMIP5 ocean grid data, adding these to the test suite will ensure that the software is up-to-date with at least the latest (circa ~2012) grid info

@chaosphere2112
Copy link
Contributor Author

The sample I provided should hopefully be enough for @dnadeau4 to make it so the generic grids can even get to the regridding stage; more data would be good for more rigorous testing once we've gotten to that point.

@durack1
Copy link
Member

durack1 commented Nov 15, 2016

@chaosphere2112 @dnadeau4 no problem, when you get to that stage tap me again (here) and I'll generate the other test data

@dnadeau4 dnadeau4 added this to the 3.0 milestone Nov 22, 2016
@doutriaux1 doutriaux1 removed this from the 3.0 milestone Mar 29, 2018
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

4 participants