Skip to content

Commit

Permalink
Fix error in indexing for matrix-to-grid input
Browse files Browse the repository at this point in the history
  • Loading branch information
seisman committed Jul 25, 2024
1 parent 1c8a78b commit 53f3677
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/gmt_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -5522,6 +5522,10 @@ GMT_LOCAL struct GMT_GRID *gmtapi_import_grid (struct GMTAPI_CTRL *API, int obje
else if (S_obj->wesn[XHI] < G_obj->header->wesn[XLO]) { /* Must first wrap G_obj->header->wesn east to fit the data */
G_obj->header->wesn[XLO] -= 360.0; G_obj->header->wesn[XHI] -= 360.0;
}

if (S_obj->wesn[XLO] < G_obj->header->wesn[XLO]) { /* Must wrap G_obj->header.wesn so that west to fit the data */
G_obj->header->wesn[XLO] -= 360.0; G_obj->header->wesn[XHI] -= 360.0;
}
}
j1 = (unsigned int)gmt_M_grd_y_to_row (GMT, S_obj->wesn[YLO]+dy, G_obj->header);
j0 = (unsigned int)gmt_M_grd_y_to_row (GMT, S_obj->wesn[YHI]-dy, G_obj->header);
Expand Down

0 comments on commit 53f3677

Please sign in to comment.