[GRASS-dev] Weekly report #3 - GRASS Interactive Scatter Plot Tool

Hello all,

1) What do I have completed this week?
This week I have revised approach to development of the backend.

The problem is that currently the scatter plot tool is not using raster library for analysed rasters and instead of this it is it is producing binary files. The reason for that bypass is that in it's current state the raster library has limitations, which make it difficult to use it in wxGUI environment. The major limitation for the scatter plot tool is an inability of the raster library to define own region just for rasters, which the tool uses. It can be changed only for the whole wxGUI environment.

After consultation with my mentor, we have concluded, that it is worth trying at least to suggest changes, which would reduce raster library limitations in wxGUI.

2) What am I going to achieve for next week?
During the weekend I am going to create some abstract draft of changes in raster library and then I would like to discuss it with GRASS community and find out whether it is dead end or it makes sense to continue in it.

3) Is there any blocking issue?
Raster library, but it is interesting to study it.

Best
Stepan

So I take it you are not using r.stats to generate the data to plot, but are getting data directly accessing rasters via GRASS libraries?

Michael
______________________________
C. Michael Barton
Director, Center for Social Dynamics & Complexity
Professor of Anthropology, School of Human Evolution & Social Change
Arizona State University
Tempe, AZ 85287-2402
USA

voice: 480-965-6262 (SHESC), 480-965-8130/727-9746 (CSDC)
fax: 480-965-7671(SHESC), 480-727-0709 (CSDC)
www: http://csdc.asu.edu, http://shesc.asu.edu
    http://www.public.asu.edu/~cmbarton

On Jul 5, 2013, at 2:13 PM, Štěpán Turek <stepan.turek@seznam.cz>
wrote:

Hello all,

1) What do I have completed this week?
This week I have revised approach to development of the backend.

The problem is that currently the scatter plot tool is not using raster library for analysed rasters and instead of this it is it is producing binary files. The reason for that bypass is that in it's current state the raster library has limitations, which make it difficult to use it in wxGUI environment. The major limitation for the scatter plot tool is an inability of the raster library to define own region just for rasters, which the tool uses. It can be changed only for the whole wxGUI environment.

After consultation with my mentor, we have concluded, that it is worth trying at least to suggest changes, which would reduce raster library limitations in wxGUI.

2) What am I going to achieve for next week?
During the weekend I am going to create some abstract draft of changes in raster library and then I would like to discuss it with GRASS community and find out whether it is dead end or it makes sense to continue in it.

3) Is there any blocking issue?
Raster library, but it is interesting to study it.

Best
Stepan

_______________________________________________
SoC mailing list
SoC@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/soc

Out of curiosity, why aren't you reusing and/or enhancing the existing scatter plot python classes?

Michael
______________________________
C. Michael Barton
Director, Center for Social Dynamics & Complexity
Professor of Anthropology, School of Human Evolution & Social Change
Arizona State University
Tempe, AZ 85287-2402
USA

voice: 480-965-6262 (SHESC), 480-965-8130/727-9746 (CSDC)
fax: 480-965-7671(SHESC), 480-727-0709 (CSDC)
www: http://csdc.asu.edu, http://shesc.asu.edu
    http://www.public.asu.edu/~cmbarton

On Jul 5, 2013, at 2:13 PM, Štěpán Turek <stepan.turek@seznam.cz>
wrote:

Hello all,

1) What do I have completed this week?
This week I have revised approach to development of the backend.

The problem is that currently the scatter plot tool is not using raster library for analysed rasters and instead of this it is it is producing binary files. The reason for that bypass is that in it's current state the raster library has limitations, which make it difficult to use it in wxGUI environment. The major limitation for the scatter plot tool is an inability of the raster library to define own region just for rasters, which the tool uses. It can be changed only for the whole wxGUI environment.

After consultation with my mentor, we have concluded, that it is worth trying at least to suggest changes, which would reduce raster library limitations in wxGUI.

2) What am I going to achieve for next week?
During the weekend I am going to create some abstract draft of changes in raster library and then I would like to discuss it with GRASS community and find out whether it is dead end or it makes sense to continue in it.

3) Is there any blocking issue?
Raster library, but it is interesting to study it.

Best
Stepan

_______________________________________________
SoC mailing list
SoC@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/soc

Štěpán wrote:

The problem is that currently the scatter plot tool is not using raster library
for analysed rasters and instead of this it is it is producing binary files. The
reason for that bypass is that in it's current state the raster library has
limitations, which make it difficult to use it in wxGUI environment. The major
limitation for the scatter plot tool is an inability of the raster library to
define own region just for rasters, which the tool uses. It can be changed only
for the whole wxGUI environment.

Hi,

I am interested to hear more about the library limitations.. you
mean the WIND region, right? I'd be surprised if WIND_OVERRIDE or
GRASS_REGION enviro variables (and the python wrappers for them)
didn't provide full control for whatever someone might like to do.

I would guess if the scatter tool was spawned as an independent
process, it could maintain its own environment & so it's own region
override enviro variables. or simply unset the wxGUI display overrides
and just use the mapset's real computational region read directly from
the WIND file?

regards,
Hamish

Hi Hamish and Michael,

your questions are connected I will try to explain both.

The scatter plot tool backend is run in same process as wxGUI. If you select some area in scatter plot, then data from numpy arrays are passed to the backend (through ctypes), which describes selected areas in scatters plots. And the backend computes corresponding areas which will be highlighted in all opened scatter plots. To avoid frozing of the wxGUI, the computation is done in separate python thread.

Currently r.out.bin is used to bypass inability to set region in raster library for different rasters. When user choose raster group for analysis in the tool, it is exported into binary files in current region and the backend works directly with the binary files. This is not very nice.

If the backend would be written as module, then I would need to create temporary files to pass the selected areas, which does not seem very elegant to me.

In simplified way the idea is that the library should give you option whether you want to open and then work with raster file according to the statically set variables (in structure R__) or open it with dynamically defined variables.

It could be also useful for Pietro’s pyGRASS API. And it would be first small step to achieve compilation of raster modules as library instead of different programs. I am working on more concrete proposal of the changes in raster library during this weekend.

I am new to this problematic, so all these suggestions can be totally wrong…

Best

Stepan

---------- Původní zpráva ----------
Od: Michael Barton Michael.Barton@asu.edu
Datum: 6. 7. 2013
Předmět: Re: [SoC] Weekly report #3 - GRASS Interactive Scatter Plot Tool

So I take it you are not using r.stats to generate the data to plot, but are getting data directly accessing rasters via GRASS libraries?

Michael


Hi,

I am interested to hear more about the library limitations… you
mean the WIND region, right? I’d be surprised if WIND_OVERRIDE or
GRASS_REGION enviro variables (and the python wrappers for them)
didn’t provide full control for whatever someone might like to do.

I would guess if the scatter tool was spawned as an independent
process, it could maintain its own environment & so it’s own region
override enviro variables. or simply unset the wxGUI display overrides
and just use the mapset’s real computational region read directly from
the WIND file?

regards,
Hamish

=

On Sat, Jul 6, 2013 at 4:19 PM, Štěpán Turek <stepan.turek@seznam.cz> wrote:

Hi Hamish and Michael,

your questions are connected I will try to explain both.

The scatter plot tool backend is run in same process as wxGUI. If you select
some area in scatter plot, then data from numpy arrays are passed to the
backend (through ctypes), which describes selected areas in scatters plots.

You probably don't need ctypes for that, have a look at
lib/python/script/array.py.

If you want to use ctypes, keep in mind that GRASS is designed for
modular use. Tools using library functions must run as a separate
process, i.e. the wxGUI should run just fine also in the absence of
ctypes.

And the backend computes corresponding areas which will be highlighted in
all opened scatter plots. To avoid frozing of the wxGUI, the computation is
done in separate python thread.

Currently r.out.bin is used to bypass inability to set region in raster
library for different rasters. When user choose raster group for analysis in
the tool, it is exported into binary files in current region and the backend
works directly with the binary files. This is not very nice.

If the backend would be written as module, then I would need to create
temporary files to pass the selected areas, which does not seem very elegant
to me.

When processing raster data, temporary files are created pretty much
all the time (by the raster lib). Regarding the scatterplot tool which
works with raster data which can be very large, an advantage of
temporary files is that out-of-memory errors are more easily avoided.

In simplified way the idea is that the library should give you option
whether you want to open and then work with raster file according to the
statically set variables (in structure R__) or open it with dynamically
defined variables.

With regard to the current region, it seems to me that this would
violate the concept of the current region. Rather run the scatterplot
tool as a separate process, then you can modify the region without
changing the regular current region. When using raster lib functions
directly, maybe Rast_set_input_window() can help you?

It could be also useful for Pietro's pyGRASS API. And it would be first
small step to achieve compilation of raster modules as library instead of
different programs. I am working on more concrete proposal of the changes in
raster library during this weekend.

Raster modules, as all GRASS modules, should (IMHO must definitively)
stay modules because GRASS is designed for modular use. Modules can
easily call other modules, effectively using them instead of some,
just like some library function. Again, the advantage is that modules
are run as a separate process.

my 2c

Markus M

I am new to this problematic, so all these suggestions can be totally
wrong..

Best
Stepan

---------- Původní zpráva ----------
Od: Michael Barton <Michael.Barton@asu.edu>
Datum: 6. 7. 2013
Předmět: Re: [SoC] Weekly report #3 - GRASS Interactive Scatter Plot Tool

So I take it you are not using r.stats to generate the data to plot, but are
getting data directly accessing rasters via GRASS libraries?

Michael
______________________________

Hi,

I am interested to hear more about the library limitations.. you
mean the WIND region, right? I'd be surprised if WIND_OVERRIDE or
GRASS_REGION enviro variables (and the python wrappers for them)
didn't provide full control for whatever someone might like to do.

I would guess if the scatter tool was spawned as an independent
process, it could maintain its own environment & so it's own region
override enviro variables. or simply unset the wxGUI display overrides
and just use the mapset's real computational region read directly from
the WIND file?

regards,
Hamish

_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

Hi Štěpán,
some notes to you implementation approach:

2013/7/6 Markus Metz <markus.metz.giswork@gmail.com>

On Sat, Jul 6, 2013 at 4:19 PM, Štěpán Turek <stepan.turek@seznam.cz> wrote:
> Hi Hamish and Michael,
>
> your questions are connected I will try to explain both.
>
> The scatter plot tool backend is run in same process as wxGUI. If you select
> some area in scatter plot, then data from numpy arrays are passed to the
> backend (through ctypes), which describes selected areas in scatters plots.

You probably don't need ctypes for that, have a look at
lib/python/script/array.py.

If you want to use ctypes, keep in mind that GRASS is designed for
modular use. Tools using library functions must run as a separate
process, i.e. the wxGUI should run just fine also in the absence of
ctypes.

I would avoid to use ctypes in the same process as wxGUI. The grass
libraries call exit() in case a fatal error occurs. This will also
crash the GUI in this case. I would strongly suggest to use
multiprocessing Python module to spawn new processes that make use of
ctypes. However, what is the reason that you use ctypes directly
instead of PyGRASS that was designed to provide an abstract layer
above several grass libraries? Maybe you can add an OO layer in
PyGRASS providing access to your backend?

> And the backend computes corresponding areas which will be highlighted in
> all opened scatter plots. To avoid frozing of the wxGUI, the computation is
> done in separate python thread.

Unfortunately are python threads not a good idea if you use ctypes,
since in case of a fatal error it will crash the GUI. Besides of that
are Python threads not really parallel. [1]

[1] https://en.wikipedia.org/wiki/Global_Interpreter_Lock

>
> Currently r.out.bin is used to bypass inability to set region in raster
> library for different rasters. When user choose raster group for analysis in
> the tool, it is exported into binary files in current region and the backend
> works directly with the binary files. This is not very nice.
>
> If the backend would be written as module, then I would need to create
> temporary files to pass the selected areas, which does not seem very elegant
> to me.

Please use the multiprocessing [2] Python module to spawn separate
processes and then use PyGRASS to set the process specific region and
to access the raster maps. With this approach each raster map can have
its own region. This will avoid GUI crash in case of a fatal error, it
will avoid the need to export raster maps or to create temporary
files. The multiprocessing modules provides inter process
communication based on serialized Python objects. Hence it is very
simple an convenient to exchange Python objects between different
processes (using a queue object).

[2] http://docs.python.org/2/library/multiprocessing.html

When processing raster data, temporary files are created pretty much
all the time (by the raster lib). Regarding the scatterplot tool which
works with raster data which can be very large, an advantage of
temporary files is that out-of-memory errors are more easily avoided.
>
> In simplified way the idea is that the library should give you option
> whether you want to open and then work with raster file according to the
> statically set variables (in structure R__) or open it with dynamically
> defined variables.

With regard to the current region, it seems to me that this would
violate the concept of the current region. Rather run the scatterplot
tool as a separate process, then you can modify the region without
changing the regular current region. When using raster lib functions
directly, maybe Rast_set_input_window() can help you?

Please use PyGRASS in separate processes to access raster maps.

> It could be also useful for Pietro's pyGRASS API. And it would be first
> small step to achieve compilation of raster modules as library instead of
> different programs. I am working on more concrete proposal of the changes in
> raster library during this weekend.

Raster modules, as all GRASS modules, should (IMHO must definitively)
stay modules because GRASS is designed for modular use. Modules can
easily call other modules, effectively using them instead of some,
just like some library function. Again, the advantage is that modules
are run as a separate process.

Absolutely. PyGRASS offers a very convenient way to call GRASS modules
of any kind (C/C++, Python) using a simple function.

Best regards and happy hacking :slight_smile:
Soeren

my 2c

Markus M
>
> I am new to this problematic, so all these suggestions can be totally
> wrong..
>
> Best
> Stepan
>
> ---------- Původní zpráva ----------
> Od: Michael Barton <Michael.Barton@asu.edu>
> Datum: 6. 7. 2013
> Předmět: Re: [SoC] Weekly report #3 - GRASS Interactive Scatter Plot Tool
>
>
> So I take it you are not using r.stats to generate the data to plot, but are
> getting data directly accessing rasters via GRASS libraries?
>
> Michael
> ______________________________
>
>
>
> Hi,
>
> I am interested to hear more about the library limitations.. you
> mean the WIND region, right? I'd be surprised if WIND_OVERRIDE or
> GRASS_REGION enviro variables (and the python wrappers for them)
> didn't provide full control for whatever someone might like to do.
>
> I would guess if the scatter tool was spawned as an independent
> process, it could maintain its own environment & so it's own region
> override enviro variables. or simply unset the wxGUI display overrides
> and just use the mapset's real computational region read directly from
> the WIND file?
>
>
> regards,
> Hamish
>
>
>
> _______________________________________________
> grass-dev mailing list
> grass-dev@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-dev
_______________________________________________
SoC mailing list
SoC@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/soc

FWIW, r.stats respects any changes in computational region but I don't think that r.out.bin does. r.stats also will calculate values from multiple rasters, along with xy coordinates in one pass. These are a couple of the reasons I used r.stat to collect data on rasters.

Michael
____________________
C. Michael Barton
Director, Center for Social Dynamics & Complexity
Professor of Anthropology, School of Human Evolution & Social Change
Arizona State University

voice: 480-965-6262 (SHESC), 480-965-8130/727-9746 (CSDC)
fax: 480-965-7671 (SHESC), 480-727-0709 (CSDC)
www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu

On Jul 6, 2013, at 9:29 AM, Markus Metz <markus.metz.giswork@gmail.com>
wrote:

On Sat, Jul 6, 2013 at 4:19 PM, Štěpán Turek <stepan.turek@seznam.cz> wrote:

Hi Hamish and Michael,

your questions are connected I will try to explain both.

The scatter plot tool backend is run in same process as wxGUI. If you select
some area in scatter plot, then data from numpy arrays are passed to the
backend (through ctypes), which describes selected areas in scatters plots.

You probably don't need ctypes for that, have a look at
lib/python/script/array.py.

If you want to use ctypes, keep in mind that GRASS is designed for
modular use. Tools using library functions must run as a separate
process, i.e. the wxGUI should run just fine also in the absence of
ctypes.

And the backend computes corresponding areas which will be highlighted in
all opened scatter plots. To avoid frozing of the wxGUI, the computation is
done in separate python thread.

Currently r.out.bin is used to bypass inability to set region in raster
library for different rasters. When user choose raster group for analysis in
the tool, it is exported into binary files in current region and the backend
works directly with the binary files. This is not very nice.

If the backend would be written as module, then I would need to create
temporary files to pass the selected areas, which does not seem very elegant
to me.

When processing raster data, temporary files are created pretty much
all the time (by the raster lib). Regarding the scatterplot tool which
works with raster data which can be very large, an advantage of
temporary files is that out-of-memory errors are more easily avoided.

In simplified way the idea is that the library should give you option
whether you want to open and then work with raster file according to the
statically set variables (in structure R__) or open it with dynamically
defined variables.

With regard to the current region, it seems to me that this would
violate the concept of the current region. Rather run the scatterplot
tool as a separate process, then you can modify the region without
changing the regular current region. When using raster lib functions
directly, maybe Rast_set_input_window() can help you?

It could be also useful for Pietro's pyGRASS API. And it would be first
small step to achieve compilation of raster modules as library instead of
different programs. I am working on more concrete proposal of the changes in
raster library during this weekend.

Raster modules, as all GRASS modules, should (IMHO must definitively)
stay modules because GRASS is designed for modular use. Modules can
easily call other modules, effectively using them instead of some,
just like some library function. Again, the advantage is that modules
are run as a separate process.

my 2c

Markus M

I am new to this problematic, so all these suggestions can be totally
wrong..

Best
Stepan

---------- Původní zpráva ----------
Od: Michael Barton <Michael.Barton@asu.edu>
Datum: 6. 7. 2013
Předmět: Re: [SoC] Weekly report #3 - GRASS Interactive Scatter Plot Tool

So I take it you are not using r.stats to generate the data to plot, but are
getting data directly accessing rasters via GRASS libraries?

Michael
______________________________

Hi,

I am interested to hear more about the library limitations.. you
mean the WIND region, right? I'd be surprised if WIND_OVERRIDE or
GRASS_REGION enviro variables (and the python wrappers for them)
didn't provide full control for whatever someone might like to do.

I would guess if the scatter tool was spawned as an independent
process, it could maintain its own environment & so it's own region
override enviro variables. or simply unset the wxGUI display overrides
and just use the mapset's real computational region read directly from
the WIND file?

regards,
Hamish

_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
grass-dev Info Page

Michael wrote:

FWIW, r.stats respects any changes in computational region
but I don't think that r.out.bin does.

(actually r.out.bin does respect the current computational
region, it uses the standard library functions to read the
input raster map. if you look at the code it is not too different
than r.example)

r.stats also will calculate values from multiple rasters,
along with xy coordinates in one pass. These are a couple
of the reasons I used r.stat to collect data on rasters.

see also r.out.xyz for a r.stats wrapper/front end for xy coord
output.

Hamish

Hi Sören and Markus,

many thanks for big help. If I understand it correctly, the key, which will solve my issue, is the multiprocessing module, which allows to define region just in this process without affecting the others (as it is in the modules). Thanks to that it will be possible to use raster library in the backend and get rid of files produced by r.out.bin.

I would avoid to use ctypes in the same process as wxGUI. The grass
libraries call exit() in case a fatal error occurs. This will also
crash the GUI in this case. I would strongly suggest to use
multiprocessing Python module to spawn new processes that make use of
ctypes. However, what is the reason that you use ctypes directly
instead of PyGRASS that was designed to provide an abstract layer
above several grass libraries? Maybe you can add an OO layer in
PyGRASS providing access to your backend?

Extending PyGRASS to provide access to the backend is good idea. I will do so.

Best

Stepan

=

Hi Štěpán,

On Sunday 07 Jul 2013 13:55:15 Štěpán Turek wrote:

many thanks for big help. If I understand it correctly, the key, which will
solve my issue, is the multiprocessing module, which allows to define
region just in this process without affecting the others (as it is in the
modules). Thanks to that it will be possible to use raster library in the
backend and get rid of files produced by r.out.bin.

yes, you can just run your command giving the right environment variables...

{{{
import subprocess as sub

sub.Popen(['grasscmd', 'option', etc.], env={dictionary with your variables})
}}}

I've used it in the pygrass.modules.grid to split the grass operations in
several
independent processes running the same command in different mapsets with
different regions. You can have a look here:

http://trac.osgeo.org/grass/browser/grass/trunk/lib/python/pygrass/modules/grid/grid.py#L34

[snip]
Extending PyGRASS to provide access to the backend is good idea. I will do
so.

Please ask me if you have any doubts... I will be happy to help! :slight_smile:

Have a nice day!

Pietro

Hi,

yes, you can just run your command giving the right environment variables…

I have just one more question.

Will it work properly when I will call some function from C libraries:

Im my case it is something like this:

int I_ComputeScatts(struct Cell_head *region, struct scCats * scatt_conds, const char ** bands,

int n_bands, struct scCats * scatt_plts, const char ** cats_rasts)

scatt_conds are selected areas in open scatter plots and scatt_plts there are returned computed scatter plots. Let say that this function will be called in separate process form wxGUI created by multiprocessing module. And in this function there is used raster library.

Is it (or can be) this raster library independent form raster library loaded to wxGUI and from the other processes created from wxGUI?

Let say that this function will call Rast_set_window function. Will be raster region set only in scope of the separate process or also out of it?

If the libraries are independent it solves the issue.

Best

Stepan

Hi,

2013/7/7 Štěpán Turek <stepan.turek@seznam.cz>:

Hi,

yes, you can just run your command giving the right environment variables...

I have just one more question.

Will it work properly when I will call some function from C libraries:

Im my case it is something like this:

int I_ComputeScatts(struct Cell_head *region, struct scCats * scatt_conds,
const char ** bands,
                                      int n_bands, struct scCats *
scatt_plts, const char ** cats_rasts)

Please use the GNU/GRASS style to implement new C library functions[1].

scatt_conds are selected areas in open scatter plots and scatt_plts there
are returned computed scatter plots. Let say that this function will be
called in separate process form wxGUI created by multiprocessing module.
And in this function there is used raster library.

Is it (or can be) this raster library independent form raster library loaded
to wxGUI and from the other processes created from wxGUI?

Yes, it is. The new process has its own environment that is not shared
with other process. It will inherit the environment from its parent
process and can modify its own environment[2,3,4].

Let say that this function will call Rast_set_window function. Will be
raster region set only in scope of the separate process or also out of it?

If you use Rast_set_window() in the new process the computational
region will only be set for this process.

Be aware that you must use Python objects to transfer the data from
the child process to its parent process using a queue[5]. I think that
numpy array objects should work.

[1] http://trac.osgeo.org/grass/browser/grass/trunk/SUBMITTING#L201
[2] https://en.wikipedia.org/wiki/Unix_process
[3] https://en.wikipedia.org/wiki/Child_process
[4] https://en.wikipedia.org/wiki/Parent_process
[5] http://docs.python.org/2/library/multiprocessing.html#multiprocessing.Queue

Best regards
Soeren

If the libraries are independent it solves the issue.

Best

Stepan

Hi,

[snip]

Be aware that you must use Python objects to transfer the data from
the child process to its parent process using a queue[5]. I think that
numpy array objects should work.

I just realized that you can use shared ctypes objects as well for
inter process communication[1].

[1] http://docs.python.org/2/library/multiprocessing.html#module-multiprocessing.sharedctypes

Best
Soeren

Are you planning to use wxPlot for the scatterplot display? This provides a consistent graphical interface with the other plotting modules.

Michael


C. Michael Barton
Director, Center for Social Dynamics & Complexity
Professor of Anthropology, School of Human Evolution & Social Change
Arizona State University

voice: 480-965-6262 (SHESC), 480-965-8130/727-9746 (CSDC)
fax: 480-965-7671 (SHESC), 480-727-0709 (CSDC)

www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu

On Jul 7, 2013, at 10:21 AM, Štěpán Turek <stepan.turek@seznam.cz>
wrote:

Hi,

yes, you can just run your command giving the right environment variables…

I have just one more question.

Will it work properly when I will call some function from C libraries:

Im my case it is something like this:

int I_ComputeScatts(struct Cell_head *region, struct scCats * scatt_conds, const char ** bands,

int n_bands, struct scCats * scatt_plts, const char ** cats_rasts)

scatt_conds are selected areas in open scatter plots and scatt_plts there are returned computed scatter plots. Let say that this function will be called in separate process form wxGUI created by multiprocessing module. And in this function there is used raster library.

Is it (or can be) this raster library independent form raster library loaded to wxGUI and from the other processes created from wxGUI?

Let say that this function will call Rast_set_window function. Will be raster region set only in scope of the separate process or also out of it?

If the libraries are independent it solves the issue.

Best

Stepan


SoC mailing list
SoC@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/soc

Hi Michael,

Are you planning to use wxPlot for the scatterplot display? This provides a consistent graphical  interface with the other plotting modules.

currently matplotlib [1] is used. The library provides events [2], which allows you to find out where the user clicked. With this information you are able to keep track of selected regions in a scatter plot.

Best,
Stepan

[1] http://matplotlib.org/

[2] http://matplotlib.org/users/event_handling.html

=

OK. I originally wanted to use matplotlib because it is a much richer environment, but it was nixed by the dev team because it added a new dependency. If we start using it, it will make numerous, powerful analytical functions accessible.

Michael


C. Michael Barton
Director, Center for Social Dynamics & Complexity
Professor of Anthropology, School of Human Evolution & Social Change
Arizona State University

voice: 480-965-6262 (SHESC), 480-965-8130/727-9746 (CSDC)
fax: 480-965-7671 (SHESC), 480-727-0709 (CSDC)

www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu

On Jul 8, 2013, at 2:24 AM, Štěpán Turek <stepan.turek@seznam.cz>
wrote:

Hi Michael,

Are you planning to use wxPlot for the scatterplot display? This provides a consistent graphical  interface with the other plotting modules.

currently matplotlib [1] is used. The library provides events [2], which allows you to find out where the user clicked. With this information you are able to keep track of selected regions in a scatter plot.

Best,
Stepan

[1] http://matplotlib.org/

[2] http://matplotlib.org/users/event_handling.html

Michael wrote:

Are you planning to use wxPlot for the scatterplot display? This
provides a consistent graphical interface with the other plotting
modules.

Stepan:

currently matplotlib [1] is used. The library provides events
[2], which allows you to find out where the user clicked. With this
information you are able to keep track of selected regions in a
scatter plot.

Michael:

OK. I originally wanted to use matplotlib because it is a much
richer environment, but it was nixed by the dev team because it added
a new dependency. If we start using it, it will make numerous,
powerful analytical functions accessible.

Hi,

fwiw I wouldn't mind matplotlib being around, since I already know the
Matlab plotting commands very well, and matplotlib is "not dissimilar".
But I've been quiet on pushing that since I'm sure there are other things
(java, C++, ruby, whatever) that other grass devs know well, but may not
be generally in line with the project's needs. So "+0" from me.

I don't know much about PyPlot or how the wx profile tool is done, so I
can't really comment on the pros and cons. Just that
trunk/scripts/i.spectral/i.spectral.py would be a good test case
(currently uses gnuplot or d.linegraph).

Another idea is to replace the d.linegraph module with a python wrapper
function, and d.histogram too.

I would add that adding a dependency for the wxGUI is not adding the
dependency to GRASS, since GRASS can be built and run without the wxGUI.

2c,
Hamish

I agree with all. wxPlot is OK but is limited in the kinds of graphs that can be produced. MatPlotLib could do something that looks like d.histogram but much nicer. It can also make polar coordinate graphs, line plots, and many other things.

Michael
____________________
C. Michael Barton
Director, Center for Social Dynamics & Complexity
Professor of Anthropology, School of Human Evolution & Social Change
Arizona State University

voice: 480-965-6262 (SHESC), 480-965-8130/727-9746 (CSDC)
fax: 480-965-7671 (SHESC), 480-727-0709 (CSDC)
www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu

On Jul 13, 2013, at 6:14 PM, Hamish <hamish_b@yahoo.com>
wrote:

Michael wrote:

Are you planning to use wxPlot for the scatterplot display? This
provides a consistent graphical interface with the other plotting
modules.

Stepan:

currently matplotlib [1] is used. The library provides events
[2], which allows you to find out where the user clicked. With this
information you are able to keep track of selected regions in a
scatter plot.

Michael:

OK. I originally wanted to use matplotlib because it is a much
richer environment, but it was nixed by the dev team because it added
a new dependency. If we start using it, it will make numerous,
powerful analytical functions accessible.

Hi,

fwiw I wouldn't mind matplotlib being around, since I already know the
Matlab plotting commands very well, and matplotlib is "not dissimilar".
But I've been quiet on pushing that since I'm sure there are other things
(java, C++, ruby, whatever) that other grass devs know well, but may not
be generally in line with the project's needs. So "+0" from me.

I don't know much about PyPlot or how the wx profile tool is done, so I
can't really comment on the pros and cons. Just that
trunk/scripts/i.spectral/i.spectral.py would be a good test case
(currently uses gnuplot or d.linegraph).

Another idea is to replace the d.linegraph module with a python wrapper
function, and d.histogram too.

I would add that adding a dependency for the wxGUI is not adding the
dependency to GRASS, since GRASS can be built and run without the wxGUI.

2c,
Hamish