Page 1 of 1

OLI Collection 1 "converter" for SeaDAS 7.4, and CSV to placemark tools

Posted: Tue Apr 24, 2018 4:37 pm America/New_York
by haag
I've written a couple of Python scripts to assist (us, at least :wink: ) in using SeaDAS.

One converts a CSV file into a placemark file, and the other will unpack a Landsat 8 bundle and rename the files to the "old" scheme, allowing use of the Collection 1 files in SeaDAS 7.

You may find them at:

Feel free to post issues and feedback and I will get to them as soon as I can.
Hope this is helpful!

OLI Collection 1 "converter" for SeaDAS 7.4, and CSV to placemark tools

Posted: Fri May 04, 2018 12:55 pm America/New_York
by alicealo

Thank you for sharing you script! I am trying to use on an image I downloaded from GloVis. However, I got the error message that there is no MLT.txt. Note that I first gzipped the directory that I had downloaded from GloVis, as it was in tar format. See the procedure I implemented and error message below.
Can you help me in resolving this issue?
Thank you!

Alices-iMac:SeaDAS-Tools-master alicealonso$ tar cvf - LC08_L1TP_017040_20160207_20170224_01_T1|gzip>LC08_L1TP_017040_20160207_20170224_01_T1.tar.gz
a LC08_L1TP_017040_20160207_20170224_01_T1
a LC08_L1TP_017040_20160207_20170224_01_T1/LC08_L1TP_017040_20160207_20170224_01_T1_B5.TIF
a LC08_L1TP_017040_20160207_20170224_01_T1/LC08_L1TP_017040_20160207_20170224_01_T1_B10.TIF
a LC08_L1TP_017040_20160207_20170224_01_T1/LC08_L1TP_017040_20160207_20170224_01_T1_B11.TIF
a LC08_L1TP_017040_20160207_20170224_01_T1/LC08_L1TP_017040_20160207_20170224_01_T1_B4.TIF
a LC08_L1TP_017040_20160207_20170224_01_T1/LC08_L1TP_017040_20160207_20170224_01_T1_B6.TIF
a LC08_L1TP_017040_20160207_20170224_01_T1/LC08_L1TP_017040_20160207_20170224_01_T1_B7.TIF
a LC08_L1TP_017040_20160207_20170224_01_T1/LC08_L1TP_017040_20160207_20170224_01_T1_B3.TIF
a LC08_L1TP_017040_20160207_20170224_01_T1/LC08_L1TP_017040_20160207_20170224_01_T1_B2.TIF
a LC08_L1TP_017040_20160207_20170224_01_T1/LC08_L1TP_017040_20160207_20170224_01_T1_MTL.txt
a LC08_L1TP_017040_20160207_20170224_01_T1/LC08_L1TP_017040_20160207_20170224_01_T1_B1.TIF
a LC08_L1TP_017040_20160207_20170224_01_T1/LC08_L1TP_017040_20160207_20170224_01_T1_B9.TIF
a LC08_L1TP_017040_20160207_20170224_01_T1/LC08_L1TP_017040_20160207_20170224_01_T1_B8.TIF
a LC08_L1TP_017040_20160207_20170224_01_T1/LC08_L1TP_017040_20160207_20170224_01_T1_ANG.txt
a LC08_L1TP_017040_20160207_20170224_01_T1/LC08_L1TP_017040_20160207_20170224_01_T1_BQA.TIF
Alices-iMac:SeaDAS-Tools-master alicealonso$ python -v LC08_L1TP_017040_20160207_20170224_01_T1.tar.gz
Unpacking tarball; this may take a while...
Traceback (most recent call last):
  File "", line 228, in <module>
  File "", line 167, in fix_files
  File "", line 101, in read_meta
    with open(old_MTL_file) as metafile:
IOError: [Errno 2] No such file or directory: 'LC08_L1TP_017040_20160207_20170224_01_T1_MTL.txt'

OLI Collection 1 "converter" for SeaDAS 7.4, and CSV to placemark tools

Posted: Mon May 07, 2018 12:09 pm America/New_York
by haag
Hi Alice,

I'm very sorry for the late response... I think the issue is that you've built a tarball with a "leading" directory. In your case, try:

$ cd LC08_L1TP_017040_20160207_20170224_01_T1
$ tar cvf - LC08_L1TP_017040_20160207_20170224_01_T1* | gzip > LC08_L1TP_017040_20160207_20170224_01_T1.tar.gz

I just pulled a bundle from GloVis, and the contents are just the files, no enclosing folder.

$ cd Downloads
$ tar tzf LC08_L1TP_022039_20180420_20180502_01_T1.tar.gz

Hope that helps!

Kind regards,

OLI Collection 1 "converter" for SeaDAS 7.4, and CSV to placemark tools

Posted: Mon May 07, 2018 4:54 pm America/New_York
by alicealo
Dear Alaric,

Thank you so much for you reply. It works now!
... but I am running into another issue: after I converted my images with, I processed it with L2gen in SeaDAS. It outputted the file "L2016038160136.L2_LAC_OC". I would like to visualize this image into SeaDAS, but I get an error message when trying to import it:

"An exception occurred: Type: java.lang.illegalStateException
Message: DataBTree doesn't start with TREE"

Any idea how to address this?

Also, I will need to export the corrected Landsat image as a GeoTIFF file, is that possible?

Thank you!
Kind regards

OLI Collection 1 "converter" for SeaDAS 7.4, and CSV to placemark tools

Posted: Mon May 07, 2018 5:37 pm America/New_York
by haag
Hi Alice,

I'm glad you're able to unpack the bundle now!

Believe it or not, I've not yet gotten around to trying to run "l2gen" on Landsat. We've only done some low level work with OLI data...
We have exported geoTIFF images, using the File-Export->GeoTIFF menu item. Try both the "GeoTIFF" and the "BigGeoTIFF" menu items and see if one wokrs better for you than the other.

Perhaps you can start a new thread asking for help with level 2 Landsat processing to get someone with some expertise to help you.
I'm sorry I can't offer more for that problem...


OLI Collection 1 "converter" for SeaDAS 7.4, and CSV to placemark tools

Posted: Tue May 08, 2018 8:50 am America/New_York
by alicealo
Thank you so much Alaric, I will start a new thread as you suggested.

Kind regards,