[GRASS-dev] [GRASS GIS] #2209: r.ros fails with -s flag with invalid descriptor error

#2209: r.ros fails with -s flag with invalid descriptor error
-------------------------+--------------------------------------------------
Reporter: wenzeslaus | Owner: grass-dev@…
     Type: defect | Status: new
Priority: minor | Milestone: 7.0.0
Component: Raster | Version: svn-trunk
Keywords: | Platform: Linux
      Cpu: Unspecified |
-------------------------+--------------------------------------------------
Steps provided with sample fire simulation data
(http://grass.osgeo.org/download/sample-data/) fails for GRASS 7 (trunk).

When G7:r.ros is used with `-s` flag it reports `ERROR: Invalid
descriptor: somenumber`:

{{{
r.ros -s model=fuel_model moisture_1h=1hour_moisture
moisture_live=live_moisture velocity=wind_speed direction=wind_direction
slope=slope aspect=aspect elevation=elevation output=my_ros
  100%
ERROR: Invalid descriptor: 11
}}}

I'm in demomapset. All output maps are created (my_ros.base, my_ros.max,
...) including `my_ros.spotdist` and I can run G7:r.spread.

It works without `-s` flag:
{{{
r.ros model=fuel_model moisture_1h=1hour_moisture
moisture_live=live_moisture velocity=wind_speed
direction=wind_direction slope=slope aspect=aspect elevation=elevation
output=my_ros
}}}

It seems that the error goes from source:grass/trunk/lib/raster/close.c:

{{{
$ grep -Irn "Invalid descriptor" .
./lib/raster/close.c:74: G_fatal_error(_("Invalid descriptor: %d"),
fd);
./lib/raster/close.c:107: G_fatal_error(_("Invalid descriptor: %d"),
fd);
}}}

Rewritten from the discussion at grass-dev:
[http://lists.osgeo.org/pipermail/grass-dev/2014-January/066740.html
Testing sample fire simulation data in GRASS 7] ([http://osgeo-
org.1560.x6.nabble.com/Testing-sample-fire-simulation-data-in-
GRASS-7-td5096039.html nabble],
[http://comments.gmane.org/gmane.comp.gis.grass.devel/56048 gmane]).

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2209&gt;
GRASS GIS <http://grass.osgeo.org>

#2209: r.ros fails with -s flag with invalid descriptor error
-------------------------+--------------------------------------------------
Reporter: wenzeslaus | Owner: grass-dev@…
     Type: defect | Status: new
Priority: minor | Milestone: 7.0.0
Component: Raster | Version: svn-trunk
Keywords: | Platform: Linux
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by neteler):

One issue hopefully fixed in r59219 (backported in r59217 and r59218).

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2209#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#2209: r.ros fails with -s flag with invalid descriptor error
-------------------------+--------------------------------------------------
  Reporter: wenzeslaus | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: minor | Milestone: 7.0.0
Component: Raster | Version: svn-trunk
Resolution: fixed | Keywords:
  Platform: Linux | Cpu: Unspecified
-------------------------+--------------------------------------------------
Changes (by wenzeslaus):

  * status: new => closed
  * resolution: => fixed

Comment:

Thanks and wow, I expected something more complicated then repeated line.

It works now. Tested with

{{{
r.ros -s model=fuel_model moisture_1h=1hour_moisture
moisture_live=live_moisture velocity=wind_speed direction=wind_direction
slope=slope aspect=aspect elevation=elevation output=my_ros --verbose
r.spread -s max=my_ros.max base=my_ros.base dir=my_ros.maxdir
spot_dist=my_ros.spotdist w_speed=wind_speed f_mois=1hour_moisture
start=fire_origin lag=95 backdrop=image_burned output=my_spread
x_output=my_spread.x y_output=my_spread.y
}}}

with sample fire simulation data (http://grass.osgeo.org/download/sample-
data/) in trunk.

No error message obtained. Maps generated.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2209#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>