diff --git a/src/class_portstarObj.py b/src/class_portstarObj.py index 246b2ed..42f6d67 100644 --- a/src/class_portstarObj.py +++ b/src/class_portstarObj.py @@ -1992,10 +1992,12 @@ def _mapPredictions(self, map_predict, imgOutPrefix, chunk, npzs): dst.write(out) dst=None + # Reopen and warp to xres gtiff = gtiff_temp.replace('temp', '') gdal.Warp(gtiff, gtiff_temp, xRes = pix_res, yRes = pix_res, targetAlignedPixels=True) + os.remove(gtiff_temp) return diff --git a/src/main_mapSubstrate.py b/src/main_mapSubstrate.py index 74daa5f..b1ca97a 100644 --- a/src/main_mapSubstrate.py +++ b/src/main_mapSubstrate.py @@ -521,6 +521,14 @@ def map_master_func(logfilename='', if map_predict > 0: start_time = time.time() + # Reduce to avoid OOM + threadPrcnt = 0.75 + if threadCnt == cpu_count(): + threadCnt = int(threadCnt * threadPrcnt) + + print("\nPrediction Map requires a lot of RAM...") + print("Lowering threadCnt to:", threadCnt) + if map_predict == 1: a = 'probability' else: