Commit ad0716f0 authored by Manuel Grizonnet's avatar Manuel Grizonnet

ENH: simplify extract_band method to allow to input zip archive to run_snow_detector

parent 1258115f
......@@ -197,17 +197,16 @@ def extract_band(inputs, band, path_tmp, noData):
dataset = gdal.Open(path, GA_ReadOnly)
path_extracted = op.join(path_tmp, band+"_extracted.tif")
if dataset.RasterCount > 1:
logging.info("extracting "+band)
gdal.Translate(
logging.info("extracting "+band)
gdal.Translate(
path_extracted,
path,
format='GTiff',
outputType=gdal.GDT_Int16,
noData=noData,
bandList=[band_no])
else:
copyfile(path, path_extracted)
return path_extracted
......
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