-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
27c7e0c
commit 85b393f
Showing
4 changed files
with
104 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import subprocess | ||
import pytest | ||
import glob | ||
|
||
|
||
def test_coincidence_preoffset(dl1_lst, merge_magic, temp_coinc_preoff, config_preoff): | ||
""" | ||
Coincidence pre-offset option | ||
""" | ||
|
||
for file in dl1_lst: | ||
out = subprocess.run( | ||
[ | ||
"lst1_magic_event_coincidence", | ||
f"-l{str(file)}", | ||
f"-m{str(merge_magic)}", | ||
f"-o{str(temp_coinc_preoff)}", | ||
f"-c{str(config_preoff)}", | ||
] | ||
) | ||
if out.returncode != 0: | ||
raise ValueError( | ||
f"Coincidence script with pre-offset option failed with return code {out.returncode} for file {file}" | ||
) | ||
|
||
assert len(glob.glob(f"{temp_coinc_preoff}/*.h5"))==1 | ||
|
||
|
||
def test_coincidence(dl1_lst, merge_magic, temp_coinc, config): | ||
""" | ||
Coincidence | ||
""" | ||
|
||
for file in dl1_lst: | ||
out = subprocess.run( | ||
[ | ||
"lst1_magic_event_coincidence", | ||
f"-l{str(file)}", | ||
f"-m{str(merge_magic)}", | ||
f"-o{str(temp_coinc)}", | ||
f"-c{str(config)}", | ||
] | ||
) | ||
if out.returncode != 0: | ||
raise ValueError( | ||
f"Coincidence script failed with return code {out.returncode} for file {file}" | ||
) | ||
|
||
assert len(glob.glob(f"{temp_coinc}/*.h5"))==1 | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import subprocess | ||
import pytest | ||
import glob | ||
|
||
|
||
def test_mc_dl0_dl1(temp_DL1_gamma, dl0_gamma, config): | ||
""" | ||
MC DL0 to DL1 | ||
""" | ||
|
||
for file in dl0_gamma: | ||
out=subprocess.run( | ||
[ | ||
"lst1_magic_mc_dl0_to_dl1", | ||
f"-i{str(file)}", | ||
f"-o{str(temp_DL1_gamma)}", | ||
f"-c{str(config)}", | ||
] | ||
) | ||
|
||
if out.returncode != 0: | ||
raise ValueError( | ||
f"MC DL0 to DL1 script failed with return code {out.returncode} for file {file}" | ||
) | ||
|
||
assert len(glob.glob(f"{temp_DL1_gamma}/*.h5"))>0 | ||
|
||
|
||
def test_mc_dl0_dl1_focal_exc(temp_DL1_gamma_focal_exc, dl0_gamma, config): | ||
""" | ||
MC DL0 to DL1 focal length exception | ||
""" | ||
|
||
for file in dl0_gamma: | ||
out=subprocess.run( | ||
[ | ||
"lst1_magic_mc_dl0_to_dl1", | ||
f"-i{str(file)}", | ||
f"-o{str(temp_DL1_gamma_focal_exc)}", | ||
f"-c{str(config)}", | ||
"-f abc", | ||
] | ||
) | ||
assert len(glob.glob(f"{temp_DL1_gamma_focal_exc}/*.h5"))==0 | ||
|
||
|