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

Please enter here to ask a question about any NASA Science related topics!
Post Reply
haag
Posts: 21
Joined: Wed Jun 08, 2016 7:06 am America/New_York

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

by haag » Tue Apr 24, 2018 4:37 pm America/New_York

Hello,
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:

https://github.com/LSUESL/SeaDAS-Tools

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

Tags:

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

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

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

Hello,

Thank you for sharing you script! I am trying to use convert_OLIbundle_from_C1.py 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!
Alice

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 convert_OLIbundle_from_C1.py -v LC08_L1TP_017040_20160207_20170224_01_T1.tar.gz
Unpacking tarball; this may take a while...
Done!
Traceback (most recent call last):
  File "convert_OLIbundle_from_C1.py", line 228, in <module>
    L8_bundle.fix_files()
  File "convert_OLIbundle_from_C1.py", line 167, in fix_files
    self.read_meta()
  File "convert_OLIbundle_from_C1.py", 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'

haag
Posts: 21
Joined: Wed Jun 08, 2016 7:06 am America/New_York

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

by haag » Mon May 07, 2018 12:09 pm America/New_York

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
LC08_L1TP_022039_20180420_20180502_01_T1_B1.TIF
LC08_L1TP_022039_20180420_20180502_01_T1_B2.TIF
LC08_L1TP_022039_20180420_20180502_01_T1_B3.TIF
LC08_L1TP_022039_20180420_20180502_01_T1_B4.TIF
LC08_L1TP_022039_20180420_20180502_01_T1_B5.TIF
LC08_L1TP_022039_20180420_20180502_01_T1_B6.TIF
LC08_L1TP_022039_20180420_20180502_01_T1_B7.TIF
LC08_L1TP_022039_20180420_20180502_01_T1_B8.TIF
LC08_L1TP_022039_20180420_20180502_01_T1_B9.TIF
LC08_L1TP_022039_20180420_20180502_01_T1_B10.TIF
LC08_L1TP_022039_20180420_20180502_01_T1_B11.TIF
LC08_L1TP_022039_20180420_20180502_01_T1_BQA.TIF
LC08_L1TP_022039_20180420_20180502_01_T1_ANG.txt
LC08_L1TP_022039_20180420_20180502_01_T1_MTL.txt
$


Hope that helps!

Kind regards,
Alaric

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

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

by alicealo » Mon May 07, 2018 4:54 pm America/New_York

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 convert_OLIbundle_from_C1.py, 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
Alice

haag
Posts: 21
Joined: Wed Jun 08, 2016 7:06 am America/New_York

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

by haag » Mon May 07, 2018 5:37 pm America/New_York

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

Alaric

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

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

by alicealo » Tue May 08, 2018 8:50 am America/New_York

Thank you so much Alaric, I will start a new thread as you suggested.

Kind regards,
Alice

Post Reply