Page 1 of 1

Reprojecting Landsat8.L2_LAC_OC with GPT

Posted: Fri Jun 01, 2018 2:05 pm America/New_York
by alicealo
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/ 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 (; Command Line Tool > Cookbook > Reproject > Example 1)

I get an error message that starts with
”  : only whitespace content allowed before start tag and not { (position: START_DOCUMENT seen {... @1:1)
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,

Reprojecting Landsat8.L2_LAC_OC with GPT

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

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 (; 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
which said I had to fix the memory Xms parameter in
vi /usr/local/apps/seadas-7.5/bin/seadas.vmoptions
vi /usr/local/apps/seadas-7.5/bin/
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: ReprojectGeoLatLon.xml -Ssource=iFile.L2_LAC_OC -t out.dim

And the damn thing ran!

Reprojecting Landsat8.L2_LAC_OC with GPT

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

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 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.