Skip to content

Commit 9feedc1

Browse files
authored
Update a warning message as discussed in #8832 (#9042)
Fix #8832
1 parent 988daf5 commit 9feedc1

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/gmt_nc.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,7 @@ GMT_LOCAL int gmtnc_grd_info (struct GMT_CTRL *GMT, struct GMT_GRID_HEADER *head
824824
threshold = (0.5-GMT_CONV5_LIMIT) * dy;
825825
if (fabs (fmod (dummy[0], dy)) > threshold) { /* Pixel registration? */
826826
if (header->registration == GMT_GRID_NODE_REG) /* No, somehow messed up now */
827-
GMT_Report (GMT->parent, GMT_MSG_WARNING, "Guessing of registration in conflict between x and y, using %s\n", regtype[header->registration]);
827+
GMT_Report (GMT->parent, GMT_MSG_WARNING, "Guessing of registration in conflict between x and y (likely bad x_inc or y_inc steps), using %s\n", regtype[header->registration]);
828828
else { /* Pixel registration confirmed */
829829
dummy[0] -= 0.5 * dy; dummy[1] += 0.5 * dy;
830830
registration = GMT_GRID_PIXEL_REG;
@@ -848,23 +848,23 @@ GMT_LOCAL int gmtnc_grd_info (struct GMT_CTRL *GMT, struct GMT_GRID_HEADER *head
848848
else
849849
GMT_Report (GMT->parent, GMT_MSG_WARNING, "The y-coordinates and range attribute are in conflict but range is exactly 180; we rely on this range\n");
850850
if ((header->n_rows%2) == 1 && header->registration == GMT_GRID_NODE_REG) /* Pixel registration? */
851-
GMT_Report (GMT->parent, GMT_MSG_WARNING, "Guessing of registration in conflict between x and y, using %s\n", regtype[header->registration]);
851+
GMT_Report (GMT->parent, GMT_MSG_WARNING, "Guessing of registration in conflict between x and y (likely bad x_inc or y_inc steps), using %s\n", regtype[header->registration]);
852852
else
853853
registration = header->registration;
854854
}
855855
}
856856
else { /* Data seems OK; determine registration and set dummy from data coordinates */
857857
dummy[0] = xy[0], dummy[1] = xy[header->n_rows-1];
858858
if ((fabs(dummy[1] - dummy[0]) / fabs(xy[header->n_rows-1] - xy[0]) - 1.0 > 0.5 / (header->n_rows - 1)) && header->registration == GMT_GRID_NODE_REG)
859-
GMT_Report (GMT->parent, GMT_MSG_WARNING, "Guessing of registration in conflict between x and y, using %s\n", regtype[header->registration]);
859+
GMT_Report (GMT->parent, GMT_MSG_WARNING, "Guessing of registration in conflict between x and y (likely bad x_inc or y_inc steps), using %s\n", regtype[header->registration]);
860860
}
861861
}
862862
else if (has_vector) { /* No attribute for range, use coordinates */
863863
threshold = (0.5-GMT_CONV5_LIMIT) * dy;
864864
dummy[0] = xy[0], dummy[1] = xy[header->n_rows-1];
865865
if (fabs (fmod (dummy[0], dy)) > threshold) { /* Most likely pixel registration since off by dy/2 */
866866
if (header->registration == GMT_GRID_NODE_REG) /* No, somehow messed up now */
867-
GMT_Report (GMT->parent, GMT_MSG_WARNING, "Guessing of registration in conflict between x and y, using %s\n", regtype[header->registration]);
867+
GMT_Report (GMT->parent, GMT_MSG_WARNING, "Guessing of registration in conflict between x and y (likely bad x_inc or y_inc steps), using %s\n", regtype[header->registration]);
868868
else { /* Pixel registration confirmed */
869869
if (dummy[0] > dummy[1]) { /* Check for reverse order of y-coordinate */
870870
gmt_M_double_swap (dummy[0], dummy[1]);
@@ -879,7 +879,7 @@ GMT_LOCAL int gmtnc_grd_info (struct GMT_CTRL *GMT, struct GMT_GRID_HEADER *head
879879
}
880880
else { /* Only has the valid_range settings. If no registration set, and no dy available, guess based on ny */
881881
if ((header->n_rows%2) == 1 && header->registration == GMT_GRID_NODE_REG) /* Pixel registration? */
882-
GMT_Report (GMT->parent, GMT_MSG_WARNING, "Guessing of registration in conflict between x and y, using %s\n", regtype[header->registration]);
882+
GMT_Report (GMT->parent, GMT_MSG_WARNING, "Guessing of registration in conflict between x and y (likely bad x_inc or y_inc steps), using %s\n", regtype[header->registration]);
883883
}
884884

885885
/* Check for reverse order of y-coordinate */

0 commit comments

Comments
 (0)