Пример #1
0
 def __init__(self, ebins, czbins, reco_mc_wt_file=None, **kwargs):
     """
     Parameters needed to instantiate a MC-based reconstruction service:
     * ebins: Energy bin edges
     * czbins: cos(zenith) bin edges
     * reco_weight_file: HDF5 containing the MC events to construct the kernels
     """
     self.simfile = reco_mc_wt_file
     RecoServiceBase.__init__(self, ebins, czbins, simfile=self.simfile, **kwargs)
Пример #2
0
 def __init__(self, ebins, czbins, reco_mc_wt_file=None, **kwargs):
     """
     Parameters needed to instantiate a MC-based reconstruction service:
     * ebins: Energy bin edges
     * czbins: cos(zenith) bin edges
     * reco_weight_file: HDF5 containing the MC events to construct the kernels
     """
     self.simfile = reco_mc_wt_file
     RecoServiceBase.__init__(self, ebins, czbins, simfile=self.simfile, **kwargs)
Пример #3
0
 def __init__(self, ebins, czbins, reco_kernel_file=None, **kwargs):
     """
     Parameters needed to instantiate a reconstruction service with
     pre-calculated kernels:
     * ebins: Energy bin edges
     * czbins: cos(zenith) bin edges
     * reco_kernel_file: JSON containing the kernel dict
     """
     self.kernelfile = reco_kernel_file
     RecoServiceBase.__init__(self, ebins, czbins,
                              kernelfile=reco_kernel_file, **kwargs)
Пример #4
0
 def __init__(self, ebins, czbins, reco_kernel_file=None, **kwargs):
     """
     Parameters needed to instantiate a reconstruction service with
     pre-calculated kernels:
     * ebins: Energy bin edges
     * czbins: cos(zenith) bin edges
     * reco_kernel_file: JSON containing the kernel dict
     """
     self.kernelfile = reco_kernel_file
     RecoServiceBase.__init__(self, ebins, czbins,
                              kernelfile=reco_kernel_file, **kwargs)
Пример #5
0
    def __init__(self,
                 ebins,
                 czbins,
                 reco_vbwkde_evts_file,
                 reco_vbwkde_make_plots=False,
                 **kwargs):
        """Initializtion

        Parameters
        ----------
        ebins : sequence
            Neutrino energy histogram bin edges

        czbins : sequence
            Cosine-of-zenith histogram bin edges

        reco_vbwkde_evts_file : str or dict
            Resource location of HDF5 file containing event reconstruction
            information for each of the neutrino flavors and interaction types.
            If an HDF5 file name is specified, the method utils.hdf.from_hdf
            converts the contents to a nested dictionary. With either type of
            input, the dictionary must have the form
              eventsdict[flav][int_type][{true|reco}_{energy|coszen}] =
                  np.array([...], dtype=float64)
            where each array of the same flav and int_type must be of the
            same length.


        """
        self.kernels = None
        self.reco_events_hash = ''
        self.duplicate_nu_bar_cc = False
        self.duplicate_nc = False

        self.MIN_NUM_EVENTS = 100
        self.TGT_NUM_EVENTS = 300
        self.EPSILON = 1e-10
        self.ENERGY_RANGE = [0, 501]

        RecoServiceBase.__init__(self,
                                 ebins=ebins,
                                 czbins=czbins,
                                 reco_vbwkde_evts_file=reco_vbwkde_evts_file,
                                 reco_vbwkde_make_plots=reco_vbwkde_make_plots,
                                 **kwargs)
Пример #6
0
    def __init__(self, ebins, czbins, reco_vbwkde_evts_file,
                 reco_vbwkde_make_plots=False, **kwargs):
        """Initializtion

        Parameters
        ----------
        ebins : sequence
            Neutrino energy histogram bin edges

        czbins : sequence
            Cosine-of-zenith histogram bin edges

        reco_vbwkde_evts_file : str or dict
            Resource location of HDF5 file containing event reconstruction
            information for each of the neutrino flavors and interaction types.
            If an HDF5 file name is specified, the method utils.hdf.from_hdf
            converts the contents to a nested dictionary. With either type of
            input, the dictionary must have the form
              eventsdict[flav][int_type][{true|reco}_{energy|coszen}] =
                  np.array([...], dtype=float64)
            where each array of the same flav and int_type must be of the
            same length.


        """
        self.kernels = None
        self.reco_events_hash = ''
        self.duplicate_nu_bar_cc = False
        self.duplicate_nc = False

        self.MIN_NUM_EVENTS = 100
        self.TGT_NUM_EVENTS = 300
        self.EPSILON = 1e-10
        self.ENERGY_RANGE = [0, 501]

        RecoServiceBase.__init__(self, ebins=ebins, czbins=czbins,
                                 reco_vbwkde_evts_file=reco_vbwkde_evts_file,
                                 reco_vbwkde_make_plots=reco_vbwkde_make_plots,
                                 **kwargs)
Пример #7
0
    def __init__(self, ebins, czbins, reco_param_file=None, **kwargs):
        """
        Parameters needed to instantiate a reconstruction service with
        parametrizations:
        * ebins: Energy bin edges
        * czbins: cos(zenith) bin edges
        * reco_param_file: JSON containing the parametrizations
        """

        # Load parametrization
        logging.info('Opening reconstruction parametrization file %s'
                     %reco_param_file)

        # Needed for self.read_param_string()
        self.ebins = ebins
        self.czbins = czbins

        # Get parametrization
        param_str = from_json(find_resource(reco_param_file))
        self.parametrization = self.read_param_string(param_str)

        # No **kwargs, so stored kernels will always have reco scales 1.0
        RecoServiceBase.__init__(self, ebins, czbins,**kwargs)
Пример #8
0
    def __init__(self, ebins, czbins, reco_param_file=None, **kwargs):
        """
        Parameters needed to instantiate a reconstruction service with
        parametrizations:
        * ebins: Energy bin edges
        * czbins: cos(zenith) bin edges
        * reco_param_file: JSON containing the parametrizations
        """

        # Load parametrization
        logging.info('Opening reconstruction parametrization file %s' %
                     reco_param_file)

        # Needed for self.read_param_string()
        self.ebins = ebins
        self.czbins = czbins

        # Get parametrization
        param_str = from_json(find_resource(reco_param_file))
        self.parametrization = self.read_param_string(param_str)

        # No **kwargs, so stored kernels will always have reco scales 1.0
        RecoServiceBase.__init__(self, ebins, czbins, **kwargs)