Example #1
0
    def queryCCDInfo(self):

        infoImg = udrv.GetCCDInfoResults0()
        infoTrk = udrv.GetCCDInfoResults0()

        gcip = udrv.GetCCDInfoParams()

        gcip.request = udrv.CCD_INFO_IMAGING
        self._cmd(udrv.CC_GET_CCD_INFO, gcip, infoImg)

        gcip.request = udrv.CCD_INFO_TRACKING
        self._cmd(udrv.CC_GET_CCD_INFO, gcip, infoTrk)

        self.cameraNames[self.imaging] = infoImg.name
        self.cameraNames[self.tracking] = infoTrk.name

        # imaging ccd readout modes
        for i in range(infoImg.readoutModes):
            mode = infoImg.readoutInfo[i]
            self.readoutModes[self.imaging][mode.mode] = SBIGReadoutMode(mode)

        for i in range(infoTrk.readoutModes):
            mode = infoTrk.readoutInfo[i]
            self.readoutModes[self.tracking][mode.mode] = SBIGReadoutMode(mode)

        return True
Example #2
0
	def cmd_getCCDParams(self,the_command):
		''' No argument - this function gets the CCD parameters using GET_CCD_INFO. Technically, 
	        this returns the parameters for the first CCD.'''
		p = sb.GetCCDInfoParams()
		p.request = 0
		r = sb.GetCCDInfoResults0()
		sb.SBIGUnivDrvCommand(sb.CC_GET_CCD_INFO,p,r)
		#Width and height are just integers.
		gain = hex(r.readoutInfo[0].gain)
		gain=float(gain[2:])*0.01
		pixel_width = hex(r.readoutInfo[0].pixel_width)
		pixel_width = float(pixel_width[2:])*0.01
		return 'width: '+str(r.readoutInfo[0].width)+ ' height: '+str(r.readoutInfo[0].height)+\
	' gain(e-/ADU): '+str(gain)+' pixel_width (microns): '+str(pixel_width)
Example #3
0
	def capture(self,exposureTime,shutter,fileInput,imtype='Light'):
		self.imtype=imtype
		#This command checks the temperature at the time it is run
		a = sb.QueryTemperatureStatusResults()
		sb.SBIGUnivDrvCommand(sb.CC_QUERY_TEMPERATURE_STATUS,None,a)
		#A-D unit conversion
		SP = a.ccdSetpoint
		v1 = 4096.0/SP
		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_rounded = round(TempC, 2)
	      	#associates the binary output of the refulation variable with on or off for the purposes of printing
		if a.enabled == 1 : reg = 'on'
		elif a.enabled == 0 : reg = 'off'
		self.camtemp=TempC_rounded
		self.ccdSetpoint=setPointC
		self.cooling=reg
		#Get CCD Parameters, this is required for later during readout
		p = sb.GetCCDInfoParams()
		p.request = 0
		r = sb.GetCCDInfoResults0()
		sb.SBIGUnivDrvCommand(sb.CC_GET_CCD_INFO,p,r)
		self.width = r.readoutInfo[0].width
		self.height = r.readoutInfo[0].height
		#This is because the spectrograph camera does not return the correct width and height from GetCCDInfoParams, but returns 1000x1000
		#This is probably ok since it is unlikely we will ever have a camera with 1000x1000 pixels exactly.
		if self.height==1000 and self.width==1000:
			self.width = 3352
			self.height = 2532
		self.gain = hex(r.readoutInfo[0].gain)
		self.gain=float(self.gain[2:])*0.01
		
		#Start the Exposure
		self.startTime = time.time()
		p = sb.StartExposureParams()
		p.ccd = 0
		p.exposureTime = int(exposureTime * 100)
		self.exposureTime=exposureTime
		# anti blooming gate, currently untouched (ABG shut off)
		p.abgState = 0 

		#sets up file name
		filename= fileInput.partition('.fits')[0]
		#calls checking functions	
		self.checkDir(filename)
		self.checkFile(self.fullpath)

		#sets the shutter to open or closed.
		print ' shutter: ' + str(shutter) + '\n file: ' + str(self.fullpath) + '\n exposure: ' + str(exposureTime) + ' seconds' 
		if shutter == 'open': shutter_status = 1
		elif shutter == 'closed':shutter_status = 2
		p.openShutter = shutter_status
		sb.SBIGUnivDrvCommand(sb.CC_START_EXPOSURE,p,None)
		p = sb.QueryCommandStatusParams()
		p.command = sb.CC_START_EXPOSURE
		r = sb.QueryCommandStatusResults()
		r.status = 0
		self.exposure_active=True
Example #4
0
import sbigudrv as sb

sb.SBIGUnivDrvCommand(sb.CC_OPEN_DRIVER, None,None)

r = sb.QueryUSBResults()
sb.SBIGUnivDrvCommand(sb.CC_QUERY_USB, None,r)
r.camerasFound
r.usbInfo[0].name

p = sb.OpenDeviceParams()
p.deviceType=0x7F00
sb.SBIGUnivDrvCommand(sb.CC_OPEN_DEVICE, p, None)

p = sb.EstablishLinkParams()
r = sb.EstablishLinkResults()
sb.SBIGUnivDrvCommand(sb.CC_ESTABLISH_LINK,p,r)

p = sb.GetCCDInfoParams()
p.request = 0
r = sb.GetCCDInfoResults0()
sb.SBIGUnivDrvCommand(sb.CC_GET_CCD_INFO,p,r)
r.readoutInfo[0].width
r.readoutInfo[0].height

hex(r.readoutInfo[0].gain

hex(r.readoutInfo[0].pixel_width)

sb.SBIGUnivDrvCommand(sb.CC_CLOSE_DEVICE, None,None)
sb.SBIGUnivDrvCommand(sb.CC_CLOSE_DRIVER, None,None)