Applied-GeoSolutions / gips

Geospatial Image Processing System
GNU General Public License v3.0
17 stars 5 forks source link

landsat driver confused about DN vs. C1 assets #407

Closed ircwaves closed 6 years ago

ircwaves commented 6 years ago

grabbing wrong MTL file

This happens:

/titan/data/landsat/tiles/019031/2010091/LE70190312010091EDC00.tar.gz/LE07_L1TP_019031_20100401_20160915_01_T1_B1.TIF

when you have both a C1 and a DN asset, like this:

-rw-rw-r-- 1 tolson staff 216489722 Sep 22 18:24 LE07_L1TP_019031_20100401_20160915_01_T1.tar.gz
-rw-rw-r-- 1 tolson staff      1243 Sep 26 18:00 LE07_L1TP_019031_20100401_20160915_01_T1.tar.gz.index
-rw-rw-r-- 1 tolson staff      9177 Sep 15  2016 LE07_L1TP_019031_20100401_20160915_01_T1_MTL.txt
-rwxrw-r-- 1 icooke staff 215106538 Oct 20  2016 LE70190312010091EDC00.tar.gz

Asks for DN asset even though only C1 is present

$ ls /titan/data/landsat/tiles/020031/2017269/*tar.gz # will show C1 asset
LC08_L1TP_020031_20170926_20170926_01_RT.tar.gz
$ gips_process landsat -t 020031 -p rhow -d 2017-09-20,2017-09-27 -v9 # breaks due to asking for DN asset
GIPS Data Processing (v0.8.2)
Retrieving inventory for site tiles
fname
LC08_L1TP_020031_20170926_20170926_01_RT.tar.gz
C1 asset
Processing [rhow] on 1 dates (1 files)
Error:
Traceback (most recent call last):
  File "/scratch/xhuang/code/gips-dev/gips/utils.py", line 474, in cli_error_handler
    yield
  File "/scratch/xhuang/code/gips-dev/gips/inventory/__init__.py", line 325, in process
    self.data[date].process(*args, **kwargs)
  File "/scratch/xhuang/code/gips-dev/gips/tiles.py", line 73, in process
    [t.process(*args, products=self.products.products, **kwargs) for t in self.tiles.values()]
  File "/scratch/xhuang/code/gips-dev/gips/data/core.py", line 1068, in wrapper
    return wrapped_method(self, *args, **kwargs)
  File "/scratch/xhuang/code/gips-dev/gips/data/landsat/landsat.py", line 930, in process
    self.basename = self.basename + '_' + self.sensors[asset]
KeyError: 'DN'
Processing completed in 0:00:00.002123
Fatal: 1 error(s) occurred:
Error:
None
ra-tolson commented 6 years ago

So it seems for the second problem, the error isn't found in current dev. The proposed fix (140947c) is still a good idea so I'll leave it in place (though I may edit the commit message)