ccd
Interface CcdDriver<T>

All Superinterfaces:
Driver
All Known Subinterfaces:
FitsDriver
All Known Implementing Classes:
AbstractCcdDriver, AsynchronousCcdDriver, E2VDriver, FechnerDriver, FireDriver, FireDriverWish, GigeDriver, JanosDriver, MagellanDriver, MagellanDriver, ScienceCcdDriver, StreamingCcdDriver, SynchronousCcdDriver

public interface CcdDriver<T>
extends Driver

The interface definition to a ccd driver tailored to work with Thomas Fechner's RPC-server implementation. Not all methods are useful for any kind of CCD driver. This is only the interface defintion, for a concrete implementation, see FechnerDriver.

Control for a shutter is missing from this interface, as it should also be applicable to shutterless CCDs.


Field Summary
static String FITSEXTENSION
          General fits file name extension, including dot.
 
Method Summary
 boolean ensureReady()
          Ensures that the data can be retrieved.
 int expose()
          Takes an exposure.
 int exposeBias()
          Takes a bias exposure.
 int exposeDark()
          Takes a dark exposure.
 Dimension getBinning()
          Gets the current active binning on the server side as a object, the width being x-binning, the height the y-binning.
 Class<T> getBufferType()
          Returns the class-type this ccd works on.
 Map<String,Object> getCcdInfo()
          Returns information known to the CCD in a map.
 Dimension getChipSize()
          Return the size of the ccd.
 T getDataBuffer()
          Returns the last data buffer set.
 long getExposureTime()
          Returns the current active exposure time in ms.
 long getReadoutTime(Rectangle window)
          Calculates the readout time for the given window in ms.
 Rectangle getWindow()
          Returns the current readout window or the size of the entire chip.
 boolean isExposing()
          Returns true, if the camera is currently exposing.
 boolean setBinning(int xbin, int ybin)
          Sets a new binning factor on the server side.
 boolean setDataBuffer(T buffer)
          Sets a data buffer where the CCD-data should be stored in.
 boolean setExposureTime(long ms)
          Sets the exposure time in milliseconds.
 boolean setWindow(Rectangle window)
          Sets a new readout window.
 Thread threadedDarkExpose()
          Starts an exposure the thread returned end when the exposure has finished, i.e.
 Thread threadedExpose()
          Starts an exposure the thread returned end when the exposure has finished, i.e.
 
Methods inherited from interface io.Driver
close, getDriverName, isOpen, open
 

Field Detail

FITSEXTENSION

static final String FITSEXTENSION
General fits file name extension, including dot.

See Also:
Constant Field Values
Method Detail

getReadoutTime

long getReadoutTime(Rectangle window)
Calculates the readout time for the given window in ms. Can be a rough estimate, but the true readout time should never be lower. In #AsynchronousCcdDrivers this method is used in the exposure thread for waiting before querying the readout status.


getChipSize

Dimension getChipSize()
Return the size of the ccd. This might return something useful prior to initialization if the ccd size is from the properties.


setBinning

boolean setBinning(int xbin,
                   int ybin)
                   throws IOException
Sets a new binning factor on the server side.

Parameters:
xbin - New binning factor in x.
ybin - New binning factor in y.
Returns:
True if successful.
Throws:
IOException - Any subclass of IOException

getBinning

Dimension getBinning()
                     throws IOException
Gets the current active binning on the server side as a object, the width being x-binning, the height the y-binning.

Returns:
x-binning in width, y-binning in height.
Throws:
IOException - Any subclass of IOException.

setWindow

boolean setWindow(Rectangle window)
                  throws IOException
Sets a new readout window. Any subsequent call to expose(), exposeBias() or exposeDark() will be affected. If binning is active, it is ignored in the sense that this method always affects physical pixels. On CCD that do not support windowing mode, an UnsupportedOperationException may be thrown.

Parameters:
window - New readout window in true pixels.
Returns:
True if successful.
Throws:
IOException - Any subclass of IOException.
UnsupportedOperationException - If windowing is not supported.

getWindow

Rectangle getWindow()
                    throws IOException
Returns the current readout window or the size of the entire chip.

Returns:
The geometry of the current readout window.
Throws:
IOException - Any subclass of IOException.

setExposureTime

boolean setExposureTime(long ms)
                        throws IOException
Sets the exposure time in milliseconds.

Parameters:
ms - The exposure time in ms.
Returns:
True if successful.
Throws:
IOException - Any subclass of IOException.

getExposureTime

long getExposureTime()
                     throws IOException
Returns the current active exposure time in ms.

Returns:
The exposure time in ms.
Throws:
IOException - Any subclass of IOException.

getBufferType

Class<T> getBufferType()
Returns the class-type this ccd works on. Possible values are Fits.class, File.class, String.class etc.


setDataBuffer

boolean setDataBuffer(T buffer)
                      throws IOException
Sets a data buffer where the CCD-data should be stored in. This method takes a general object as an argument, which might be a file (then, data is stored in a file of the given name), or an array of primitives, where the data is then pushed into. Note that is highly implementation depending, which type of arguemnts are supported. In case this method is called with an argument that is not supported, a runtime exception should be thrown.

Parameters:
buffer - Any sort of buffer the driver knows to store CCD-data in.
Returns:
True if successful.
Throws:
IOException - Any subclass of IOException.
RuntimeException - If the buffer is not applicable for this driver.

getDataBuffer

T getDataBuffer()
                throws IOException
Returns the last data buffer set. This might be a file name etc.

Throws:
IOException - Any subclass of IOException.

expose

int expose()
           throws IOException
Takes an exposure. The exposure time and the data buffer must be set prior to a call to this method. This method blocks until the exposure is over.

Returns:
Number of pixel writtn.
Throws:
IOException - Any subclass of IOException.
See Also:
startExpose

threadedExpose

Thread threadedExpose()
                      throws IOException
Starts an exposure the thread returned end when the exposure has finished, i.e. when the data can be read out from the buffer. This method should return fast.

Returns:
The thread that ends when the exposure is done.
Throws:
IOException - Any subclass of IOException.
See Also:
expose

threadedDarkExpose

Thread threadedDarkExpose()
                          throws IOException
Starts an exposure the thread returned end when the exposure has finished, i.e. when the data can be read out from the buffer. This method should return fast.

Returns:
The thread that ends when the exposure is done.
Throws:
IOException - Any subclass of IOException.
See Also:
expose

isExposing

boolean isExposing()
                   throws IOException
Returns true, if the camera is currently exposing.

Throws:
IOException

ensureReady

boolean ensureReady()
                    throws IOException
Ensures that the data can be retrieved. In some cases, this means that this method blocks until the data has been read out.

Returns:
True, if data is ready.
Throws:
IOException

getCcdInfo

Map<String,Object> getCcdInfo()
                              throws IOException
Returns information known to the CCD in a map. This mapping can readily be used in FITS header info, meaning that the values should be of type String, Long, Double or Boolean. This method may return null.

Throws:
IOException

exposeBias

int exposeBias()
               throws IOException
Takes a bias exposure. If the driver does not support bias exposures, an unsupported operation exception should be thrown to indicate to the user that the bias exposure can only be realized as a normal exposure with an integration time of zero. The data buffer must be set prior to a call to this method.

Returns:
Number of pixel writtn.
Throws:
IOException - Any subclass of IOException.
UnsupportedOperationException - If true bias is not supported.

exposeDark

int exposeDark()
               throws IOException
Takes a dark exposure. If the driver does not support dark exposures, e.g. if it has no shutter, an unsupported operation exception should be thrown. The exposure time and the data buffer must be set prior to a call to this method.

Returns:
Number of pixel writtn..
Throws:
IOException - Any subclass of IOException.
UnsupportedOperationException - If dark frames are not supported.