Wrapper around phot which only returns the computed magnitude directly.
480328
def phot_mag(*args, **kwargs):
    """"""
    try:
        return phot(*args, **kwargs)
    except IndexError:
        raise TaskError("No photometric records returned for {0}".format(kwargs))
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
}
116845
def asFloat(self, maxval=1.0):
        

        x,y,pixels,info = self.asDirect()
        sourcemaxval = 2**info['bitdepth']-1
        del info['bitdepth']
        info['maxval'] = float(maxval)
        factor = float(maxval)/float(sourcemaxval)
        def iterfloat():
            for row in pixels:
                yield map(factor.__mul__, row)
        return x,y,iterfloat(),info
261484
def random(magnitude=1):
        
        theta = random.uniform(0, 2 * math.pi)
        return magnitude * Vector(math.cos(theta), math.sin(theta))
827602
def _get_magnitude_term(self, C, mag):
        
        if mag >= self.CONSTS["Mh"]:
            return C["e1"] + C["b3"] * (mag - self.CONSTS["Mh"])
        else:
            return C["e1"] + (C["b1"] * (mag - self.CONSTS["Mh"])) +\
                (C["b2"] * (mag - self.CONSTS["Mh"]) ** 2.)
354935
def _get_magnitude_term(self, C, mag):
        
        lny = C['C1'] + (C['C3'] * ((8.5 - mag) ** 2.))
        if mag > 6.3:
            return lny + (-C['H'] * C['C5']) * (mag - 6.3)
        else:
            return lny + C['C2'] * (mag - 6.3)
646925
def _compute_magnitude(self, rup, C):
        
        m_h = 6.75
        b_3 = 0.0
        if rup.mag <= m_h:
            return C["e1"] + (C['b1'] * (rup.mag - m_h)) +\
                (C['b2'] * (rup.mag - m_h) ** 2)
        else:
            return C["e1"] + (b_3 * (rup.mag - m_h))
1031076
def _get_distance_scaling(self, C, mag, rhypo):
        
        return (C["a3"] * np.log(rhypo)) + (C["a4"] + C["a5"] * mag) * rhypo
329972
def absolute(self):
        
        da = distob.vectorize(np.absolute)(self)
        return _dts_from_da(da, self.tspan, self.labels)
535571
def get_scaled(self, magnitude):
        
        result = self.copy()
        result.scale(magnitude)
        return result
542303
def point_to_t(self, point):
        """"""

        # Single-precision floats have only 7 significant figures of
        # resolution, so test that we're within 6 sig figs.
        if np.isclose(point, self.start, rtol=0, atol=1e-6):
            return 0.0
        elif np.isclose(point, self.end, rtol=0, atol=1e-6):
            return 1.0

        # Finding the point "by hand" here is much faster than calling
        # radialrange(), see the discussion on PR #40:
        # https://github.com/mathandy/svgpathtools/pull/40#issuecomment-358134261

        p = self.poly()
        # p(t) = (p_1 * t) + p_0 = point
        # t = (point - p_0) / p_1
        t = (point - p[0]) / p[1]
        if np.isclose(t.imag, 0) and (t.real >= 0.0) and (t.real <= 1.0):
            return t.real
        return None
939576
def _get_magnitude_scaling(self, C, mag):
        
        if mag < self.CONSTANTS["mh"]:
            return C["e1"] + C["b1"] * (mag - self.CONSTANTS["mref"]) +\
                C["b2"] * ((mag - self.CONSTANTS["mref"]) ** 2.)
        else:
            d_m = self.CONSTANTS["mh"] - self.CONSTANTS["mref"]
            return C["e1"] + C["b3"] * (mag - self.CONSTANTS["mh"]) +\
                (C["b1"] * d_m) + C["b2"] * (d_m ** 2.)
1092105
def vector_magnitude(vector_in):
    
    sq_sum = 0.0
    for vin in vector_in:
        sq_sum += vin**2
    return math.sqrt(sq_sum)
586688
def LaplaceCentreWeight(self):
        """"""

        sz = [1,] * self.S.ndim
        for ax in self.axes:
            sz[ax] = self.S.shape[ax]
        lcw = 2*len(self.axes)*np.ones(sz, dtype=self.dtype)
        for ax in self.axes:
            lcw[(slice(None),)*ax + ([0, -1],)] -= 1.0
        return lcw
890859
def _compute_magnitude_scaling_term(self, C, mag):
        
        assert mag <= 8.5
        return C['c1'] + C['c2'] * mag + C['c3'] * (8.5 - mag) ** 2.5
1163969
def get_pvalue(self):
        """"""
        if self.method_flds:
            return getattr(self, "p_{m}".format(m=self.get_method_name()))
        return getattr(self, "p_uncorrected")
795457
def rdirichlet(theta, size=1):
    
    gammas = np.vstack([rgamma(theta, 1) for i in xrange(size)])
    if size > 1 and np.size(theta) > 1:
        return (gammas.T / gammas.sum(1))[:-1].T
    elif np.size(theta) > 1:
        return (gammas[0] / gammas[0].sum())[:-1]
    else:
        return 1.