Say I have an in-memory raster (i.e. a raster made by the MEM gdal driver), how can I load this raster into a QGIS layer? QgsRasterLayer's constructor wants a path to the raster file, but the in-memory raster doesn't have one.
Creating in-memory raster layer using PyQGIS? doesn't quite cover it as the solution seems to be to avoid creating your own MEM raster altogether.
If there is a way to load a numpy array as a QGIS raster layer, that would work too. I'm just trying to avoid having to write to the disk in case of a rapidly-changing raster.