SeaDAS OCSSW Command line/Batch processing

Please enter here to ask a question about any NASA Science related topics!
Post Reply
vito609
Posts: 20
Joined: Mon Apr 05, 2021 2:01 am America/New_York

SeaDAS OCSSW Command line/Batch processing

by vito609 » Thu Apr 22, 2021 3:51 am America/New_York

Hello.

I tried to run an ocssw command in the terminal, however I got this error:

[code]
torres609@torres609:~/SeaDAS/ocssw/bin$ ./modis_GEO /home/torres609/Downloads/A2009023054500.L1A_LAC -v
Neither the L2GEN_ANC nor USER_L2GEN_ANC environment variables are set.
...using the current working directory for ancillary file download.
Error! Unable to locate LIB3_BIN environment variable. You may need to run
[/code]

What path should I set for L2GEN_ANC or LIB3_BIN?

Moreover, is there a way to batch process images with ocssw in the SeaDAS GUI or is it just through the command line?

Thank you.

Tags:

vito609
Posts: 20
Joined: Mon Apr 05, 2021 2:01 am America/New_York

Re: SeaDAS OCSSW Command line/Batch processing

by vito609 » Thu Apr 22, 2021 1:06 pm America/New_York

Hello.

So I tried to use the multilevel_processor in order to batch process with l2gen to produce L1C MODIS. However the parameters defaulted to this when loaded:

[code]
Main of multi_level processor:
[main]
ifile=/home/torres609/Downloads/batch/_inputFiles.lst
odir=/home/torres609/Downloads/batch

[l2gen]
gain=[1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0]
l2prod="latitude longitude polcor_nnn rhot_nnn sena senz sola solz
[/code]

I tried to run the multi_level processor with above parameters but I got this error:
[code]
Error:
execution exception: java.io.IOException: multilevel_processor failed with exit code 1.
Check log for more details.
Error! Section name "gain=[1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0]" is not recognized.
[/code]

For your reference, this is the parameters I use when I process with l2gen GUI one by one.
[code]
Paramaters:
# PRIMARY INPUT OUTPUT FIELDS
ifile=/home/torres609/Downloads/2003/A2003337044000.L1B_LAC
geofile=/home/torres609/Downloads/2003/A2003337044000.GEO
ofile=/home/torres609/Downloads/2003/A2003337044000.L1C.nc

# SUITE
suite=OC

# PRODUCTS
l2prod=latitude longitude polcor_1240 polcor_1640 polcor_2130 polcor_748 polcor_859 polcor_869 polcor_vvv rhot_1240 rhot_1640 rhot_2130 rhot_748 rhot_859 rhot_869 rhot_vvv sena senz sola solz

# PROCESSING OPTIONS
gain=[1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0]

# ANCILLARY INPUTS Default = climatology (select 'Get Ancillary' to download ancillary files)
[/code]

gnwiii
Posts: 606
Joined: Fri Jan 29, 2021 5:51 pm America/New_York
Answers: 1

Re: SeaDAS OCSSW Command line/Batch processing

by gnwiii » Thu Apr 22, 2021 6:36 pm America/New_York

Error! Section name "gain=[1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0]" is not recognized.
This might mean the square brackets in the gain option are being mistaken for the square brackets used for section names. Maybe it is necessary to use a parameter file.

gnwiii
Posts: 606
Joined: Fri Jan 29, 2021 5:51 pm America/New_York
Answers: 1

Re: SeaDAS OCSSW Command line/Batch processing

by gnwiii » Thu Apr 22, 2021 7:34 pm America/New_York

With a few experiments I found that entering gain with quotes instead of square brackets and spaces instead of commas works:

Code: Select all

[main]
ifile=...
odir=...

[l2gen]
suite=OC
l2prod=latitude longitude polcor_nnn rhot_nnn sena senz sola solz
gain="1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0"
atmocor=off
Note that the output files will need renaming to replace L2 with L1C.

OB.DAAC - SeanBailey
User Services
User Services
Posts: 1173
Joined: Wed Sep 18, 2019 6:15 pm America/New_York

Re: SeaDAS OCSSW Command line/Batch processing

by OB.DAAC - SeanBailey » Fri Apr 23, 2021 1:46 pm America/New_York

To answer the original question about the missing environment variables, before running OCSSW programs from the command line you should source the $OCSSWROOT/OCSSW_bash.env file:

Code: Select all

$ export OCSSWROOT=<path to ocssw>
$ source $OCSSWROOT/OCSSW_bash.env
...and yes, the MLP wrapper doesn't like keyword=value pairs with brackets, but luckily, the OCSSW program input parser allows some flexibility as George discovered.

Sean

Post Reply