コード例 #1
0
    def __init__(self, *args, **kwargs):
        TransformationBundle.__init__(self, *args, **kwargs)
        self.check_nidx_dim(0, 0)

        # check that order is sane
        if not self.cfg.order in [0, 1]:
            raise Exception("Unsupported ibe order {} (should be 0 or 1)".format(self.cfg.order))
コード例 #2
0
ファイル: reactor_anu_spectra_v06.py プロジェクト: gnafit/gna
    def __init__(self, *args, **kwargs):
        TransformationBundle.__init__(self, *args, **kwargs)
        self.check_nidx_dim(1, 1, 'major')
        self.check_nidx_dim(0, 0, 'minor')

        self.shared = NestedDict()  # TODO: remove
        self.load_data()
コード例 #3
0
    def __init__(self, *args, **kwargs):
        TransformationBundle.__init__(self, *args, **kwargs)
        self.check_nidx_dim(0, 1, 'major')

        paroptnames = 'parname', 'scale', 'ndiag'
        paropts = (s in self.cfg for s in paroptnames)
        if any(paropts) and not all(paropts):
            self.exception('Not all options are specified. Need: {!s}'.format(
                paroptnames))
コード例 #4
0
ファイル: oscprob_v02.py プロジェクト: gnafit/gna
    def __init__(self, *args, **kwargs):
        TransformationBundle.__init__(self, *args, **kwargs)
        self.check_nidx_dim(3, 3, 'major')
        self.check_nidx_dim(0, 0, 'minor')

        try:
            source_name, detector_name, component_name = self.cfg.bundle.major
        except:
            raise Exception('Unable to obtain major indices: source, detector and OP component')
        self.idx_source = self.nidx_major.get_subset(source_name)
        self.idx_detector = self.nidx_major.get_subset(detector_name)
        self.idx_component = self.nidx_major.get_subset(component_name)
コード例 #5
0
    def __init__(self, *args, **kwargs):
        TransformationBundle.__init__(self, *args, **kwargs)
        self.check_nidx_dim(2, 2, 'major')

        try:
            detector_name, component_name = self.cfg.bundle.major
        except:
            raise Exception(
                'Unable to obtain major indices: detector and component')
        self.detector_idx = self.nidx_major.get_subset(detector_name)
        self.component_idx = self.nidx_major.get_subset(component_name)

        self.storage = NestedDict()
コード例 #6
0
    def __init__(self, *args, **kwargs):
        '''Initialize reactor information such as daily ratios of actual
        thermal power to nominal, fission fractions per core.
        Cores are provided by caller through indices.
        Info is read from npz file.
        '''
        TransformationBundle.__init__(self, *args, **kwargs)
        self.check_nidx_dim(2, 2, 'major')
        self.check_nidx_dim(0, 0, 'minor')

        self.nidx_reactor = self.nidx.get_subset(self.bundlecfg.major[0])
        self.nidx_isotope = self.nidx.get_subset(self.bundlecfg.major[1])

        self.init_data()
コード例 #7
0
    def __init__(self, *args, **kwargs):
        TransformationBundle.__init__(self, *args, **kwargs)
        self.check_nidx_dim(2, 2, 'major')
        self.check_nidx_dim(0, 0, 'minor')
        self.unc_ns = self.namespace(self.cfg.ns_name)

        self.uncorrelated_vars = defaultdict(dict)
        self.correlated_vars = defaultdict(dict)
        self.total_unc = defaultdict(dict)
        self.objects = defaultdict(dict)

        self._dtype = [('enu', 'd'), ('unc', 'd')]
        self.load_data()
        self._enu_to_bins()
コード例 #8
0
    def __init__(self, *args, **kwargs):
        TransformationBundle.__init__(self, *args, **kwargs)
        self.check_nidx_dim(2, 2, 'major')

        try:
            source_name, detector_name = self.cfg.bundle.major
        except:
            raise Exception(
                'Unable to obtain major indices: source, detector and OP component'
            )

        self.idx_source = self.nidx_major.get_subset(source_name)
        self.idx_detector = self.nidx_major.get_subset(detector_name)

        if not 'density' in self.cfg:
            raise Exception('Density is not provided')
コード例 #9
0
    def __init__(self, *args, **kwargs):
        TransformationBundle.__init__(self, *args, **kwargs)
        self.check_nidx_dim(1, 1, 'major')

        if len(self.cfg.bundle.major) == 2:
            detector_name, component_name = self.cfg.bundle.major
            self.detector_idx = self.nidx_major.get_subset(detector_name)
            self.component_idx = self.nidx_major.get_subset(component_name)
        elif len(self.cfg.bundle.major) == 1:
            component_name = self.cfg.bundle.major
            self.detector_idx = self.nidx_major.get_subset([])
            self.component_idx = self.nidx_major.get_subset(component_name)
        else:
            raise self._exception(
                'Unable to obtain major indices: detector and component')

        self.storage = NestedDict()
コード例 #10
0
    def __init__(self, *args, **kwargs):
        TransformationBundle.__init__(self, *args, **kwargs)
        self.check_nidx_dim(3, 3, 'major')

        try:
            source_name, detector_name, component_name = self.cfg.bundle.major
        except:
            raise Exception(
                'Unable to obtain major indices: source, detector and OP component'
            )
        self.idx_source = self.nidx_major.get_subset(source_name)
        self.idx_detector = self.nidx_major.get_subset(detector_name)
        self.idx_component = self.nidx_major.get_subset(component_name)

        assert 'dm' in self.cfg, "Expect 'dm' option"
        assert self.cfg.dm in ('23',
                               'ee'), "Expect 'dm' option to be '23', or 'ee'"
コード例 #11
0
    def __init__(self, *args, **kwargs):
        TransformationBundle.__init__(self, *args, **kwargs)
        self.check_nidx_dim(0, 0, 'major')

        self.storage = NestedDict()
コード例 #12
0
 def __init__(self, *args, **kwargs):
     TransformationBundle.__init__(self, *args, **kwargs)
     self.check_nidx_dim(0, 0, 'major')
コード例 #13
0
ファイル: conditional_product_v01.py プロジェクト: gnafit/gna
    def __init__(self, *args, **kwargs):
        TransformationBundle.__init__(self, *args, **kwargs)
        self.check_nidx_dim(0, 0, 'major')

        self.varname = self.get_globalname('condition')
コード例 #14
0
 def __init__(self, *args, **kwargs):
     TransformationBundle.__init__(self, *args, **kwargs)
     self.check_cfg()
コード例 #15
0
 def __init__(self, *args, **kwargs):
     TransformationBundle.__init__(self, *args, **kwargs)
     self.objects = NestedDict()
コード例 #16
0
 def __init__(self, *args, **kwargs):
     TransformationBundle.__init__(self, *args, **kwargs)
     self.check_nidx_dim(1, 1, 'both')
コード例 #17
0
    def __init__(self, *args, **kwargs):
        TransformationBundle.__init__(self, *args, **kwargs)
        self.check_nidx_dim(0, 1, 'major')
        self.check_nidx_dim(0, 0, 'minor')

        self.groups = Categories(self.cfg.get('groups', {}), recursive=True)