Re: [GRASS-user] 10day accumulation which t.rast module to use?
Dear Soeren, > The temporal raster algebra module is very experimental, but i hope > that this will work. Thanks will try this. -- cheers, maning -- "Freedom is still the most radical idea of all" -N.Branden wiki: http://esambale.wikispaces.com/ blog: http://epsg4253.wordpress.com/ -- ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] 10day accumulation which t.rast module to use?
> > Oh, I see... then, t.rast.accumulate is what you need. The default method > "mean" does the sum. So "mean" is actually sum? > > Maybe, something like this (please re-check the cycle and granularity > parameters, i didn't test) > > t.rast.accumulate input=3hr_rainrate output=10day_acum_precip > base=10day_acc_prec start="2001-01-01" end="2001-01-20" cycle="10 days" > granularity="1 days" method=mean I tried this, "end" should be "stop" t.rast.accumulate --overwrite input=10day_hourly output=10day_accumulation base=10day_accumulation \ start="2014-11-04 11:00:00" stop="2014-12-04 11:00:00" cycle="10 days" granularity="1 days" method=mean The process wouldn't stop, my area is very small so I expect it to finish in less than an hour: > g.region -p projection: 3 (Latitude-Longitude) zone: 0 datum: wgs84 ellipsoid: wgs84 north: 22N south: 4N west: 115E east: 155E nsres: 0:15 ewres: 0:15 rows: 72 cols: 160 cells: 11520 -- cheers, maning -- "Freedom is still the most radical idea of all" -N.Branden wiki: http://esambale.wikispaces.com/ blog: http://epsg4253.wordpress.com/ -- ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] 10day accumulation which t.rast module to use?
Hi Maning, i think that the combination of t.rast.aggreagte and the new t.rast.algebra will help you here. Be aware that you will need the latest grass7.1 trunk version for this. First you need to compute the daily rainfall sum with t.rast.aggregate. All 3h map layer that are temporally contained in the 1 day granule are summed up: t.rast.aggregate input=3hr_rainrate output=prec1d method=sum granularity="1 day" basename=prec1d sampling=contains Then you need to use a temporal moving window of 9 day size in the past (including the current layer that will be 10 map layers). The granularity is one day so we can use the temporal neighbor index to address the past map layers. Be aware that the "result" strds will only contain map layers that have 9 map layers in the past: t.rast.algebra basename="10d_acc" expression="result = prec1d[0] + prec1d[-1] + ... + prec1d[-9]" The temporal raster algebra module is very experimental, but i hope that this will work. Best regards Soeren ps.: The code is untested 2014-12-04 3:47 GMT+01:00 maning sambale : > Dear Vero, > > Thanks for the reply. But t.rast.aggregate does not do what I intend > to do. My rainrate is from a span of 20 days. > t.rast.aggregate produces (as expected) two rasters, one for each of > the 10day accumulation. What I want for example is like a moving sum, > where for each day, it calculates the sum for the past 10 days. > > On Thu, Dec 4, 2014 at 4:31 AM, Veronica Andreo wrote: >> Hi Emmanuel, >> >>> Hi, >>> >>> I have 3hourly rainrate data for a given region in a GRASS temporal >>> database (strds). >>> >>> I want to aggregate the data by summing all raster from the previous >>> 10 days to calculate the accumulated rainfall. >>> The temporal modules have several tools: >>> t.rast.series >>> t.rast.accumulate >>> t.rast.aggregate >>> t.rast.mapcalc >>> >>> >From the manual, the appropriate module seems to be t.rast.accumulate >>> but it does not have sum in the method parameters. Currently, I'm >>> running several r.series commands for each day like below: >>> >>> r.series input=\ >>> "`t.rast.list input=3hr_rainrate where=\ >>> "('${DATE} 00:00:00' >= datetime(start_time, '3 hours')) \ >>> and ('${DATE} 00:00:00' <= datetime(start_time, '10 days')) " \ >>> col=name method=comma`" \ >>> output="test_2014-07-20" method=sum >>> >>> Then, register each layer in another strds: >>> >>> #Create a new STRDS >>> t.create output='10day_accumulation' type='strds' temporaltype='absolute' >>> \ >>> title='10day_accumulation' \ >>> description="10 day rainfall accumulation" >>> >>> >>> g.mlist type='rast', pattern='test*', separator=',' >>> >>> #Register the r.series output to the strds >>> t.register -i type=rast input=10day_accumulation \ >>> start="2014-07-10 00:00:00" increment="1 days" separator="," \ >>> maps="`g.mlist type='rast', pattern='test*', separator=','`" >>> >>> >>> Is there another approach using directly any of the t.rast.* modules. >>> For a time-line visualization, here's what I want to do: >>> https://dl.dropboxusercontent.com/u/2096185/sample_accumulation.png >>> >>> Thanks! >> >> If i understood right, something like >> >> t.rast.aggregate input=3hr_rainrate output=10day_rain basename=10day_rain >> granularity='10 days' method=sum >> >> should do the what you need. >> >> HTH, >> >> Vero > > > > -- > cheers, > maning > -- > "Freedom is still the most radical idea of all" -N.Branden > wiki: http://esambale.wikispaces.com/ > blog: http://epsg4253.wordpress.com/ > -- > ___ > grass-user mailing list > grass-user@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/grass-user ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] 10day accumulation which t.rast module to use?
Hello Emma, 2014-12-03 23:47 GMT-03:00 maning sambale : > Dear Vero, > Thanks for the reply. But t.rast.aggregate does not do what I intend > to do. My rainrate is from a span of 20 days. > t.rast.aggregate produces (as expected) two rasters, one for each of > the 10day accumulation. What I want for example is like a moving sum, > where for each day, it calculates the sum for the past 10 days. > > Oh, I see... then, t.rast.accumulate is what you need. The default method "mean" does the sum. Maybe, something like this (please re-check the cycle and granularity parameters, i didn't test) t.rast.accumulate input=3hr_rainrate output=10day_acum_precip base=10day_acc_prec start="2001-01-01" end="2001-01-20" cycle="10 days" granularity="1 days" method=mean Hope it helps now :) Cheers, Vero On Thu, Dec 4, 2014 at 4:31 AM, Veronica Andreo > wrote: > > Hi Emmanuel, > > > >> Hi, > >> > >> I have 3hourly rainrate data for a given region in a GRASS temporal > >> database (strds). > >> > >> I want to aggregate the data by summing all raster from the previous > >> 10 days to calculate the accumulated rainfall. > >> The temporal modules have several tools: > >> t.rast.series > >> t.rast.accumulate > >> t.rast.aggregate > >> t.rast.mapcalc > >> > >> >From the manual, the appropriate module seems to be t.rast.accumulate > >> but it does not have sum in the method parameters. Currently, I'm > >> running several r.series commands for each day like below: > >> > >> r.series input=\ > >> "`t.rast.list input=3hr_rainrate where=\ > >> "('${DATE} 00:00:00' >= datetime(start_time, '3 hours')) \ > >> and ('${DATE} 00:00:00' <= datetime(start_time, '10 days')) " \ > >> col=name method=comma`" \ > >> output="test_2014-07-20" method=sum > >> > >> Then, register each layer in another strds: > >> > >> #Create a new STRDS > >> t.create output='10day_accumulation' type='strds' > temporaltype='absolute' > >> \ > >> title='10day_accumulation' \ > >> description="10 day rainfall accumulation" > >> > >> > >> g.mlist type='rast', pattern='test*', separator=',' > >> > >> #Register the r.series output to the strds > >> t.register -i type=rast input=10day_accumulation \ > >> start="2014-07-10 00:00:00" increment="1 days" separator="," \ > >> maps="`g.mlist type='rast', pattern='test*', separator=','`" > >> > >> > >> Is there another approach using directly any of the t.rast.* modules. > >> For a time-line visualization, here's what I want to do: > >> https://dl.dropboxusercontent.com/u/2096185/sample_accumulation.png > >> > >> Thanks! > > > > If i understood right, something like > > > > t.rast.aggregate input=3hr_rainrate output=10day_rain basename=10day_rain > > granularity='10 days' method=sum > > > > should do the what you need. > > > > HTH, > > > > Vero > > > > -- > cheers, > maning > -- > "Freedom is still the most radical idea of all" -N.Branden > wiki: http://esambale.wikispaces.com/ > blog: http://epsg4253.wordpress.com/ > -- > ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] 10day accumulation which t.rast module to use?
Dear Vero, Thanks for the reply. But t.rast.aggregate does not do what I intend to do. My rainrate is from a span of 20 days. t.rast.aggregate produces (as expected) two rasters, one for each of the 10day accumulation. What I want for example is like a moving sum, where for each day, it calculates the sum for the past 10 days. On Thu, Dec 4, 2014 at 4:31 AM, Veronica Andreo wrote: > Hi Emmanuel, > >> Hi, >> >> I have 3hourly rainrate data for a given region in a GRASS temporal >> database (strds). >> >> I want to aggregate the data by summing all raster from the previous >> 10 days to calculate the accumulated rainfall. >> The temporal modules have several tools: >> t.rast.series >> t.rast.accumulate >> t.rast.aggregate >> t.rast.mapcalc >> >> >From the manual, the appropriate module seems to be t.rast.accumulate >> but it does not have sum in the method parameters. Currently, I'm >> running several r.series commands for each day like below: >> >> r.series input=\ >> "`t.rast.list input=3hr_rainrate where=\ >> "('${DATE} 00:00:00' >= datetime(start_time, '3 hours')) \ >> and ('${DATE} 00:00:00' <= datetime(start_time, '10 days')) " \ >> col=name method=comma`" \ >> output="test_2014-07-20" method=sum >> >> Then, register each layer in another strds: >> >> #Create a new STRDS >> t.create output='10day_accumulation' type='strds' temporaltype='absolute' >> \ >> title='10day_accumulation' \ >> description="10 day rainfall accumulation" >> >> >> g.mlist type='rast', pattern='test*', separator=',' >> >> #Register the r.series output to the strds >> t.register -i type=rast input=10day_accumulation \ >> start="2014-07-10 00:00:00" increment="1 days" separator="," \ >> maps="`g.mlist type='rast', pattern='test*', separator=','`" >> >> >> Is there another approach using directly any of the t.rast.* modules. >> For a time-line visualization, here's what I want to do: >> https://dl.dropboxusercontent.com/u/2096185/sample_accumulation.png >> >> Thanks! > > If i understood right, something like > > t.rast.aggregate input=3hr_rainrate output=10day_rain basename=10day_rain > granularity='10 days' method=sum > > should do the what you need. > > HTH, > > Vero -- cheers, maning -- "Freedom is still the most radical idea of all" -N.Branden wiki: http://esambale.wikispaces.com/ blog: http://epsg4253.wordpress.com/ -- ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] 10day accumulation which t.rast module to use?
Hi Emmanuel, > Hi, > > I have 3hourly rainrate data for a given region in a GRASS temporal > database (strds). > > I want to aggregate the data by summing all raster from the previous > 10 days to calculate the accumulated rainfall. > The temporal modules have several tools: > t.rast.series > t.rast.accumulate > t.rast.aggregate > t.rast.mapcalc > > >From the manual, the appropriate module seems to be t.rast.accumulate > but it does not have sum in the method parameters. Currently, I'm > running several r.series commands for each day like below: > > r.series input=\ > "`t.rast.list input=3hr_rainrate where=\ > "('${DATE} 00:00:00' >= datetime(start_time, '3 hours')) \ > and ('${DATE} 00:00:00' <= datetime(start_time, '10 days')) " \ > col=name method=comma`" \ > output="test_2014-07-20" method=sum > > Then, register each layer in another strds: > > #Create a new STRDS > t.create output='10day_accumulation' type='strds' temporaltype='absolute' \ > title='10day_accumulation' \ > description="10 day rainfall accumulation" > > > g.mlist type='rast', pattern='test*', separator=',' > > #Register the r.series output to the strds > t.register -i type=rast input=10day_accumulation \ > start="2014-07-10 00:00:00" increment="1 days" separator="," \ > maps="`g.mlist type='rast', pattern='test*', separator=','`" > > > Is there another approach using directly any of the t.rast.* modules. > For a time-line visualization, here's what I want to do: > https://dl.dropboxusercontent.com/u/2096185/sample_accumulation.png > > Thanks! If i understood right, something like t.rast.aggregate input=3hr_rainrate output=10day_rain basename=10day_rain granularity='10 days' method=sum should do the what you need. HTH, Vero ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] 10day accumulation which t.rast module to use?
Hi, I have 3hourly rainrate data for a given region in a GRASS temporal database (strds). I want to aggregate the data by summing all raster from the previous 10 days to calculate the accumulated rainfall. The temporal modules have several tools: t.rast.series t.rast.accumulate t.rast.aggregate t.rast.mapcalc >From the manual, the appropriate module seems to be t.rast.accumulate but it does not have sum in the method parameters. Currently, I'm running several r.series commands for each day like below: r.series input=\ "`t.rast.list input=3hr_rainrate where=\ "('${DATE} 00:00:00' >= datetime(start_time, '3 hours')) \ and ('${DATE} 00:00:00' <= datetime(start_time, '10 days')) " \ col=name method=comma`" \ output="test_2014-07-20" method=sum Then, register each layer in another strds: #Create a new STRDS t.create output='10day_accumulation' type='strds' temporaltype='absolute' \ title='10day_accumulation' \ description="10 day rainfall accumulation" g.mlist type='rast', pattern='test*', separator=',' #Register the r.series output to the strds t.register -i type=rast input=10day_accumulation \ start="2014-07-10 00:00:00" increment="1 days" separator="," \ maps="`g.mlist type='rast', pattern='test*', separator=','`" Is there another approach using directly any of the t.rast.* modules. For a time-line visualization, here's what I want to do: https://dl.dropboxusercontent.com/u/2096185/sample_accumulation.png Thanks! -- cheers, maning -- "Freedom is still the most radical idea of all" -N.Branden wiki: http://esambale.wikispaces.com/ blog: http://epsg4253.wordpress.com/ -- ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user