Re: [GRASS-user] d.rast in python script

2018-10-22 Thread Nikos Alexandris

* Stefan Blumentrath  [2018-10-22 08:20:05 +]:


I think Laurents solution is for rendering maps to file/image.


If of interest, see also: 
https://lists.osgeo.org/pipermail/grass-user/2018-October/079436.html

Nikos



signature.asc
Description: PGP signature
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

[GRASS-user] tygrass, working with GRASS GIS under Terminology

2018-10-22 Thread Nikos Alexandris

Maybe of your interest,

an approach on rendering maps directly in the Terminology terminal while
working interactively or even while running a script:
https://gitlab.com/NikosAlexandris/tygrass

an experimental addon:
https://gitlab.com/NikosAlexandris/d.tyraster

a series of screencasts:
https://archive.org/details/GrassGisUnderTerminology [*]

Nikos

[*] replay is slow, to do: maybe some quality downgrade


signature.asc
Description: PGP signature
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] r.basin error

2018-10-22 Thread pelempito
Thanks.

I think the same as you, that the problem arises in r.width.funct.

Unfortunately, I don't have a finer DEM for this region.

I appreciate your help.

Best regards.

Jose



--
Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Horizontal bands on raster maps

2018-10-22 Thread Rich Shepard

On Mon, 22 Oct 2018, Markus Metz wrote:


Can you provide the input data and the commands used to create the TCI map?


  Sent off the mail list because client data are involved.

Rich
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Horizontal bands on raster maps

2018-10-22 Thread Markus Metz
On Mon, Oct 22, 2018 at 8:03 PM Rich Shepard 
wrote:
>
>What might cause the darker horizontal bands seen on the attached TCI
map?

Can you provide the input data and the commands used to create the TCI map?

Markus M

>
> TIA,
>
> Rich___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] r.basin error

2018-10-22 Thread Helmut Kudrnovsky
pelempito wrote
> Thanks Helmut for your reply.
> 
> Certainly having two areas is not a desirable result, but I am not sure if
> there is a problem with the DEM. One of the areas encompasses an isolated
> pixel, which in fact is the basin outlet. This polygon is connected
> diagonally with the other one, which is the main area of the basin. Is it
> an
> issue of the DEM? The picture below shows the DEM cropped in the basin
> area,
> as well as the polygons and the main channel:
> 
> http://osgeo-org.1560.x6.nabble.com/file/t368208/demcropped.jpg; 
> 
> Many of my basins have an outlet such as the one described above. Should I
> move the outlets to the main area? Such a solution would be a bit
> impractical. However, some basin outlets may fall on an isolated pixel,
> which may not be considered as an error.
> 
> 
> 
> --
> Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html
> ___
> grass-user mailing list

> grass-user@.osgeo

> https://lists.osgeo.org/mailman/listinfo/grass-user


---
"/home/jr/.grass7/addons/scripts/r.width.funct", line 
125, in findint 
z1, z2, f1, f2 = kl[int(Xf[0])][0], kl[int(Xf[0]-1)][0], 
kl[int(Xf[0])][1], kl[int(Xf[0]-1)][1] 
TypeError: only length-1 arrays can be converted to Python 
scalars 
--

maybe it's not an DEM issue.

looking on your error, the issue arises in r.width.funct.

Not checked the code, AFAIR there may be some instability if there are 2
polygones. Have look into the source.

Do you maybe have some finer DEM for this region to test?



-
best regards
Helmut
--
Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] r.basin error

2018-10-22 Thread pelempito
Thanks Helmut for your reply.

Certainly having two areas is not a desirable result, but I am not sure if
there is a problem with the DEM. One of the areas encompasses an isolated
pixel, which in fact is the basin outlet. This polygon is connected
diagonally with the other one, which is the main area of the basin. Is it an
issue of the DEM? The picture below shows the DEM cropped in the basin area,
as well as the polygons and the main channel:

 

Many of my basins have an outlet such as the one described above. Should I
move the outlets to the main area? Such a solution would be a bit
impractical. However, some basin outlets may fall on an isolated pixel,
which may not be considered as an error.



--
Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] r.basin error

2018-10-22 Thread Helmut Kudrnovsky
pelempito wrote
> Hi.
> 
> I tryed to run the r.basin addon for almost 4000 basins. Approximately 10%
> of the basins end without the .csv parameters file. Digging deeper into
> the
> command output, I spotted the following error at the end of the log from
> r.basin:
> 
> 
> Traceback (most recent call last):
>   File "/home/jr/.grass7/addons/scripts/r.width.funct", line
> 132, in 
> 
> sys.exit(main())
>   File "/home/jr/.grass7/addons/scripts/r.width.funct", line
> 85, in main
> prc[2,0] , prc[2,1] = findint(kl,0.3) , 0.3
>   File "/home/jr/.grass7/addons/scripts/r.width.funct", line
> 125, in findint
> z1, z2, f1, f2 = kl[int(Xf[0])][0], kl[int(Xf[0]-1)][0],
> kl[int(Xf[0])][1], kl[int(Xf[0]-1)][1]
> TypeError: only length-1 arrays can be converted to Python
> scalars
> 
> --
> 
> An ERROR occurred running r.basin
> Please check for error messages above or try with another pairs of outlet
> coordinates
> 
> 
> I think that r.basin stops after this error occurs, which may prevent
> r.basin from generating the .csv parameter file for a given basin. I
> researched a bit about the scalars in Python, and found  this post
> https://stackoverflow.com/questions/21687581/typeerror-only-length-1-arrays-can-be-converted-to-python-scalars-while-trying;
>   
> (sorry for cross referencing), which refers that "non-numpy functions ...
> don't play nicely with numpy arrays", but I couldn't make more follow up.
> 
> The error I just found can be reproduced by importing the raster DEM
> included in  this ZIP file
> http://geografiafisica.org/consigna/visitante/grass/hydrodem.zip;  
> into
> GRASS, and running the following command (I have more coordinates for
> which
> r.basin fails as well):
> 
> 
> r.basin --overwrite --verbose map=hydrodem prefix=cuenca13
> coordinates=335595,2066655 threshold=22 dir=/tmp/tst
> 
> 
> The raster is a subset of the tile Entity ID SRTM1N18W071V3, from the SRTM
> 1
> Arc-Second Global DEM, post-treated by myself with the r.hydrodem addon.
> 
> I unsuccessfully tried to solve the issue by updating the region with both
> the -a flag and the align parameter, since I read in the forum about that
> trick as a possible workaround as well.

have a look into the created vector basin, for the coordinates mentioned
above:

Number of areas:2 

maybe there is some issue withe DEM?




-
best regards
Helmut
--
Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

[GRASS-user] i.sentinel.mask - importing raster bands needed?

2018-10-22 Thread Helmut Kudrnovsky
Hi,

in the i.sentinel.mask manual [1] there is following mentioned:

"[...]
All necessary input bands (blue, green, red, nir, nir8a, swir11, swir12)
must be imported in GRASS
[...]"

is it really needed ti import all the sentinel raster band into GRASS? or is
it enough with r.external'ed raster bands?

any experience?

[1] https://grass.osgeo.org/grass74/manuals/addons/i.sentinel.mask.html



-
best regards
Helmut
--
Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

[GRASS-user] r.basin error

2018-10-22 Thread pelempito
Hi.

I tryed to run the r.basin addon for almost 4000 basins. Approximately 10%
of the basins end without the .csv parameters file. Digging deeper into the
command output, I spotted the following error at the end of the log from
r.basin:


Traceback (most recent call last):
  File "/home/jr/.grass7/addons/scripts/r.width.funct", line
132, in 
sys.exit(main())
  File "/home/jr/.grass7/addons/scripts/r.width.funct", line
85, in main
prc[2,0] , prc[2,1] = findint(kl,0.3) , 0.3
  File "/home/jr/.grass7/addons/scripts/r.width.funct", line
125, in findint
z1, z2, f1, f2 = kl[int(Xf[0])][0], kl[int(Xf[0]-1)][0],
kl[int(Xf[0])][1], kl[int(Xf[0]-1)][1]
TypeError: only length-1 arrays can be converted to Python
scalars

--

An ERROR occurred running r.basin
Please check for error messages above or try with another pairs of outlet
coordinates


I think that r.basin stops after this error occurs, which may prevent
r.basin from generating the .csv parameter file for a given basin. I
researched a bit about the scalars in Python, and found  this post

  
(sorry for cross referencing), which refers that "non-numpy functions ...
don't play nicely with numpy arrays", but I couldn't make more follow up.

The error I just found can be reproduced by importing the raster DEM
included in  this ZIP file
   into
GRASS, and running the following command (I have more coordinates for which
r.basin fails as well):


r.basin --overwrite --verbose map=hydrodem prefix=cuenca13
coordinates=335595,2066655 threshold=22 dir=/tmp/tst


The raster is a subset of the tile Entity ID SRTM1N18W071V3, from the SRTM 1
Arc-Second Global DEM, post-treated by myself with the r.hydrodem addon.

I unsuccessfully tried to solve the issue by updating the region with both
the -a flag and the align parameter, since I read in the forum about that
trick as a possible workaround as well.

My GRASS region output is included below:


g.region -p 
projection: 1 (UTM)
zone:   19
datum:  wgs84
ellipsoid:  wgs84
north:  2068530
south:  2017320
west:   314970
east:   353400
nsres:  30
ewres:  30
rows:   1707
cols:   1281
cells:  2186667


And this is the r.info command output for the raster map hydrodem:


r.info map=hydrodem@PERMANENT   

++
 | Map:  hydrodem@PERMANENT Date: Mon Oct 22 10:04:29 2018   
|
 | Mapset:   PERMANENT  Login of Creator: jr 
|
 | Location: hydrodemocoa
|
 | DataBase: /home/jr/Documentos/grass/tst   
|
 | Title: ( hydrodem )   
|
 | Timestamp: none   
|

||
 |   
|
 |   Type of Map:  raster   Number of Categories: 0  
|
 |   Data Type:DCELL 
|
 |   Rows: 1707  
|
 |   Columns:  1281  
|
 |   Total Cells:  2186667   
|
 |Projection: UTM (zone 19)  
|
 |N:2068530S:2017320   Res:30
|
 |E: 353400W: 314970   Res:30
|
 |   Range of data:min = 0.946  max = 2340.517   
|
 |   
|
 |   Data Description:   
|
 |generated by r.in.gdal 
|
 |   
|
 |   Comments:   
|
 |r.in.gdal -e input="/home/jr/Documentos/grass/tst/hydrodem.tif" outp\  
|
 |ut="hydrodem" memory=300 offset=0  
|
 |   
|

++

I appreciate any help. I also would like to thank the developers for this
great addon.

Jose



--
Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html
___
grass-user 

[GRASS-user] Change defaults for g.gui.psmap

2018-10-22 Thread Rich Shepard

  I would like to change the default paper size in g.gui.psmap from a4 to
us-letter. Where can I do this? And, will this change with module upgrades?

TIA,

Rich
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

[GRASS-user] Interpreting legend for TCI map

2018-10-22 Thread Rich Shepard

Hi folks,

  The attached image is a TCI map output from r.watershed. The legend is in
units of meters. I'm having difficulty interpreting the distances indicated
by the legend per the description of the map in the r.watershed manual page:

"Output tci raster map contains topographic index TCI, computed as ln(α
/ tan(β)) where α is the cumulative upslope area draining through a
point per unit contour length and tan(β) is the local slope angle. The
TCI reflects the tendency of water to accumulate at any point in the
catchment and the tendency for gravitational forces to move that water
downslope (Quinn et al. 1991). This value will be negative if α / tan(β)
< 1."

  I don't understand the source of the tick numbers in the legend. Seems to
me that the map depicts relative amounts of water accumulation which vary
with precipitation amounts, contributing area, and slope. Would it be better
to leave off tick marks and distances on the legend since the range of
colors represents the range from low accumulation (yellow) to high
accumulation (dark blue)?

TIA,

Rich___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Python script for template creation -i.atcorr module-reg

2018-10-22 Thread Markus Metz
On Mon, Oct 22, 2018 at 1:32 PM Moritz Lennert 
wrote:
>
> Hi,
>
> Please keep discussions on the mailing list.
>
> On 22/10/18 13:07, kameswari devi wrote:
> > yes i have given a csv file but x_new is above the interpolation range
> > message is appeared.
> >> wav(nm),B10,B11
> >> 477,0.3744
> >> 478,0.6864
> >> 480,1
> >> 481,0.8624
> >> 482,0.6018
> >> 483,0.4434
> >> 484,
> >> 485,
> >> 486,,0.377
> >> 487,,0.667
> >> 488,,0.968
> >> 489,,1
> >> 490,,0.760
> >> 491,,0.590
> >> 492,,0.455
>
> AFAIK, you always need the same number of fields on every line, but the
> first 8 lines only have two fields while the rest has 3 fields.

Which GRASS version are you using? Please use a recent GRASS 7.4 version,
or better GRASS 7.6. Can you also post the full output of create_iwave.py?
That could help to find out what goes wrong.

Markus M

>
> Moritz
>
> > On Mon, Oct 22, 2018 at 1:32 PM Moritz Lennert
> >  wrote:
> >>
> >> On 22/10/18 06:02, kameswari devi wrote:
> >>> Hello all,
> >>> I m trying to use Create_iwave.py for template creation in grass for
> >>> atmopsheric correction.But due to the spectral response values errors
> >>> are thrown. here i am sending the rsr i used and error i got .please
> >>> suggest me. thakn you
> >>>
> >>> wav(nm)  B10
> >>> 477 0.3744
> >>> 478 0.6864
> >>> 480 1
> >>> 481 0.8624
> >>> 482 0.6018
> >>> 483 0.4434
> >>> 484
> >>> 485
> >>> 486 0.377
> >>> 487 0.667
> >>> 488 0.968
> >>> 489 1
> >>> 490 0.760
> >>> 491 0.590
> >>> 492 0.455
> >>
> >>
> >> AFAIR, you need to separate fields by a comma, not a space.
> >>
> >> Moritz
> >
> >
> >
>
>
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] r.flow: units for flow accumulation [RESOLVED]

2018-10-22 Thread Rich Shepard

On Sat, 20 Oct 2018, Micha Silver wrote:


I have always found that the best way to do watershed delineation, to get
streams and flow accumulation is to set the computational region a *bit
larger* than the basin you are examining, and use a DEM that covers the
full region. i.e. don't second guess the module. Then all pixels within
the basin will have positive flow accum values. (Only pixels outside the
main basin, which are in partially covered, adjacent basins will have
negative values).

The final step could be to mask out all areas outside the basin of interest.


MIcha,

  To close this thread: I worked out the details that resolved the issue.

  Briefly, I set the region and mask to the whole basin, used r.grow to
expand the size of the project area by 100m (my assumption of 'bit larger'
with the DEM cell resolution at 1m), set the region to this expanded area
and kept the mask for the project area as input to r.watershed.

  As I wrote before, the area of interest is only 2.1% of the basin and
quite flat (other than a 26m bluff separating the riparian from upland
areas). The resulting accumulation map shows the accumulation areas for
almost all cells to be <25m, which makes sense for this place.

Thanks very much for the help,

Rich

___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Python script for template creation -i.atcorr module-reg

2018-10-22 Thread Moritz Lennert

Hi,

Please keep discussions on the mailing list.

On 22/10/18 13:07, kameswari devi wrote:

yes i have given a csv file but x_new is above the interpolation range
message is appeared.

wav(nm),B10,B11
477,0.3744
478,0.6864
480,1
481,0.8624
482,0.6018
483,0.4434
484,
485,
486,,0.377
487,,0.667
488,,0.968
489,,1
490,,0.760
491,,0.590
492,,0.455


AFAIK, you always need the same number of fields on every line, but the 
first 8 lines only have two fields while the rest has 3 fields.


Moritz


On Mon, Oct 22, 2018 at 1:32 PM Moritz Lennert
 wrote:


On 22/10/18 06:02, kameswari devi wrote:

Hello all,
I m trying to use Create_iwave.py for template creation in grass for
atmopsheric correction.But due to the spectral response values errors
are thrown. here i am sending the rsr i used and error i got .please
suggest me. thakn you

wav(nm)  B10
477 0.3744
478 0.6864
480 1
481 0.8624
482 0.6018
483 0.4434
484
485
486 0.377
487 0.667
488 0.968
489 1
490 0.760
491 0.590
492 0.455



AFAIR, you need to separate fields by a comma, not a space.

Moritz







___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] d.rast in python script

2018-10-22 Thread Frank David

Hi Stefan,

Sorry If I'm not clear... Yes I want add my new map in the active map 
display. Unfortunately "add created map(s) into layer tree” tick-box  
does not appear in my GUI script (I don't know why) and I would like to 
make it visible or to add another one in options tab. Just do 
run_command("d.rast", map=my_map) does not work..


Cheers,

Frank


Le 22/10/2018 à 10:20, Stefan Blumentrath a écrit :


Hi Frank,

I think Laurents solution is for rendering maps to file/image.

Do I understand you correctly, that you are looking for a solution for 
adding maps to the currently active map display (and respective Layer 
manager)?


I have not found a documentation and would be interested too. I assume 
one has to use wxgui code, like e.g. here:


https://trac.osgeo.org/grass/browser/grass/trunk/gui/wxpython/core/render.py

?

Yet, having the “Add created map(s) into layer tree” tick-box that 
core modules have available also for addons (without GUI programming 
for addon devs) would be nice (if possible)…


Kind regards,

Stefan

*From:*grass-user  *On Behalf Of 
*Frank David

*Sent:* søndag 21. oktober 2018 21:35
*To:* Laurent C. 
*Cc:* GRASS user list 
*Subject:* Re: [GRASS-user] d.rast in python script

Hello Laurent,

Thank you for your help. I'm very surprised by the complexity of the 
way to display a raster. I thought that only d.rast was needed. Other 
grass command are so simple to use...


Anayway, I don't understand why you need to set a image width and 
height. is it pixel number between west to east and south to north 
from region ?


and from where "img_file_name" is coming ? (my layer's name is "my_map")

To remove raster from display, I just manually remove from the layer tree.

Cheers,

Frank

Le 20/10/2018 à 23:06, Laurent C. a écrit :

Hello Frank,

It is not very straightforward, but it is possible.
Here is an example on how I do it:

import os
import grass.script as gscript
from grass.pygrass.gis.region import Region

# Set general env

os.environ['GRASS_RENDER_IMMEDIATE'] = "cairo"
os.environ['GRASS_RENDER_FILE_COMPRESSION'] = "9"
os.environ['GRASS_RENDER_FILE_READ'] = "TRUE"

# Set image size using the region
region = Region()
xr = region.cols
yr = region.rows
ratio = xr/yr
height = int(WIDTH / ratio)  # Choose the width you like
os.environ['GRASS_RENDER_WIDTH'] = str(WIDTH)
os.environ['GRASS_RENDER_HEIGHT'] = str(height)

# Then you can draw
os.environ['GRASS_RENDER_FILE'] = img_file_name
gscript.run_command('d.rast', map=my_map, quiet=True)

Be aware that every time you run your script, it will add layer on
the file.

So you might want to delete the png file between the runs.

Cheers,

Laurent

Le ven. 19 oct. 2018 à 13:00, Frank David mailto:frank.da...@geophom.fr>> a écrit :
>
> Hello,
>
> I wrote some python script and I do not find how to display created
> rasters.
>
> I tried to use d.rast but I believe this command is not designed
to be
> used in python script (no monitor available with d.mon -l). Am I
wright
> ? so how to do ?...
>
> Thank you for your help.
>
> Frank
>
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org 
> https://lists.osgeo.org/mailman/listinfo/grass-user

--

*Geophom*
327 rue de Vieille Cour 44521 OUDON
Tel +33(0)2 85 52 02 59 - Port +33(0)6 04 47 91 06
www.geophom.fr 

___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] d.rast in python script

2018-10-22 Thread Stefan Blumentrath
Hi Frank,

I think Laurents solution is for rendering maps to file/image.

Do I understand you correctly, that you are looking for a solution for adding 
maps to the currently active map display (and respective Layer manager)?

I have not found a documentation and would be interested too. I assume one has 
to use wxgui code, like e.g. here:
https://trac.osgeo.org/grass/browser/grass/trunk/gui/wxpython/core/render.py
?

Yet, having the “Add created map(s) into layer tree” tick-box that core modules 
have available also for addons (without GUI programming for addon devs) would 
be nice (if possible)…

Kind regards,
Stefan


From: grass-user  On Behalf Of Frank David
Sent: søndag 21. oktober 2018 21:35
To: Laurent C. 
Cc: GRASS user list 
Subject: Re: [GRASS-user] d.rast in python script


Hello Laurent,

Thank you for your help. I'm very surprised by the complexity of the way to 
display a raster. I thought that only d.rast was needed. Other grass command 
are so simple to use...

Anayway, I don't understand why you need to set a image width and height. is it 
pixel number between west to east and south to north from region ?

and from where "img_file_name" is coming ? (my layer's name is "my_map")

To remove raster from display, I just manually remove from the layer tree.

Cheers,

Frank

Le 20/10/2018 à 23:06, Laurent C. a écrit :
Hello Frank,

It is not very straightforward, but it is possible.
Here is an example on how I do it:

import os
import grass.script as gscript
from grass.pygrass.gis.region import Region

# Set general env
os.environ['GRASS_RENDER_IMMEDIATE'] = "cairo"
os.environ['GRASS_RENDER_FILE_COMPRESSION'] = "9"
os.environ['GRASS_RENDER_FILE_READ'] = "TRUE"

# Set image size using the region
region = Region()
xr = region.cols
yr = region.rows
ratio = xr/yr
height = int(WIDTH / ratio)  # Choose the width you like
os.environ['GRASS_RENDER_WIDTH'] = str(WIDTH)
os.environ['GRASS_RENDER_HEIGHT'] = str(height)

# Then you can draw
os.environ['GRASS_RENDER_FILE'] = img_file_name
gscript.run_command('d.rast', map=my_map, quiet=True)


Be aware that every time you run your script, it will add layer on the file.
So you might want to delete the png file between the runs.

Cheers,
Laurent

Le ven. 19 oct. 2018 à 13:00, Frank David 
mailto:frank.da...@geophom.fr>> a écrit :
>
> Hello,
>
> I wrote some python script and I do not find how to display created
> rasters.
>
> I tried to use d.rast but I believe this command is not designed to be
> used in python script (no monitor available with d.mon -l). Am I wright
> ? so how to do ?...
>
> Thank you for your help.
>
> Frank
>
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user

--
Geophom
327 rue de Vieille Cour 44521 OUDON
Tel +33(0)2 85 52 02 59 - Port +33(0)6 04 47 91 06
www.geophom.fr
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Python script for template creation -i.atcorr module-reg

2018-10-22 Thread Moritz Lennert

On 22/10/18 06:02, kameswari devi wrote:

Hello all,
I m trying to use Create_iwave.py for template creation in grass for
atmopsheric correction.But due to the spectral response values errors
are thrown. here i am sending the rsr i used and error i got .please
suggest me. thakn you

wav(nm)  B10
477 0.3744
478 0.6864
480 1
481 0.8624
482 0.6018
483 0.4434
484
485
486 0.377
487 0.667
488 0.968
489 1
490 0.760
491 0.590
492 0.455



AFAIR, you need to separate fields by a comma, not a space.

Moritz
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user