TransWikia.com

Rainfall time-series to raster

Geographic Information Systems Asked by Amrie Singh on November 27, 2020

I have a rainfall time series for 15 hours in increments of 0.250s, I need to convert it from a .txt-file to a raster.

I’ve tried using r.mapcalc in GRASS, however, have not been successful. I’ve also tried creating a temporal data set in GRASS, but the layer creation always ends up empty.
The output format needs to be a raster either asc or tif format, essentially a hyetograph in raster form.
I don’t mind if this is in either QGIS or GRASS. I’ve tried adding the layer extent to the txt file i.e. ncols, nrows and so on, cause the rainfall is uniform over a given location but I still haven’t been successful.

The format is as follows:

time,rain
0,0
0.25,0
0.5,0.06100329
0.75,0.067136294
1,0.073993471
1.25,0.081679436
1.5,0.090317861

Are there any other methods I could try out for the conversion?

One Answer

OK, bit by bit the details behind your question are unfolding. Itzi is an excellent flood simulation modeling program. To run it you must begin with an elevation raster, a DEM. Do you have a DEM raster covering your watershed?

Have you followed the steps in the Itzi wiki page?

Next, the example in those docs refers to a single rain map (with uniform precipitation over the watershed). The time steps in the tutorial simulation are 5 seconds, over a period of 2 hours (24 time steps). In your case, as I pointed out in the comments, you have a huge number of rainfall measurements: IIUC, you have rainrate every 1/4 second for 15 hours. So that's 4x60x60x15 = 216,000 total measurements (!). What do you intend to do with that data? Perhaps aggregate to hourly rainfall, then create 15 hourly raster maps, each with a uniform rain rate over your watershed. Then define a STRDS in GRASS from those 15 rainfall rasters and use that as input to Itzi...

If this is your plan, then:

  1. You need to be working in a projected LOCATION (required by Itzi), NOT long/lat
  2. You need a DEM as pointed out in the Itzi docs
  3. I assume you have a polygon of the watershed, already imported into GRASS

So the steps would be:

g.region -ap vect=<watershed_polygon>
# For each of the 15 hourly aggregated rainfall values:
r.mapcalc "rain_hr1 = <rainrall_at_hour1>"  # Note the space surrounding the '=' sign
r.mapcalc "rain_hr2 = <rainfall_at_hour2>"
...
# Create a STRDS
t.create type=strds temporaltype=relative output=rain_strds semantictype=mean title="Rain STRDS" description="Rain STRDS"
t.register -i type=raster input=rain_strds maps=`g.list raster pattern="rain_hr*" separator=comma` start="2020-10-10" increment="1 days"

Now you should have enough to get started with Itzi.

Correct answer by Micha on November 27, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP