Returns the direct band gap.

        Returns:
             the value of the direct band gap
352816
def get_direct_band_gap(self):
        
        if self.is_metal():
            return 0.0
        dg = self.get_direct_band_gap_dict()
        return min(v['value'] for v in dg.values())
896948
def bandwidth(self):
    """"""
    return np.abs(np.diff(self.pairs(), axis=1)).max()
1302138
def selected_band(self):
        
        item = self.lstBands.currentItem()
        return item.data(QtCore.Qt.UserRole)
937338
def _calculate_gap(self, X: Union[pd.DataFrame, np.ndarray], n_refs: int, n_clusters: int) -> Tuple[float, int]:
        
        # Holder for reference dispersion results
        ref_dispersions = np.zeros(n_refs)  # type: np.ndarray

        # For n_references, generate random sample and perform kmeans getting resulting dispersion of each loop
        for i in range(n_refs):

            # Create new random reference set
            random_data = np.random.random_sample(size=X.shape)  # type: np.ndarray

            # Fit to it, getting the centroids and labels, and add to accumulated reference dispersions array.
            centroids, labels = kmeans2(data=random_data,
                                        k=n_clusters,
                                        iter=10,
                                        minit='points')  # type: Tuple[np.ndarray, np.ndarray]
            dispersion = self._calculate_dispersion(X=random_data, labels=labels, centroids=centroids)  # type: float
            ref_dispersions[i] = dispersion

        # Fit cluster to original data and create dispersion calc.
        centroids, labels = kmeans2(data=X, k=n_clusters, iter=10, minit='points')
        dispersion = self._calculate_dispersion(X=X, labels=labels, centroids=centroids)

        # Calculate gap statistic
        gap_value = np.mean(np.log(ref_dispersions)) - np.log(dispersion)

        return gap_value, int(n_clusters)
1150014
public float getBand(int band)
	{
		float eq = 0.0f;
		
		if ((band>=0) && (band<BANDS))
		{
			eq = settings[band];
		}
		
		return eq;
	}
945217
def _l2rgb(self, mode):
        
        self._check_modes(("L", "LA"))

        bands = ["L"] * 3
        if mode[-1] == "A":
            bands.append("A")
        data = self.data.sel(bands=bands)
        data["bands"] = list(mode)
        return data
1216247
def get_all_bandwidth_groups(self):
        
        bandwidth_groups = self._call("getAllBandwidthGroups")
        bandwidth_groups = [IBandwidthGroup(a) for a in bandwidth_groups]
        return bandwidth_groups
395281
def gap_sizes(self):
         
        if not self._gap_sizes:
            gap_file = self.props["gaps"]["gaps"]
            self._gap_sizes = {}
            with open(gap_file) as f:
                for line in f:
                    chrom, start, end = line.strip().split("\t")
                    start, end = int(start), int(end)
                    self._gap_sizes[chrom] = self._gap_sizes.get(chrom, 0) + end - start
        return self._gap_sizes
32495
def _get_solarflux(self):
        
        solar_spectrum = \
            SolarIrradianceSpectrum(TOTAL_IRRADIANCE_SPECTRUM_2000ASTM,
                                    dlambda=0.0005,
                                    wavespace=self.wavespace)
        self.solar_flux = solar_spectrum.inband_solarflux(self.rsr[self.bandname])
879773
def getMatrix(self):
        
        if self.mflag:
            m0 = 9.10938215e-31
            e0 = 1.602176487e-19
            c0 = 299792458.0
            rho = np.sqrt(self.gamma ** 2 - 1) * m0 * c0 / self.bend_field / e0
            theta = np.arcsin(self.bend_length / rho)
            self.bangle = theta

            m_rb_1 = transRbend(theta, rho, self.gamma, -1)
            m_rb_2 = transRbend(-theta, -rho, self.gamma, 1)
            m_rb_3 = transRbend(-theta, -rho, self.gamma, -1)
            m_rb_4 = transRbend(theta, rho, self.gamma, 1)
            m_df_12 = transDrift(self.dflist[0], self.gamma)
            m_df_23 = transDrift(self.dflist[1], self.gamma)
            m_df_34 = transDrift(self.dflist[2], self.gamma)

            self.transM = reduce(np.dot, [m_rb_1, m_df_12, m_rb_2, m_df_23, m_rb_3, m_df_34, m_rb_4])

            return self.transM
536187
def get(self):
        
        x = self.coords('cross_v')[0]
        y = self.coords('cross_h')[1]
        xp = min(x, self.bg.width() - 1)
        yp = min(y, self.bg.height() - 1)
        try:
            r, g, b = self.bg.get(round2(xp), round2(yp))
        except ValueError:
            r, g, b = self.bg.get(round2(xp), round2(yp)).split()
            r, g, b = int(r), int(g), int(b)
        hexa = rgb_to_hexa(r, g, b)
        h = self.get_hue()
        s = round2((1 - float(y) / self.winfo_height()) * 100)
        v = round2(100 * float(x) / self.winfo_width())
        return (r, g, b), (h, s, v), hexa
781914
def get_bandstructure(self):
        

        return LobsterBandStructureSymmLine(kpoints=self.kpoints_array, eigenvals=self.eigenvals, lattice=self.lattice,
                                            efermi=self.efermi, labels_dict=self.label_dict,
                                            structure=self.structure,
                                            projections=self.p_eigenvals)
1176731
def reduce(self, op):
        
        per_band = [getattr(np.ma, op)(self.image.data[band, np.ma.getmaskarray(self.image)[band, :, :] == np.False_])
                    for band in range(self.num_bands)]
        return per_band
399115
def saturation_mask(self, band, value=255):
        
        dn = self._get_band('b{}'.format(band))
        mask = self.mask()
        mask = where((dn == value) & (mask > 0), True, False)

        return mask
1189253
def getvalue(self):
		
		bitset = [0] * self.width
		zero = [1] * self.width

		for shift in range(self.width):
			bitset[shift] = (self._value & (1 << shift)) >> shift
		sign = 0
		if((not bitset[-1]) and self._sign):
			bitset[-1] = 1
			sign = 1
		elif(bitset[-1]):
			bitset = bitsetxor(bitset, zero)
			sign = 1
		
		value = [ bitset[shift] << shift for shift in range(self.width - 1)]
		value = sum(value)
		if(sign):
			return -1 * value
		return value
1119877
def dmag(self, band):
        
        m1 = self.stars['{}_mag_A'.format(band)]
        m2 = addmags(self.stars['{}_mag_B'.format(band)],
                     self.stars['{}_mag_C'.format(band)])
        return np.abs(m2-m1)
134224
def _log_band_gap_information(bs):
    
    bg_data = bs.get_band_gap()
    if not bg_data['direct']:
        logging.info('Indirect band gap: {:.3f} eV'.format(bg_data['energy']))

    direct_data = bs.get_direct_band_gap_dict()
    if bs.is_spin_polarized:
        direct_bg = min((spin_data['value']
                         for spin_data in direct_data.values()))
        logging.info('Direct band gap: {:.3f} eV'.format(direct_bg))

        for spin, spin_data in direct_data.items():
            direct_kindex = spin_data['kpoint_index']
            direct_kpoint = bs.kpoints[direct_kindex].frac_coords
            direct_kpoint = kpt_str.format(k=direct_kpoint)
            eq_kpoints = bs.get_equivalent_kpoints(direct_kindex)
            k_indices = ', '.join(map(str, eq_kpoints))

            # add 1 to band indices to be consistent with VASP band numbers.
            b_indices = ', '.join([str(i+1) for i in spin_data['band_indices']])

            logging.info('  {}:'.format(spin.name.capitalize()))
            logging.info('    k-point: {}'.format(direct_kpoint))
            logging.info('    k-point indices: {}'.format(k_indices))
            logging.info('    Band indices: {}'.format(b_indices))

    else:
        direct_bg = direct_data[Spin.up]['value']
        logging.info('Direct band gap: {:.3f} eV'.format(direct_bg))

        direct_kindex = direct_data[Spin.up]['kpoint_index']
        direct_kpoint = kpt_str.format(k=bs.kpoints[direct_kindex].frac_coords)
        k_indices = ', '.join(map(str,
                                  bs.get_equivalent_kpoints(direct_kindex)))
        b_indices = ', '.join([str(i+1) for i in
                               direct_data[Spin.up]['band_indices']])

        logging.info('  k-point: {}'.format(direct_kpoint))
        logging.info('  k-point indices: {}'.format(k_indices))
        logging.info('  Band indices: {}'.format(b_indices))