Skip to content

Commit a187e14

Browse files
committed
Make sure intensity subset matches tiled region if given
If an intensity grid is given, and a remote earth_relief grid is given, then when the intensity grid is read in and we specify the subregion wesn, make sure this region matches the possibly adjusted tile_wesn due to rounding in gmt_remote.c See #4124 for background.
1 parent 8117722 commit a187e14

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/grdimage.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -932,11 +932,11 @@ EXTERN_MSC int GMT_grdimage (void *V_API, int mode, void *args) {
932932
/* If given, get intensity grid or compute intensities (for a constant intensity) */
933933

934934
if (use_intensity_grid) { /* Illumination wanted */
935-
935+
double *region = (gmt_file_is_tiled_list (API, Ctrl->In.file[0], NULL, NULL, NULL)) ? API->tile_wesn : wesn; /* Region to pass to grdgradient */
936936
GMT_Report (API, GMT_MSG_INFORMATION, "Allocates memory and read intensity file\n");
937937

938938
/* Remember, the illumination header was already read at the start of grdimage */
939-
if (!Ctrl->I.derive && GMT_Read_Data (API, GMT_IS_GRID, GMT_IS_FILE, GMT_IS_SURFACE, GMT_DATA_ONLY, wesn, Ctrl->I.file, Intens_orig) == NULL) {
939+
if (!Ctrl->I.derive && GMT_Read_Data (API, GMT_IS_GRID, GMT_IS_FILE, GMT_IS_SURFACE, GMT_DATA_ONLY, region, Ctrl->I.file, Intens_orig) == NULL) {
940940
Return (API->error); /* Failed to read the intensity grid data */
941941
}
942942
mixed = grdimage_clean_global_headers (GMT, Intens_orig->header);

0 commit comments

Comments
 (0)