ccd
Class AsynchronousCcdDriver<T>

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by io.AbstractDriver
                  extended by ccd.AbstractCcdDriver<T>
                      extended by ccd.AsynchronousCcdDriver<T>
All Implemented Interfaces:
CcdDriver<T>, Driver, Cloneable, Asynchronous, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying
Direct Known Subclasses:
JanosDriver

public abstract class AsynchronousCcdDriver<T>
extends AbstractCcdDriver<T>
implements Asynchronous

A non-blocking ccd-driver acts on the #startExpose and #startDarkExpose. The expose(), exposeBias(), and exposeDark() methods are wrapped around these methods.

See Also:
SynchronousCcdDriver

Nested Class Summary
protected  class AsynchronousCcdDriver.ExposureThread
          An exposure thread start an exposure in its run method by calling the appropriate driver method.
static class AsynchronousCcdDriver.Readout
          The different stati of the driver.
 
Nested classes/interfaces inherited from class ccd.AbstractCcdDriver
AbstractCcdDriver.Endurance, AbstractCcdDriver.Exposure, AbstractCcdDriver.Shot
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private  ExitThread busy
          Indicates that a thread is running.
static String KEY_MAXTRANSFER
          The maximum CCD to board memory transfer time.
static String KEY_QUERYCYCLE
          The exposure time to mimic bias exposures.
 
Fields inherited from class ccd.AbstractCcdDriver
KEY_AMPLIFIERS, KEY_AREAREADOUT, KEY_COLUMNPOST, KEY_COLUMNPRIOR, KEY_COLUMNREADOUT, KEY_FIXEDREADOUT, KEY_INITSIZE, KEY_ROWPOST, KEY_ROWPRIOR, KEY_ROWREADOUT, KEY_XBINNING, KEY_XCHIPSIZE, KEY_XORIGIN, KEY_XSIZE, KEY_YBINNING, KEY_YCHIPSIZE, KEY_YORIGIN, KEY_YSIZE
 
Fields inherited from class io.AbstractDriver
KEY_DRIVERNAME
 
Fields inherited from class util.PropertyBundles
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES
 
Fields inherited from class util.PropertyResources
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset
 
Fields inherited from class util.PropertyContainer
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR
 
Fields inherited from interface ccd.CcdDriver
FITSEXTENSION
 
Fields inherited from interface util.ResourceSupplying
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Fields inherited from interface util.PropertySupplying
CONFIG, KEY_CLASS
 
Constructor Summary
protected AsynchronousCcdDriver(Map<String,String> info)
          Constructor.
 
Method Summary
protected abstract  boolean abort()
          Interrupts an ongoing exposure.
 boolean ensureReady()
          If the current read-out status of the CCD is not IDLE, we query until it is.
 int expose()
          Make an exposure.
 int exposeBias()
          Makes a bias exposure.
 int exposeDark()
          Makes a dark exposure.
protected abstract  AsynchronousCcdDriver.Readout getReadoutStatus()
          Returns the readout-status of the ccd.
 boolean interruptProcess()
          Aborts the ongoing exposure.
 boolean interruptProcess(Method any)
          Aborts the ongoing exposure.
 boolean isExposing()
          We query the CCD if it is exposing.
protected abstract  boolean startBias()
          Starts a bias exposure.
protected abstract  boolean startDark()
          Starts a dark exposure, i.e.
protected abstract  boolean startScience()
          Starts a science exposure, i.e.
 ExitThread threadedBiasExpose()
          Returns a thread that exposes the ccd for a science exposure when started.
 ExitThread threadedDarkExpose()
          Returns a thread that exposes the ccd for a science exposure when started.
 ExitThread threadedExpose()
          Returns a thread that exposes the ccd for a science exposure when started.
 
Methods inherited from class ccd.AbstractCcdDriver
getChipSize, getReadoutTime, init, open, openController
 
Methods inherited from class io.AbstractDriver
createDriver, equals, getDriverName, hashCode
 
Methods inherited from class util.PropertyBundles
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource
 
Methods inherited from class util.PropertyResources
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, keyCreate, keyCreate, reload, setApplet
 
Methods inherited from class util.PropertyContainer
augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, reload, removeProperty, rescanned, setObject, setProperties, setProperty, stringProperties, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ccd.CcdDriver
getBinning, getBufferType, getCcdInfo, getDataBuffer, getExposureTime, getWindow, setBinning, setDataBuffer, setExposureTime, setWindow
 
Methods inherited from interface io.Driver
close, getDriverName, isOpen
 
Methods inherited from interface util.ResourceSupplying
getResource, getResourceAsStream, getResources
 
Methods inherited from interface util.PropertySupplying
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties
 

Field Detail

KEY_QUERYCYCLE

public static final String KEY_QUERYCYCLE
The exposure time to mimic bias exposures.

See Also:
Constant Field Values

KEY_MAXTRANSFER

public static final String KEY_MAXTRANSFER
The maximum CCD to board memory transfer time.

See Also:
Constant Field Values

busy

private ExitThread busy
Indicates that a thread is running.

Constructor Detail

AsynchronousCcdDriver

protected AsynchronousCcdDriver(Map<String,String> info)
Constructor. Does not open the connection, this is done in AbstractCcdDriver.open().

Method Detail

interruptProcess

public boolean interruptProcess()
                         throws InterruptedException
Aborts the ongoing exposure.

Specified by:
interruptProcess in interface Asynchronous
Returns:
True, if process was interrupted.
Throws:
InterruptedException

interruptProcess

public boolean interruptProcess(Method any)
                         throws InterruptedException
Aborts the ongoing exposure. There is only one process to be interrupted, that is an exposure thread.

Specified by:
interruptProcess in interface Asynchronous
Returns:
True, if process was interrupted.
Throws:
InterruptedException

abort

protected abstract boolean abort()
                          throws IOException
Interrupts an ongoing exposure.

Throws:
IOException

startScience

protected abstract boolean startScience()
                                 throws IOException
Starts a science exposure, i.e. an observation with opened shutter. This method should only start the exposure, the thread returned by #startExpose is built around this method by this class.

Throws:
IOException

startDark

protected abstract boolean startDark()
                              throws IOException
Starts a dark exposure, i.e. an observation with closed shutter.

Throws:
IOException

startBias

protected abstract boolean startBias()
                              throws IOException
Starts a bias exposure. Subclasses may divert that to startDark() with a small or zero exposure time.

Throws:
IOException

getReadoutStatus

protected abstract AsynchronousCcdDriver.Readout getReadoutStatus()
                                                           throws IOException
Returns the readout-status of the ccd.

Throws:
IOException

isExposing

public boolean isExposing()
                   throws IOException
We query the CCD if it is exposing.

Specified by:
isExposing in interface CcdDriver<T>
Throws:
IOException

ensureReady

public boolean ensureReady()
                    throws IOException
If the current read-out status of the CCD is not IDLE, we query until it is.

Specified by:
ensureReady in interface CcdDriver<T>
Returns:
True, if data is ready.
Throws:
IOException

expose

public int expose()
           throws IOException
Make an exposure. The exposure time and the data buffer must be set prior to a call to this function. Note that this method does not check for proper settings. In JB's driver the expos method does not block, thus we start an exposure and wait

Specified by:
expose in interface CcdDriver<T>
Returns:
Number of pixel writtn.
Throws:
IOException - Any subclass of IOException.
See Also:
startExpose

exposeBias

public int exposeBias()
               throws IOException
Makes a bias exposure. If bias is not supported by the driver directly, this should be indicated by the #KEY_SUPPORTBIAS key set to false. In the latter case, this method thros an UnsupportedOperationException.

The data buffer has to be set prior to a call to this method.

Specified by:
exposeBias in interface CcdDriver<T>
Returns:
Number of pixel writtn.
Throws:
IOException - Any subclass of IOException.

exposeDark

public int exposeDark()
               throws IOException
Makes a dark exposure. If dark is not supported by the driver, e.g. if no shutter is present, this should be indicated by the #KEY_SUPPORTDARK key set to false. In the latter case, this method thros an UnsupportedOperationException.

The data buffer has to be set prior to a call to this method.

Specified by:
exposeDark in interface CcdDriver<T>
Returns:
Number of pixel writtn..
Throws:
IOException - Any subclass of IOException.

threadedExpose

public ExitThread threadedExpose()
Returns a thread that exposes the ccd for a science exposure when started. It live-time ends when the exposure finished.

Specified by:
threadedExpose in interface CcdDriver<T>
Returns:
The thread that ends when the exposure is done.
See Also:
expose

threadedDarkExpose

public ExitThread threadedDarkExpose()
Returns a thread that exposes the ccd for a science exposure when started. It live-time ends when the exposure finished.

Specified by:
threadedDarkExpose in interface CcdDriver<T>
Returns:
The thread that ends when the exposure is done.
See Also:
expose

threadedBiasExpose

public ExitThread threadedBiasExpose()
Returns a thread that exposes the ccd for a science exposure when started. It live-time ends when the exposure finished.