# Grdcut regions slightly off

**URL:** <https://forum.generic-mapping-tools.org/t/grdcut-regions-slightly-off/3778>\
**Category:** Q&A\
**Created:** [March 23, 2023, 3:25pm UTC](https://forum.generic-mapping-tools.org/t/grdcut-regions-slightly-off/3778 "2023-03-23T15:25:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![thwbecker](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/thwbecker/32/1215_2.png) [@thwbecker](https://forum.generic-mapping-tools.org/u/thwbecker)\
**Post date:** [March 23, 2023, 3:25pm UTC](https://forum.generic-mapping-tools.org/t/grdcut-regions-slightly-off/3778/1 "2023-03-23T15:25:30Z")

</div>

Hi,

I noticed that grdcut seems to sometimes get the regions of a cut slightly off if the spacing of the grid is fine. In the case of the grid whose info is shown, I tried to cut to W = 231 but get W = 231.1, with no error or warning message. This messes up processing steps when operating with other grids, for example. Is this something I am doing wrong, or a known issue? I could not find anything in the documentation. Sorry if this is stupid,

Thanks

T

/tmp/tmp.qYysLA1kas.strain.grd: Title: Produced by grdcut  
/tmp/tmp.qYysLA1kas.strain.grd: Command: gmt grdcut /tmp/tmp.qYysLA1kas.1.grd -R231/249/28.5/44 -G/tmp/tmp.qYysLA1kas.strain.grd  
/tmp/tmp.qYysLA1kas.strain.grd: Remark:  
/tmp/tmp.qYysLA1kas.strain.grd: Pixel node registration used [Geographic grid]  
/tmp/tmp.qYysLA1kas.strain.grd: Grid file format: nf = GMT netCDF format (32-bit float), CF-1.7  
/tmp/tmp.qYysLA1kas.strain.grd: x\_min: 232.1 x\_max: 249 x\_inc: 0.00416666666667 (15 sec) name: longitude n\_columns: 4056  
/tmp/tmp.qYysLA1kas.strain.grd: y\_min: 28.5 y\_max: 44 y\_inc: 0.00416666666667 (15 sec) name: latitude n\_rows: 3720  
/tmp/tmp.qYysLA1kas.strain.grd: v\_min: -2.90879273415 v\_max: 1.23624956608 name: z  
/tmp/tmp.qYysLA1kas.strain.grd: scale\_factor: 1 add\_offset: 0

---

<div class="post-metadata">

**Author:** ![pwessel](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/pwessel/32/30_2.png) [@pwessel](https://forum.generic-mapping-tools.org/u/pwessel)\
**Post date:** [March 23, 2023, 3:42pm UTC](https://forum.generic-mapping-tools.org/t/grdcut-regions-slightly-off/3778/2 "2023-03-23T15:42:17Z")

</div>

Will need to see grdinfo of /tmp/tmp.qYysLA1kas.1.grd to understand that.

---

<div class="post-metadata">

**Author:** ![thwbecker](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/thwbecker/32/1215_2.png) [@thwbecker](https://forum.generic-mapping-tools.org/u/thwbecker)\
**Post date:** [March 23, 2023, 4:06pm UTC](https://forum.generic-mapping-tools.org/t/grdcut-regions-slightly-off/3778/3 "2023-03-23T16:06:18Z")

</div>

Thanks for the quick reply and making me think twice - turns out that the original grid was too small by 0.1 which I missed in my script mess - sorry about that! (I missed it because I thought grdcut would have complained but it just used as much of the grid as it could - which seems like an OK MO).

Thanks, and sorry again!
