ubarsc / python-fmask

A set of command line utilities and Python modules that implement the ‘fmask’ algorithm
https://www.pythonfmask.org
GNU General Public License v3.0
74 stars 21 forks source link

Using Fmask #39

Closed luanschimidel closed 4 years ago

luanschimidel commented 4 years ago

Hello, i would like know how i can use the fmask funcionalities associated whit a qgis code, for create a cloud mask

neilflood commented 4 years ago

This implementation of Fmask is a command-line tool, and a Python module for use by Python programmers. It is not connected to qgis. Someone else has used it to build an interactive qgis plugin, but I see that you have also asked a question there, too.

luanschimidel commented 4 years ago

@neilflood I know this, but i'm trying use this funcionalities at by comand line, and i dont know how do it,. I'm not working at graphic interface, but at the python terminal . There's any tutorial that could pass me please?

petebunting commented 4 years ago

Examples of the command line tools are on the website: http://www.pythonfmask.org

e.g., fmask_usgsLandsatStacked.py -o cloud.img --scenedir LC08_L1TP_150033_20150413_20170410_01_T1

luanschimidel commented 4 years ago

Yes yes, but i need examples aren't for the python's terminal not the cmd. It's my doubt

gillins commented 4 years ago

You could launch the command line tools via Python's subprocess module. Otherwise there is some documentation of how to call the fmask internals directly from Python here: http://www.pythonfmask.org/en/latest/fmask_fmask.html#fmask.fmask.doFmask

Don't think there are any examples though.

neilflood commented 4 years ago

It depends what you are trying to do. If you just want to run Fmask on the files supplied by ESA, then I recommend just using the command line tools. If you need to run this from inside another Python program, then do as @gillins suggests and use subprocess or similar, to call the command line tool.

You should only need to work with the Python module if you want to be able to re-organise the data files in some way. This should only be attempted after a bit more experience than you seem to have at the moment. If you really need an example, the command line tools are a good place to start, as this is exactly what they do.

neilflood commented 4 years ago

One more thing - if you are having trouble, please show us what you are doing, and what error you get.