<div dir="ltr">Hi Roberta,<br><br>On Tue, May 29, 2018 at 1:41 PM, Moritz Lennert <<a href="mailto:mlennert@club.worldonline.be">mlennert@club.worldonline.be</a>> wrote:<br>><br>> Hi Roberta,<br>><br>> Le Tue, 29 May 2018 13:16:48 +0200,<br>> Roberta Fagandini <<a href="mailto:robifagandini@gmail.com">robifagandini@gmail.com</a>> a écrit :<br>><br>> > Hi all!<br>> > I'm working on the GUI of my module for clouds and shadows detection<br>> > in Sentinel 2 images  (GSoC 2018 project) and I have some trouble<br>> > with the automatic addition of the mapset name in the output maps.<br>> > I have several input bands imported in GRASS that I convert into float<br>> > value and rescale using r.mapcalc, each output map should be<br>> > automatically named with the inputs band name and a suffix (e.g.<br>> > input: nir - output: nir_float).<br>> > When I run the script using the GUI I have an error due to the @mapset<br>> > automatically added to the output map name (e.g. nir@mymapset_float).<br>> ><br>> > At the moment, I solved the problem with a replace() function but I'm<br>> > not sure this can be the best solution, do you have any hint?<br>><br>> A classic solution that you will find in many scripts is using split():<br>><br>> mapname_without_mapset = mapname_with_mapset.split('@')[0]<br><div><br></div><div>there is find_file() in lib/python/script/core.py with returns a dictionary of keys/values including the name without mapset</div><div><br></div><div>Markus M</div><div><br></div><div>></div>> Moritz<br>> _______________________________________________<br>> grass-dev mailing list<br>> <a href="mailto:grass-dev@lists.osgeo.org">grass-dev@lists.osgeo.org</a><br>> <a href="https://lists.osgeo.org/mailman/listinfo/grass-dev">https://lists.osgeo.org/mailman/listinfo/grass-dev</a><br><br></div>