Skip to content

Commit

Permalink
nest recos/ under client/
Browse files Browse the repository at this point in the history
  • Loading branch information
ric-evans committed Oct 28, 2024
1 parent fb31b71 commit de2f4d6
Show file tree
Hide file tree
Showing 14 changed files with 30 additions and 41 deletions.
3 changes: 2 additions & 1 deletion skymap_scanner/client/reco_icetray.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
from icecube.icetray import I3Tray # type: ignore[import-not-found]
from wipac_dev_tools import argparse_tools, logging_tools

from .. import config as cfg, recos
from .. import config as cfg
from ..client import recos
from ..utils import messages
from ..utils.data_handling import get_gcd_datastager
from ..utils.load_scan_state import get_baseline_gcd_frames
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
"""IceTray segment for a dummy reco."""


import datetime
import random
import time
from typing import List, Final
from typing import Final, List

from icecube.icetray import I3Units # type: ignore[import]
from icecube import ( # type: ignore[import] # noqa: F401
dataclasses,
frame_object_diff,
Expand All @@ -18,12 +16,10 @@
recclasses,
simclasses,
)
from icecube.icetray import I3Frame, I3Units # type: ignore[import]; type: ignore[import]

from icecube.icetray import I3Frame # type: ignore[import]

from .. import config as cfg
from . import RecoInterface, VertexGenerator, config as cfg
from ..utils.pixel_classes import RecoPixelVariation
from . import RecoInterface, VertexGenerator


class Dummy(RecoInterface):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@
# pylint: skip-file
# mypy: ignore-errors

import copy
import datetime
from typing import Final, List, Tuple

import numpy

from icecube.icetray import I3Units
from icecube import ( # noqa: F401
VHESelfVeto,
dataclasses,
Expand All @@ -25,17 +22,16 @@
recclasses,
simclasses,
)
from icecube.icetray import I3Frame
from icecube.icetray import I3Frame, I3Units

from .. import config as cfg
from ..utils.data_handling import DataStager
from ..utils.pixel_classes import RecoPixelVariation
from . import RecoInterface, VertexGenerator
from . import RecoInterface, VertexGenerator, config as cfg
from .common.pulse_proc import late_pulse_cleaning
from ..utils.pixel_classes import RecoPixelVariation


class MillipedeOriginal(RecoInterface):
"""Reco logic for millipede."""


@staticmethod
def get_vertex_variations() -> List[dataclasses.I3Position]:
Expand All @@ -45,9 +41,9 @@ def get_vertex_variations() -> List[dataclasses.I3Position]:

if cfg.ENV.SKYSCAN_MINI_TEST:
return VertexGenerator.mini_test(variation_distance=variation_distance)
else:
else:
return VertexGenerator.octahedron(radius=variation_distance)

pulsesName = cfg.INPUT_PULSES_NAME
pulsesName_cleaned = pulsesName+'LatePulseCleaned'

Expand Down Expand Up @@ -79,8 +75,8 @@ def extract_seed(frame):

tray.Add(extract_seed, "ExtractSeed",
If = lambda frame: frame.Has("HESE_VHESelfVeto"))
# Generates the vertex seed for the initial scan.

# Generates the vertex seed for the initial scan.
# Only run if HESE_VHESelfVeto is not present in the frame.
# VertexThreshold is 250 in the original HESE analysis (Tianlu)
# If HESE_VHESelfVeto is already in the frame, is likely using implicitly a VertexThreshold of 250 already. To be determined when this is not the case.
Expand All @@ -101,7 +97,7 @@ def setup_reco(self):
datastager = self.get_datastager()

datastager.stage_files(self.SPLINE_REQUIREMENTS)

abs_spline = datastager.get_filepath(self.MIE_ABS_SPLINE)
prob_spline = datastager.get_filepath(self.MIE_PROB_SPLINE)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from typing import Final, List, Tuple

import numpy
from icecube.icetray import I3Units
from icecube import ( # noqa: F401
VHESelfVeto,
dataclasses,
Expand All @@ -23,12 +22,11 @@
recclasses,
simclasses
)
from icecube.icetray import I3Frame
from icecube.icetray import I3Frame, I3Units

from .. import config as cfg
from ..utils.pixel_classes import RecoPixelVariation
from . import RecoInterface, VertexGenerator
from . import RecoInterface, VertexGenerator, config as cfg
from .common.pulse_proc import mask_deepcore, pulse_cleaning
from ..utils.pixel_classes import RecoPixelVariation


class MillipedeWilks(RecoInterface):
Expand Down Expand Up @@ -84,7 +82,7 @@ def setup_reco(self):
@classmethod
@icetray.traysegment
def prepare_frames(cls, tray, name, logger):
# Generates the vertex seed for the initial scan.
# Generates the vertex seed for the initial scan.
# Only run if HESE_VHESelfVeto is not present in the frame.
# VertexThreshold is 250 in the original HESE analysis (Tianlu)
# If HESE_VHESelfVeto is already in the frame, is likely using implicitly a VertexThreshold of 250 already. To be determined when this is not the case.
Expand Down Expand Up @@ -112,7 +110,7 @@ def extract_seed(frame):
OutputVertexTime=cfg.INPUT_TIME_NAME,
OutputVertexPos=cfg.INPUT_POS_NAME,
If=lambda frame: not frame.Has("HESE_VHESelfVeto"))


tray.Add(mask_deepcore, origpulses=cfg.INPUT_PULSES_NAME, maskedpulses=cls.pulsesName)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@
from icecube.lilliput import i3minuit, scipymin # type: ignore[import]
from icecube.photonics_service import I3PhotoSplineService # type: ignore[import]

from . import RecoInterface, VertexGenerator
from . import RecoInterface, VertexGenerator, config as cfg
from .common.pulse_proc import mask_deepcore
from .. import config as cfg
from ..utils.pixel_classes import RecoPixelVariation


Expand Down
File renamed without changes.
5 changes: 3 additions & 2 deletions skymap_scanner/server/start_scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@
get_mqclient_connections,
kill_switch_check_from_skydriver,
)
from .. import config as cfg, recos
from ..recos import RecoInterface, set_pointing_ra_dec
from .. import config as cfg
from ..client import recos
from ..client.recos import RecoInterface, set_pointing_ra_dec
from ..utils import extract_json_message, messages
from ..utils.load_scan_state import get_baseline_gcd_frames
from ..utils.pixel_classes import (
Expand Down
3 changes: 2 additions & 1 deletion skymap_scanner/utils/pixel_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
import time
from typing import Any, Dict, Tuple

from .. import config as cfg, recos
from .. import config as cfg
from ..client import recos

try: # these are only used for typehints, so mock imports are fine
from icecube.dataclasses import I3Position # type: ignore[import]
Expand Down
11 changes: 4 additions & 7 deletions skymap_scanner/utils/prepare_frames.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""prepare the GCDQp packet by adding frame objects that might be missing."""


# fmt: off
# pylint: skip-file

Expand All @@ -9,18 +8,16 @@
import os
from typing import List, Union

from icecube import icetray # type: ignore[import-not-found]
from icecube import ( # type: ignore[import-not-found] # for I3LCPulseCleaning # noqa: F401
DomTools,
)
from icecube import DomTools, \
icetray # type: ignore[import-not-found] # for I3LCPulseCleaning # noqa: F401; type: ignore[import-not-found]
from icecube.BadDomList.BadDomListTraySegment import BadDomList # type: ignore[import-not-found]
from icecube.frame_object_diff.segments import ( # type: ignore[import-not-found]
uncompress,
)
from icecube.BadDomList.BadDomListTraySegment import BadDomList # type: ignore[import-not-found]
from icecube.icetray import I3Tray # type: ignore[import-not-found]

from .. import recos
from .. import config as cfg
from ..client import recos

LOGGER = logging.getLogger(__name__)

Expand Down

0 comments on commit de2f4d6

Please sign in to comment.