Page 1 of 1

Error when running polymer_cli.py

Posted: Thu Apr 01, 2021 10:08 am
by Mengmeng
Hello!

When I ran ./polymer_cli.py <level1> <level2> in the terminal of Ubuntu, I got an error as below:
bash: syntax error near unexpected token `<'

The detail command is shown in the attached figure.

Can anyone help? Thank you in advance!

Best regards,
Mengmeng.

Re: Error when running polymer_cli.py

Posted: Fri Apr 02, 2021 8:05 am
by fsteinmetz
Dear Mengmeng,
<level1> and <level2> means that you have to provide the paths to the level1 and level2. The <> characters should not be included.
Cheers,
François

Re: Error when running polymer_cli.py

Posted: Sun Apr 04, 2021 11:44 am
by Mengmeng
Dear François,

I tried this code: ./polymer_cli.py /Home/Downloads/MODIS_data/A2004095042500.L2_LAC_OC.x.nc /Home/Downloads/MODIS_data/output.hdf
But I got the error shown in the attached figure. Could you show me an example of this code?

Thank you in advance!

Best regards,
Mengmeng.

Re: Error when running polymer_cli.py

Posted: Tue Apr 06, 2021 6:24 am
by fsteinmetz
Indeed, your file is a Level2 file. Polymer needs to be applied to a Level1 file. Please see section 2.3 of the readme.
A modis example is also provided in example.py with some custom parameters ; you should rather use default parameters as in the meris, msi and olci examples.
Cheers,
François

Re: Error when running polymer_cli.py

Posted: Wed Apr 07, 2021 12:35 am
by Mengmeng
Dear François,

Thank you for your reply!
However, I could not relate the readme 2.3 and example.py to this code: ./polymer_cli.py <level1> <level2>
Because I am not familiar with python.

In addition, I used a Level1 file and ran this code: ./polymer_cli.py A2021001040500.L1A_LAC output.hdf, but I still got error.
You used MODIS L1C file as the input for polymer, but I found there was no L1C available from the NASA Ocean Color website. So I wonder where did you get the L1C data?

Before running this code: ./polymer_cli.py <level1> <level2>, do I need to customize any script? May I ask again how to define <level1> <level2>?

Thank you in advance!

Best regards,
Mengmeng.

Re: Error when running polymer_cli.py

Posted: Wed Apr 07, 2021 6:46 am
by fsteinmetz
Dear Mengmeng,

polymer_cli.py is a minimalistic command line interface, and a first way to run the code. For more control I generally advise to use your own python script as shown in the examples.
readme 2.3 gives you the possible inputs you can provide to Polymer.
readme 2.4 explains how to create L1C files from L1A using NASA SeaDAS (this is just for SeaWiFS, MODIS and VIIRS)
I think you did correctly, but you just have to provide a MODIS L1C instead of L1A.
Cheers,
François