Returns the light-hole band effective mass in the [110] direction,
        meff_lh_110, in units of electron mass.
489858
def meff_lh_110(self, **kwargs):
        '''
        
        '''
        return 2. / (2 * self.luttinger1(**kwargs) + self.luttinger2(**kwargs)
                + 3 * self.luttinger3(**kwargs))
1063341
def mjd2gmst(mjd):
    """"""
    
    D2PI= 6.2831853071795864769252867665590057683943387987502
    DS2R= 7.2722052166430399038487115353692196393452995355905e-5
    
    tu = (mjd-51544.5)/36525.0;
    
    st = fmod(mjd,1.0) * D2PI + ( 24110.54841 + ( 8640184.812866 + ( 0.093104 - 6.2e-6 * tu ) * tu ) * tu ) * DS2R 
    
    w = fmod(st,D2PI)
    if w >= 0.0 :
        return w
    else:
        return w+D2PI
465470
def spin2x_from_mass1_mass2_xi2_phi_a_phi_s(mass1, mass2, xi2, phi_a, phi_s):
    
    chi_perp = chi_perp_from_mass1_mass2_xi2(mass1, mass2, xi2)
    phi2 = phi2_from_phi_a_phi_s(phi_a, phi_s)
    return chi_perp * numpy.cos(phi2)
573821
def _get_em(length):
        '''
        
        '''
        m = CssParse.RE_UNIT.search(length)
        value = float(m.group(1))
        unit = m.group(2)

        if unit not in ('em', 'qem', 'rem'):
            return int(round(value/8))
        else:
            return int(round(value))
45593
def optical_absorption_coeff(self):
        
        if self.dielectric_data["density"]:
            real_avg = [sum(self.dielectric_data["density"][1][i][0:3]) / 3
                        for i in range(len(self.dielectric_data["density"][0]))]
            imag_avg = [sum(self.dielectric_data["density"][2][i][0:3]) / 3
                        for i in range(len(self.dielectric_data["density"][0]))]

            def f(freq, real, imag):
                """
                The optical absorption coefficient calculated in terms of
                equation
                """
                hbar = 6.582119514e-16  # eV/K
                coeff = np.sqrt(
                    np.sqrt(real ** 2 + imag ** 2) - real) * \
                        np.sqrt(2) / hbar * freq
                return coeff

            absorption_coeff = [f(freq, real, imag) for freq, real, imag in
                                zip(self.dielectric_data["density"][0],
                                    real_avg, imag_avg)]
        return absorption_coeff
328003
def mw(mol, ndigits=2):
    
    mol.require("Valence")
    return round(sum(a.mw() for _, a in mol.atoms_iter()), ndigits)
937689
def mass_tot(self, rho0, Ra, Rs):
        
        Ra, Rs = self._sort_ra_rs(Ra, Rs)
        sigma0 = self.rho2sigma(rho0, Ra, Rs)
        m_tot = 2 * np.pi * sigma0 * Ra * Rs
        return m_tot
951553
public MDecimal getMMHg() {
		MDecimal result = new MDecimal(currentUnit.getConverterTo(
				MILLIMETER_OF_MERCURY).convert(doubleValue()));
		logger.trace(MMarker.GETTER,
				"Converting from {} to millimetres of Mecrcury : {}",
				currentUnit, result);
		return result;
	}
184552
function calculateLux(data)
{
	// Get 16 bit value from data buffer in little endian format.
	var value = data.getUint16(0, true)

	// Extraction of luxometer value, based on sfloatExp2ToDouble
	// from BLEUtility.m in Texas Instruments TI BLE SensorTag
	// iOS app source code.
	var mantissa = value & 0x0FFF
	var exponent = value >> 12

	var magnitude = Math.pow(2, exponent)
	var output = (mantissa * magnitude)

	var lux = output / 100.0

	// Return result.
	return lux
}
662750
def freq_units(units):
    

    d = {"thz": FreqUnits(1, "THz"),
         "ev": FreqUnits(const.value("hertz-electron volt relationship") * const.tera, "eV"),
         "mev": FreqUnits(const.value("hertz-electron volt relationship") * const.tera / const.milli, "meV"),
         "ha": FreqUnits(const.value("hertz-hartree relationship") * const.tera, "Ha"),
         "cm-1": FreqUnits(const.value("hertz-inverse meter relationship") * const.tera * const.centi, "cm^{-1}"),
         'cm^-1': FreqUnits(const.value("hertz-inverse meter relationship") * const.tera * const.centi, "cm^{-1}")
         }
    try:
        return d[units.lower().strip()]
    except KeyError:
        raise KeyError('Value for units `{}` unknown\nPossible values are:\n {}'.format(units, list(d.keys())))
1263278
def get_as(self, key, units='pt'):
        
        dpi = 72
        size = self.element.properties.get('size', 0)
        value = self[key]

        functions = {
            'pt-lines': lambda x: x/size,
            'pt-in': lambda x: x/dpi,
            'lines-pt': lambda x: x*size,
            'lines-in': lambda x: x*size/dpi,
            'in-pt': lambda x: x*dpi,
            'in-lines': lambda x: x*dpi/size
        }

        if self['units'] != units:
            conversion = '{}-{}'.format(self['units'], units)
            try:
                value = functions[conversion](value)
            except ZeroDivisionError:
                value = 0

        return value
615585
def determine_coefficient
      # Array of photon energies (in units of MeV).
      @energies = [
        0.001,
        0.0015,
        0.002,
        0.003,
        0.004,
        0.005,
        0.006,
        0.008,
        0.01,
        0.015,
        0.02,
        0.03,
        0.04,
        0.05,
        0.06,
        0.08,
        0.1,
        0.15,
        0.2,
        0.3,
        0.4,
        0.5,
        0.6,
        0.8,
        1.0,
        1.25,
        1.5,
        2.0,
        3.0,
        4.0,
        5.0,
        6.0,
        8.0,
        10.0,
        15.0,
        20.0
      ]
      # Array of mass attenuation coefficients for the above energies, for liquid water (in units of cm^2/g):
      @att_coeffs = [
        4078,
        1376,
        617.3,
        192.9,
        82.78,
        42.58,
        24.64,
        10.37,
        5.329,
        1.673,
        0.8096,
        0.3756,
        0.2683,
        0.2269,
        0.2059,
        0.1837,
        0.1707,
        0.1505,
        0.137,
        0.1186,
        0.1061,
        0.09687,
        0.08956,
        0.07865,
        0.07072,
        0.06323,
        0.05754,
        0.04942,
        0.03969,
        0.03403,
        0.03031,
        0.0277,
        0.02429,
        0.02219,
        0.01941,
        0.01813
      ]
      # Determine the coefficient:
      if @energy >= 20.0
        # When the energy is above 20, we use the coefficient for 20 MeV:
        @ac_water = @att_coeffs.last
      else
        if i = @energies.index(@energy)
          # When it exactly matches one of the listed energies, use its corresponding coefficient:
          @ac_water = @att_coeffs[i]
        else
          # When the given energy is between two of the listed values, interpolate:
          i_after = @energies.index {|x| x > @energy}
          if i_after
            e_high = @energies[i_after]
            e_low = @energies[i_after - 1]
            ac_high = @att_coeffs[i_after]
            ac_low = @att_coeffs[i_after - 1]
            @ac_water = (ac_high - ac_low ) / (e_high - e_low) * (@energy - e_low)
          else
            raise "Unexpected behaviour with index in the energy interpolation logic."
          end
        end
      end
    end
92819
def mass_2d_lens(self, r, sigma0, Rs):
        
        X = r/Rs
        alpha_r = 2*sigma0 * Rs * X * (1-self._F(X)) / (X**2-1)
        mass_2d = alpha_r * r * np.pi
        return mass_2d
509497
protected int effectiveBandSize(final int dim1, final int dim2) {
    if(bandSize == Double.POSITIVE_INFINITY) {
      return (dim1 > dim2) ? dim1 : dim2;
    }
    if(bandSize >= 1.) {
      return (int) bandSize;
    }
    // Max * bandSize:
    return (int) Math.ceil((dim1 >= dim2 ? dim1 : dim2) * bandSize);
  }
1123070
def get_effective_wavelength(self, bandname):
        """"""
        try:
            rsr = RelativeSpectralResponse(self.platform_name, self.sensor)
        except(IOError, OSError):
            LOG.exception(
                "No spectral responses for this platform and sensor: %s %s", self.platform_name, self.sensor)
            if isinstance(bandname, (float, integer_types)):
                LOG.warning(
                    "Effective wavelength is set to the requested band wavelength = %f", bandname)
                return bandname

            msg = ("Can't get effective wavelength for band %s on platform %s and sensor %s" %
                   (str(bandname), self.platform_name, self.sensor))
            raise KeyError(msg)

        if isinstance(bandname, str):
            bandname = BANDNAMES.get(self.sensor, BANDNAMES['generic']).get(bandname, bandname)
        elif isinstance(bandname, (float, integer_types)):
            if not(0.4 < bandname < 0.8):
                raise BandFrequencyOutOfRange(
                    'Requested band frequency should be between 0.4 and 0.8 microns!')
            bandname = get_bandname_from_wavelength(self.sensor, bandname, rsr.rsr)

        wvl, resp = rsr.rsr[bandname][
            'det-1']['wavelength'], rsr.rsr[bandname]['det-1']['response']

        cwvl = get_central_wave(wvl, resp, weight=1. / wvl**4)
        LOG.debug("Band name: %s  Effective wavelength: %f", bandname, cwvl)

        return cwvl
1252808
def meff_hh_110(self, **kwargs):
        '''
        
        '''
        return 2. / (2 * self.luttinger1(**kwargs) - self.luttinger2(**kwargs)
                - 3 * self.luttinger3(**kwargs))
129572
def mass_2d(self, r, rho0, Rs):
        

        sigma0 = self.rho2sigma(rho0, Rs)
        return self.mass_2d_lens(r, sigma0, Rs)