Opened 8 years ago

Last modified 4 years ago

#2935 new defect

r.watershed returns bogus flow direction without warning when using large "virtual" terrain

Reported by: mankoff Owned by: grass-dev@…
Priority: normal Milestone: 7.8.3
Component: Raster Version: 7.2.0
Keywords: Cc: mankoff
CPU: Unspecified Platform: MacOSX

Description

I'm using the hydropotential, in units Pa, as my "elevation" for r.watershed in order to route flow under a glacier. The values are larger than a normal elevation, although perhaps not using grass for planetary research. The output of "r.info" follows. When I use this with r.watershed -a --v elevation=phi accumulation=acch drainage=fdir thresh=50 flow=RUh.2k, the fdir results are incorrect.

If I r.mapcalc 'phi = phi / 1000' # [Pa] to [kpa], then things work.

I can provide example files if needed to recreate this.

> r.info phi
 +----------------------------------------------------------------------------+
 | Layer:    phi                            Date: Wed Feb 24 20:37:58 2016    |
 | Mapset:   PERMANENT                      Login of Creator: mankoff         |
 | Location: Morlighem_2014                                                   |
 | DataBase: /Users/mankoff/data/grass                                        |
 | Title:     ( phi )                                                         |
 | Timestamp: none                                                            |
 |----------------------------------------------------------------------------|
 |                                                                            |
 |   Type of Map:  raster               Number of Categories: 255             |
 |   Data Type:    DCELL                                                      |
 |   Rows:         538                                                        |
 |   Columns:      301                                                        |
 |   Total Cells:  161938                                                     |
 |        Projection: Stereographic                                           |
 |            N:    -657600    S:   -3349500   Res: 5003.53159851             |
 |            E:     864700    W:    -638000   Res: 4992.35880399             |
 |   Range of data:    min = -250782  max = 32395007.4                        |
 |                                                                            |
 |   Data Description:                                                        |
 |    generated by r.mapcalc                                                  |
 |                                                                            |
 |   Comments:                                                                |
 |    1000 * 9.8 * z_b + 917 * 9.8 * (z_s - z_b)                              |
 |                                                                            |
 +----------------------------------------------------------------------------+

Change History (14)

comment:1 by mankoff, 8 years ago

Milestone: 7.0.4

I've upgrade to grass 7.0.3 and this bug still exists. Here is an MWE to recreate it:

grass70 -text ./nc_spm_08_grass7/PERMANENT

r.rescale input=elev_srtm_30m output=HUGE_elev to=-30000,30000000
r.rescale input=elev_srtm_30m output=OK_elev to=-30,30000

r.watershed elevation=HUGE_elev accumulation=HUGE.acc drainage=HUGE.fdir
r.watershed elevation=OK_elev accumulation=OK.acc drainage=OK.fdir

g.gui.mapswipe first=HUGE.acc second=OK.acc
g.gui.mapswipe first=HUGE.fdir second=OK.fdir

Now that grass supports other planets https://grasswiki.osgeo.org/wiki/Planetary_mapping it is likely others will run into similar issues when flow routing over terrain with values significantly larger than Earth topography.

comment:2 by mankoff, 8 years ago

Cc: mankoff added
Version: 6.4.47.0.3

I've upgrade to grass 7.0.3 and this bug still exists. Here is an MWE to recreate it:

grass70 -text ./nc_spm_08_grass7/PERMANENT

r.rescale input=elev_srtm_30m output=HUGE_elev to=-30000,30000000
r.rescale input=elev_srtm_30m output=OK_elev to=-30,30000

r.watershed elevation=HUGE_elev accumulation=HUGE.acc drainage=HUGE.fdir
r.watershed elevation=OK_elev accumulation=OK.acc drainage=OK.fdir

g.gui.mapswipe first=HUGE.acc second=OK.acc
g.gui.mapswipe first=HUGE.fdir second=OK.fdir

Now that grass supports other planets https://grasswiki.osgeo.org/wiki/Planetary_mapping it is likely others will run into similar issues when flow routing over terrain with values significantly larger than Earth topography.

comment:3 by martinl, 8 years ago

Milestone: 7.0.47.0.5

comment:4 by neteler, 8 years ago

Milestone: 7.0.57.0.6

comment:5 by mankoff, 7 years ago

Milestone: 7.0.67.2.1
Version: 7.0.37.2.0

comment:6 by martinl, 7 years ago

Milestone: 7.2.17.2.2

comment:7 by neteler, 7 years ago

Milestone: 7.2.27.2.3

Ticket retargeted after milestone closed

comment:8 by martinl, 6 years ago

Milestone: 7.2.3

Ticket retargeted after milestone closed

comment:9 by martinl, 6 years ago

Milestone: 7.2.4

comment:10 by mankoff, 5 years ago

Milestone: 7.2.47.8.0

Updating milestone so that this is included in GitHub migration.

comment:11 by neteler, 5 years ago

Milestone: 7.8.07.8.1

Ticket retargeted after milestone closed

comment:12 by neteler, 4 years ago

Milestone: 7.8.17.8.2

Ticket retargeted after milestone closed

comment:13 by neteler, 4 years ago

Milestone: 7.8.2

Ticket retargeted after milestone closed

comment:14 by neteler, 4 years ago

Milestone: 7.8.3
Note: See TracTickets for help on using tickets.