<div dir="ltr">Hi all!<div>I'm working on the GUI of my module for clouds and shadows detection in Sentinel 2 images  (GSoC 2018 project) and I have some trouble with the automatic addition of the mapset name in the output maps.</div><div>I have several input bands imported in GRASS that I convert into float value and rescale using r.mapcalc, each output map should be automatically named with the inputs band name and a suffix (e.g. input: nir - output: nir_float). </div><div>When I run the script using the GUI I have an error due to the @mapset automatically added to the output map name (e.g. nir@mymapset_float).</div><div><br></div><div>At the moment, I solved the problem with a replace() function but I'm not sure this can be the best solution, do you have any hint?</div><div><br></div><div>Following you can find the code:</div><div><br></div><div><div><span style="white-space:pre">    </span>mapset = gscript.gisenv()['MAPSET']</div><div><span style="white-space:pre">   </span>mapset2 = '@%s' % mapset</div></div><div><div><span style="white-space:pre">       </span>b1 = options['blu']</div><div><span style="white-space:pre">   </span>b1 = b1.replace(mapset2, "")</div><div><span style="white-space:pre">        </span>b2 = options['green']</div><div><span style="white-space:pre"> </span>b2 = b2.replace(mapset2, "")</div><div><span style="white-space:pre">        </span>b3 = options['red']</div><div><span style="white-space:pre">   </span>b3 = b3.replace(mapset2, "")</div><div><span style="white-space:pre">        </span>b4 = options['nir']</div><div><span style="white-space:pre">   </span>b4 = b4.replace(mapset2, "")</div><div><span style="white-space:pre">        </span>b5 = options['nir8a']</div><div><span style="white-space:pre"> </span>b5 = b5.replace(mapset2, "")</div><div><span style="white-space:pre">        </span>b7 = options['swir11']</div><div><span style="white-space:pre">        </span>b7 = b7.replace(mapset2, "")</div><div><span style="white-space:pre">        </span>b8 = options['swir12']</div><div><span style="white-space:pre">        </span>b8 = b8.replace(mapset2, "")</div><div><span style="white-space:pre">        </span>f = 'float'</div><div><span style="white-space:pre">   </span>bands = [b1, b2, b3, b4, b5, b7, b8]</div></div><div><br></div><div><div><span style="white-space:pre">  </span>for b in bands:</div><div><span style="white-space:pre">               </span>gscript.mapcalc('{r} = 1.0 * ({a})/{c}'.format(r="%s_%s" % (b, f), a=b, c=scale_fac), overwrite=True)</div><div><span style="white-space:pre">               </span>f_bands.append ("%s_%s" % (b, f))</div></div><div><br></div><div><br></div><div>Thanks in advance,</div><div>Roberta</div></div>