Skip to content

Commit

Permalink
try the save-to-tmpdir approach
Browse files Browse the repository at this point in the history
  • Loading branch information
keflavich committed Oct 12, 2024
1 parent d52af14 commit 483ac14
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions aces/analysis/giantcube_cuts.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def do_all_stats(cube, molname, mompath=f'{basepath}/mosaics/cubes/moments/',
if hasattr(cube, 'rechunk'):
print("Dask graph:\n", cube._data.max().__dask_graph__(), flush=True)

cube = cube.rechunk((-1, 1000, 1000))
cube = cube.rechunk((-1, 1000, 1000), save_to_tmp_dir=True)

print("Rechunked")
print(cube, flush=True)
Expand All @@ -135,7 +135,10 @@ def do_all_stats(cube, molname, mompath=f'{basepath}/mosaics/cubes/moments/',
del mx

print(f"argmax. dt={time.time() - t0}")
argmx = cube.argmax(axis=0, how='ray', progressbar=True)
if hasattr(cube, 'rechunk'):
argmx = cube.argmax(axis=0)
else:
argmx = cube.argmax(axis=0, how='ray', progressbar=True)
print(f"Done computing argmax, now computing vmax. dt={time.time() - t0}")
vmax = cube.spectral_axis[argmx]
hdu = mx.hdu
Expand Down

0 comments on commit 483ac14

Please sign in to comment.