Sentinel-2 with l2gen

Use this Forum to find information on, or ask a question about, NASA Earth Science data.
ayelen
Posts: 4
Joined: Mon Jul 15, 2019 10:51 am America/New_York
Answers: 0

Sentinel-2 with l2gen

by ayelen » Thu May 19, 2022 10:48 am America/New_York

Hi,
The only way to process Sentinel-2 in l2gen is by the script console?
In the GUI is not yet available?

Thanks :)

Tags:

OB SeaDAS - xuanyang02
Subject Matter Expert
Subject Matter Expert
Posts: 401
Joined: Tue Feb 09, 2021 5:42 pm America/New_York
Answers: 1

Re: Sentinel-2 with l2gen

by OB SeaDAS - xuanyang02 » Fri May 20, 2022 9:26 am America/New_York

Right, SeaDAS 8.2.0 does not have GUI capability to do l2gen on Sentinel-2 MSI data. Hopefully next release will.

m_alsahli
Posts: 5
Joined: Wed Aug 03, 2022 4:06 pm America/New_York
Answers: 0

Re: Sentinel-2 with l2gen

by m_alsahli » Wed Aug 03, 2022 4:12 pm America/New_York

I am trying to process Sentinel-2A MSIL1C images to level2 data. I knew from this thread that this is not possible using GUI, and I have to use the script console.
I have not used the console to process images in SeaDAS. Any guidance that helps me to accomplish my task is highly appreciated.

Regards,
Mohammad

OB SeaDAS - xuanyang02
Subject Matter Expert
Subject Matter Expert
Posts: 401
Joined: Tue Feb 09, 2021 5:42 pm America/New_York
Answers: 1

Re: Sentinel-2 with l2gen

by OB SeaDAS - xuanyang02 » Wed Aug 03, 2022 4:32 pm America/New_York

Here is the help for l2gen https://seadas.gsfc.nasa.gov/help-8.2.0/processors/ProcessL2gen.html

On the command line, you can do

Code: Select all

l2gen ifile=/Users/*/Scenes/MSI_S2A/run/S2A_MSIL1C_20170525T112121_N0205_R037_T30UUB_20170525T112434.SAFE/manifest.safe
ofile=/Users/*/Scenes/MSI_S2A/run/S2A_MSI.20170525T112121.L2.OC.nc
You can also edit a par file such as l2gen-tmpParFile.par with the following content
# PRIMARY INPUT OUTPUT FIELDS
ifile=/Users/bingyang/Scenes/MSI_S2A/run/S2A_MSIL1C_20170525T112121_N0205_R037_T30UUB_20170525T112434.SAFE/manifest.safe
ofile=/Users/bingyang/Scenes/MSI_S2A/run/S2A_MSI.20170525T112121.L2.OC.nc

and then

Code: Select all

l2gen par=l2gen-tmpParFile.par
Before you can do l2gen, you need to install msis2a processor. Assuming you already have OCSSW V2022.0 and modisa installed in $HOME/ocssw --

Code: Select all

install_ocssw --install_dir $HOME/ocssw --tag V2022.0 --msis2a


Here is the instruction for installing OCSSW -- https://seadas.gsfc.nasa.gov/downloads/

m_alsahli
Posts: 5
Joined: Wed Aug 03, 2022 4:06 pm America/New_York
Answers: 0

Re: Sentinel-2 with l2gen

by m_alsahli » Thu Aug 04, 2022 5:39 pm America/New_York

Thank you,
This put me on the right road.
I set up the OCSSW using the terminal and following the instructions in this webpage:
https://seadas.gsfc.nasa.gov/downloads/
But, when I tried using your commend to process the Sentinel-2A MSICL1 image, I got this error message:

alsahli@alsahli-U47A:~$ l2gen ifile=/home/alsahli/Landsat8/Test/Sentinel-2A/S2A_MSIL1C_20220619T072631_N0400_R049_T39RTN_20220619T081751.SAFE/manifest.safe
Loading default parameters from /home/alsahli/SeaDAS/ocssw/share/common/msl12_defaults.par
Found MSI Sentinel-2A product: SENTINEL-2 MSI Level-1C User Product

Loading characteristics for MSIS2A
-E- /home/dshea/focs/oel_util/libpiutils/rdsensorinfo.c line 167: unable to open /home/alsahli/SeaDAS/ocssw/share/msi/msl12_sensor_info.dat for reading
Loading default parameters for MSIS2A from /home/alsahli/SeaDAS/ocssw/share/msi/msl12_defaults.par
-E- clo_readFile: Can't open parameter file - /home/alsahli/SeaDAS/ocssw/share/msi/msl12_defaults.par

I need to use MUMM atmospheric correction algorithm and AAQ (i.e., iop_opt=3).

Your assistance is highly appreciated.
Mohammad

OB SeaDAS - xuanyang02
Subject Matter Expert
Subject Matter Expert
Posts: 401
Joined: Tue Feb 09, 2021 5:42 pm America/New_York
Answers: 1

Re: Sentinel-2 with l2gen

by OB SeaDAS - xuanyang02 » Thu Aug 04, 2022 6:25 pm America/New_York

Can you do

Code: Select all

seadas_info

Code: Select all

ls /home/alsahli/SeaDAS/ocssw/share/msi
and share the result here?

You can add
aer_opt=-10 (for Multi-scattering with MUMM correction and MUMM NIR calculation) and
iop_opt=3 (for QAA) to l2gen's arguments
If you need IOP suite, you might also want to add suite=IOP
See the command line part for l2gen help -- https://seadas.gsfc.nasa.gov/help-8.2.0/processors/ProcessL2gen.html#COMMAND_LINE_HELP

Code: Select all

l2gen ifile=/home/alsahli/Landsat8/Test/Sentinel-2A/S2A_MSIL1C_20220619T072631_N0400_R049_T39RTN_20220619T081751.SAFE/manifest.safe ofile=/home/alsahli/Landsat8/Test/Sentinel-2A/S2A_MSI.20220619T072631.L2.OC.nc
iop_opt=3 aer_opt=-10

m_alsahli
Posts: 5
Joined: Wed Aug 03, 2022 4:06 pm America/New_York
Answers: 0

Re: Sentinel-2 with l2gen

by m_alsahli » Thu Aug 04, 2022 6:35 pm America/New_York

This is what you requested:
alsahli@alsahli-U47A:~$ seadas_info
NASA Science Processing (OCSSW):
Environment {$OCSSWROOT}: /home/alsahli/SeaDAS/ocssw
Environment {$OCDATAROOT}: /home/alsahli/SeaDAS/ocssw/share
l2gen version: msl12 9.5.1-V2022.0 (Jan 11 2022 14:33:38)
l2bin version: 7.0.3
l3bin version: 5.13
l3mapgen version: l3mapgen 2.3.0-V2022.0 (Jan 11 2022 14:35:13)
Installed Missions: ['aquarius', 'avhrr', 'czcs', 'goci', 'hawkeye', 'hico', 'meris', 'aqua', 'terra', 'mos', 'ocm1', 'ocm2', 'octs', 'oli', 'osmi', 'seawifs', 'sgli', 'viirsn', 'viirsj1']

General System and Software:
Operating system: Ubuntu 18.04.4 LTS
Java version: 1.8.0_312
Python3 version: 3.6.9
Python3 Path: /usr/bin/python3
Env: ASAP_PARMS=/home/alsahli/SeaDAS/ocssw/share/common/nav
CC=gcc
CLUTTER_IM_MODULE=xim
COLORTERM=truecolor
CXX=g++
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
DEFAULTS_PATH=/usr/share/gconf/ubuntu.default.path
DESKTOP_SESSION=ubuntu
DISPLAY=:0
ELEMENTS=/home/alsahli/SeaDAS/ocssw/var/seawifs
EOS_LIB_PREFIX=linux64
FC=gfortran
GCC_TUNE=
GDMSESSION=ubuntu
GJS_DEBUG_OUTPUT=stderr
GJS_DEBUG_TOPICS=JS ERROR;JS LOG
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
GNOME_SHELL_SESSION_MODE=ubuntu
GNOME_TERMINAL_SCREEN=/org/gnome/Terminal/screen/7ea6147e_15f3_457d_8454_32945e077532
GNOME_TERMINAL_SERVICE=:1.135
GPG_AGENT_INFO=/run/user/1000/gnupg/S.gpg-agent:0:1
GTK_IM_MODULE=ibus
GTK_MODULES=gail:atk-bridge
HDFEOS_LIB=/home/alsahli/SeaDAS/ocssw/opt/EOS/lib/linux64
_=/home/alsahli/SeaDAS/ocssw/bin/seadas_info
HOME=/home/alsahli
HRPT_STATION_IDENTIFICATION_FILE=/home/alsahli/SeaDAS/ocssw/share/seawifs/station/station_id.dat
IM_CONFIG_PHASE=2
L2GEN_ANC=/home/alsahli/SeaDAS/ocssw/var/anc
LANG=en_US.UTF-8
LC_ADDRESS=ar_KW.UTF-8
LC_IDENTIFICATION=ar_KW.UTF-8
LC_MEASUREMENT=ar_KW.UTF-8
LC_MONETARY=ar_KW.UTF-8
LC_NAME=ar_KW.UTF-8
LC_NUMERIC=ar_KW.UTF-8
LC_PAPER=ar_KW.UTF-8
LC_TELEPHONE=ar_KW.UTF-8
LC_TIME=ar_KW.UTF-8
LESSCLOSE=/usr/bin/lesspipe %s %s
LESSOPEN=| /usr/bin/lesspipe %s
LIB3_BIN=/home/alsahli/SeaDAS/ocssw/opt/bin
LIB3_CHECK=0
LIB3_DIR=/home/alsahli/SeaDAS/ocssw/opt
LIB3_INC=/home/alsahli/SeaDAS/ocssw/opt/include
LIB3_LIB=/home/alsahli/SeaDAS/ocssw/opt/lib
LOGNAME=alsahli
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:
MANDATORY_PATH=/usr/share/gconf/ubuntu.mandatory.path
NAVCTL=/home/alsahli/SeaDAS/ocssw/share/seawifs/nav
NAVQC=/home/alsahli/SeaDAS/ocssw/share/seawifs/nav
OCDATAROOT=/home/alsahli/SeaDAS/ocssw/share
OCSSW_ARCH=linux_64
OCSSW_BIN=/home/alsahli/SeaDAS/ocssw/bin
OCSSW_DEBUG=0
OCSSWROOT=/home/alsahli/SeaDAS/ocssw
OCSSW_SVN=localhost
OCTS_REGISTRATION_TABLES=/home/alsahli/SeaDAS/ocssw/share/octs/nav
OCVARROOT=/home/alsahli/SeaDAS/ocssw/var
ORBCTL=/home/alsahli/SeaDAS/ocssw/share/seawifs/nav
PATH=/home/alsahli/SeaDAS/ocssw/opt/bin:/home/alsahli/SeaDAS/ocssw/bin:/home/alsahli/SeaDAS/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
PGSINC=/home/alsahli/SeaDAS/ocssw/opt/EOS/include
PGSLIB=/home/alsahli/SeaDAS/ocssw/opt/EOS/lib/linux64
PROJ_LIB=/home/alsahli/SeaDAS/ocssw/opt/share/proj
PWD=/home/alsahli
QT4_IM_MODULE=xim
QT_ACCESSIBILITY=1
QT_IM_MODULE=xim
QT_QPA_PLATFORMTHEME=qt5ct
SESSION_MANAGER=local/alsahli-U47A:@/tmp/.ICE-unix/1409,unix/alsahli-U47A:/tmp/.ICE-unix/1409
SHELL=/bin/bash
SHLVL=1
SSH_AGENT_PID=1505
SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
SWFTBL=/home/alsahli/SeaDAS/ocssw/share/seawifs/qc
SWTBL=/home/alsahli/SeaDAS/ocssw/share/seawifs
TERM=xterm-256color
TEXTDOMAINDIR=/usr/share/locale/
TEXTDOMAIN=im-config
USER=alsahli
USERNAME=alsahli
VTE_VERSION=5202
WINDOWPATH=2
XAUTHORITY=/run/user/1000/gdm/Xauthority
XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg
XDG_CURRENT_DESKTOP=ubuntu:GNOME
XDG_DATA_DIRS=/usr/share/ubuntu:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop
XDG_MENU_PREFIX=gnome-
XDG_RUNTIME_DIR=/run/user/1000
XDG_SEAT=seat0
XDG_SESSION_DESKTOP=ubuntu
XDG_SESSION_ID=2
XDG_SESSION_TYPE=x11
XDG_VTNR=2
XMODIFIERS=@im=ibus

OB SeaDAS - xuanyang02
Subject Matter Expert
Subject Matter Expert
Posts: 401
Joined: Tue Feb 09, 2021 5:42 pm America/New_York
Answers: 1

Re: Sentinel-2 with l2gen

by OB SeaDAS - xuanyang02 » Fri Aug 05, 2022 10:11 am America/New_York

Thanks for sharing the output of seadas_info.

What about

Code: Select all

ls /home/alsahli/SeaDAS/ocssw/share/msi
?

m_alsahli
Posts: 5
Joined: Wed Aug 03, 2022 4:06 pm America/New_York
Answers: 0

Re: Sentinel-2 with l2gen

by m_alsahli » Fri Aug 05, 2022 11:20 am America/New_York

alsahli@alsahli-U47A:~$ ls /home/alsahli/SeaDAS/ocssw/share/msi
ls: cannot access '/home/alsahli/SeaDAS/ocssw/share/msi': No such file or directory

It seems there is no directory for MSI. Did I miss something?

I installed msis2a as follows:
alsahli@alsahli-U47A:~$ ./install_ocssw --install_dir=/home/alsahli/ocssw --tag V2022.0 --msis2a
Installing (1 of 2) - msi
Installing (2 of 2) - msis2a
Done

Should I use this directory "/home/alsahli/SeaDAS/ocssw/"?
So the code should be:
./install_ocssw --install_dir=/home/alsahli/SeaDAS/ocssw/ --tag V2022.0 --msis2a

?

OB SeaDAS - xuanyang02
Subject Matter Expert
Subject Matter Expert
Posts: 401
Joined: Tue Feb 09, 2021 5:42 pm America/New_York
Answers: 1

Re: Sentinel-2 with l2gen

by OB SeaDAS - xuanyang02 » Fri Aug 05, 2022 2:43 pm America/New_York

Since your OCSSWROOT is /home/alsahli/SeaDAS/ocssw

You should do

Code: Select all

./install_ocssw --install_dir=/home/alsahli/SeaDAS/ocssw/ --tag V2022.0 --msis2a
to install msis2a

Post Reply