GACK! Point isn't on grid!

Bug #838973 reported by Vitor Silva
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenQuake (deprecated)
Fix Released
Critical
beatpanic

Bug Description

When running any of the calculators, it's quite common in running into an error in which messages like the following fill the terminal:

DEBUG:root:GACK! at col 4 row 0
DEBUG:root:Point at 15.64 38.01 isnt on grid
DEBUG:root:GACK! at col 4 row 1
DEBUG:root:Point at 15.64 38.05 isnt on grid
DEBUG:root:GACK! at col 4 row 2
DEBUG:root:Point at 15.64 38.09 isnt on grid
DEBUG:root:GACK! at col 4 row 3
DEBUG:root:Point at 15.64 38.13 isnt on grid
DEBUG:root:GACK! at col 4 row 4
DEBUG:root:Point at 15.64 38.17 isnt on grid
DEBUG:root:GACK! at col 4 row 5
DEBUG:root:Point at 15.64 38.21 isnt on grid

This is a very old error that should be fixed since when using very large regions, hundreds of these warnings are displayed.

John Tarter (toh2)
Changed in openquake:
importance: Undecided → Critical
milestone: none → 0.4.4
Revision history for this message
Mattia Barbon (mattia.barbon) wrote :

Can be reproduce using

    ./bin/openquake --config_file=smoketests/nshmp-california-fault/config.gem

Changed in openquake:
status: New → In Progress
assignee: nobody → Mattia Barbon (mattia.barbon)
Revision history for this message
Mattia Barbon (mattia.barbon) wrote :

It's a floating point rounding problem; putting a breakpoint on the line were it prints the GACK:

(Pdb) self.region.upper_right_corner.longitude
-118.18
(Pdb) self.region.upper_left_corner.longitude
-118.3
# region width
(Pdb) self.region.upper_right_corner.longitude - self.region.upper_left_corner.longitude
0.11999999999999034
# number of columns in the region
(Pdb) (self.region.upper_right_corner.longitude - self.region.upper_left_corner.longitude)/self.cell_size
5.999999999999517
# coordinate of the 6-th column:
(Pdb) self.region.upper_left_corner.longitude + 6 * 0.02
-118.17999999999999

which is slightly more than region right border -> the point is outside the region.

I think the correct solution is applying round_float() to the temporary Point() constructed for bounds checking.

By the way, there are some other shapes objects where round_float() is not used.

Revision history for this message
Mattia Barbon (mattia.barbon) wrote :
Revision history for this message
Mattia Barbon (mattia.barbon) wrote :

Vitor: there are some other configurations that still print the warning; for example, the one linked in #838983:

REGION_VERTEX = 38.30, 15.48, 38.30, 15.63, 38.01, 15.63, 38.01, 15.48
REGION_GRID_SPACING = 0.05

here the region width (38.01 -> 38.30 = 0.29 is not an exact multiple of 0.05).
In this case should OQ just silently use: 38.01, 38.06, ... 38.26 or should there be some kind of warning to the user (maybe not repeated for each point...)?

Changed in openquake:
status: In Progress → Fix Committed
beatpanic (kpanic)
Changed in openquake:
assignee: Mattia Barbon (mattia.barbon) → beatpanic (kpanic)
status: Fix Committed → Confirmed
Revision history for this message
John Tarter (toh2) wrote :

These 2 bugs are needed to be completed before this Gagk bug can be closed, due to incomplete features

https://bugs.launchpad.net/openquake/+bug/809410
https://bugs.launchpad.net/openquake/+bug/856323

Changed in openquake:
milestone: 0.4.4 → 0.4.5
beatpanic (kpanic)
Changed in openquake:
status: Confirmed → In Progress
Revision history for this message
John Tarter (toh2) wrote :

Awaiting input from Vitor

Revision history for this message
beatpanic (kpanic) wrote :
John Tarter (toh2)
Changed in openquake:
milestone: 0.4.5 → 0.4.6
beatpanic (kpanic)
Changed in openquake:
status: In Progress → Fix Committed
Revision history for this message
Paul Henshaw (paul-sl-henshaw) wrote :
Changed in openquake:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related blueprints

Remote bug watches

Bug watches keep track of this bug in other bug trackers.