diff --git a/arrakis/linmos.py b/arrakis/linmos.py index 1539189..cfd2dfe 100644 --- a/arrakis/linmos.py +++ b/arrakis/linmos.py @@ -12,6 +12,7 @@ from typing import Dict, List from typing import NamedTuple as Struct from typing import Optional, Tuple +from shutil import copyfile import astropy.units as u import numpy as np @@ -204,6 +205,14 @@ def genparset( if holofile is not None: logger.info(f"Using holography file {holofile} -- setting removeleakge to true") + mem_dir = os.getenv("MEMDIR", None) + if mem_dir is not None: + logger.info(f"Copying holography file to {mem_dir}") + mem_path = Path(mem_dir) + holo_copy = mem_path / holofile.name + if not holo_copy.exists(): + copyfile(holofile, holo_copy) + holofile = holo_copy parset += f""" linmos.primarybeam = ASKAP_PB