I have been creating .asc raster files by saving a numpy array with numpy.savetxt and the following header: header = "ncols %s\n" % ncols header += "nrows %s\n" % nrows header += "xllcorner %s\n" % xll header += "yllcorner %s\n" % yll header += "cellsize %s\n" % cellsize header += "NODATA_value -99999"
After producing the .asc files I load them into QGIS and they are by default given a style with min: nan, and max: nan. If I go into the Style dialog, set to Stretch to min/max, and change the min and max to match the appropriate range for the source file (eg 0 to 40), the preview thumbnail shows a pixelated mess and the raster shows as completely black.
Sometimes the raster shows up fine if I just hit apply, but then reverts to all black once I hit OK. If I am zoomed very far in (well within the limits of the raster), then sometimes the raster shows up fine and sometimes it doesn't.
Source and generated .asc files here: https://github.com/mrlmautner/PrecipRasters