Commit 7da79227 authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Progress bars during MGRS tiling are now only shown in log level 'DEBUG'.

parent 1058ea6e
......@@ -404,7 +404,8 @@ class Dataset(object):
self.mask_nodata = self.arr.mask_nodata
return self.mask_nodata
def get_subset_obj(self, imBounds=None, mapBounds=None, mapBounds_prj=None, out_prj=None, logmsg=None, v=False):
def get_subset_obj(self, imBounds=None, mapBounds=None, mapBounds_prj=None, out_prj=None, logmsg=None,
progress=False, v=False):
# type: (tuple) -> self
"""Returns a subset of the given GMS object, based on the given bounds coordinates.
Array attributes are clipped and relevant metadata keys are updated according to new extent.
......@@ -416,6 +417,7 @@ class Dataset(object):
:param out_prj: <str> a WKT string containing output projection.
If not given, the projection of self.arr is used.
:param logmsg: <str> a message to be logged when this method is called
:param progress: <bool> whether to show progress bar (default: False)
:param v: <bool> verbose mode (default: False)
:return: <GMS_object> the GMS object subset
"""
......@@ -463,7 +465,7 @@ class Dataset(object):
out_prj = out_prj if out_prj else geoArr.prj
rspAlg = 'near' if arrname == 'masks' else 'cubic'
subArr = GeoArray(*geoArr.get_mapPos((xmin, ymin, xmax, ymax), mapBounds_prj,
out_prj=out_prj, rspAlg=rspAlg), progress=False,
out_prj=out_prj, rspAlg=rspAlg, progress=progress),
bandnames=list(geoArr.bandnames), nodata=geoArr.nodata)
# show result
......
......@@ -1183,6 +1183,7 @@ class GMS_object(Dataset):
out_prj=EPSG2WKT(GDF_row['MGRStileObj'].EPSG),
logmsg='Producing MGRS tile %s from scene %s (entity ID %s).'
% (GDF_row.granuleid, self.scene_ID, self.entity_ID),
progress=CFG.log_level in ['DEBUG', 10],
v=v)
MGRS_tileID = GDF_row['granuleid']
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment