# Grdclip not working after updating to dev

**URL:** <https://forum.generic-mapping-tools.org/t/grdclip-not-working-after-updating-to-dev/4383>\
**Category:** PyGMT Q&A\
**Tags:** gmt\
**Created:** [October 27, 2023, 6:13pm UTC](https://forum.generic-mapping-tools.org/t/grdclip-not-working-after-updating-to-dev/4383 "2023-10-27T18:13:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![meekus-fischer](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/meekus-fischer/32/3736_2.png) [@meekus-fischer](https://forum.generic-mapping-tools.org/u/meekus-fischer)\
**Post date:** [October 27, 2023, 6:13pm UTC](https://forum.generic-mapping-tools.org/t/grdclip-not-working-after-updating-to-dev/4383/1 "2023-10-27T18:13:11Z")

</div>

Due to issues with Ghostscript, I updated GMT this morning to dev 6.5.0, after switching, grdclip() no longer clipped values correctly.

grid = pygmt.datasets.load\_earth\_relief(resolution=‘03s’, region = [min\_max\_lon[0], min\_max\_lon[1], min\_max\_lat[0], min\_max\_lat[1]])

print(f’Before \*\* Grid min {grid.min()}, Grid Max {grid.max()}’)  
grid = pygmt.grdclip(grid, above=[0.0,10000.0])  
print(f’After \*\* Grid min {grid.min()}, Grid Max {grid.max()}’)

Before \*\* Grid min \<xarray.DataArray ‘z’ ()\>  
array(-3475.2976, dtype=float32), Grid Max \<xarray.DataArray ‘z’ ()\>  
array(1173., dtype=float32)  
After \*\* Grid min \<xarray.DataArray ‘z’ ()\>  
array(-3475.2976, dtype=float32), Grid Max \<xarray.DataArray ‘z’ ()\>  
array(1173., dtype=float32)

If I revert to GMT 6.4, this works correctly; however, transparency does not work due to incompatibility with Ghostscript.

---

<div class="post-metadata">

**Author:** ![seisman](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/seisman/32/4_2.png) [@seisman](https://forum.generic-mapping-tools.org/u/seisman)\
**Post date:** [October 29, 2023, 2:38pm UTC](https://forum.generic-mapping-tools.org/t/grdclip-not-working-after-updating-to-dev/4383/2 "2023-10-29T14:38:29Z")

</div>

Yes, I can reproduce the issue, but the GMT 6.5.0 CLI version works. So this might be issues on the PyGMT side. Please open an issue report at [https://github.com/GenericMappingTools/pygmt](https://github.com/GenericMappingTools/pygmt) so that we can track it down.

---

<div class="post-metadata">

**Author:** ![seisman](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/seisman/32/4_2.png) [@seisman](https://forum.generic-mapping-tools.org/u/seisman)\
**Post date:** [October 31, 2023, 10:18am UTC](https://forum.generic-mapping-tools.org/t/grdclip-not-working-after-updating-to-dev/4383/3 "2023-10-31T10:18:07Z")

</div>

Related issue report at [https://github.com/GenericMappingTools/pygmt/issues/2785](https://github.com/GenericMappingTools/pygmt/issues/2785)
