Skip to content

overly precise cell dimensions test creates issues with non square cell sizes #121

@craigmillernz

Description

@craigmillernz

The test for nonsquare cell sizes could be relaxed so that this error does not occur. Perhaps some rounding of grid dimenions prior to this test would be good.

fft = gx.grid_fft.GridFFT(grd)
File "C:\Users\xxxxx\Anaconda3\lib\site-packages\geosoft\gxpy\grid_fft.py", line 223, in __init__
  raise GridFFTException(_t('Cell size must be square'))

My grid cell sizes only vary in the 13th? decimal place of a meter.

grd.dx
Out[9]: 99.658858107433**62**
grd.dy
Out[10]: 99.658858107433**59**

proposed solution line 222/223 of grid_fft.py

if np.round(grid.dx, 10) != np.round(grid.dy):
            raise GridFFTException(_t('Cell size must be square'))

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions