[GRASS-user] r.threshold modification

Anna Petrášová kratochanna at gmail.com
Fri Nov 3 20:15:41 PDT 2017


Hi,

I added the -g flag, that should do it.

Best,


Anna

On Fri, Nov 3, 2017 at 4:48 AM, Bartolomei.Chris
<Bartolomei.Chris at ensco.com> wrote:
> I'm not sure if this is the correct place to ask for this but can the addon r.threshold have an option to just return the estimated threshold value? As it is written, it returns the the status and value but I can't extract the value in any way i know. It would be nice to have a "-g" argument to return the value for scripting.  Here are my attempts (using an accumulation raster "tmp_accum"):
>
>
> PY_SCRIPTS="C:/OSGeo4W64/apps/grass/grass-7.2.1/scripts"
> GRASS 7.2.1> X1=`python $PY_SCRIPTS/r.threshold.py acc=tmp_accum`
>
>  100%
> Suggested threshold is 4182
> Done!
> GRASS 7.2.1> echo $X1
>
> GRASS 7.2.1> python $PY_SCRIPTS/r.threshold.py acc=tmp_accum > T_test
>  100%
> Suggested threshold is 4182
> Done!
> GRASS 7.2.1> cat T_test
> GRASS 7.2.1>
> GRASS 7.2.1> python $PY_SCRIPTS/r.threshold.py acc=tmp_accum | grep "is" | cut -d\  -f4
>  100%
> Suggested threshold is 4182
> Done!
> GRASS 7.2.1>
>
>
> Am I crazy? I would think one of those methods should get me something usable... (???)
>
> Thanks
>
> [😊]
>
>
> Chris Bartolomei P.E.
> bartolomei.chris at ensco.com
>
> ________________________________
>
> The information contained in this email message is intended only for the use of the individual(s) to whom it is addressed and may contain information that is privileged and sensitive. If you are not the intended recipient, or otherwise have received this communication in error, please notify the sender immediately by email at the above referenced address and note that any further dissemination, distribution or copying of this communication is strictly prohibited.
>
> The U.S. Export Control Laws regulate the export and re-export of technology originating in the United States. This includes the electronic transmission of information and software to foreign countries and to certain foreign nationals. Recipient agrees to abide by these laws and their regulations -- including the U.S. Department of Commerce Export Administration Regulations and the U.S. Department of State International Traffic in Arms Regulations -- and not to transfer, by electronic transmission or otherwise, any content derived from this email to either a foreign national or a foreign destination in violation of such laws.
>
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user


More information about the grass-user mailing list