When using gdal_translate
on the command-line, there is an option to set a scale factor without modifying pixel values using the a_scale
option (see here).
I want to use this option in Python, e.g. like this:
ds = gdal.Translate(fp_out, correctedImage, a_scale = 0.01)
But I don't see the options listed in the docstring of gdal.TranslateOptions
and so the above doesn't work:
options --- can be be an array of strings, a string or let empty and filled from other keywords.
format --- output format ("GTiff", etc...)
outputType --- output type (gdalconst.GDT_Byte, etc...)
bandList --- array of band numbers (index start at 1)
maskBand --- mask band to generate or not ("none", "auto", "mask", 1, ...)
width --- width of the output raster in pixel
height --- height of the output raster in pixel
widthPct --- width of the output raster in percentage (100 = original width)
heightPct --- height of the output raster in percentage (100 = original height)
xRes --- output horizontal resolution
yRes --- output vertical resolution
creationOptions --- list of creation options
srcWin --- subwindow in pixels to extract: [left_x, top_y, width, height]
projWin --- subwindow in projected coordinates to extract: [ulx, uly, lrx, lry]
projWinSRS --- SRS in which projWin is expressed
strict --- strict mode
unscale --- unscale values with scale and offset metadata
scaleParams --- list of scale parameters, each of the form [src_min,src_max] or [src_min,src_max,dst_min,dst_max]
exponents --- list of exponentiation parameters
outputBounds --- assigned output bounds: [ulx, uly, lrx, lry]
metadataOptions --- list of metadata options
outputSRS --- assigned output SRS
nogcp --- ignore GCP in the raster
GCPs --- list of GCPs
noData --- nodata value (or "none" to unset it)
rgbExpand --- Color palette expansion mode: "gray", "rgb", "rgba"
stats --- whether to calculate statistics
rat --- whether to write source RAT
xmp --- whether to copy XMP metadata
resampleAlg --- resampling mode
callback --- callback method
callback_data --- user data for callback
Any ideas on how to get this option to work?