Details Ticket 2238


Comment | Reply | Take | Resolve


Serial Number 2238
Subject r.series: support for wildcards in input filenames
Area wish
Queue grass
Requestors hamish_nospam@yahoo.com,neteler@itc.it
Owner none
Status open
Last User Contact Tue Dec 2 17:39:02 2003 (5 yr ago)
Current Priority 30
Final Priority 70
Due No date assigned
Last Action Mon Feb 5 22:04:30 2007 (2 yr ago)
Created Mon Dec 1 15:37:09 2003 (5 yr ago)

Transaction History Ticket 2238


Mon, Dec 1 2003 15:37:09    Request created by guest  
Subject: r.series: support for wildcards in input filenames

Platform: GNU/Linux/i386
grass obtained from: Mirror of Trento site
grass binary for platform: Compiled from Sources
GRASS Version: 5.3-cvs_nov2003

Hi,
It would be nice if r.series would accept wildcards for the input maps.

e.g.
r.series input=insitu_data.* output=insitu_data.stddev method=stddev

for:
insitu_data.001
insitu_data.002
...
insitu_data.052


such as the g.mremove script does. [0-9] expansions etc would be nice too, but
not critical.

For now I use a bash loop to set INPUT_MAPS=$INPUT_MAPS,next_map then 
'r.series input=$INPUT_MAPS ...', but that sort of sucks.


Any reason not to activate this module for 5.3 yet?


thanks,
Hamish
Mon, Dec 1 2003 20:51:32    Mail sent by glynn.clements@virgin.net  
Return-Path <glynn.clements@virgin.net>
Delivered-To grass-bugs@lists.intevation.de
From Glynn Clements <glynn.clements@virgin.net>
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
Message-ID <16331.39092.462532.746078@cerise.nosuchdomain.co.uk>
Date Mon, 1 Dec 2003 19:38:28 +0000
To Request Tracker <grass-bugs@intevation.de>
Cc grass5@grass.itc.it
Subject Re: [GRASS5] [bug #2238] (grass) r.series: support for wildcards in input filenames
In-Reply-To <20031201143709.0371A13B92@lists.intevation.de>
References <20031201143709.0371A13B92@lists.intevation.de>
X-Mailer VM 7.07 under 21.4 (patch 14) "Reasonable Discussion" XEmacs Lucid
X-Spam-Status No, hits=-4.9 tagged_above=-999.0 required=3.0 tests=BAYES_00
X-Spam-Level
Request Tracker wrote:

> It would be nice if r.series would accept wildcards for the input maps.
> 
> e.g.
> r.series input=insitu_data.* output=insitu_data.stddev method=stddev
> 
> for:
> insitu_data.001
> insitu_data.002
> ...
> insitu_data.052

That may also true for several other modules; in which case, it might
be better to figure out how to build this into G_parser().

> such as the g.mremove script does. [0-9] expansions etc would be nice too,
but not critical.

g.mremove is a shell script, which makes implementing shell
substitutions somewhat easier.

glibc has the glob() function, which is apparently specified by
POSIX.2, although I would be reluctant to just rely upon its existence
(e.g. it might not be present on all platforms, or it may require an
additional library).

> For now I use a bash loop to set INPUT_MAPS=$INPUT_MAPS,next_map then 
> 'r.series input=$INPUT_MAPS ...', but that sort of sucks.
> 
> Any reason not to activate this module for 5.3 yet?

Only the standard reason: once a module becomes "official", changing
its behaviour becomes problematic.

-- 
Glynn Clements <glynn.clements@virgin.net>


Tue, Dec 2 2003 07:54:42    Comments added by hbowman  
Cc: glynn.clements@virgin.net

> > Any reason not to activate this module for 5.3 yet?
>
> Only the standard reason: once a module becomes "official", changing
> its behaviour becomes problematic.

Is 5.3 anywhere near being frozen though?


Hamish
Tue, Dec 2 2003 15:04:29    Mail sent by neteler@itc.it  
Return-Path <neteler@itc.it>
Delivered-To grass-bugs@lists.intevation.de
Date Tue, 2 Dec 2003 15:04:10 +0100
From Markus Neteler <neteler@itc.it>
To Glynn Clements <glynn.clements@virgin.net>
Cc Request Tracker <grass-bugs@intevation.de>, grass5@grass.itc.it
Subject Re: [GRASS5] [bug #2238] (grass) r.series: support for wildcards in input filenames
Message-ID <20031202150410.M29048@itc.it>
Mail-Followup-To Glynn Clements <glynn.clements@virgin.net>, Request Tracker <grass-bugs@intevation.de>, grass5@grass.itc.it
References <20031201143709.0371A13B92@lists.intevation.de> <16331.39092.462532.746078@cerise.nosuchdomain.co.uk>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent Mutt/1.2.5.1i
In-Reply-To <16331.39092.462532.746078@cerise.nosuchdomain.co.uk>; from glynn.clements@virgin.net on Mon, Dec 01, 2003 at 07:38:28PM +0000
X-Spam-Status No, hits=-4.9 tagged_above=-999.0 required=3.0 tests=BAYES_00
X-Spam-Level
On Mon, Dec 01, 2003 at 07:38:28PM +0000, Glynn Clements wrote:
> 
> Request Tracker wrote:
> 
> > It would be nice if r.series would accept wildcards for the input maps.
> > 
> > e.g.
> > r.series input=insitu_data.* output=insitu_data.stddev method=stddev
> > 
> > for:
> > insitu_data.001
> > insitu_data.002
> > ...
> > insitu_data.052
> 
> That may also true for several other modules; in which case, it might
> be better to figure out how to build this into G_parser().
> 
> > such as the g.mremove script does. [0-9] expansions etc would be nice too,
but not critical.
> 
> g.mremove is a shell script, which makes implementing shell
> substitutions somewhat easier.

Note:
r.out.mpeg supports wildcards. Maybe this could be moved somehow into
the parser.
 
[...]
> > Any reason not to activate this module for 5.3 yet?
> 
> Only the standard reason: once a module becomes "official", changing
> its behaviour becomes problematic.

There would be needed also a html doc file then.
Eg. extending
 http://grass.itc.it/grass51/manuals/html57_user/r.series.html
(which was generated automatically).

Markus Neteler


Tue, Dec 2 2003 17:39:02    Mail sent by glynn.clements@virgin.net  
Return-Path <glynn.clements@virgin.net>
Delivered-To grass-bugs@lists.intevation.de
From Glynn Clements <glynn.clements@virgin.net>
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
Message-ID <16332.48122.356161.110062@cerise.nosuchdomain.co.uk>
Date Tue, 2 Dec 2003 16:21:14 +0000
To Markus Neteler <neteler@itc.it>
Cc Request Tracker <grass-bugs@intevation.de>, grass5@grass.itc.it
Subject Re: [GRASS5] [bug #2238] (grass) r.series: support for wildcards in input filenames
In-Reply-To <20031202150410.M29048@itc.it>
References <20031201143709.0371A13B92@lists.intevation.de> <16331.39092.462532.746078@cerise.nosuchdomain.co.uk> <20031202150410.M29048@itc.it>
X-Mailer VM 7.07 under 21.4 (patch 14) "Reasonable Discussion" XEmacs Lucid
X-Spam-Status No, hits=-4.9 tagged_above=-999.0 required=3.0 tests=BAYES_00
X-Spam-Level
Markus Neteler wrote:

> > > It would be nice if r.series would accept wildcards for the input maps.
> > > 
> > > e.g.
> > > r.series input=insitu_data.* output=insitu_data.stddev method=stddev
> > > 
> > > for:
> > > insitu_data.001
> > > insitu_data.002
> > > ...
> > > insitu_data.052
> > 
> > That may also true for several other modules; in which case, it might
> > be better to figure out how to build this into G_parser().
> > 
> > > such as the g.mremove script does. [0-9] expansions etc would be nice too,
but not critical.
> > 
> > g.mremove is a shell script, which makes implementing shell
> > substitutions somewhat easier.
> 
> r.out.mpeg supports wildcards. Maybe this could be moved somehow into
> the parser.

That code (gee_wildfiles()) is a hack; it spawns an "ls" command via
system() to generate the list of filenames.

The issue isn't figuring out how to implement wildcard expansion;
that's easy enough to do without using system() hacks. The issue is
deciding how to make use of it within GRASS.

-- 
Glynn Clements <glynn.clements@virgin.net>


Tue, Dec 2 2003 23:40:11    Mail sent by hamish_nospam@yahoo.com  
Return-Path <hamish_nospam@yahoo.com>
Delivered-To grass-bugs@lists.intevation.de
Date Wed, 3 Dec 2003 11:39:51 +1300
From Hamish <hamish_nospam@yahoo.com>
To "Glynn Clements" <glynn.clements@virgin.net>
Cc neteler@itc.it, grass-bugs@intevation.de, grass5@grass.itc.it, jhuddleston@itc.nrcs.usda.gov
Subject Re: [GRASS5] [bug #2238] (grass) r.series: support for wildcards in input filenames
Message-Id <20031203113951.6c271bda.hamish_nospam@yahoo.com>
In-Reply-To <16332.48122.356161.110062@cerise.nosuchdomain.co.uk>
References <20031201143709.0371A13B92@lists.intevation.de> <16331.39092.462532.746078@cerise.nosuchdomain.co.uk> <20031202150410.M29048@itc.it> <16332.48122.356161.110062@cerise.nosuchdomain.co.uk>
X-Mailer Sylpheed version 0.7.4 (GTK+ 1.2.10; i386-debian-linux-gnu)
Mime-Version 1.0
Content-Type text/plain; charset=US-ASCII
Content-Transfer-Encoding 7bit
X-scanner scanned by Inflex 1.0.12.7
X-Spam-Status No, hits=-4.0 tagged_above=-999.0 required=3.0 tests=BAYES_00, FORGED_YAHOO_RCVD
X-Spam-Level
> > > > It would be nice if r.series would accept wildcards for the
> > > > input maps.
> > > > 
...
> > > That may also true for several other modules; in which case, it
> > > might be better to figure out how to build this into G_parser().
...
> > > > e.g.
...
> then G_parser() would do glob expansion, so in Hamish' example, using:
>    input=insitu_data.*
> would have the same result as:
>    input=insitu_data.001,insitu_data.002,...,insitu_data.052
...
> The issue isn't figuring out how to implement wildcard expansion;
> that's easy enough to do without using system() hacks. The issue is
> deciding how to make use of it within GRASS.


I'd just point out that it should have a check against MAXFILES.
[Maybe not in this case, I haven't studied how r.series works]

Moreover, it would be good to have MAXFILES defined globally, such as
with DEFAULT_BG_COLOR, etc.


src/raster/r.patch/cmd/nfiles.h:
---------------------------------------------------------------------
/* The number of cell files that can be patched together.
 *
 * All cell files will be opened at one time, so this number can not
 * be arbitrarily large.
 *
 * Must be smaller than MAXFILES as defined in src/libes/gis/G.h which 
 * in turn must be smaller than the operating system's limit.
 *  (Given by `cat /proc/sys/fs/file-max` in Linux 2.4)
 */

#define MAXFILES 200
---------------------------------------------------------------------


regards,
Hamish


Tue, Dec 30 2003 07:55:32    Mail sent by hamish_nospam@yahoo.com  
Return-Path <hamish_nospam@yahoo.com>
Delivered-To grass-bugs@lists.intevation.de
Message-ID <20031230065527.66897.qmail@web13305.mail.yahoo.com>
Date Mon, 29 Dec 2003 22:55:27 -0800 (PST)
From H B <hamish_nospam@yahoo.com>
Subject Re: [GRASS5] [bug #2238] (grass) r.series: support for wildcards in input filenames
To grass-bugs@intevation.de
Cc grass5@grass.itc.it, glynn.clements@virgin.net
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
X-Spam-Status No, hits=-4.9 tagged_above=-999.0 required=3.0 tests=BAYES_00
X-Spam-Level
> > > It would be nice if r.series would accept wildcards for the input
> > > maps.
> > > 
> > > e.g.
> r.series input=insitu_data.* output=insitu_data.stddev method=stddev
> > > 
> > > for:
> > > insitu_data.001
> > > insitu_data.002
> > > ...
> > > insitu_data.052
> > 
> > That may also true for several other modules; in which case, it 
> > might be better to figure out how to build this into G_parser().
> > 
> > > such as the g.mremove script does. [0-9] expansions etc would be 
> > > nice too, but not critical.
> > 
> > g.mremove is a shell script, which makes implementing shell
> > substitutions somewhat easier.
>>
>> r.out.mpeg supports wildcards. Maybe this could be moved somehow
into
>> the parser.
>
> That code (gee_wildfiles()) is a hack; it spawns an "ls" command via
> system() to generate the list of filenames.
> 
> The issue isn't figuring out how to implement wildcard expansion;
> that's easy enough to do without using system() hacks. The issue is
> deciding how to make use of it within GRASS.


A possible (temporary) solution: `g.mlist` (just updated in CVS).

for the example above, you might use:

r.series input="`g.mlist pattern='insitu_data.*' sep=,`" \
    output=insitu_data.stddev method=stddev


Note the g.mlist script also supports regular expressions for picking
map names, so there's quite a bit of flexability there.



regards,
Hamish


__________________________________
Do you Yahoo!?
Find out what made the Top Yahoo! Searches of 2003
http://search.yahoo.com/top2003


Mon, Feb 5 2007 22:04:11    User changed to hamish_nospam@yahoo.com,neteler@grass.itc.it by mneteler  
Mon, Feb 5 2007 22:04:30    User changed to hamish_nospam@yahoo.com,neteler@itc.it by mneteler  
Comment | Reply | Take | Resolve

You are currently authenticated as guest.
[Show Configuration] [Login as another user]

Users Guide - Mail Commands - Homepage of RequestTracker 1.0.7 - list any request