Skip to content

Commit

Permalink
Same fix for 5.4 branch
Browse files Browse the repository at this point in the history
Sloppy grid limit comparisons, again fixing #164 but in the 5.4 branch,
  • Loading branch information
PaulWessel committed Nov 7, 2018
1 parent 17c791d commit 47d3941
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/gmt_nc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1234,9 +1234,8 @@ GMT_LOCAL int gmtnc_grd_prep_io (struct GMT_CTRL *GMT, struct GMT_GRID_HEADER *h
wesn[XHI] += 360;
}
}
else
assert ((wesn[XLO]+GMT_CONV8_LIMIT*header->inc[GMT_X]) >= header->wesn[XLO] && (wesn[XHI]-GMT_CONV8_LIMIT*header->inc[GMT_X]) <= header->wesn[XHI]);
//assert (wesn[XLO] >= header->wesn[XLO] && wesn[XHI] <= header->wesn[XHI]); /* Too harsh */
else /* Apply a 10^-4 times inc sloppiness in the test [it was zero which was too harsh for sloppy grids] */
assert ((wesn[XLO]+GMT_CONV4_LIMIT*header->inc[GMT_X]) >= header->wesn[XLO] && (wesn[XHI]-GMT_CONV4_LIMIT*header->inc[GMT_X]) <= header->wesn[XHI]);

/* Get dimension of subregion */
*width = urint ((wesn[XHI] - wesn[XLO]) * header->r_inc[GMT_X]) + is_gridline_reg;
Expand Down

0 comments on commit 47d3941

Please sign in to comment.