Skip to content

Commit

Permalink
Less hard-ass in checking for regions
Browse files Browse the repository at this point in the history
Allow a slop up to 10^-4 instead of 10^-8 in w/e/s/n comparisons to fix issue #164
  • Loading branch information
PaulWessel committed Nov 7, 2018
1 parent c5a5435 commit b121c56
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 @@ -1279,9 +1279,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]) * HH->r_inc[GMT_X]) + is_gridline_reg;
Expand Down

0 comments on commit b121c56

Please sign in to comment.