Skip to content

Commit e8d4501

Browse files
Race condition fix (#86)
* Drop typos * Add rename * Add catalogue name * style: pre-commit fixes * Yeet --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 6402f4f commit e8d4501

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

arrakis/linmos.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
from glob import glob
1212
from pathlib import Path
1313
from pprint import pformat
14-
from shutil import copyfile
1514
from typing import NamedTuple as Struct
1615

1716
import astropy.units as u
@@ -202,15 +201,6 @@ def genparset(
202201

203202
if holofile is not None:
204203
logger.info(f"Using holography file {holofile} -- setting removeleakge to true")
205-
mem_dir = os.getenv("MEMDIR", None)
206-
if mem_dir is not None:
207-
logger.info(f"Copying holography file to {mem_dir}")
208-
mem_path = Path(mem_dir)
209-
holo_copy = mem_path / holofile.name
210-
if not holo_copy.exists():
211-
copyfile(holofile, holo_copy)
212-
holofile = holo_copy
213-
214204
parset += f"""
215205
linmos.primarybeam = ASKAP_PB
216206
linmos.primarybeam.ASKAP_PB.image = {holofile.resolve().as_posix()}

arrakis/makecat.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1143,11 +1143,16 @@ def main(
11431143
name="pos_err",
11441144
)
11451145

1146+
if outfile is not None:
1147+
catalogue_name = Path(outfile).stem
1148+
else:
1149+
catalogue_name = None
1150+
11461151
# Add common columns
11471152
rmtab["rm_method"] = "RM Synthesis - Fractional polarization"
11481153
rmtab["telescope"] = "ASKAP"
11491154
rmtab["pol_bias"] = "2012PASA...29..214G"
1150-
rmtab["catalog"] = "Arrakis-DR1"
1155+
rmtab["catalog"] = catalogue_name
11511156
rmtab["ionosphere"] = "FRion"
11521157
rmtab["flux_type"] = "Peak"
11531158
rmtab["aperture"] = 0 * u.deg

0 commit comments

Comments
 (0)