Batch processing Landsat with l2gen

Please enter here to ask a question about any NASA Science related topics!
Post Reply
dogun
Posts: 33
Joined: Tue Oct 11, 2016 11:49 am America/New_York

Batch processing Landsat with l2gen

by dogun » Sat Mar 04, 2017 9:03 am America/New_York

Hi All,

I wanted to atmospherically correct a lots of OLI images with the  l2gen processor. Any ideas on batch processing please?

Tags:

zhigang
Posts: 67
Joined: Tue Nov 10, 2020 8:03 pm America/New_York

Batch processing Landsat with l2gen

by zhigang » Mon Mar 06, 2017 2:15 am America/New_York

You can use one programming language(shell or python) to implement a batch processing, for OLI, this task is similar with MODIS. Here is my idea:
(1) to put all files into same folder.
(2) using a loop statement(do,while, for, etc.) to read filename one by one, then you can use this as input to execute l2gen command.
Here is a prototype to show how using shell to batch:

dataPath="/run/media/zhigang/DATA/viirs/"
resultPath="/run/media/zhigang/DATA/viirs/result/"
gpfPath="/home/zhigang/Batch_Codes/seadas/"
cd "$dataPath"
files=`echo "$dataPath"*.L1A_NPP.tar.bz2`
for file in $files
do 
l2gen ifile=$file ofile=... par=$ancfile l2prod='Rrs_nnn' north=... south=... west=... earth=... ....
done

And, you can find more information by searching posts in forum.
Regards,
zhigang

dogun
Posts: 33
Joined: Tue Oct 11, 2016 11:49 am America/New_York

Batch processing Landsat with l2gen

by dogun » Thu Mar 09, 2017 7:55 pm America/New_York

Thanks zhigang!

cassandranormandin
Posts: 23
Joined: Mon Apr 24, 2017 4:08 pm America/New_York

Batch processing Landsat with l2gen

by cassandranormandin » Fri May 19, 2017 11:27 am America/New_York

Hello,
I am a new user on SeaDAS. I am a PhD Student, working on MODIS images to study the variability of Suspended Particular Matter (SPM) in the Gironde Estuary (France). I have a lot images to process since I am working on 16 years (2000-2016). First, I have to apply atmospheric corrections using l2gen. I would like to konw if there is a User Guide on l2gen function on the different options. I only found some descriptions on the help.

Then, I have to automate tasks to process all MODIS images using Python, shell or other language. I am a beginner using this. On the forum, I've seen some little parts of script to automate task. Do you have some scripts to help me to begin to use l2gen? What is the difference with multilevel processor (mlp) ?

Thank you in advance,
Cassandra

melliott
Posts: 11
Joined: Tue Jun 08, 2010 2:23 pm America/New_York

Batch processing Landsat with l2gen

by melliott » Wed May 24, 2017 6:12 pm America/New_York

Cassandra,

I'm not exactly sure how to respond to "What is the difference with multilevel processor (mlp)?" The results shouldn't be any different whether you run l2gen via the mlp or the command line, except in how you set it up to run.

Perhaps the easiest way to do what you want with the mlp is to set it up with the options you want and use a text file containing the list of the files you want to process. A quick example of the par file follows:

[main]
ifile=my_files.txt
[l2gen]
(options you want for l2gen)

Then, my_files.txt should look something like:

A2015223172500.L1A_LAC
A2015223190000.L1A_LAC
(and so forth)

Once you've done this, you can change the file names in my_files.txt (or whatever you call the file) and re-run the mlp to process a new set of files. Creating a script to handle this shouldn't be too difficult, but more specifics about what you're trying to do are needed.

Hope this helps,

Matt

xiao_0.026
Posts: 17
Joined: Wed Jun 12, 2019 9:47 pm America/New_York

Batch processing Landsat with l2gen

by xiao_0.026 » Sun Jul 21, 2019 7:15 am America/New_York

Hi PH.d
I see your work is about the SPM in the estuary, I have the same work with you,
Can I ask you some question about the L2gen process?

Post Reply