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
75 stars 21 forks source link

Arguments not being passed by fmask_sentinel2makeAnglesImage.py #10

Closed gillins closed 7 years ago

gillins commented 7 years ago

Original report by Jens2121 (Bitbucket: Jens2121, GitHub: Jens2121).


I am unable to pass my arguments into the cmd line to "Make a 4-layer image of satellite and sun angles, from the given tile metadata file."

I am following the guide at "http://pythonfmask.org/en/latest/":

Make a separate image of the per-pixel sun and satellite angles.

#!python
fmask_sentinel2makeAnglesImage.py -i ../*.xml -o angles.img

The exact command I put into the cmd in windows is, as well as the output is as follows:

#!python
F:\1_Cloud_Masking_Test\s2a_35jpm_2016_12_23>fmask_sentinel2makeAnglesImage.py -i metdata.xml -o allangles.img
usage: fmask_sentinel2makeAnglesImage.py [-h] [-i INFILE] [-o OUTFILE]

optional arguments:
  -h, --help            show this help message and exit
  -i INFILE, --infile INFILE
                        Input sentinel-2 tile metafile
  -o OUTFILE, --outfile OUTFILE
                        Output angles image file

As you can see it is just returning the 'print_help()' command.

Is there anything I am doing incorrectly?

gillins commented 7 years ago

Original comment by Jens2121 (Bitbucket: Jens2121, GitHub: Jens2121).


I needed to write "python" before the cmd command.

gillins commented 7 years ago

Original comment by Sam Gillingham (Bitbucket: gillins, GitHub: gillins).


You can also put "fmask_expandWildcards" before the cmd command as described here: http://www.pythonfmask.org/en/latest/#command-line-examples

This will invoke "python" if it is a Python script, but more importantly expand any wildcards (*.xml etc) in the arguments like Unix does which is what the fmask commands expect.