I'm attempting to do what is generally a straightforward raster calculation when I do this in QGIS, but am trying to do this with gdal_calc.py in terminal. The output is close, but produces banding and inconsistencies in parts of the output raster. I'm wondering if there is anything I'm overlooking. Code to calculate the image is below:
gdal_calc.py -A <input> --outfile = <output> --calc="(A/nanmax(A)) * 65535" --NoDataValue=0
Driver: GTiff/GeoTIFF Files: maryland.tiff Size is 15978, 6520 Coordinate System is: GEOGCS["NAD83", DATUM["North_American_Datum_1983", SPHEROID["GRS 1980",6378137,298.2572221010042, AUTHORITY["EPSG","7019"]], TOWGS84[0,0,0,0,0,0,0], AUTHORITY["EPSG","6269"]], PRIMEM["Greenwich",0], UNIT["degree",0.0174532925199433], Pixel Size = (0.000277777777896,-0.000277777777896) AREA_OR_POINT=Area Image Structure Metadata: INTERLEAVE=BAND Band 1 Block=15978x1 Type=Float32, ColorInterp=Gray NoData Value=-9999