Reprojecting Landsat8.L2_LAC_OC with GPT

Use this Forum to find information on, or ask a question about, NASA Earth Science data.
Post Reply
alicealo
Posts: 14
Joined: Mon Apr 30, 2018 7:31 pm America/New_York
Answers: 0

Reprojecting Landsat8.L2_LAC_OC with GPT

by alicealo » Fri Jun 01, 2018 2:05 pm America/New_York

Dear all,
I am navigating my way through everything SeaDAS, and need to work with the command line, for which I am a new user as well. Without surprise, I am running through a few hitches. I am hoping someone could help me overcome these issues. I suspect it will be very straightforwards for most users here.

What I want to do:

STEP1. Atmospheric correction of GEOTIFF img with L2gen, where IMG =  a Landsat 8 OLI - C1 imagery
Output Step 1: IMG.L2_LAC_OC

STEP2. Reproject IMG.L2_LAC_OC
Output Step 2: IMG.L2_LAC_OC_Reprojected

I already figured how to implement STEP1 in the commande line.

I am currently stuck with step 2. This is the commande line I am using:

/usr/local/apps/seadas-7.5/bin/gpt.sh ReprojectGeoLatLon.xml -p ReprojectGeoLatLon.par -Ssource=IMG.L2_LAC_OC -t IMG:_Reprojection.dim

So far, I am using the .xml and .par file copied from the SeaDAS help webpage (https://seadas.gsfc.nasa.gov/help/; Command Line Tool > Cookbook > Reproject > Example 1)

I get an error message that starts with
”com.thoughtworks.xstream.io.StreamException:  : only whitespace content allowed before start tag and not { (position: START_DOCUMENT seen {... @1:1)
  at com.thoughtworks.xstream.io.xml.XppReader.pullNextEvent(XppReader.java:124)
  at com.thoughtworks.xstream.io.xml.AbstractPullReader.readRealEvent(AbstractPullReader.java:148)
  at com.thoughtworks.xstream.io.xml.AbstractPullReader.readEvent(AbstractPullReader.java:141)
  at com.thoughtworks.xstream.io.xml.AbstractPullReader.move(AbstractPullReader.java:118)
  at com.thoughtworks.xstream.io.xml.AbstractPullReader.moveDown(AbstractPullReader.java:103)”
And goes on and on.

Any idea? Also, although I am guessing that using the default WGS84 CRS is a good way to proceed, I am not sure about the other parameters. Could someone help me with that? Again, I am working with Landsat 8 OLI imagery.

Any support to help me move forwards with that would be greatly appreciated!

Thank you much in advance,
Alice

Tags:

alicealo
Posts: 14
Joined: Mon Apr 30, 2018 7:31 pm America/New_York
Answers: 0

Reprojecting Landsat8.L2_LAC_OC with GPT

by alicealo » Sun Jun 03, 2018 10:33 am America/New_York

Guys,

I found the solution to my problem. Here is how, if anyone else ever face the same question:

- The ReprojectedLatLog.xml  file I had initially used was seemingly corrupted. I re-copied and pasted the  ReprojectedLatLog.xml and .par files copied from the SeaDAS help webpage (https://seadas.gsfc.nasa.gov/help/; Command Line Tool > Cookbook > Reproject > Example 1). The error message mentioned in the previous post didn't appear --> one problem solved.

- The next problem, is that when I ran it, it ran out of memory, because it gave me the error: Error: Cannot construct DataBuffer.
When I Googled this error, I got
https://oceancolor.gsfc.nasa.gov/forum/oceancolor/topic_show.pl?tid=6165
which said I had to fix the memory Xms parameter in
vi /usr/local/apps/seadas-7.5/bin/seadas.vmoptions
and
vi /usr/local/apps/seadas-7.5/bin/gpt.sh
In those 2 files, I increased it from 1GB to 7GB

- As for parameterisation:
(i) I reprojected one image through the GUI and copied the parameter list in Metadata > Global Attribute > Reproject_gpt_parameter
(iii) I opened the  ReprojectedLatLog.xml file in a text editor and replaced the content between the <parameter> mark-up with the parameter list from (i)
(iii) Since the parameters are defined in the xml file, I removed the -p   ReprojectedLatLog.par command
This is how the command line looks like:
gpt.sh ReprojectGeoLatLon.xml -Ssource=iFile.L2_LAC_OC -t out.dim

And the damn thing ran!

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

Reprojecting Landsat8.L2_LAC_OC with GPT

by OB SeaDAS - knowles » Tue Jun 05, 2018 10:53 am America/New_York

Alice,

Yes the GUI is designed to create a xml of the parameters which can be used to run through gpt.  You do not need to actually Reproject via the GUI and then look at the metadata of the generated file.  This metadata field is new to 7.5 and its only created by the Reproject tool.  The way you do this, is to use the GUI and select all your parameters.  Once you have everything set and are ready to run then go to menu File -> Display Parameters or File -> Save Parameters and your xml is here.  This GUI parameter auto-generate feature is available in all GUI equivalents of the gpt tools except (unfortunately) the Crop/Subset tool.

Note that when you post a gpt command (for instance gpt.sh ReprojectGeoLatLon.xml -Ssource=iFile.L2_LAC_OC -t out.dim), unless you actually post the graph and parameter files (in this instance  ReprojectGeoLatLon.xml and in your other case there was a .par file which you would need to show) there is no way for other users to know what you are doing and whether you've formatted something right/wrong.  The graph file .xml and the parameter file .par are critical to the gpt command.

Danny

Post Reply