Skip to content

Commit bc40744

Browse files
committed
open_beamcut, open_locit and open_position now check if the file can be opened.
1 parent d4fe6b9 commit bc40744

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/astrohack/io/dio.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99

1010
from astrohack.io.beamcut_mds import AstrohackBeamcutFile
1111
from astrohack.io.locit_mds import AstrohackLocitFile
12-
from astrohack.utils.file import check_if_file_can_be_opened
12+
from astrohack.utils.file import (
13+
check_if_file_can_be_opened,
14+
check_if_file_can_be_opened_2,
15+
)
1316
from astrohack.io.mds import AstrohackImageFile
1417
from astrohack.io.mds import AstrohackHologFile
1518
from astrohack.io.mds import AstrohackPanelFile
@@ -55,6 +58,7 @@ def open_beamcut(file: str) -> Union[AstrohackBeamcutFile, None]:
5558
ant_n: …
5659
}
5760
"""
61+
check_if_file_can_be_opened_2(file, "beamcut", "0.10.1")
5862
_data_file = AstrohackBeamcutFile(file=file)
5963

6064
if _data_file.open():
@@ -212,6 +216,7 @@ def open_locit(file: str) -> Union[AstrohackLocitFile, None]:
212216
}
213217
214218
"""
219+
check_if_file_can_be_opened_2(file, "extract_locit", "0.10.1")
215220
_data_file = AstrohackLocitFile(file=file)
216221

217222
if _data_file.open():
@@ -249,6 +254,7 @@ def open_position(file: str) -> Union[AstrohackPositionFile, None]:
249254
}
250255
251256
"""
257+
check_if_file_can_be_opened_2(file, "locit", "0.10.1")
252258
_data_file = AstrohackPositionFile(file=file)
253259

254260
if _data_file.open():

0 commit comments

Comments
 (0)