Example #1
0
	def cmd_disableRegulation(self,the_command):
		'''disables temperature regulation, important to run before quitting'''
		b = sb.SetTemperatureRegulationParams()
		b.regulation = 0
		b.ccdSetpoint = 1000
		sb.SBIGUnivDrvCommand(sb.CC_SET_TEMPERATURE_REGULATION, b, None)
		a = sb.QueryTemperatureStatusResults()
		sb.SBIGUnivDrvCommand(sb.CC_QUERY_TEMPERATURE_STATUS,None,a)

		#A-D unit conversion	
		v1 = 4096.0/b.ccdSetpoint
		v2 = 10.0/(v1-1.0)
		setPointC = int(25.0 - 25.0 *((np.log(v2/3.0))/0.943906))
		
		v3 = 4096.0/a.ccdThermistor
		v4 = 10.0/(v3-1.0)
		TempC = 25.0 - 25.0 *((np.log(v4/3.0))/0.943906)
		TempC_round = round(TempC, 2)

		#associates the binary output of the refulation variable with on or off for the purposes of printing
		if b.regulation == 1 : reg = 'on'
		elif b.regulation == 0 : reg = 'off'

		return 'regulation = ' +str(reg) +'\n power = '+str(a.power) + '\n CCD set point (A/D) = '\
		    + str(a.ccdSetpoint) + ', CCD set point (C) = ' + str(setPointC)+'\n current CCD temp (A/D) = '\
		    + str(a.ccdThermistor) + ', current CCD temp (C)' + str(TempC_round)+ '\n'
Example #2
0
	def cmd_setTemperature(self,the_command):
		'''this command sets the temperature of the imaging CCD, input is in degrees C.'''
		commands = str.split(the_command)
		if len(commands) < 2 : return 'error: no input value'
		b = sb.SetTemperatureRegulationParams()
		b.regulation = 1
		#tests input validity, if not an integer value then input is rejected
		try: tempC = int(commands[1])
		except Exception: return 'invalid input (Please input an integer value in degrees C)'
		#Converts the degrees C input into A-D units, A-D units are interpretted and used by the driver
		v1 = (3.0 * np.exp((0.943906 * (25.0 -tempC))/25.0))
		temp = int(4096.0/((10.0/v1) + 1.0))
		b.ccdSetpoint = temp
		sb.SBIGUnivDrvCommand(sb.CC_SET_TEMPERATURE_REGULATION, b, None)
		#calls the querey temperature command to check current CCD status
		time.sleep(0.1)	
		a = sb.QueryTemperatureStatusResults()
		sb.SBIGUnivDrvCommand(sb.CC_QUERY_TEMPERATURE_STATUS,None,a)
		#converts thermistor value and setpoint to degrees C
		SPa = a.ccdThermistor
		v2 = 4096.0/SPa	
		v3 = 10.0/(v2-1.0)
		ccdThermistorC = 25.0 - 25.0 *((np.log(v3/3.0))/0.943906)
		ccdThermistorC_rounded = round(ccdThermistorC, 2)
		#associates the binary output of the refulation variable with on or off for the purposes of printing
		if b.regulation == 1 : reg = 'on'
		elif b.regulation == 0 : reg = 'off'
		#prints useful values to screen
		return ' regulation = ' +str(reg) +'\n power = '+str(a.power) + '\n CCD set point (A/D) = '\
		    + str(a.ccdSetpoint) + ', CCD set point (C) = ' + str(tempC)+'\n current CCD temp (A/D) = '\
		    + str(a.ccdThermistor) + ', current CCD temp (C) = ' + str(ccdThermistorC_rounded) +'\n'
Example #3
0
	def cmd_closeLink(self,the_command):
		'''turns off the temperature regualtion, if not already done, before closing the link'''
		b = sb.SetTemperatureRegulationParams()
		b.regulation = 0
		b.ccdSetpoint = 1000
		sb.SBIGUnivDrvCommand(sb.CC_SET_TEMPERATURE_REGULATION, b, None)
		# No argument - this function shuts down the driver and connection to the CCD, run before quitting
		sb.SBIGUnivDrvCommand(sb.CC_CLOSE_DEVICE, None,None)
		sb.SBIGUnivDrvCommand(sb.CC_CLOSE_DRIVER, None,None)
		return 'link closed \n'
Example #4
0
    def setTemperature(self, regulation, setpoint, autofreeze=True):

        strp = udrv.SetTemperatureRegulationParams()

        if regulation == True:
            strp.regulation = udrv.REGULATION_ON
        else:
            strp.regulation = udrv.REGULATION_OFF

        strp.ccdSetpoint = TemperatureSetPoint.toAD(setpoint)

        self._cmd(udrv.CC_SET_TEMPERATURE_REGULATION, strp, None)

        # activate autofreeze if enabled
        if autofreeze == True:
            strp = udrv.SetTemperatureRegulationParams()
            strp.regulation = udrv.REGULATION_ENABLE_AUTOFREEZE
            return self._cmd(udrv.CC_SET_TEMPERATURE_REGULATION, strp, None)

        return True