Skip to content

Cannot regrid generic grids #26

@chaosphere2112

Description

@chaosphere2112
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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions