Example #1
0
 public DummyCamera()
 {
     Height      = 255;
     Width       = 1024;
     Image       = new ImageArea(1, 1, 0, Width, 0, Height);
     Calibration = Enumerable.Range(0, Width).Select(x => (double)x).ToArray();
     ReadMode    = AndorCamera.ReadModeFVB;
 }
Example #2
0
 public override void Update(CameraParameters p)
 {
     LoadCalibration(p.CalFile);
     ReadMode        = p.ReadMode;
     Image           = p.Image;
     SaturationLevel = p.SaturationLevel;
     if (HasIntensifier)
     {
         IntensifierGain = p.InitialGain;
     }
 }
Example #3
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;
        }
Example #4
0
        public DummyAndorCamera(CameraParameters p)
        {
            if (p == null)
            {
                throw new ArgumentException("Non-null CameraParameters instance required");
            }

            _MinTemp    = -100;
            _MaxTemp    = 100;
            _Width      = 1024;
            _Height     = 256;
            _Image      = new ImageArea(1, 1, 0, Width, 0, Height);
            Image       = p.Image;
            Calibration = Enumerable.Range(0, Width).Select(x => (double)x).ToArray();
            LoadCalibration(p.CalFile);
            MinIntensifierGain = 0;
            MaxIntensifierGain = 4095;
            IntensifierGain    = p.InitialGain;
            ReadMode           = p.ReadMode;
            p.Image            = Image;
            p.ReadMode         = ReadMode;
            _Temperature       = 25.0F; // Room temperature.
            Cts = new CancellationTokenSource();
            Task.Run(() =>
            {
                while (true)
                {
                    if (Cts.IsCancellationRequested)
                    {
                        break;
                    }
                    _Temperature += 0.01F * (_TargetTemperature - _Temperature);
                    Thread.Sleep(10);
                }
            }, Cts.Token);
            EquilibrateTemperature(p.Temperature);
        }