|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectutil.PropertyContainer
util.PropertyResources
util.PropertyBundles
ccd.DarkOverlapTiler
public class DarkOverlapTiler
A dark tiler splits an available (guider) CCD into individual tiles and tries to generate darks and bias for it. Different to the first class that had problematic points at the edges of the two layers, this is an overlapping tiler with four layers. Any point on the CCD (except points at the physical edge of the CCD) can be located in a tile where it has at least a quarter of the tile dimension to either side. It works as follows:
KEY_DRIVER points to the properties of a ccd-driver.
The driver is opened on init.KEY_CORNER property is set, this is the upper left
corner of the photoactive ccd (or, normally in fits the lower left
corner). Otherwise 0,0 is used.KEY_TILESIZE property must point to a Dimension that
is used as the tile size. It must be even in x and y, preferrably also
after binning has applied.KEY_ACTIVEAREA property must point to the active size
of the CCD. On init, we check if this active area is a plain integer
multiple of the tilesize and if the tile fits at least twice in x and
y. Further, if the maximum size of the ccd as defined in the
CcdDriver#getSize is smaller than the specified active
area plus a possible corner offset, an exception is thrown.KEY_EXITSTATE property exists and points to a
readable resource, the current tile number to execute is read, otherwise
we start at tile 0.KEY_TEMPERATURE property points to a sensor, we
record the (bay) temperature.KEY_AVERAGECOUNT property points to the number
of frames taken for each tile.KEY_AVERAGECOUNT frames,
master frames are generated and stored in KEY_DARKDIRECTORY.
The fits header is augmented with an average bay temperature plus
its sigma, if applicable.AuxiliaryMaster to
generated
a heap of reductional frames for the guider CCD whenever the Telescope
is idle and it is dark.
| Nested Class Summary | |
|---|---|
static class |
DarkOverlapTiler.Check
Checks the entire CCD for best tile-nr and edge distance. |
static class |
DarkOverlapTiler.Current
Retrieves the best-fitting dark and bias frames. |
static class |
DarkOverlapTiler.Scan
A class that allows scanning of directories to reconstruct the lookup tables. |
static class |
DarkOverlapTiler.Standalone
A standalone class, mainly for testing. |
private class |
DarkOverlapTiler.TilerThread
A tiler thread is a thread that runs forever until its cancel method is called. |
| Nested classes/interfaces inherited from class util.PropertyResources |
|---|
PropertyResources.URLResource |
| Field Summary | |
|---|---|
private static String |
AVERAGECOMMENT
Fits comment for average temperatue. |
private static String |
AVERAGETEMP
Fits key word for average temperatue. |
private static String |
BIAS
Default bias ID. |
private List<SortedMap<Double,File>>[] |
biaslookup
Lookup list for the different tiles sizes. |
private List<Dimension> |
binnings
All tile binnings. |
private CcdDriver |
ccd
My CCD driver interface. |
private int[] |
columns
The number of tiles in x direction. |
private static String |
DARK
Default dark ID. |
private List<SortedMap<Double,File>>[] |
darklookup
Lookup list for the different tiles sizes. |
private static int |
DEFAVERAGECOUNT
Number of frames to record on each tile for bias/dark. |
private static long |
DEFBIASEXPOSE
Exposure time in ms for the bias frames. |
private static Point |
DEFCORNER
Point of the upper left corner, i.e. |
private static long |
DEFDARKEXPOSE
Exposure time in ms for the dark frames. |
private static Format |
DEFDARKFORMAT
The formatter to name sub-dirs below dark. |
private static String |
DEFEXITSTATE
Resource where we write/read our current tile number. |
private static boolean |
DEFSIMULATE
Points to true if we should only simulate action. |
private static Dimension |
DEFTILEBINNING
Default binning used on all tile sizes, if not overruled. |
private static Format |
DEFTILEFORMAT
The formatter to name sub-dirs below dark runs. |
private static Insets |
DEFTILEFRAME
Frame of the overlap as an inset. |
private static String |
HEADER
Comment line in tile/temperature/fits-file lookup table. |
static String |
KEY_ACTIVEAREA
Size of the active area on the chip. |
static String |
KEY_AVERAGECOUNT
Number of frames to record on each tile for bias/dark. |
static String |
KEY_BIASEXPOSE
Exposure time in ms for the bias frames. |
static String |
KEY_BIASLOOKUP
The resource for restoring the bias lookup lists. |
static String |
KEY_CORNER
Point of the upper left corner, i.e. |
static String |
KEY_DARKDIRECTORY
Directory where we put the master frames. |
static String |
KEY_DARKEXPOSE
Exposure time in ms for the dark frames. |
static String |
KEY_DARKFORMAT
The formatter to name sub-dirs below dark. |
static String |
KEY_DARKLOOKUP
The resource for restoring the bias lookup lists. |
static String |
KEY_DRIVER
Name of the ccd driver. |
static String |
KEY_EXITSTATE
Resource where we write/read our current tile number. |
static String |
KEY_SIMULATE
Points to true if we should only simulate action. |
static String |
KEY_TEMPERATURE
Temperature sensor for matching dark currents. |
static String |
KEY_TILEBINNING
List of binning of the tiles, separator '|'. |
static String |
KEY_TILEDIRECTORY
Directory where we get the tile frames. |
static String |
KEY_TILEFORMAT
The formatter to name sub-dirs below dark. |
static String |
KEY_TILEFRAME
Extra border that overlaps each tile, if readout spoils. |
static String |
KEY_TILESIZE
List of dimension of the single tiles, separator '|'. |
private static String |
MASTER
Default master ID. |
private boolean |
matchnag
Avoid to many errors. |
private int[] |
rows
The number of tiles in y direction. |
private int |
runnr
The current run number. |
private static String |
SIGMA
Default master ID. |
private static String |
SIGMACOMMENT
Fits comment for average temperatue. |
private static String |
SIGMATEMP
Fits key word for average temperatue. |
private int |
sizenr
The tile size that is currently processed, index in array. |
private Value |
temperature
If we have a temperature sensor. |
private int |
tilenr
The tile number that is currently processed. |
private DarkOverlapTiler.TilerThread |
tilerthread
The thread that does the work. |
private List<Dimension> |
tiles
All tile sizes the active area is cut into. |
private static String |
XOFF
Fits key word for x corner. |
private static String |
XOFFCOMMENT
Fits comment for x corner . |
private static String |
YOFF
Fits key word for x corner. |
private static String |
YOFFCOMMENT
Fits comment for x corner . |
| 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 util.ResourceSupplying |
|---|
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME |
| Fields inherited from interface util.PropertySupplying |
|---|
CONFIG, KEY_CLASS |
| Constructor Summary | |
|---|---|
DarkOverlapTiler(Map<String,String> prop)
Construct the dark tiler. |
|
| Method Summary | |
|---|---|
private int |
closestTile(int t0,
Point2D p0)
Scans for the tile which center is closest to the given point. |
void |
exit()
On exit, we save the current tile. |
Rectangle |
getAccessible()
Returns the accessible area on this dark tiler. |
Guiding.RawFrame |
getAround(int tilesize,
Point2D tentative)
Supply a tentative center of view in ccd-pixel, in the same pixel coordinate system as the acquire center and guiding center are defined. |
private File |
getMatching(int sizeidx,
int tileidx,
List<SortedMap<Double,File>>[] tab)
Scans the look-up lists for the bias/dark frame that fits closest to the frame queried. |
private double |
getTemperature()
Gets the current temperature, if applicable or zero. |
private int |
getTileCount(int tilesizeindex)
Returns the number of tiles in the given tile size. |
private Dimension |
getTileSize(int tilesizeindex)
Returns the tile dimension to the given index. |
private Rectangle |
getTileWindow(int nr,
int sizeindex)
From a valid tile number, we calculate the characteristics of the tile window, i.e. |
void |
init()
On init, we first test if the active area can host the tile size. |
private List<SortedMap<Double,File>>[] |
loadLookup(URL resource)
Creates a lookup list-array. |
boolean |
registerDriver(Driver fechi)
Registers the CCD-driver. |
private static boolean |
saveLookup(File write,
List<SortedMap<Double,File>>[] tab)
Saves our specific look-up list (bias or dark) to the specified file. |
private static boolean |
saveLookup(URL where,
List<SortedMap<Double,File>>[] tab)
Saves our specific look-up list (bias or dark) to the specified resource if this resource points to a file that can be writtn. |
private static boolean |
saveRun(File state,
int run,
int size,
int tile)
Saves the current run number, size number and tile number. |
boolean |
start()
Starts the tiler. |
boolean |
stop()
Stops the tiler. |
| 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 |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| 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 |
|---|
public static final String KEY_DRIVER
public static final String KEY_CORNER
public static final String KEY_TILESIZE
public static final String KEY_TILEFRAME
public static final String KEY_TILEBINNING
public static final String KEY_ACTIVEAREA
public static final String KEY_EXITSTATE
public static final String KEY_TEMPERATURE
public static final String KEY_AVERAGECOUNT
public static final String KEY_BIASEXPOSE
public static final String KEY_DARKEXPOSE
public static final String KEY_TILEDIRECTORY
public static final String KEY_DARKDIRECTORY
public static final String KEY_DARKFORMAT
public static final String KEY_TILEFORMAT
public static final String KEY_SIMULATE
public static final String KEY_BIASLOOKUP
public static final String KEY_DARKLOOKUP
private static final String BIAS
private static final String DARK
private static final String MASTER
private static final String SIGMA
private static final String AVERAGETEMP
private static final String AVERAGECOMMENT
private static final String SIGMATEMP
private static final String SIGMACOMMENT
private static final String XOFF
private static final String XOFFCOMMENT
private static final String YOFF
private static final String YOFFCOMMENT
private static final String HEADER
private static final Point DEFCORNER
private static final Insets DEFTILEFRAME
private static final Dimension DEFTILEBINNING
private static final String DEFEXITSTATE
private static final int DEFAVERAGECOUNT
private static final long DEFBIASEXPOSE
private static final long DEFDARKEXPOSE
private static final Format DEFDARKFORMAT
private static final Format DEFTILEFORMAT
private static final boolean DEFSIMULATE
private CcdDriver ccd
private List<SortedMap<Double,File>>[] biaslookup
private List<SortedMap<Double,File>>[] darklookup
private List<Dimension> tiles
private List<Dimension> binnings
private int[] columns
private int[] rows
private int runnr
private int tilenr
private int sizenr
private Value temperature
private DarkOverlapTiler.TilerThread tilerthread
private boolean matchnag
| Constructor Detail |
|---|
public DarkOverlapTiler(Map<String,String> prop)
| Method Detail |
|---|
public void init()
init in interface Initializableinit in class PropertyResourcespublic boolean registerDriver(Driver fechi)
KEY_DRIVER
property.
We query its size
to see if the active area plus the corner offset fits into it.
registerDriver in interface DriverDependingpublic Rectangle getAccessible()
public boolean start()
stop(). If the tiler is already active,
we return silently.
public boolean stop()
public void exit()
stop(), otherwise
it may take some time to execute.
exit in interface ExitCleaning
public Guiding.RawFrame getAround(int tilesize,
Point2D tentative)
private int closestTile(int t0,
Point2D p0)
private Rectangle getTileWindow(int nr,
int sizeindex)
private File getMatching(int sizeidx,
int tileidx,
List<SortedMap<Double,File>>[] tab)
private double getTemperature()
private int getTileCount(int tilesizeindex)
private Dimension getTileSize(int tilesizeindex)
private List<SortedMap<Double,File>>[] loadLookup(URL resource)
tilesizeindex tilenumber Temperature absoultePath.
private static boolean saveRun(File state,
int run,
int size,
int tile)
private static boolean saveLookup(URL where,
List<SortedMap<Double,File>>[] tab)
private static boolean saveLookup(File write,
List<SortedMap<Double,File>>[] tab)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||