Obtain the chisq bins for this template and PSD.
327236
def calculate_chisq_bins(self, template, psd):
        
        num_bins = int(self.parse_option(template, self.num_bins))
        if hasattr(psd, 'sigmasq_vec') and \
                                       template.approximant in psd.sigmasq_vec:
            kmin = int(template.f_lower / psd.delta_f)
            kmax = template.end_idx
            bins = power_chisq_bins_from_sigmasq_series(
                   psd.sigmasq_vec[template.approximant], num_bins, kmin, kmax)
        else:
            bins = power_chisq_bins(template, num_bins, psd, template.f_lower)
        return bins
171772
def _get_template_dirs(type="plugin"):
    
    template_dirs = [
        os.path.expanduser(os.path.join(USER_CONFIG_DIR, "templates", type)),
        os.path.join("rapport", "templates", type)  # Local dev tree
    ]
    return template_dirs
231856
def get_templates(load_all=True, **kwargs):
    
    if load_all is False:
        templates = db.DBSession.query(Template).all()
    else:
        templates = db.DBSession.query(Template).options(joinedload_all('templatetypes.typeattrs')).all()

    return templates
1247329
def get_distbins(start=100, bins=2500, ratio=1.01):
    
    b = np.ones(bins, dtype="float64")
    b[0] = 100
    for i in range(1, bins):
        b[i] = b[i - 1] * ratio
    bins = np.around(b).astype(dtype="int")
    binsizes = np.diff(bins)
    return bins, binsizes
1255208
def get_bins(self):
        
        if self.retrieved:
            raise errors.IllegalState('List has already been retrieved.')
        self.retrieved = True
        return objects.BinList(self._results, runtime=self._runtime)
380754
def get_bin(self):
        
        if self._lookup_session is None:
            mgr = get_provider_manager('RESOURCE', runtime=self._runtime, proxy=self._proxy)
            self._lookup_session = mgr.get_bin_lookup_session(proxy=getattr(self, "_proxy", None))
        return self._lookup_session.get_bin(Id(self._my_map['id']))
571719
def get_desc2nts(self, **kws_usr):
        """"""
        # desc2nts contains: (sections hdrgo_prt sortobj) or (flat hdrgo_prt sortobj)
        # keys_nts: hdrgo_prt section_prt top_n use_sections
        kws_nts = {k:v for k, v in kws_usr.items() if k in self.keys_nts}
        return self.get_desc2nts_fnc(**kws_nts)
1074996
def get_rotations(self):
        """"""
        if self.centrosymmetric:
            return np.vstack((self.rotations, -self.rotations))
        else:
            return self.rotations
1167691
def get_families(self):
        """"""
        # Implemented from kitosid template for -
        # osid.resource.BinLookupSession.get_bins_template
        catalogs = self._get_provider_session('family_lookup_session').get_families()
        cat_list = []
        for cat in catalogs:
            cat_list.append(Family(self._provider_manager, cat, self._runtime, self._proxy))
        return FamilyList(cat_list)
1026923
def _get_template_dirs():
    """"""
    return filter(lambda x: os.path.exists(x), [
        # user dir
        os.path.join(os.path.expanduser('~'), '.py2pack', 'templates'),
        # system wide dir
        os.path.join('/', 'usr', 'share', 'py2pack', 'templates'),
        # usually inside the site-packages dir
        os.path.join(os.path.dirname(os.path.abspath(__file__)), 'templates'),
    ])
211572
def _fetch_templates(src):
    '''
    
    '''
    templates = []
    log.debug('Listing contents of %s', src)
    for item in os.listdir(src):
        s = os.path.join(src, item)
        if os.path.isdir(s):
            template_path = os.path.join(s, TEMPLATE_FILE_NAME)
            if os.path.isfile(template_path):
                templates.append(_get_template(template_path, item))
            else:
                log.debug("Directory does not contain %s %s", template_path,
                          TEMPLATE_FILE_NAME)
    return templates
64531
def get_idxs(exprs):
    
    idxs = set()
    for expr in (exprs):
        for i in expr.find(sympy.Idx):
            idxs.add(i)
    return sorted(idxs, key=str)
1048018
def get_logs(self):
        """"""
        # Implemented from kitosid template for -
        # osid.resource.BinLookupSession.get_bins_template
        catalogs = self._get_provider_session('log_lookup_session').get_logs()
        cat_list = []
        for cat in catalogs:
            cat_list.append(Log(self._provider_manager, cat, self._runtime, self._proxy))
        return LogList(cat_list)
425358
def get_model(LAB_DIR):
    
    coeffs = np.load("%s/coeffs.npz" %LAB_DIR)['arr_0']
    scatters = np.load("%s/scatters.npz" %LAB_DIR)['arr_0']
    chisqs = np.load("%s/chisqs.npz" %LAB_DIR)['arr_0']
    pivots = np.load("%s/pivots.npz" %LAB_DIR)['arr_0']
    return coeffs, scatters, chisqs, pivots
1307921
def get_parent_bin_nodes(self):
        
        parent_bin_nodes = []
        for node in self._my_map['parentNodes']:
            parent_bin_nodes.append(BinNode(
                node._my_map,
                runtime=self._runtime,
                proxy=self._proxy,
                lookup_session=self._lookup_session))
        return BinNodeList(parent_bin_nodes)
1153727
def pss(self):
        """"""
        return (self.table[0, 0] * self.table[1, 1] - self.table[0, 1] * self.table[1, 0]) / \
               ((self.table[0, 0] + self.table[1, 0]) * (self.table[0, 1] + self.table[1, 1]))
626002
def get_banks_by_item(self, *args, **kwargs):
        """"""
        # Implemented from kitosid template for -
        # osid.resource.ResourceBinSession.get_bins_by_resource
        catalogs = self._get_provider_session('item_bank_session').get_banks_by_item(*args, **kwargs)
        cat_list = []
        for cat in catalogs:
            cat_list.append(Bank(self._provider_manager, cat, self._runtime, self._proxy))
        return BankList(cat_list)