Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/CameronBodine/PINGMapper in…
Browse files Browse the repository at this point in the history
…to main
  • Loading branch information
CameronBodine committed Jan 17, 2024
2 parents 451b97a + 08f0ac4 commit 7ac6c8e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/class_portstarObj.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions src/main_mapSubstrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 7ac6c8e

Please sign in to comment.