set a minimum number of computed grid values to trigger upscaling of grid image
This commit is contained in:
@@ -519,10 +519,14 @@ verbose: {verbose}")
|
|||||||
dtype=np.float64) # this reduces values to 8 decimal places
|
dtype=np.float64) # this reduces values to 8 decimal places
|
||||||
iml_grid_tmp = np.nan_to_num(iml_grid[j]) # change nans to zeroes
|
iml_grid_tmp = np.nan_to_num(iml_grid[j]) # change nans to zeroes
|
||||||
|
|
||||||
# upscale the grid
|
# upscale the grid if there are at least 10 grid values
|
||||||
|
if np.count_nonzero(iml_grid_tmp) >= 10:
|
||||||
up_factor = 4
|
up_factor = 4
|
||||||
iml_grid_hd = resize(iml_grid_tmp, (up_factor * len(iml_grid_tmp), up_factor * len(iml_grid_tmp)),
|
iml_grid_hd = resize(iml_grid_tmp, (up_factor * len(iml_grid_tmp), up_factor * len(iml_grid_tmp)),
|
||||||
mode='reflect', anti_aliasing=False)
|
mode='reflect', anti_aliasing=False)
|
||||||
|
else:
|
||||||
|
iml_grid_hd = iml_grid_tmp
|
||||||
|
|
||||||
iml_grid_hd[iml_grid_hd == 0.0] = np.nan # change zeroes back to nan
|
iml_grid_hd[iml_grid_hd == 0.0] = np.nan # change zeroes back to nan
|
||||||
|
|
||||||
# trim edges so the grid is not so blocky
|
# trim edges so the grid is not so blocky
|
||||||
|
Reference in New Issue
Block a user