Properties of CCD detectors - lab report

Preparation of measurements

With the help of the lab teacher, turn on the control unit of the SBIG ST-5 CCD camera and start the helper script with the following command on the lab computer that relays camera control to the Jupyter server.

$ /labor/ccd/server.sh

The command print the current status of the CCD camera to the terminal. Now connect to the camera from Jupyter by executing the following cells. If connection is unsuccessful within a few seconds, perform the following steps.

  • Interrupt the Jupyter kernel
  • Quit the helper script by pressing Ctrl+C
  • Reset the camera controller with the button on its back
  • Restart the helper script

Please note, that interrupting camera operations (interrupting the kernel) will require resetting the camera controller.

Please note, that the values of python variables are lost when restarting the kernel. Measurements must always be saved with myvalue.save('filename'). Do not save images with imsave as saving in standard image formats will reduce the bit depth of images.

In [ ]:
%pylab inline
In [ ]:
import sys
import time
import sbigpy
import scipy.optimize
In [ ]:
st5 = sbigpy.ST5("tcp://157.181.168.75:3333")
st5.open()
In [ ]:
st5.print_status()

Task 1: Measuring properties of the CCD thermostat

1. a

The control unit of ST5 will keep the temperature of the CCD at a constant temperature. The current temperature of the detector can be read by the funtion st5.get_temperature() in units of °C. Write a short python script to read out the thermistor of the camera during a short period of time with one second resolution. Plot the results. Use the function time.sleep(sec) to wait between readouts.

In [ ]:
# Read temperature
In [ ]:
# Sampling
In [ ]:
# Plot

With a few python commands, calculate the mean and variance (standard deviation) of the temperature as sampled above.

In [ ]:
# Calculations

1. b

The setpoint of the temperature is controlled with the function st5.set_temperature(celsius) whereas the thermostat can be turned off with the function st5.reset_temperature(). Turn off the thermostat and sample the change of temperature of the detector for a period of time. Plot the results.

In [ ]:
# Measurement
In [ ]:
# Plot

1. c

Cool the CCD to -5 °C. Sample the value of the thermistor during the colling process. Plot the temperature as a function of time. How long does it take for the control unit to stabilize the temperature of the detector? What charactertic feature of the cooling process can you observe? What causes this feature?

In [ ]:
# Measurement
In [ ]:
# Plot
In [ ]:
# Answers

1. d

Turn off the thermostat and measure the warming curve of the detector. What is the time scale constant of warming?

In [ ]:
# Measuremnt
In [ ]:
# Plot
In [ ]:
# Fitting the time constant

Task 2: Measuring the thermal noise and hot pixels of the CCD

To measure the thermal properties of the CCD, cover the aperture of the camera to take 'dark' images. Pictures are taken with the function st5.take_image(cs) where the parameter cs is the exposure time in units of 1/100 seconds. To download the images from the control unit to the notebook, use the function st5.read_image(). Remember to record the temperature of the detector with the function st5.get_temperature().

2. a

With the thermostat turned off, cover the aperture of the camera and take a picture with an exposure time of a few seconds. Record the exposure time and the temperature of the detector. The resulting image can be plotted in grayscale with the function imshow(img, cmap='gray'). The intensity scale of the plot can be controlled through the parameters vmin and vmax.

In [ ]:
# Measurement
In [ ]:
# Image plot

2. b

Plot the intensity histogram of the image taken in the previous task. Plot the histogram such way that both the termal noise and hot pixels are visible. Determine the average of pixel values and level of noise. Repeat the calculations by masking out the hot pixels. When scaling the axes of the histogram, take into account the the A/D converted of the camera has 12 bits.

In [ ]:
# Histogram
In [ ]:
# Plot
In [ ]:
# Mean pixel value and noise level

2. c

Repeat the previous measurement with a varying exposure time and temperature settings. Please note, that it takes a significant time to reach the desired temperature. Decrease the temperature in steps of 5 °C from 15 °C to -10 °C. Plot the images and pixel value histograms. Determine the average pixel level and noise of each image. How does the noise depend on exposure time and temperature?

In [ ]:
# Measurement
In [ ]:
# Images
In [ ]:
# Histograms
In [ ]:
# Calculations
In [ ]:
# Noise as a function of temperature
In [ ]:
# Noise as a function of exposure time
In [ ]:
# Summarize your experiences here

2. d

The thermal noise of the CCD detector increases with temperature linearly, according to $S \sim k_B T$. On the other hand, the read-out electronics are not cooled so the the read-out noise is approximately constant. How could one estimate the value of the Boltzmann constant from the temperature-dependent dark noise of the CCD?

In [ ]:
# Ideas

Task 3: Taking a grayscale calibrated image

3. a

Rotate the filter wheel to the filterless position and set the lens aperture to minimal (f/22). Cool the detector to -10 °C and take an image of one of the small figures supplied with the experiment setup. Choose an appropriate exposure time to use the entire dynamic range of the detector but make sure no pixels are saturated. Verify the choice by plotting the pixel value histogram. If necessary, adjust the focus of the camera with the help of lab teacher. Plot the image and the pixel value histogram.

The images taken during the following tasks will be necessary to calibrate the final image so make sure images remain in memory and name variables accordingly. You can save numpy arrays into binary files by calling myvar.save('filename').

In [ ]:
# Set temperature
In [ ]:
# Exposure
In [ ]:
# Plot image
In [ ]:
# Plot histogram

3. b: taking the flat field image

Position a sheet of paper in front of the camera and, using the same exposure time and temperature setting as in Task 3. a, take at least 5 out-of-focus exposures of the uniformly illuminated paper. Download the images one by one after exposure to avoid overflow of the camera controller internal image buffer. Average the images, and plot the results.

In [ ]:
# Exposures
In [ ]:
# Averaging
In [ ]:
# Plot of the average flat
In [ ]:
# Summary of experiences

3. c: taking the dark image

The image taken in 3. a is raw in the sense that it contains the dark current of the detector. Cover the aperture of the camera and create dark images with the same exposure time and temperature setting as above. Take the avereage of about 10 exposures. To shorten the measurement, you can do the averaging without downloading the individual exposures by exploiting the internal processing capabilities of the camera controller, as demonstrated by the following script.

In [ ]:
# Dark kép rögzítése

N = 10
st5.clr_buf(sbigpy.ST5.BUFFER_ACCU)
for i in range(N):
    st5.take_image(50)
    st5.accum_image()
dark = st5.read_image(buffer=sbigpy.ST5.BUFFER_ACCU)
dark = dark / N
In [ ]:
# Plot
In [ ]:
# Histogram
In [ ]:
# Summary of experiences

3. d: taking the bias image

Similarly to the previous task, cover the camera and take bias images with minimal, 1/100 sec exposure time. By averaging the bias exposures, the varying zero points of the individual pixels can be determined. Plot the results.

In [ ]:
# Taking a bias image

N = 10
st5.clr_buf(sbigpy.ST5.BUFFER_ACCU)
for i in range(N):
    st5.take_image(1)
    st5.accum_image()
bias = st5.read_image(buffer=sbigpy.ST5.BUFFER_ACCU)
bias = bias / N
In [ ]:
# Plot
In [ ]:
# Histogram
In [ ]:
# Summary of experiences

3. e: grayscale image calibration

Calibrate the image takin in 3. a using the formula $I = \frac{R - D}{F}$. Plot the image and compare with the original. Summarize your experiences.

In [ ]:
# Calculations
In [ ]:
# Plot
In [ ]:
# Histogram
In [ ]:
# Summary of experiences

Task 4: Taking a color image

4. a

Take images of the figurine with each color filter. Take precautions not to move the camera, nor the figurine between exposures. Calibrate the pictures as in 3. e. Use the same no-filter flat image with each color-filter image.

In [ ]:
# Exposure
In [ ]:
# Calibration
In [ ]:
# Plots

4. b

Combine the three color channels into a single RGB image. Plot the picture in color. Please note, that the function imshow can only present images in color when using a uint8 representation of the picture. Summarize your finding. How could you estimate the correct mixing ratio of the color channels?

In [ ]:
# Calculations
In [ ]:
# Plot
In [ ]:
# Summary of experiences

Task 5: Anti-blooming protection

The ST5 CCD camera has an anti-blooming protection feature with is enabled by default with a clock period of 6000 during exposures. The feature can be turned off completely by taking and exposure with

st5.take_image(cs, abg_state=st5.ABG_STATE_LOW)

The level of anti-blooming protection can be controlled by specifying the clock period

st5.take_image(80, abg_state=st5.ABG_STATE_CLOCKED, abg_period=256)

Take a slightly overexposed image of the figurine with default settings and then turn off anti-blooming protection and repeat the exposure. Can you spot the blooming effects? Try to subtract the two images from each other. Try to vary the anti-blooming clock period between 256 and 65535. What are your experiences?

In [ ]:
# Measurements
In [ ]:
# Plots
In [ ]:
# Summary of experiences