command line OCSSW advice

Use this Forum to find information on, or ask a question about, NASA Earth Science data.
avmehta
Posts: 184
Joined: Mon Feb 03, 2020 10:27 am America/New_York
Answers: 0
Been thanked: 1 time

command line OCSSW advice

by avmehta » Mon Feb 03, 2020 1:16 pm America/New_York

Hello,
   I am a SeaDAS GUI user with limited experience.  I have mostly worked with processing MODIS and Landsat images using OCSSW.  I am interested in using OCSSW/SeaDAS without GUI (command-line version) where I can write scripts to process  MSI and OLCI data. I use MacOS and also have access to Linux server. Any suggestion for which is better? Is there a tutorial to use OCSSW (l2gen) for MSI and OLCI?
Thanks.
Amita

Tags:

OB SeaDAS - knowles
Subject Matter Expert
Subject Matter Expert
Posts: 269
Joined: Mon Apr 07, 2008 4:40 pm America/New_York
Answers: 0

command line OCSSW advice

by OB SeaDAS - knowles » Tue Feb 04, 2020 11:58 am America/New_York

MSI and OLCI are not supported yet within the SeaDAS GUI, but can be done on the command line.  OCSSW works well on both Linux and Mac.  There is currently no tutorial on l2gen command line but some of the presentation slides give a broad overview of the l2gen features.

To install the MSI/OLCI processors run these commands:
./install_ocssw.py --msis2a
./install_ocssw.py --msis2b
./install_ocssw.py --olcis3a
./install_ocssw.py --olcis3b

From the command line your l2gen run might look something like this:
l2gen ifile={level1_input_file} ofile={level2_output_file} par=parfile.txt

where parfile.txt is an optional textfile you provide containing your desired parameters of the form:
variable1=value1
variable2=value2
...

You can run l2gen from the command line to see a listing of the parameters and defaults.  To get an idea of what this parfile might look like for your desired parameters, you could load MODIS into the l2gen GUI and export the parameter file.

Also you need to have your command line environment configured so you should put these lines in your startup file ~/.bashrc (Linux) or ~/.profile (Mac):

export OCSSWROOT=[SeaDAS_install_dir]/ocssw
source $OCSSWROOT/OCSSW_bash.env

thanks
Danny

gnwiii
Posts: 713
Joined: Fri Jan 29, 2021 5:51 pm America/New_York
Answers: 2
Has thanked: 1 time

command line OCSSW advice

by gnwiii » Wed Feb 05, 2020 8:09 am America/New_York

The OCSSW software works well on either MacOS or linux.   Both provide a bash command-line.   If the two systems differ in performance, I would choose the faster system.  You may need to run a few test jobs on both systems to see how they perform on your workload.   The OCSSW software includes a benchmark script and data that is a useful check on the installation, provides sample files that are readily accessible to other users so is useful when reporting a problem, and gives you an idea of the relative performance of different systems.

avmehta
Posts: 184
Joined: Mon Feb 03, 2020 10:27 am America/New_York
Answers: 0
Been thanked: 1 time

command line OCSSW advice

by avmehta » Fri Feb 07, 2020 2:58 pm America/New_York

Thanks Danny! I did install OCSSW for MSI and OLCI -- I think successfully!
I have questions about setting options for atmospheric correction, particularly for aerosol correction. I see several models one can use. Is there documentation describing various options? Any  suggestion about which one to choose for OLI,  MSI, OLCI?
Thanks a lot for your help.
Amita

avmehta
Posts: 184
Joined: Mon Feb 03, 2020 10:27 am America/New_York
Answers: 0
Been thanked: 1 time

command line OCSSW advice

by avmehta » Fri Feb 07, 2020 3:00 pm America/New_York

Thanks much! I will try both.

avmehta
Posts: 184
Joined: Mon Feb 03, 2020 10:27 am America/New_York
Answers: 0
Been thanked: 1 time

command line OCSSW advice

by avmehta » Wed Feb 26, 2020 11:27 am America/New_York

Hello,
  I a trying to export an OLI OC file processed by using l2gen in SeaDAS (I am using the GUI). After creating L2 data I reprojected the image and then used File-->Export-->NetCDF4-CF. I get the following error:
   " An exception occurred:
    Type: org.esa.beam.framework.gpf.OperatorException
     Message: Cannot construct DataBuffer."

I also tried saving the file as GeoTIFF. I do get the file but when I use QGIS to open the file it gives a Gdal error and can not open it.
I'd really appreciate your help.
Thanks.
Amita

gnwiii
Posts: 713
Joined: Fri Jan 29, 2021 5:51 pm America/New_York
Answers: 2
Has thanked: 1 time

command line OCSSW advice

by gnwiii » Wed Feb 26, 2020 5:56 pm America/New_York

Several forum posts discuss "Cannot construct DataBuffer" errors.  Use the search tool to find them.   NetCDF4-CF has much more complete than than GeoTIFF, so is generally easier to use.  Note that QGIS uses GDAL notation to indentify the band to be loaded from multi-band files.  If you aren't familiar with this notation, try using the search tool to find "QGIS netcdf".

avmehta
Posts: 184
Joined: Mon Feb 03, 2020 10:27 am America/New_York
Answers: 0
Been thanked: 1 time

command line OCSSW advice

by avmehta » Mon Mar 16, 2020 12:17 pm America/New_York

Hello,
     I want to know details  about OSSSW options. I have looked at https://oceandata.sci.gsfc.nasa.gov/ocssw/ site which provides a lot if practical information but is there a document that describes definition of all the output and processing options ?
Thanks.
Amita

gnwiii
Posts: 713
Joined: Fri Jan 29, 2021 5:51 pm America/New_York
Answers: 2
Has thanked: 1 time

command line OCSSW advice

by gnwiii » Mon Mar 16, 2020 1:08 pm America/New_York

The definitive documentation for the OCSSW programs is the source code.   Netcdf metadata often include the command-line used to generate the file as well as references taken from "$OCSSWROOT/share/common/product.xml".     Beyond that, the journal literature sometimes provides insights into options chosen for a particular study.

avmehta
Posts: 184
Joined: Mon Feb 03, 2020 10:27 am America/New_York
Answers: 0
Been thanked: 1 time

command line OCSSW advice

by avmehta » Mon Mar 16, 2020 5:19 pm America/New_York

Thanks for the information.

I generated an OLI L-2 file using l2gen. The ncdump of the output summarizes the following  l2_falgs for which I am looking for definition:

l2_flags:flag_meanings = "ATMFAIL LAND PRODWARN HIGLINT HILT HISATZEN COASTZ SPARE8 STRAYLIGHT CLDICE COCCOLITH TURBIDW HISOLZEN SPARE14 LOWLW CHLFAIL NAVWARN ABSAER SPARE19 MAXAERITER MODGLINT CHLWARN ATMWARN SPARE24 SEAICE NAVFAIL FILTER SPARE28 BOWTIEDEL HIPOL PRODFAIL SPARE32" ;
                l2_flags:flag_masks = 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 67108864, 134217728, 268435456, 536870912, 1073741824, -2147483648 ;

Also, in the output file Global Attribute there is what is the Tile Size ?
// global attributes:
                :Conventions = "CF-1.4" ;
               :TileSize = "563:515" ;
                :start_date = "24-OCT-2019 15:41:03.930000" ;
                :stop_date = "24-OCT-2019 15:41:03.930000" ;
                :title = "L2019297154103.L2_LAC_OC" ;

Post Reply