diff --git a/CHANGES.txt b/CHANGES.txt index 7e141a68..c265198a 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -20,7 +20,12 @@ # along with this program. If not, see ################################################################################ v0.8.2 -- landsat assets now tagged as 'DN' and 'SR' for USGS downloaded surface reflectance. +- landsat assets now tagged as 'DN' and 'SR' for USGS downloaded surface + reflectance. +- added landsat 'bqashadow' product that uses `gippy.algorithms.AddShadowMask` + to catch shadows of BQA detected clouds via shadow smear. +- enabled `--sensors` filter for landsat. +- fixed: `gips.tiles.Tiles.pprint` TypeError when `colors` is None v0.8.1 - added support for `alltouch` paramter in CookieCutter (gippy==0.3.6) diff --git a/gips/tiles.py b/gips/tiles.py index 04f632eb..35078c83 100644 --- a/gips/tiles.py +++ b/gips/tiles.py @@ -141,22 +141,30 @@ def pprint_asset_header(self): """ Print asset header """ self.dataclass.pprint_asset_header() + def _colorize_product(self, prod, colors=None): + color = ['', ''] + if colors is not None: + s = self.which_sensor(prod) + if s is not None: + color = [colors[s], Colors.OFF] + return color[0] + prod + color[1] + + def pprint(self, dformat='%j', colors=None): """ Print coverage for each and every asset """ #assets = [a for a in self.dataclass.Asset._assets] sys.stdout.write('{:^12}'.format(self.date.strftime(dformat))) asset_coverage = self.asset_coverage() for a in sorted(asset_coverage): - color = ['', ''] - if colors is not None: - s = self.which_sensor(a) - if s is not None: - color = [colors[s], Colors.OFF] cov = asset_coverage[a] if cov > 0: - sys.stdout.write(color[0] + ' {:>4.1f}% '.format(cov) + color[1]) + text = self._colorize_product( + ' {:>4.1f}% '.format(cov), colors + ) else: - sys.stdout.write(' ') + text = ' ' + sys.stdout.write(text) + products = [p for t in self.tiles for p in self.tiles[t].products] # Check product is available for all tiles before reporting as processed prods = [] @@ -164,6 +172,6 @@ def pprint(self, dformat='%j', colors=None): if products.count(p) == len(self.tiles): prods.append(p) for p in sorted(set(prods)): - color = colors[self.which_sensor(p)] - sys.stdout.write(' ' + color + p + Colors.OFF) + text = self._colorize_product(p, colors) + sys.stdout.write(' ' + text) sys.stdout.write('\n')