public class DitherParameter extends AbstractTargetParameter implements ParameterDepending
ReservedConstants#. Setup id="dithering" Constantname ragrid Constantvalue 5The constant names must be equal to the properties. A regular dither is always conducted along a spiral. The grid values are pixel offsets, the steps is the number of grid offsets to either direction, e.g. in the above case with a step=2 we would get five ra offsets at, -10 -5, 0, +5 and +10 pixels on the CCD. If combined with degrid=7, we would get as pattern
0, 0; 5, 0; 5, -7; 0, -7; -5, -7; -5, 0; -5, 7; 0, 7; 5, 7; 10, 7; 10, 0; 10, -7; 10, -14; 5, -14; 0, -14; -5, -14; -10, -14; -10, -7; -10, 0; -10, 7; -10, 14; -5, 14; 0, 14; 5, 14; 10, 14;If a randomized offset is given, an additional maximum offset of rarandom and derandom is added to the pattern.
PropertyResources.Load, PropertyResources.URLResource| Modifier and Type | Field and Description |
|---|---|
private Value |
count
The parameter that counts the actual exposure number.
|
private static double |
DEFDEGRID
Default de-step, zero.
|
private static double |
DEFDERANDOM
Default ra-step, zero.
|
private static String |
DEFEXPOSURECOUNT
Default exposure counter name.
|
private static int |
DEFGRIDSTEP
Default grid size, zero.
|
private static double |
DEFRAGRID
Default ra-step, zero.
|
private static double |
DEFRARANDOM
Default ra-step, zero.
|
private double |
degrid
This value is changed with each new target.
|
private double |
derandom
This value is changed with each new target.
|
private int |
gridstep
This value is changed with each new target.
|
static String |
KEY_DEGRID
Size of de-like step, in pixel.
|
static String |
KEY_DERANDOM
Size of ra-like step, in pixel.
|
static String |
KEY_EXPOSURECOUNT
The parameter that counts the exposure number.
|
static String |
KEY_GRIDSTEP
Size of grid, to both directions.
|
static String |
KEY_RAGRID
Size of ra-like step, in pixel.
|
static String |
KEY_RARANDOM
Size of ra-like random step, in pixel.
|
private double |
ragrid
This value is changed with each new target.
|
private double |
rarandom
This value is changed with each new target.
|
KEY_INDEXKEY_FORMAT, KEY_NAME, KEY_PRESERVE, UNKNOWNKEY_NOINITONCREATE, POSTFIX_ALPHABET, POSTFIX_BYTES, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_MODTIME, POSTFIX_URLKEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATORCONFIG, KEY_CLASSKEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME| Constructor and Description |
|---|
DitherParameter(Map<String,String> prop)
Constructs a new dither parameter, defaulting all values to zero.
|
| Modifier and Type | Method and Description |
|---|---|
private static Vector2D |
calculateDither(int index,
double rapix,
double depix,
double rarand,
double derand,
int size)
Calculates a spiral-like pattern dither, where the first number is the
current dither count.
|
private void |
defaultDither()
Default dither values loaded from properties.
|
Vector2D |
get()
We return from a previously registered target and the actual exposure
number the qulified pixel ofset in pseude ra/de.
|
Vector2D |
getForTarget(TargetDefinition td)
Returns the dither offsets for the given target, using the actual
exposure count.
|
void |
init()
On init, we set our grid size and steps to the default values.
|
void |
registerParameter(Parameter c)
We need a parameter that counts the ongoing exposures, normally an
ExposureCount. |
void |
registerTarget(TargetDefinition td)
On target registering, we see if a dithering setup exists, if not we
load the default values from the properties.
|
private static Number[] |
scanTarget(TargetDefinition td)
We scan the target for the specific setup with the name
ReservedConstants.DITHERING. |
Object |
set(Object to)
Not allowed.
|
getAsStar, getConstant, getFormattedFor, getSetupcreateParameter, delivers, exit, getFormatted, getFormatted, getName, getPreserveFile, getString, getString, overrideDefaultName, register, rescanned, setName, toStringclone, createFrom, createFrom, createFrom, createInstance, getApplet, getAsResources, getLocate, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, hasLocalURLs, initProperties, keyCreate, keyCreate, reload, setAppletaugment, augment, 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, parseObject, reload, removeProperty, requires, setObject, setProperties, setProperty, stringPropertiesequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetFormatted, getName, getStringdefaultBoolean, 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, stringPropertiespublic static final String KEY_RAGRID
public static final String KEY_DEGRID
public static final String KEY_GRIDSTEP
public static final String KEY_RARANDOM
public static final String KEY_DERANDOM
public static final String KEY_EXPOSURECOUNT
private static final double DEFRAGRID
private static final double DEFDEGRID
private static final int DEFGRIDSTEP
private static final double DEFRARANDOM
private static final double DEFDERANDOM
private static final String DEFEXPOSURECOUNT
private int gridstep
private double ragrid
private double degrid
private double rarandom
private double derandom
private Value count
public void init()
throws InitException
init in interface Initializableinit in class AbstractParameterInitExceptionprivate void defaultDither()
public void registerParameter(Parameter c)
ExposureCount.registerParameter in interface ParameterDependingpublic void registerTarget(TargetDefinition td)
registerTarget in interface TargetDependingpublic Vector2D getForTarget(TargetDefinition td)
getForTarget in interface TargetDependingParameterpublic Vector2D get()
public Object set(Object to) throws UnsupportedOperationException
set in interface ParameterUnsupportedOperationException - If this parameter is read-only.private static Number[] scanTarget(TargetDefinition td)
ReservedConstants.DITHERING. If found, we return the ragrid,
degrid, rarandom, derandom, and gridsize as a five-dim number array in
exactly this order. Non-defined constants are null.private static Vector2D calculateDither(int index, double rapix, double depix, double rarand, double derand, int size)