Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewhanson committed Mar 22, 2017
1 parent cdc8a83 commit d2684be
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions modispds/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ def convert_to_geotiff(hdf, outdir=''):
overviews = products[product]['overviews']
file_names = []
img = gippy.GeoImage(hdf, True)
opts = {'COMPRESS': 'DEFLATE', 'PREDICTOR': '2', 'TILED': 'YES', 'BLOCKXSIZE': '512', 'BLOCKYSIZE': '512',
'COMPRESS_OVERVIEW': 'DEFLATE'}
opts = {'COMPRESS': 'DEFLATE', 'PREDICTOR': '2', 'TILED': 'YES', 'BLOCKXSIZE': '512', 'BLOCKYSIZE': '512'}
# save each band as a TIF
for i, band in enumerate(img):
fname = os.path.join(outdir, bname.replace('.hdf', '') + '_' + bandnames[i] + '.TIF')
Expand All @@ -116,7 +115,6 @@ def convert_to_geotiff(hdf, outdir=''):
file_names.append(fname)
# add overview as separate file
if overviews[i]:
#from nose.tools import set_trace; set_trace()
cmd = 'gdaladdo -ro -r average --config COMPRESS_OVERVIEW DEFLATE %s 2 4 8' % fname
logger.debug('Creating overviews: %s' % cmd)
out = subprocess.check_output(cmd.split(' '))
Expand Down

0 comments on commit d2684be

Please sign in to comment.