GPT batch processing

Use this Forum to find information on, or ask a question about, NASA Earth Science data.
Post Reply
r.fernandes
Posts: 27
Joined: Wed Jun 06, 2012 6:55 pm America/New_York

GPT batch processing

by r.fernandes » Tue Nov 06, 2018 1:00 pm America/New_York

Hi,
I need to reproject a huge amount of L2 MODIS images, i've been reading about how to use the gpt.command (im running seadas in a mac) and i understand (i believe) how it works. I was able to run the script and get the desired output, although i had to specify the file in the command line.
This is the command im trying to run.
while read day
do
ls -1 /Users/Mogli/Desktop/images/A2017$day* > /Users/Mogli/Desktop/2017/Reprojected/input.txt
gpt.command -e /Users/Mogli/Desktop/2017/Reproject.xml -Ssource=/Users/Mogli/Desktop/2017/Reprojected/input.txt
done < /Users/Mogli/Desktop/2017/2017filelist.txt


its gives me the error
Error: No product reader found for file /Users/Mogli/Desktop/2017/Reprojected/input.txt


I've been using the same type of loop with the multi_processor.py for L2bin/l3mapgen and has been working.
I know that most likely its a basic question, but how do i make it run for all the files(individually) in a specific folder?

Thank you in advance!

Best,
Ricardo

Tags:

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

GPT batch processing

by gnwiii » Tue Nov 06, 2018 8:05 pm America/New_York

I'm not quite sure what you want to do.   There may be a more efficient workflow using binning followed by mapping using the OCSSW programs which are generally much faster than gpt.command.  

The gpt.command Reproject operator needs a single source filename and target filename. ESA SNAP also provides gpt and has a Bulk Processing with GPT document that includes a fairly generic example script that seems close to what you describe.

r.fernandes
Posts: 27
Joined: Wed Jun 06, 2012 6:55 pm America/New_York

GPT batch processing

by r.fernandes » Wed Nov 07, 2018 5:48 am America/New_York

I already have an efficient workflow using l2bin and l3mapgen with the multi_processor.py.
For this work i need to work with L2 and not L3 images so i need to reproject/orthorectify each L2 image in one folder. There would be only one source input for the gpt at a time. I was asking for help with the loop because I haven't figured out how to make it run for each file in the folder.

I tried ESA SNPA bulk processing with GPT but i'm also having issues.

Best,
Ricardo

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

GPT batch processing

by OB SeaDAS - knowles » Wed Nov 07, 2018 7:40 am America/New_York

The following gpt command will not work:
ls -1 /Users/Mogli/Desktop/images/A2017$day* > /Users/Mogli/Desktop/2017/Reprojected/input.txt
gpt.command -e /Users/Mogli/Desktop/2017/Reproject.xml -Ssource=/Users/Mogli/Desktop/2017/Reprojected/input.txt

GPT is one file at a time.  You cannot give a text file (which is a list of files) as input to gpt.  That functionality does not exist.  To do bulk processing, you will need to write your own script which loops through the files and calls gpt one file at a time.

Danny

r.fernandes
Posts: 27
Joined: Wed Jun 06, 2012 6:55 pm America/New_York

GPT batch processing

by r.fernandes » Wed Nov 14, 2018 10:55 am America/New_York

Thank you for the help!
I will try your suggestion.

Best,
Ricardo

Post Reply