Skip to content
Snippets Groups Projects
Select Git revision
  • 6b80793fc011814710c1bb1e6463ee77676424d5
  • master default protected
2 results

SensorInfo_PCOEdge.java

Blame
  • user avatar
    Oliver Ford (IPP) @pc-cld-ws-5036 authored
    6b80793f
    History
    SensorInfo_PCOEdge.java 1.74 KiB
    package fusionDefs.sensorInfo;
    
    import java.util.Map;
    import java.util.Map.Entry;
    
    import fusionDefs.sensorInfo.SensorInfoService.SensorParser;
    import fusionDefs.sensorInfo.SensorInfoService.MetaDataGetter;
    
    public class SensorInfo_PCOEdge implements SensorParser {
    	
    	@Override
    	public SensorInfo attemptGet(MetaDataGetter src) {		
    		//try to find the camera metadata
    
    		try { 
    			Integer ccdWidth = (Integer) src.get("PCOCam/config/sensorWidth", Integer.class);
    			if(ccdWidth == null) // not a PCO
    				return null;
    		}catch(RuntimeException err) {			
    			return null; //No PCOCam metadata, ignore
    		}
    		
    		SensorInfo camInfo = new SensorInfo();
    				
    		//camInfo.zeroLevel = (Double)src.get("/AndorCam/config/BaselineLevel", Double.class);
    		camInfo.zeroLevel = 100; //just seems to be
    
    		//from the PCO we seem to get this done for us
    		camInfo.photoelectronsPerADCU = (Double)src.get("PCOCam/config/photoelectronsPerCount", Double.class);
    		
    		if((Long)src.get("PCOCam/config/exp_timebase", Long.class) != 1)
    			throw new RuntimeException("PCO timebase unit is unusual. Not implemented.");
    			
    		camInfo.exposureTime = (Long)src.get("PCOCam/config/exp_time", Long.class) / 1e6; //in us
    		camInfo.frameTime = (Double)src.get("PCOCam/config/frameTimeMS", Double.class) / 1e3;
    		camInfo.cameraName = "PCOCam-" + (String)src.get("/PCOCam/config/cameraInfo", String.class);
    		camInfo.modeString = camInfo.cameraName;		
    
    		camInfo.sensorPixelOfImageLeft = src.get("/PCOCam/config/roiX0", Integer.class) - 1;
    		camInfo.sensorPixelOfImageTop = src.get("/PCOCam/config/roiY0", Integer.class) - 1;
    
    		camInfo.sensorBinningX = src.get("/PCOCam/config/binningX", Integer.class);
    		camInfo.sensorBinningY = src.get("/PCOCam/config/binningY", Integer.class);
    		
    		return camInfo;
    		
    	}
    
    
    }