public class SesDriver extends SynchronousCcdDriver implements StatusProviding, MultiMode, Asynchronous, AutoClearing
SynchronousCcdDriver.ExposureThread, SynchronousCcdDriver.ThreadShotAbstractCcdDriver.Endurance, AbstractCcdDriver.Exposure, AbstractCcdDriver.Shot| Modifier and Type | Field and Description |
|---|---|
private MFits |
async
The data buffer for asynchroneous retrieval.
|
static String |
BIASSEC
Fits key for entering y-pregap info to header.
|
static String |
BIASSECREM
Comment for entering y-pregap info to header.
|
private static SesMagellanClient |
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 |
DATASEC
Fits key for entering y-pregap info to header.
|
static String |
DATASECREM
Comment for entering y-pregap info to header.
|
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 |
DEFMINDARKTIME
Default property value.
|
private static long |
DEFMINIMUMABORTMS |
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, output .
|
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 |
DETSEC
Fits key for entering y-pregap info to header.
|
static String |
DETSECREM
Comment for entering y-pregap info to header.
|
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_GAIN
If this key is present, it points to the gain of the quadrants.
|
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_MINDARKTIME
The minimum dark exposure time in milliseconds.
|
static String |
KEY_MINIMUMABORTMS
Aborts are issued via a stop command only if at least ms exposure left.
|
static String |
KEY_MODENAMES
The name of the supported modes.
|
static String |
KEY_OUTPUTCH
The parameters for the mode setup, outputch .
|
static String |
KEY_READNOISE
If this key is present, it points to the read-noise of the quadrants.
|
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.
|
private Rectangle |
lastwindow
Last window set (offset is not recoverable otherwise).
|
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 static SesMagellanClient |
status
RPC client solely for status retrieval.
|
private Map<String,Character> |
vclkdir
Lookup table for mode to vlckdir.
|
KEY_AMPLIFIERS, KEY_AREAREADOUT, KEY_COLUMNPOST, KEY_COLUMNPRIOR, KEY_COLUMNREADOUT, KEY_FIXEDREADOUT, KEY_INITSIZE, KEY_MAXTIME, KEY_MINTIME, KEY_ROWPOST, KEY_ROWPRIOR, KEY_ROWREADOUT, KEY_XBINNING, KEY_XCHIPSIZE, KEY_XDETECTORSIZE, KEY_XORIGIN, KEY_XSIZE, KEY_YBINNING, KEY_YCHIPSIZE, KEY_YDETECTORSIZE, KEY_YORIGIN, KEY_YSIZEKEY_DRIVERNAMEKEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATORFITSEXTENSIONCONFIG, KEY_CLASS| Constructor and Description |
|---|
SesDriver(Map<String,String> info)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
close()
Close the RPC communication.
|
String |
conciseStatus()
Returns the current state of the CCD.
|
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.
|
Object |
extendedStatus()
Returns the current state of the CCD.
|
String |
getActiveMode()
The last mode successfully set.
|
Dimension |
getBinning()
Get the binning values in x (columns) and y (rows).
|
Map<String,Object> |
getCcdInfo()
We return the temperature of the cold head plus the temperature of the
CCD here.
|
MFits |
getData()
Returns the output buffer.
|
double |
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 |
interruptProcess()
Aborts the ongoing exposure.
|
boolean |
interruptProcess(Method any)
Aborts the ongoing exposure.
|
boolean |
isAutoClearing()
Gets the autoflush property.
|
boolean |
isExposing()
We are exposing if the
#provideStatus method returns 1. |
boolean |
isOpen()
We consider the driver to be open if the ccdclient is initialized.
|
boolean |
isReadingOut()
We are exposing if the
#provideStatus method returns 1. |
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.
|
private Integer |
readStatus(int param)
Returns the current state of the CCD.
|
boolean |
selectMode(String mode)
Select this mode, if supported.
|
boolean |
setAutoClearing(boolean to)
Sets the autoflush property.
|
boolean |
setBinning(int xbin,
int ybin)
Set the binning values in x (columns) and y (rows).
|
boolean |
setExposureTime(double exptime)
Set the current exposure time in milliseconds.
|
private boolean |
setExposureTime(double exptime,
boolean check) |
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.
|
private boolean |
stopExposure()
Tries to stop the SES exposure by issuing the new STOP command.
|
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.
|
cancelContinuous, ensureReady, getRunning, startContinuous, stopContinuous, threadedBiasExpose, threadedDarkExpose, threadedExposegetDetectorSize, getMaximumExposureTime, getMinimumExposureTime, getReadoutMaximum, getReadoutTime, opencreateDriver, equals, getDriverName, hashCodeaugment, augment, augment, augment, augment, clone, 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, initProperties, isNew, parseObject, parseObject, reload, reload, removeProperty, requires, rescanned, setObject, setProperties, setProperty, stringProperties, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitgetDetectorSize, getMaximumExposureTime, getMinimumExposureTime, getReadoutMaximum, getReadoutTimegetDriverName, openpublic static final String CCDTEMP
public static final String LN2TEMP
public static final int OK
public static final double COPYBZERO
public static final double COPYBSCALE
public static final String DETSIZE
public static final String DETSIZEREM
public static final String CCDSEC
public static final String DETSEC
public static final String DATASEC
public static final String BIASSEC
public static final String CCDSECREM
public static final String DETSECREM
public static final String DATASECREM
public static final String BIASSECREM
public static final String COPYREM
public static final String DATESEND
public static final String DATECOAL
public static final String DATESENDREM
public static final String DATECOALREM
public static final String KEY_SERVERNAME
public static final String KEY_EXPOSEMULTIPLY
public static final String KEY_SUPPORTSHUTTER
public static final String KEY_SHUTTEROPEN
public static final String KEY_SHUTTERCLOSE
public static final String KEY_MINDARKTIME
public static final String KEY_RPCTIMEOUT
public static final String KEY_WRONGENDIAN
public static final String KEY_COLAMPLIFIERS
public static final String KEY_STARTUPMODE
public static final String KEY_MODENAMES
public static final String KEY_VCLKDIR
public static final String KEY_HCLKDIR
public static final String KEY_OUTPUTCH
public static final String KEY_MAXPIXEL
public static final String KEY_AUTOFLUSH
public static final String KEY_MINIMUMABORTMS
public static final String KEY_READNOISE
public static final String KEY_GAIN
public static final String DEFDRIVERNAME
private static final String DEFSERVERNAME
private static final boolean DEFSUPPORTSHUTTER
private static final int DEFSHUTTEROPEN
private static final int DEFSHUTTERCLOSE
private static final long DEFMINTIME
private static final long DEFMINDARKTIME
private static final long DEFEXPOSEMULTIPLY
private static final long DEFMAXTIME
private static final int DEFRPCTIMEOUT
private static final boolean DEFWRONGENDIAN
private static final int DEFAMPLIFIERS
private static final int DEFCOLAMPLIFIERS
private static final String DEFSTARTUPMODE
private static final String DEFMODENAMES
private static final String DEFVCLKDIR
private static final String DEFHCLKDIR
private static final String DEFOUTPUTCH
private static final String DEFMAXPIXEL
private static final boolean DEFAUTOFLUSH
private static final long DEFMINIMUMABORTMS
private static SesMagellanClient ccdclient
private static SesMagellanClient status
private MFits async
private Rectangle lastwindow
private String lastmode
public void init()
throws InitException
init in interface Initializableinit in class AbstractCcdDriverInitExceptionprivate static Map<String,Character> parseChar(Map<String,String> parse)
public boolean isExposing()
#provideStatus method returns 1. Never ask
directly at exposure start, may yield inadequate results.isExposing in interface CcdDriverisExposing in class SynchronousCcdDriverpublic boolean isReadingOut()
#provideStatus method returns 1. Never ask
directly at exposure start, may yield inadequate results.isReadingOut in interface CcdDriverisReadingOut in class SynchronousCcdDriverpublic boolean interruptProcess()
throws InterruptedException
interruptProcess in interface AsynchronousInterruptedExceptionpublic boolean interruptProcess(Method any) throws InterruptedException
interruptProcess in interface AsynchronousInterruptedExceptionpublic Object extendedStatus()
extendedStatus in interface StatusProvidingpublic String conciseStatus()
conciseStatus in interface StatusProvidingprivate Integer readStatus(int param)
protected boolean openController()
throws IOException
openController in class AbstractCcdDriverIOException - If controller connection fails.public boolean supportMode(String mode)
supportMode in interface MultiModepublic String getActiveMode()
getActiveMode in interface MultiModepublic boolean selectMode(String mode) throws IOException
selectMode in interface MultiModeIOExceptionpublic boolean isOpen()
public boolean close()
throws IOException
close in interface DriverIOExceptionprotected boolean setMaxPixel(Dimension max) throws IOException
max - maximum CCD size in x-direction and y-directionIOExceptionprotected Dimension getMaxPixel() throws IOException
IOExceptionpublic boolean setBinning(int xbin,
int ybin)
throws IOException
setBinning in interface CcdDriverxbin - binning factor in x-direction (1 <= binning factor <= 255)ybin - binning factor in y-direction (1 <= binning factor <= 255)IOException - Any subclass of IOExceptionpublic Dimension getBinning() throws IOException
getBinning in interface CcdDriverIOException - Any subclass of IOException.public boolean setWindow(Rectangle window) throws IOException
setWindow in interface CcdDriverwindow - The origin being the upper left corner of the rectangle.IOException - Any subclass of IOException.public Rectangle getWindow() throws IOException
getWindow in interface CcdDriverIOException - Any subclass of IOException.public boolean setExposureTime(double exptime)
throws IOException
setExposureTime in interface CcdDriverexpTime - exposure time in milliseconds. (0 <= expTime < 65536 ms)IOException - Any subclass of IOException.private boolean setExposureTime(double exptime,
boolean check)
throws IOException
IOExceptionpublic double getExposureTime()
throws IOException
getExposureTime in interface CcdDriverIOException - Any subclass of IOException.public boolean setAutoClearing(boolean to)
throws IOException
setAutoClearing in interface AutoClearingIOExceptionpublic boolean isAutoClearing()
throws IOException
isAutoClearing in interface AutoClearingIOExceptionpublic MFits getData() throws IOException
#setDataBuffer, 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.getData in interface CcdDriverIOException - Any subclass of IOException.public Map<String,Object> getCcdInfo() throws IOException
getCcdInfo in interface CcdDriverIOExceptionpublic int expose()
throws IOException
expose in interface CcdDriverIOException - Any subclass of IOException.startExposepublic int exposeBias()
throws IOException
exposeBias in interface CcdDriverIOException - Any subclass of IOException.public int exposeDark()
throws IOException
exposeDark in interface CcdDriverIOException - Any subclass of IOException.private boolean stopExposure()
throws IOException
IOExceptionprivate Point getPregap() throws IOException
IOExceptionprivate static short[] swap(short[] little,
int start,
int len)
private Dimension getReadoutArea() throws IOException
IOExceptionprivate boolean setShutter(boolean open)
throws IOException
IOExceptionprotected double getReadoutDirectionX(int x0,
int y0,
int n)
protected double getReadoutDirectionY(int x0,
int y0,
int n)
private static String getSection(int xl, int yd, int xll, int ydd)
private boolean doExposure()
throws IOException
StreamClient#DO_EXPOSURE_2, grabs the returned fits
object and transforms it to the more general MFits 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 originIOExceptionprivate boolean doDark()
throws IOException
SesMagellanClient.DO_DARK_2(ccd.ses231.cmd), grabs the returned fits
object and transforms it to the more general MFits 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 originIOExceptionprivate boolean download(Date t0, Date t1, ergf result) throws BasicFitsException
BasicFitsException