The constructor of Img2Ts does the following check on the target_grid:
# if the target grid is not a cell grid make it one
# default is just one cell for the
# this is just a dirty hack until grids have a method
# to check their grid type
if (type(self.target_grid) == grids.BasicGrid or
(pygeogrids.grids.BasicGrid in type(self.target_grid).__bases__ and
len(type(self.target_grid).__bases__))) == 1:
self.target_grid = self.target_grid.to_cell_grid(cellsize_lat=cellsize_lat,
cellsize_lon=cellsize_lon)
However, when using a CellGrid, the condition evaluates to True. Therefore the target_grid is again converted to a cell_grid, but probably with different cellsizes.
I would propose to instead test whether the expected functions of the target grid are available, e.g. get_cells, or whether it has the attribute arrcell.
The constructor of
Img2Ts
does the following check on the target_grid:However, when using a
CellGrid
, the condition evaluates toTrue
. Therefore the target_grid is again converted to a cell_grid, but probably with different cellsizes.I would propose to instead test whether the expected functions of the target grid are available, e.g.
get_cells
, or whether it has the attributearrcell
.