Ejemplo n.º 1
0
        public AndorCamera(CameraParameters p)
        {
            if (p == null)
            {
                throw new ArgumentException();
            }

            if (p.Dir != null)
            {
                InitVal = AndorSdk.Initialize(p.Dir);
                AndorSdk.GetCapabilities(ref Capabilities);
                AndorSdk.FreeInternalMemory();
                AndorSdk.GetDetector(ref _Width, ref _Height);

                AndorSdk.GetNumberADChannels(ref _NumberADChannels);
                ADChannel = DefaultADChannel;

                AndorSdk.GetBitDepth(ADChannel, ref _BitDepth);
                SaturationLevel = p.SaturationLevel;

                AndorSdk.GetMaximumBinning(ReadModeImage, 0, ref _MaxHorizontalBinSize);
                AndorSdk.GetMaximumBinning(ReadModeImage, 1, ref _MaxVerticalBinSize);

                _Image = new ImageArea(1, 1, 0, Width, 0, Height);
                Image  = p.Image;

                GateMode  = Constants.GatingModeSMBOnly;
                MCPGating = 1; // enable the MCP

                AndorSdk.GetMCPGainRange(ref _MinMCPGain, ref _MaxMCPGain);
                IntensifierGain = p.InitialGain;

                AcquisitionMode = AcquisitionModeSingle;
                TriggerMode     = TriggerModeExternal;
                DDGTriggerMode  = DDGTriggerModeExternal;
                ReadMode        = p.ReadMode;

                // quick hack for optimal camera setting for spectroscopy
                AndorSdk.SetHighCapacity(0);      // Note: 0 enables high sensitivity.
                AndorSdk.SetPreAmpGain(2);        // 2 = 4x , 1 = 2x, 0 = 1x;
                AndorSdk.SetDDGInsertionDelay(1); // set to fast insertion delay, intelligate off.
            }

            LoadCalibration(p.CalFile);

            p.Image    = Image;
            p.ReadMode = ReadMode;
        }
Ejemplo n.º 2
0
        // This function sets up the camera
        public void SetUpAndor()
        {
            sdk.SetADChannel(ADChannel);

            int _NumberHSSpeeds = 0;

            sdk.GetNumberHSSpeeds(ADChannel, 0, ref _NumberHSSpeeds);

            float _HSSpeedMax = 0;

            sdk.GetHSSpeed(ADChannel, 0, 0, ref _HSSpeedMax);
            HSSpeedMax = _HSSpeedMax;

            float _HSSpeedMin = 0;

            sdk.GetHSSpeed(ADChannel, 0, _NumberHSSpeeds - 1, ref _HSSpeedMin);
            HSSpeedMin = _HSSpeedMin;

            sdk.SetHighCapacity(0); // Note: 1 disables high sensitivity. 0 enables high sensitivity

            // sdk.SetImage(hbin, vbin, hstart, hend,vstart,vend)
            sdk.SetImage(1, 1, 1, XDim, 1, YDim); // Use full sensor area

            sdk.SetAcquisitionMode(AcquisitionMode);
            sdk.SetReadMode(ReadMode);

            // These functions control the camera's mode of operation
            sdk.SetMCPGating(Gating);
            sdk.SetTriggerMode(TriggerMode);
            sdk.SetDDGTriggerMode(DDGTriggerMode);

            sdk.SetGateMode(GateMode);

            sdk.SetMCPGain(defaultGain); // This functions controls the voltage of the intensifier mcp

            sdk.SetHSSpeed(0, 0);

            int   vsspeed_i = 0;
            float vsspeed   = 0;

            sdk.GetFastestRecommendedVSSpeed(ref vsspeed_i, ref vsspeed);
            sdk.SetVSSpeed(vsspeed_i);
        }