ccd.sta4240
Class E2VDriver

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.SynchronousCcdDriver<nom.tam.fits.Fits>
                          extended by ccd.sta4240.E2VDriver
All Implemented Interfaces:
CcdDriver<nom.tam.fits.Fits>, MultiMode, Driver, Cloneable, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying, StatusProviding

public class E2VDriver
extends SynchronousCcdDriver<nom.tam.fits.Fits>
implements StatusProviding, MultiMode

This class interfaces to Thomas Fechner's EsV controller (Magellan) type. Due to increased version spread, each new RPC package is put in its own directory.


Nested Class Summary
 
Nested classes/interfaces inherited from class ccd.SynchronousCcdDriver
SynchronousCcdDriver.ExposureThread
 
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  nom.tam.fits.Fits async
          The data buffer for asynchroneous retrieval.
private static E2VMagellanClient ccdclient
          RPC client instance.
static String CCDSEC
          Fits key for entering y-pregap info to header.
static String CCDSECREM
          Comment for entering y-pregap info to header.
static String CCDTEMP
          The keyword for the CCD temperature.
static double COPYBSCALE
          Default scaling factor copied into the extensions, if not in primary.
static double COPYBZERO
          Default zero offset copied into the extensions, if not in primary.
static String COPYREM
          Comment for a key that was copied from the primary.
static String DATECOAL
          Header keyword for receive exposure end.
static String DATECOALREM
          Comment for receive exposure end.
static String DATESEND
          Header keyword for send exposure start.
static String DATESENDREM
          Comment for send exposure start.
private static int DEFAMPLIFIERS
          Default property value.
private static boolean DEFAUTOFLUSH
          The parameters for the extra setup, autoflush .
private static int DEFCOLAMPLIFIERS
          Default property value.
static String DEFDRIVERNAME
          The name of this ccd.
private static long DEFEXPOSEMULTIPLY
          Default property value.
private static String DEFHCLKDIR
          The parameters for the extra setup, vclkdir .
private static String DEFMAXPIXEL
          The parameters for the extra setup, usec .
private static long DEFMAXTIME
          Default property value.
private static long DEFMINTIME
          Default property value.
private static String DEFMODENAMES
          The names of all supported modes.
private static String DEFOUTPUTCH
          The parameters for the extra setup, outputch .
private static int DEFRPCTIMEOUT
          Default property value.
private static String DEFSERVERNAME
          Default property value.
private static int DEFSHUTTERCLOSE
          Default property value.
private static int DEFSHUTTEROPEN
          Default property value.
private static String DEFSTARTUPMODE
          The mode that is selected after startup.
private static boolean DEFSUPPORTSHUTTER
          Default property value.
private static String DEFVCLKDIR
          The parameters for the extra setup, vclkdir .
private static boolean DEFWRONGENDIAN
          Default property value.
static String DETSIZE
          Fits key for entering x-pregap info to header.
static String DETSIZEREM
          Comment for entering x-pregap info to header.
private  Map<String,Character> hclkdir
          Lookup table for mode to hlckdir.
static String KEY_AUTOFLUSH
          The parameters for the extra setup, autoflush .
static String KEY_COLAMPLIFIERS
          Total number of amplifiers expected in row direction.
static String KEY_EXPOSEMULTIPLY
          The multiplier for exposure times returned to ms.
static String KEY_HCLKDIR
          The parameters for the mode setup, hclkdir .
static String KEY_MAXPIXEL
          The parameters for the mode setup, max pixel .
static String KEY_MAXTIME
          The maximum exposure time in milliseconds.
static String KEY_MINTIME
          The minimum exposure time in milliseconds.
static String KEY_MODENAMES
          The name of the supported modes.
static String KEY_OUTPUTCH
          The parameters for the mode setup, outputch .
static String KEY_RPCTIMEOUT
          The RPC time-out in millisecond.
static String KEY_SERVERNAME
          FCDN of the host where the guider rpc server is running.
static String KEY_SHUTTERCLOSE
          The short paramter for shutter-close.
static String KEY_SHUTTEROPEN
          The short paramter for shutter-open.
static String KEY_STARTUPMODE
          We start with this mode per default.
static String KEY_SUPPORTSHUTTER
          If true, driver supports shutter operation.
static String KEY_VCLKDIR
          The parameters for the mode setup, vclkdir.
static String KEY_WRONGENDIAN
          If true, endian of received short are little.
private  String lastmode
          This was the last successfully attained mode.
static String LN2TEMP
          The keyword for the CCD temperature.
private  Map<String,Dimension> maxpixel
          Lookup table for mode to maxpixel.
private  List<String> modes
          The list of supported modes.
static int OK
          General return code from rpc calls indicating okay.
private  Map<String,Character> outputch
          Lookup table for mode to output channel.
private  Map<String,Character> vclkdir
          Lookup table for mode to vlckdir.
 
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
E2VDriver(Map<String,String> info)
          Constructor.
 
Method Summary
protected  void addPrimaryCards(List<nom.tam.fits.HeaderCard> pcard)
          Adds header cards for the primary HDU.
protected  void addSecondaryCards(List<nom.tam.fits.HeaderCard> pcard, nom.tam.fits.Header p, int arow, int acol)
          Adds header cards for the secondary HDU.
 boolean close()
          Close the RPC communication.
private  boolean doDark()
          Does a dark exposure.
private  boolean doExposure()
          Does an open-shutter exposure.
private  boolean download(Date t0, Date t1, ergf result)
          Takes the result of an exposure and makes a fits file out of it.
 int expose()
          Make an exposure.
 int exposeBias()
          Makes a bias exposure.
 int exposeDark()
          Makes a dark exposure.
 String getActiveMode()
          The last mode successfully set.
 boolean getAutoflush()
          Gets the autoflush property.
 Dimension getBinning()
          Get the binning values in x (columns) and y (rows).
 Class<nom.tam.fits.Fits> getBufferType()
          We work directly on a fits object.
 Map<String,Object> getCcdInfo()
          We return the temperature of the cold head plus the temperature of the CCD here.
 nom.tam.fits.Fits getDataBuffer()
          Returns the output buffer.
 long getExposureTime()
          Get the current exposure time in milliseconds.
protected  Dimension getMaxPixel()
          Get the max_pixel values for x (columns) and y (rows).
 List<String> getModes()
          Returns all modes supported.
private  Point getPregap()
          Returns the pregap.
private  Dimension getReadoutArea()
          Returns read-ouyt area as a dimension.
protected  double getReadoutDirectionX(int x0, int y0, int n)
          Get the readout direction in x for the current amplifier position
protected  double getReadoutDirectionY(int x0, int y0, int n)
          Get the readout direction in y for the current amplifier position
private static String getSection(int xl, int yd, int xll, int ydd)
          Formats a window to a section string.
 Rectangle getWindow()
          Get the current image origin (pre-gap) in x (columns) and y (rows) and the size
 void init()
          Clear any leftovers.
 boolean isOpen()
          We consider the driver to be open if the ccdclient is initialized.
protected  boolean openController()
          Initializes the fechner driver.
private static Map<String,Character> parseChar(Map<String,String> parse)
          Parses a string-to-string mapping into a string-to-char mapping.
 Object provideStatus()
          Returns the current state of the CCD.
 boolean selectMode(String mode)
          Select this mode, if supported.
 boolean setAutoflush(boolean to)
          Sets the autoflush property.
 boolean setBinning(int xbin, int ybin)
          Set the binning values in x (columns) and y (rows).
 boolean setDataBuffer(nom.tam.fits.Fits file)
          Sets the output buffer.
 boolean setExposureTime(long exptime)
          Set the current exposure time in milliseconds.
protected  boolean setMaxPixel(Dimension max)
          Set the max_pixel values for x (columns) and y (rows).
private  boolean setShutter(boolean open)
          Sets the shutter position.
 boolean setWindow(Rectangle window)
          Set the current image window.
 boolean supportMode(String mode)
          Return true if this mode is supported.
private static short[] swap(short[] little, int start, int len)
          Swaps wrong endian in a short array.
 
Methods inherited from class ccd.SynchronousCcdDriver
ensureReady, isExposing, threadedDarkExpose, threadedExpose
 
Methods inherited from class ccd.AbstractCcdDriver
getChipSize, getReadoutTime, open
 
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 io.Driver
getDriverName
 
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

CCDTEMP

public static final String CCDTEMP
The keyword for the CCD temperature.

See Also:
Constant Field Values

LN2TEMP

public static final String LN2TEMP
The keyword for the CCD temperature.

See Also:
Constant Field Values

OK

public static final int OK
General return code from rpc calls indicating okay.

See Also:
Constant Field Values

COPYBZERO

public static final double COPYBZERO
Default zero offset copied into the extensions, if not in primary.

See Also:
Constant Field Values

COPYBSCALE

public static final double COPYBSCALE
Default scaling factor copied into the extensions, if not in primary.

See Also:
Constant Field Values

DETSIZE

public static final String DETSIZE
Fits key for entering x-pregap info to header.

See Also:
Constant Field Values

DETSIZEREM

public static final String DETSIZEREM
Comment for entering x-pregap info to header.

See Also:
Constant Field Values

CCDSEC

public static final String CCDSEC
Fits key for entering y-pregap info to header.

See Also:
Constant Field Values

CCDSECREM

public static final String CCDSECREM
Comment for entering y-pregap info to header.

See Also:
Constant Field Values

COPYREM

public static final String COPYREM
Comment for a key that was copied from the primary.

See Also:
Constant Field Values

DATESEND

public static final String DATESEND
Header keyword for send exposure start.

See Also:
Constant Field Values

DATECOAL

public static final String DATECOAL
Header keyword for receive exposure end.

See Also:
Constant Field Values

DATESENDREM

public static final String DATESENDREM
Comment for send exposure start.

See Also:
Constant Field Values

DATECOALREM

public static final String DATECOALREM
Comment for receive exposure end.

See Also:
Constant Field Values

KEY_SERVERNAME

public static final String KEY_SERVERNAME
FCDN of the host where the guider rpc server is running.

See Also:
Constant Field Values

KEY_EXPOSEMULTIPLY

public static final String KEY_EXPOSEMULTIPLY
The multiplier for exposure times returned to ms.

See Also:
Constant Field Values

KEY_SUPPORTSHUTTER

public static final String KEY_SUPPORTSHUTTER
If true, driver supports shutter operation.

See Also:
Constant Field Values

KEY_SHUTTEROPEN

public static final String KEY_SHUTTEROPEN
The short paramter for shutter-open.

See Also:
Constant Field Values

KEY_SHUTTERCLOSE

public static final String KEY_SHUTTERCLOSE
The short paramter for shutter-close.

See Also:
Constant Field Values

KEY_MINTIME

public static final String KEY_MINTIME
The minimum exposure time in milliseconds.

See Also:
Constant Field Values

KEY_MAXTIME

public static final String KEY_MAXTIME
The maximum exposure time in milliseconds.

See Also:
Constant Field Values

KEY_RPCTIMEOUT

public static final String KEY_RPCTIMEOUT
The RPC time-out in millisecond.

See Also:
Constant Field Values

KEY_WRONGENDIAN

public static final String KEY_WRONGENDIAN
If true, endian of received short are little.

See Also:
Constant Field Values

KEY_COLAMPLIFIERS

public static final String KEY_COLAMPLIFIERS
Total number of amplifiers expected in row direction.

See Also:
Constant Field Values

KEY_STARTUPMODE

public static final String KEY_STARTUPMODE
We start with this mode per default.

See Also:
Constant Field Values

KEY_MODENAMES

public static final String KEY_MODENAMES
The name of the supported modes.

See Also:
Constant Field Values

KEY_VCLKDIR

public static final String KEY_VCLKDIR
The parameters for the mode setup, vclkdir. Mapping of modes to char.

See Also:
Constant Field Values

KEY_HCLKDIR

public static final String KEY_HCLKDIR
The parameters for the mode setup, hclkdir .

See Also:
Constant Field Values

KEY_OUTPUTCH

public static final String KEY_OUTPUTCH
The parameters for the mode setup, outputch .

See Also:
Constant Field Values

KEY_MAXPIXEL

public static final String KEY_MAXPIXEL
The parameters for the mode setup, max pixel .

See Also:
Constant Field Values

KEY_AUTOFLUSH

public static final String KEY_AUTOFLUSH
The parameters for the extra setup, autoflush .

See Also:
Constant Field Values

DEFDRIVERNAME

public static final String DEFDRIVERNAME
The name of this ccd.

See Also:
Constant Field Values

DEFSERVERNAME

private static final String DEFSERVERNAME
Default property value.

See Also:
Constant Field Values

DEFSUPPORTSHUTTER

private static final boolean DEFSUPPORTSHUTTER
Default property value.

See Also:
Constant Field Values

DEFSHUTTEROPEN

private static final int DEFSHUTTEROPEN
Default property value.

See Also:
Constant Field Values

DEFSHUTTERCLOSE

private static final int DEFSHUTTERCLOSE
Default property value.

See Also:
Constant Field Values

DEFMINTIME

private static final long DEFMINTIME
Default property value.

See Also:
Constant Field Values

DEFEXPOSEMULTIPLY

private static final long DEFEXPOSEMULTIPLY
Default property value.

See Also:
Constant Field Values

DEFMAXTIME

private static final long DEFMAXTIME
Default property value.

See Also:
Constant Field Values

DEFRPCTIMEOUT

private static final int DEFRPCTIMEOUT
Default property value.

See Also:
Constant Field Values

DEFWRONGENDIAN

private static final boolean DEFWRONGENDIAN
Default property value.

See Also:
Constant Field Values

DEFAMPLIFIERS

private static final int DEFAMPLIFIERS
Default property value.

See Also:
Constant Field Values

DEFCOLAMPLIFIERS

private static final int DEFCOLAMPLIFIERS
Default property value.

See Also:
Constant Field Values

DEFSTARTUPMODE

private static final String DEFSTARTUPMODE
The mode that is selected after startup. Two-amplifier readout.

See Also:
Constant Field Values

DEFMODENAMES

private static final String DEFMODENAMES
The names of all supported modes.

See Also:
Constant Field Values

DEFVCLKDIR

private static final String DEFVCLKDIR
The parameters for the extra setup, vclkdir .

See Also:
Constant Field Values

DEFHCLKDIR

private static final String DEFHCLKDIR
The parameters for the extra setup, vclkdir .

See Also:
Constant Field Values

DEFOUTPUTCH

private static final String DEFOUTPUTCH
The parameters for the extra setup, outputch .

See Also:
Constant Field Values

DEFMAXPIXEL

private static final String DEFMAXPIXEL
The parameters for the extra setup, usec .

See Also:
Constant Field Values

DEFAUTOFLUSH

private static final boolean DEFAUTOFLUSH
The parameters for the extra setup, autoflush .

See Also:
Constant Field Values

ccdclient

private static E2VMagellanClient ccdclient
RPC client instance.


async

private nom.tam.fits.Fits async
The data buffer for asynchroneous retrieval.


lastmode

private String lastmode
This was the last successfully attained mode.


modes

private List<String> modes
The list of supported modes.


vclkdir

private Map<String,Character> vclkdir
Lookup table for mode to vlckdir.


hclkdir

private Map<String,Character> hclkdir
Lookup table for mode to hlckdir.


outputch

private Map<String,Character> outputch
Lookup table for mode to output channel.


maxpixel

private Map<String,Dimension> maxpixel
Lookup table for mode to maxpixel.

Constructor Detail

E2VDriver

public E2VDriver(Map<String,String> info)
Constructor. Does not open the connection, this is done in init().

Method Detail

init

public void init()
Clear any leftovers.

Specified by:
init in interface Initializable
Overrides:
init in class AbstractCcdDriver<nom.tam.fits.Fits>

parseChar

private static Map<String,Character> parseChar(Map<String,String> parse)
Parses a string-to-string mapping into a string-to-char mapping.


provideStatus

public Object provideStatus()
Returns the current state of the CCD. We query the underlying client's GET_STATUS and deliver the returned value as an Integer. SCI_IDLE = 00 SCI_EXPOSE = 01 ; entweder prewipe oder expose SCI_READOUT = 02 ; auslesen SCI_WIPE = 03 ; auto clean SCI_BUSY = 99

Specified by:
provideStatus in interface StatusProviding

openController

protected boolean openController()
                          throws IOException
Initializes the fechner driver. Tries to connect to the server and sets default values for binning, maximum size of the chip and read-out window. If a shutter is supported, it is closed. Returns true if initialization was successful.

Specified by:
openController in class AbstractCcdDriver<nom.tam.fits.Fits>
Throws:
IOException - If controller connection fails.

getModes

public List<String> getModes()
Returns all modes supported.

Specified by:
getModes in interface MultiMode

supportMode

public boolean supportMode(String mode)
Return true if this mode is supported. This is done by looking up the requested mode in the list of supported modes.

Specified by:
supportMode in interface MultiMode

getActiveMode

public String getActiveMode()
The last mode successfully set.

Specified by:
getActiveMode in interface MultiMode

selectMode

public boolean selectMode(String mode)
                   throws IOException
Select this mode, if supported. Though the vclkdir does not change in the default setup, it is set here anyway. Depending on the mode, also the hclkdir, the outputchannel and the maximum pixel are set. The read-out frame is reset to full frame by passing the maximal window to the set window method, once the mode has been selected.

Specified by:
selectMode in interface MultiMode
Throws:
IOException

isOpen

public boolean isOpen()
We consider the driver to be open if the ccdclient is initialized.

Specified by:
isOpen in interface Driver
Returns:
True, if a previous initialization was successful

close

public boolean close()
              throws IOException
Close the RPC communication.

Specified by:
close in interface Driver
Returns:
True if clean-up was successful.
Throws:
IOException

setMaxPixel

protected boolean setMaxPixel(Dimension max)
                       throws IOException
Set the max_pixel values for x (columns) and y (rows).

Parameters:
xmax - maximum CCD size in x-direction (1 <= value < 65536)
ymax - maximum CCD size in y-direction (1 <= value < 65536)
Throws:
IOException

getMaxPixel

protected Dimension getMaxPixel()
                         throws IOException
Get the max_pixel values for x (columns) and y (rows).

Returns:
A dimension object, where the size in x is the width.
Throws:
IOException

setBinning

public boolean setBinning(int xbin,
                          int ybin)
                   throws IOException
Set the binning values in x (columns) and y (rows).

Specified by:
setBinning in interface CcdDriver<nom.tam.fits.Fits>
Parameters:
xbin - binning factor in x-direction (1 <= binning factor <= 255)
ybin - binning factor in y-direction (1 <= binning factor <= 255)
Returns:
True if successful.
Throws:
IOException - Any subclass of IOException

getBinning

public Dimension getBinning()
                     throws IOException
Get the binning values in x (columns) and y (rows).

Specified by:
getBinning in interface CcdDriver<nom.tam.fits.Fits>
Returns:
Dimension object, columns in width.
Throws:
IOException - Any subclass of IOException.

setWindow

public boolean setWindow(Rectangle window)
                  throws IOException
Set the current image window.

Specified by:
setWindow in interface CcdDriver<nom.tam.fits.Fits>
Parameters:
window - The origin being the upper left corner of the rectangle.
Returns:
True if successful.
Throws:
IOException - Any subclass of IOException.

getWindow

public Rectangle getWindow()
                    throws IOException
Get the current image origin (pre-gap) in x (columns) and y (rows) and the size

Specified by:
getWindow in interface CcdDriver<nom.tam.fits.Fits>
Returns:
A rectangle with pre-gap upper left corner.
Throws:
IOException - Any subclass of IOException.

setExposureTime

public boolean setExposureTime(long exptime)
                        throws IOException
Set the current exposure time in milliseconds.

Specified by:
setExposureTime in interface CcdDriver<nom.tam.fits.Fits>
Parameters:
expTime - exposure time in milliseconds. (0 <= expTime < 65536 ms)
Returns:
True if successful.
Throws:
IOException - Any subclass of IOException.

getExposureTime

public long getExposureTime()
                     throws IOException
Get the current exposure time in milliseconds.

Specified by:
getExposureTime in interface CcdDriver<nom.tam.fits.Fits>
Returns:
current exposure time (in milliseconds).
Throws:
IOException - Any subclass of IOException.

setAutoflush

public boolean setAutoflush(boolean to)
                     throws IOException
Sets the autoflush property. Without autoflushing, a few seconds can be spared on an exposure, but the danger of charge-buildup remains.

Throws:
IOException

getAutoflush

public boolean getAutoflush()
                     throws IOException
Gets the autoflush property.

Throws:
IOException

getBufferType

public Class<nom.tam.fits.Fits> getBufferType()
We work directly on a fits object.

Specified by:
getBufferType in interface CcdDriver<nom.tam.fits.Fits>

setDataBuffer

public boolean setDataBuffer(nom.tam.fits.Fits file)
                      throws IOException
Sets the output buffer. The buffer must be a fits object.

Specified by:
setDataBuffer in interface CcdDriver<nom.tam.fits.Fits>
Parameters:
file - Any sort of buffer the driver knows to store CCD-data in.
Returns:
True if successful.
Throws:
IOException - Any subclass of IOException.

getDataBuffer

public nom.tam.fits.Fits getDataBuffer()
                                throws IOException
Returns the output buffer. This is either the fits buffer set via a call to setDataBuffer(nom.tam.fits.Fits), or null if not set and no exposure has been taken. If an exposure has finished and the buffer has not been explicedly set, a new fits object has been allocated, which will be returned here.

Specified by:
getDataBuffer in interface CcdDriver<nom.tam.fits.Fits>
Throws:
IOException - Any subclass of IOException.

getCcdInfo

public Map<String,Object> getCcdInfo()
                              throws IOException
We return the temperature of the cold head plus the temperature of the CCD here.

Specified by:
getCcdInfo in interface CcdDriver<nom.tam.fits.Fits>
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. If the driver supports a shutter, the shutter is opened before the exposure starts and closed after. Note that this method does not check for proper settings. In TF's driver this method blocks.

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

exposeBias

public int exposeBias()
               throws IOException
Makes a bias exposure. Does an dark exposure with minimum time. The data buffer has to be set prior to a call to this method.

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

exposeDark

public int exposeDark()
               throws IOException
Makes a dark exposure. The shutter is not moved, even if present. The data buffer has to be set prior to a call to this method.

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

getPregap

private Point getPregap()
                 throws IOException
Returns the pregap. Returns property setting if not open.

Throws:
IOException

swap

private static short[] swap(short[] little,
                            int start,
                            int len)
Swaps wrong endian in a short array.


getReadoutArea

private Dimension getReadoutArea()
                          throws IOException
Returns read-ouyt area as a dimension. Returns property setting if not open.

Throws:
IOException

setShutter

private boolean setShutter(boolean open)
                    throws IOException
Sets the shutter position. If called with true, shutter is opened. Driver must be opened, this is unchecked.

Throws:
IOException

addPrimaryCards

protected void addPrimaryCards(List<nom.tam.fits.HeaderCard> pcard)
Adds header cards for the primary HDU. Default implementation does nothing.


addSecondaryCards

protected void addSecondaryCards(List<nom.tam.fits.HeaderCard> pcard,
                                 nom.tam.fits.Header p,
                                 int arow,
                                 int acol)
Adds header cards for the secondary HDU. Default implementation copies the BSCALE and BZERO setting from the primary header, if they are there, otherwise COPYBZERO and COPYBSCALE are used. The CCD-section is entered in the main method, but possible extension could involve: Point x0y0 = getPregap(); // add as origin if known HeaderCard org; if (x0y0 != null) { org = new HeaderCard(XORIGIN, x0y0.x, XORGREM); cards.add(org.toString()); org = new HeaderCard(YORIGIN, x0y0.y, YORGREM); cards.add(org.toString()); }


getReadoutDirectionX

protected double getReadoutDirectionX(int x0,
                                      int y0,
                                      int n)
Get the readout direction in x for the current amplifier position


getReadoutDirectionY

protected double getReadoutDirectionY(int x0,
                                      int y0,
                                      int n)
Get the readout direction in y for the current amplifier position


getSection

private static String getSection(int xl,
                                 int yd,
                                 int xll,
                                 int ydd)
Formats a window to a section string. The counting starts at zero, but the correct value is added.


doExposure

private boolean doExposure()
                    throws IOException
Does an open-shutter exposure. This method calls the RPC-method StreamClient#DO_EXPOSURE_2, grabs the returned fits object and transforms it to the more general ImageHDU java object. If a data buffer-fits is set, all of its HDU's are deleted and the new Image is added to the fits file. If no async buffer was set, a new fits file is generated with the current data. // the END card is always missing, but we want to add origin

Throws:
IOException

doDark

private boolean doDark()
                throws IOException
Does a dark exposure. This method calls the RPC-method StreamClient#DO_DARK_2, grabs the returned fits object and transforms it to the more general ImageHDU java object. If a data buffer-fits is set, all of its HDU's are deleted and the new Image is added to the fits file. If no async buffer was set, a new fits file is generated with the current data. // the END card is always missing, but we want to add origin

Throws:
IOException

download

private boolean download(Date t0,
                         Date t1,
                         ergf result)
                  throws nom.tam.fits.FitsException
Takes the result of an exposure and makes a fits file out of it.

Throws:
nom.tam.fits.FitsException