Skip to content
Snippets Groups Projects
Commit 1bd76710 authored by POLLET Vincent's avatar POLLET Vincent
Browse files

Add tests files and models

parent d9b85fbf
No related branches found
No related tags found
No related merge requests found
Pipeline #341683 passed
tests/resources/dl1_LST_Run06892_gammaness_cut_70_sample_500.h5 filter=lfs diff=lfs merge=lfs -text
tests/resources/dl2_LST_Run06892_gammaness_cut_70_sample_500.h5 filter=lfs diff=lfs merge=lfs -text
tests/resources/energy_regressor.sav filter=lfs diff=lfs merge=lfs -text
tests/resources/gamma_classifier.sav filter=lfs diff=lfs merge=lfs -text
tests/resources/image_displacement_vector_regressor.sav filter=lfs diff=lfs merge=lfs -text
......@@ -135,9 +135,7 @@ def dl1_to_dl2(
alt_tel = -np.pi / 2.0 * np.ones(len(dl2_df))
az_tel = -np.pi / 2.0 * np.ones(len(dl2_df))
# TODO: this calls astropy coordinates changing routines, but using ctapipe's "camera frame" aligned
# set with the telescope pointing orientation and focal length.
# We need a replacement for that.
# TODO: this calls astropy coordinates changing routines, can it be optimized ?
src_pos_reco = reco_source_position_sky(
dl2_df.x.values * u.m,
dl2_df.y.values * u.m,
......
......@@ -10,7 +10,9 @@ def init_dl2_file(dl2_file_path: Path, dl1_file_path: Path):
# TODO: make these configurable somehow
not_copy_list = [
"/dl1/event/telescope/image",
"/dl1/event/telescope/image/LST_LSTCam",
"/dl1/event/telescope/parameters",
"/dl1/event/telescope/parameters/LST_LSTCam",
"/dl1/event/telescope/parameters_src_dependent/LST_LSTCam",
"/dl1/event/telescope/likelihood_parameters/LST_LSTCam",
......
File added
File added
File added
File added
File added
{
"events_filters": {
"intensity": [
0, Infinity
],
"width": [
0, Infinity
],
"length": [
0, Infinity
],
"wl": [
0,
1
],
"r": [
0,
1
],
"leakage_intensity_width_2": [
0,
1
]
},
"fixed_cuts": {
"gh_score": [
0.5,
1
],
"theta_cut": {
"value": 0.2,
"unit": "deg"
},
"source_fov_offset": {
"value": 2.83,
"unit": "deg"
}
},
"energy_regressor_features": [
"log_intensity",
"width",
"length",
"x",
"y",
"psi",
"phi",
"wl",
"skewness",
"kurtosis",
"r",
"time_gradient",
"leakage_intensity_width_2",
"n_islands"
],
"gamma_classifier_features": [
"log_intensity",
"width",
"length",
"x",
"y",
"psi",
"phi",
"wl",
"skewness",
"kurtosis",
"r",
"time_gradient",
"leakage_intensity_width_2",
"n_islands",
"log_reco_energy",
"reco_disp_dx",
"reco_disp_dy"
],
"disp_vector_regressor_features": [
"log_intensity",
"width",
"length",
"x",
"y",
"psi",
"phi",
"wl",
"skewness",
"kurtosis",
"r",
"time_gradient",
"leakage_intensity_width_2",
"n_islands"
]
}
\ No newline at end of file
......@@ -39,4 +39,4 @@ def test_dl1_to_dl2(monkeypatch: pytest.MonkeyPatch, tmp_path: Path, request: py
main()
assert dl2_file_path.exists()
compare_hdf5(current_dir / "resources/dl1_LST_Run06892_gammaness_cut_70_sample_500.h5", dl2_file_path)
compare_hdf5(current_dir / "resources/dl2_LST_Run06892_gammaness_cut_70_sample_500.h5", dl2_file_path)
......@@ -7,7 +7,7 @@ import tables
def compare_hdf5(file1_pathname: Path, file2_pathname: Path):
with tables.open_file(file1_pathname, "r") as f1, tables.open_file(file2_pathname, "r") as f2:
for ref_node in f1.walk_nodes():
assert ref_node._v_pathname in f2
assert ref_node._v_pathname in f2, ref_node._v_pathname
if isinstance(ref_node, tables.Table):
output_node = f1.get_node(ref_node._v_pathname)
for name in ref_node.colnames:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment