diff --git a/magicctapipe/io/gadf.py b/magicctapipe/io/gadf.py index 6c247eb81..86f1463ed 100644 --- a/magicctapipe/io/gadf.py +++ b/magicctapipe/io/gadf.py @@ -9,11 +9,13 @@ from astropy.io import fits from astropy.table import QTable from astropy.time import Time -from magicctapipe import __version__ -from magicctapipe.io.io import TEL_COMBINATIONS -from magicctapipe.utils.functions import HEIGHT_ORM, LAT_ORM, LON_ORM from pyirf.binning import split_bin_lo_hi +from .. import __version__ as MCP_VERSION +from ..utils.functions import HEIGHT_ORM, LAT_ORM, LON_ORM +from .io import TEL_COMBINATIONS + + __all__ = [ "create_gh_cuts_hdu", "create_event_hdu", @@ -71,7 +73,7 @@ def create_gh_cuts_hdu( # Create a header header = fits.Header( cards=[ - ("CREATOR", f"magicctapipe v{__version__}"), + ("CREATOR", f"magicctapipe v{MCP_VERSION}"), ("HDUCLAS1", "RESPONSE"), ("HDUCLAS2", "GH_CUTS"), ("HDUCLAS3", "POINT-LIKE"), @@ -322,4 +324,3 @@ def create_pointing_hdu(event_table): pointing_hdu = fits.BinTableHDU(qtable, header=header, name="POINTING") return pointing_hdu - diff --git a/magicctapipe/io/io.py b/magicctapipe/io/io.py index 5b9e152ce..9b2f5b9d7 100644 --- a/magicctapipe/io/io.py +++ b/magicctapipe/io/io.py @@ -17,11 +17,12 @@ from ctapipe.coordinates import CameraFrame from ctapipe.instrument import SubarrayDescription from lstchain.reco.utils import add_delta_t_key -from magicctapipe.utils import calculate_mean_direction, transform_altaz_to_radec from pyirf.binning import join_bin_lo_hi from pyirf.simulations import SimulatedEventsInfo from pyirf.utils import calculate_source_fov_offset, calculate_theta +from ..utils import calculate_mean_direction, transform_altaz_to_radec + __all__ = [ "format_object", "get_stereo_events", diff --git a/magicctapipe/irfs/utils.py b/magicctapipe/irfs/utils.py index 6c16b1c6e..fe8b67752 100644 --- a/magicctapipe/irfs/utils.py +++ b/magicctapipe/irfs/utils.py @@ -3,18 +3,15 @@ import numpy as np import pandas as pd -from astropy import table +import matplotlib.pylab as plt import astropy.units as u + +from astropy import table from astropy.io import fits from astropy.table import QTable - from pyirf.simulations import SimulatedEventsInfo -from magicctapipe.utils.filedir import read_mc_header -from magicctapipe.utils.plot import save_plt, load_default_plot_settings -from magicctapipe.utils.utils import print_title - -import matplotlib.pylab as plt +from ..utils import read_mc_header, save_plt, load_default_plot_settings, print_title __all__ = [ "read_simu_info_mcp_sum_num_showers", diff --git a/magicctapipe/reco/classifier_utils.py b/magicctapipe/reco/classifier_utils.py index 6f6db717d..a8a90b339 100644 --- a/magicctapipe/reco/classifier_utils.py +++ b/magicctapipe/reco/classifier_utils.py @@ -4,13 +4,12 @@ import os import sklearn.metrics - -from magicctapipe.utils.utils import info_message -from magicctapipe.utils.filedir import ( +from ..utils import ( + info_message, load_dl1_data_stereo_list, load_dl1_data_stereo_list_selected, ) -from magicctapipe.reco.global_utils import check_train_test_intersections +from .global_utils import check_train_test_intersections __all__ = [ "GetHist_classifier", diff --git a/magicctapipe/reco/direction_utils.py b/magicctapipe/reco/direction_utils.py index c6899e1a0..2733b0605 100644 --- a/magicctapipe/reco/direction_utils.py +++ b/magicctapipe/reco/direction_utils.py @@ -2,7 +2,7 @@ from astropy import units as u from astropy.coordinates import SkyCoord, AltAz -from magicctapipe.utils.tels import get_tel_ids_dl1 +from ..utils import get_tel_ids_dl1 __all__ = ["compute_separation_angle_direction"] diff --git a/magicctapipe/reco/estimators.py b/magicctapipe/reco/estimators.py index 5bd02a4c3..19eb7db8f 100644 --- a/magicctapipe/reco/estimators.py +++ b/magicctapipe/reco/estimators.py @@ -7,7 +7,7 @@ import numpy as np import pandas as pd import sklearn.ensemble -from magicctapipe.io.io import TEL_NAMES +from ..io.io import TEL_NAMES __all__ = ["EnergyRegressor", "DispRegressor", "EventClassifier"] diff --git a/magicctapipe/reco/stereo.py b/magicctapipe/reco/stereo.py index f2e841216..5c20a337c 100644 --- a/magicctapipe/reco/stereo.py +++ b/magicctapipe/reco/stereo.py @@ -3,7 +3,7 @@ from ctapipe.core.container import Container, Field -from magicctapipe.utils.tels import tel_ids_2_num +from ..utils import tel_ids_2_num __all__ = ["write_hillas", "check_write_stereo", "check_stereo", "write_stereo"]