Return the dark current for the WFC3 UVIS detector.  This value
        will be contained within an instrument specific keyword.

        Returns
        -------
        darkcurrent: float
            The dark current value with **units of electrons**.
762712
def getdarkcurrent(self,chip):
        
        darkcurrent = 0.

        try:
            darkcurrent = self._image[self.scienceExt, chip].header['MEANDARK']

        except:
            msg =  "#############################################\n"
            msg += "#                                           #\n"
            msg += "# Error:                                    #\n"
            msg += "#   Cannot find the value for 'MEANDARK'    #\n"
            msg += "#   in the image header.  WFC3 input images #\n"
            msg += "#   are expected to have this header        #\n"
            msg += "#   keyword.                                #\n"
            msg += "#                                           #\n"
            msg += "# Error occured in WFC3UVISInputImage class #\n"
            msg += "#                                           #\n"
            msg += "#############################################\n"
            raise ValueError(msg)

        return darkcurrent
851197
def lux_unit(self):
        """"""
        if CONST.UNIT_LUX in self._get_status(CONST.LUX_STATUS_KEY):
            return CONST.LUX
        return None
324490
def read(self):
        
        # Read value
        try:
            buf = os.read(self._fd, 8)
        except OSError as e:
            raise LEDError(e.errno, "Reading LED brightness: " + e.strerror)

        # Rewind
        try:
            os.lseek(self._fd, 0, os.SEEK_SET)
        except OSError as e:
            raise LEDError(e.errno, "Rewinding LED brightness: " + e.strerror)

        return int(buf)
630882
def contrast(self, value):
        
        assert(0x00 <= value <= 0xFF)
        self._contrast = value
        self._ws.ws2811_channel_t_brightness_set(self._channel, value)
        self._flush()
1067034
def uval(self):
        ""
        from .msmt import Uval
        return Uval.from_norm(self.value, self.uncert)
64946
def addDarkCurrent(self, slope, intercept=None, date=None, info='', error=None):
        '''
        
        '''
        date = _toDate(date)

        self._checkShape(slope)
        self._checkShape(intercept)

        d = self.coeffs['dark current']
        if intercept is None:
            data = slope
        else:
            data = (slope, intercept)
        d.insert(_insertDateIndex(date, d), [date, info, data, error])
742548
def _get_reference_band(self, data):
        
        nir = data[..., self.nir_idx].astype("float32")
        red = data[..., self.red_idx].astype("float32")
        return (nir - red) / (nir + red)
716062
def light(self):
        
        sun = self.chart.getObject(const.SUN)
        return light(self.obj, sun)
690113
def getChargingCurrent(self):
    """"""
    command = '$GG'
    currentAndVoltage = self.sendCommand(command)
    amps = float(currentAndVoltage[1])/1000
    return amps
683317
public static boolean isDarkTheme(Context context, boolean current) {
        return resolveBoolean(context, R.attr.mdtp_theme_dark, current);
    }
67474
def get_uvw_segment(d, segment=-1):
    

    # define times to read
    if segment != -1:
        assert 'segmenttimes' in d, 'd must have segmenttimes defined'

        t0 = d['segmenttimes'][segment][0]
        t1 = d['segmenttimes'][segment][1]
        datetime = qa.time(qa.quantity((t1+t0)/2, 'd'),
                           form=['ymdhms'], prec=9)[0]
        logger.debug('Calculating uvw for segment %d' % (segment))
    else:
        datetime = 0

    (u, v, w) = calc_uvw(d['filename'], d['scan'],
                         datetime=datetime, bdfdir=d['bdfdir'])

    # cast to units of lambda at first channel.
    # -1 keeps consistent with ms reading convention
    u = u * d['freq_orig'][0] * (1e9/3e8) * (-1)
    v = v * d['freq_orig'][0] * (1e9/3e8) * (-1)
    w = w * d['freq_orig'][0] * (1e9/3e8) * (-1)

    return u.astype('float32'), v.astype('float32'), w.astype('float32')
140404
public static int wavelengthToRGB(float wavelength) {
		float gamma = 0.80f;
		float r, g, b, factor;

		int w = (int)wavelength;
		if (w < 380) {
			r = 0.0f;
			g = 0.0f;
			b = 0.0f;
		} else if (w < 440) {
			r = -(wavelength - 440) / (440 - 380);
			g = 0.0f;
			b = 1.0f;
		} else if (w < 490) {
			r = 0.0f;
			g = (wavelength - 440) / (490 - 440);
			b = 1.0f;
		} else if (w < 510) {
			r = 0.0f;
			g = 1.0f;
			b = -(wavelength - 510) / (510 - 490);
		} else if (w < 580) {
			r = (wavelength - 510) / (580 - 510);
			g = 1.0f;
			b = 0.0f;
		} else if (w < 645) {
			r = 1.0f;
			g = -(wavelength - 645) / (645 - 580);
			b = 0.0f;
		} else if (w <= 780) {
			r = 1.0f;
			g = 0.0f;
			b = 0.0f;
		} else {
			r = 0.0f;
			g = 0.0f;
			b = 0.0f;
		}

		// Let the intensity fall off near the vision limits
		if (380 <= w && w <= 419)
			factor = 0.3f + 0.7f*(wavelength - 380) / (420 - 380);
		else if (420 <= w && w <= 700)
			factor = 1.0f;
		else if (701 <= w && w <= 780)
			factor = 0.3f + 0.7f*(780 - wavelength) / (780 - 700);
		else
			factor = 0.0f;

		int ir = adjust(r, factor, gamma);
		int ig = adjust(g, factor, gamma);
		int ib = adjust(b, factor, gamma);

		return 0xff000000 | (ir << 16) | (ig << 8) | ib;
	}
434618
def get_brightness_level(cls, percent):
        
        # Clamp to appropriate range.
        percent = min(100, max(0, percent))

        # Map 0-100 to 2-27
        value = int(2 + ((float(percent) / 100) * 25))
        return percent, value
326435
def display_current(self):
        """"""
        if self.idx_current in self.scene.items():
            self.scene.removeItem(self.idx_current)

        item = QGraphicsRectItem(0,
                                 CURR['pos0'],
                                 self.parent.value('window_length'),
                                 CURR['pos1'])
        # it's necessary to create rect first, and then move it
        item.setPos(self.parent.value('window_start'), 0)
        item.setPen(QPen(Qt.lightGray))
        item.setBrush(QBrush(Qt.lightGray))
        item.setZValue(-10)
        self.scene.addItem(item)
        self.idx_current = item
108822
def get_brightness(self):
        """"""
        self.get_status()
        try:
            self.brightness = self.data['color'].split(';')[-1]
        except TypeError:
            self.brightness = 0

        return self.brightness
779789
def get_lux_count(lux_byte):
    
    LUX_VALID_MASK = 0b10000000
    LUX_CHORD_MASK = 0b01110000
    LUX_STEP_MASK = 0b00001111
    valid = lux_byte & LUX_VALID_MASK
    if valid != 0:
        step_num = (lux_byte & LUX_STEP_MASK)
        # Shift to normalize value
        chord_num = (lux_byte & LUX_CHORD_MASK) >> 4
        step_val = 2**chord_num
        chord_val = int(16.5 * (step_val - 1))
        count = chord_val + step_val * step_num
        return count
    else:
        raise SensorError("Invalid lux sensor data.")
560193
def bk_light(cls):
        ""
        wAttributes = cls._get_text_attributes()
        wAttributes |= win32.BACKGROUND_INTENSITY
        cls._set_text_attributes(wAttributes)