public class FitsCheck extends PropertyResources implements ExitCleaning, Initializable
FlatCheckPropertyResources.Load, PropertyResources.URLResource| Modifier and Type | Field and Description |
|---|---|
static String |
DEFFAILEXT
The parental reduce directory.
|
private static String |
DEFTMPDIR
Temporal directory including slash.
|
private static String |
DEFTMPFITS
Temporal fits file for uncompressing
|
static String |
KEY_BIASMAXIMA
The statistic minima valid bias must fulfill.
|
static String |
KEY_BIASMINIMA
The statistic minima valid bias must fulfill.
|
static String |
KEY_DARKMAXIMA
The statistic minima valid dark must fulfill.
|
static String |
KEY_DARKMINIMA
The statistic minima valid dark must fulfill.
|
static String |
KEY_FAILDIR
Parent directory where the failture files should be writtn/retrieved.
|
static String |
KEY_FAILEXT
The parent directory of the reduced files.
|
static String |
KEY_OBSDB
If non-default properties are needed for the obs db.
|
static String |
KEY_TMPDIR
Temporal directory including slash.
|
static String |
KEY_TMPFITS
Temporal fits file for uncompressing
|
protected ObserveSql |
obs
Access to the obs table.
|
static String |
PREFIX_FLATMAXIMA
The statistic minima valid flats must fulfill.
|
static String |
PREFIX_FLATMINIMA
The statistic minima valid flats must fulfill.
|
static String |
PREFIX_SCIENCEMAXIMA
The statistic minima valid science frames must fulfill.
|
static String |
PREFIX_SCIENCEMINIMA
The statistic minima valid science frames must fulfill.
|
KEY_NOINITONCREATE, POSTFIX_ALPHABET, POSTFIX_BYTES, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_MODTIME, POSTFIX_URLKEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATORKEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOMECONFIG, KEY_CLASS| Constructor and Description |
|---|
FitsCheck(Map<String,String> prop)
Defaults everything.
|
| Modifier and Type | Method and Description |
|---|---|
List<FailureSql.Failure> |
check(String unique)
We check an oberservation specified by its unique ID.
|
protected List<FailureSql.Failure> |
checkAdu(String unique,
String minkey,
String maxkey,
boolean strict)
Checks average, standard deviation and higher order moments of the stated
file to be within the bounds.
|
List<FailureSql.Failure> |
checkBias(String unique)
In the basic version diverts to strcit checking of adu statistics.
|
List<FailureSql.Failure> |
checkCentroid(String unique,
float xcen,
float ycen)
From the unique id of a flat observation, we check if the centroid is
withinin bounds.
|
List<FailureSql.Failure> |
checkCentroidFromAverage(double[] av,
double xcen,
double ycen)
From the average of a flat observation, we check if the centroid is
withinin bounds.
|
List<FailureSql.Failure> |
checkDark(String unique)
In the basic version diverts to strcit checking of adu statistics.
|
List<FailureSql.Failure> |
checkFlat(String unique)
In the basic version diverts to strict checking of adu statistics.
|
List<FailureSql.Failure> |
checkScience(String unique)
In the basic version, do a non-strict checking of adu statistic (failure
only if all quadrants fail for the same reason).
|
void |
exit() |
protected List<List<Double>> |
getAduConstraints(String key)
Parses a double-linked list into a list of a list of doubles,
representing in the outer index the moment, in the inner list the
amplifier.
|
void |
init()
Creates and initializes the obs db.
|
List<FailureSql.Failure> |
isAduCompatible(String unique,
List<List<Double>> min,
List<List<Double>> max,
boolean strict)
Checks for a single file if it satisfies the ADU constriants.
|
List<FailureSql.Failure> |
readFailure(String unique)
We read the failure flag file.
|
static List<FailureSql.Failure> |
readFailureFile(File fail) |
protected static void |
updateFailure(List<FailureSql.Failure> target,
FailureSql.Failure with,
double r)
Helps to add a new failure to the list if, not already there.
|
boolean |
writeFailure(String unique,
List<FailureSql.Failure> outcome)
As long as there is no table for indicating failed files, we write a
flag-file into the reduced dir.
|
static boolean |
writeFailureFile(File fail,
List<FailureSql.Failure> outcome) |
clone, 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, rescanned, setObject, setProperties, setProperty, stringProperties, toStringequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdefaultBoolean, 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_TMPDIR
public static final String KEY_TMPFITS
public static final String KEY_FAILDIR
public static final String KEY_FAILEXT
public static final String KEY_BIASMINIMA
public static final String KEY_BIASMAXIMA
public static final String KEY_DARKMINIMA
public static final String KEY_DARKMAXIMA
public static final String PREFIX_FLATMINIMA
public static final String PREFIX_FLATMAXIMA
public static final String PREFIX_SCIENCEMINIMA
public static final String PREFIX_SCIENCEMAXIMA
public static final String KEY_OBSDB
public static final String DEFFAILEXT
private static final String DEFTMPDIR
private static final String DEFTMPFITS
protected ObserveSql obs
public void init()
throws InitException
init in interface InitializableInitExceptionpublic void exit()
exit in interface ExitCleaningpublic List<FailureSql.Failure> check(String unique)
public List<FailureSql.Failure> checkBias(String unique)
public List<FailureSql.Failure> checkDark(String unique)
public List<FailureSql.Failure> checkFlat(String unique)
public List<FailureSql.Failure> checkScience(String unique)
protected static void updateFailure(List<FailureSql.Failure> target, FailureSql.Failure with, double r)
protected List<FailureSql.Failure> checkAdu(String unique, String minkey, String maxkey, boolean strict)
public List<FailureSql.Failure> isAduCompatible(String unique, List<List<Double>> min, List<List<Double>> max, boolean strict)
public List<FailureSql.Failure> checkCentroid(String unique, float xcen, float ycen)
x_c=0.5*(-Q0+Q1-Q2+Q3)/ΣQ
y_c=0.5*(-Q0-Q1+Q2+Q3)/ΣQ
where the Q's are the average of the respective quadrants. A stuck filter
wheel will manifest itself in a possible higher y-centroid.public List<FailureSql.Failure> checkCentroidFromAverage(double[] av, double xcen, double ycen)
x_c=0.5*(-Q0+Q1-Q2+Q3)/ΣQ
y_c=0.5*(-Q0-Q1+Q2+Q3)/ΣQ
where the Q's are the average of the respective quadrants. A stuck filter
wheel will manifest itself in a possible higher y-centroid.public boolean writeFailure(String unique, List<FailureSql.Failure> outcome) throws IOException
IOExceptionpublic static boolean writeFailureFile(File fail, List<FailureSql.Failure> outcome) throws IOException
IOExceptionpublic List<FailureSql.Failure> readFailure(String unique) throws IOException
IOExceptionpublic static final List<FailureSql.Failure> readFailureFile(File fail) throws IOException
IOExceptionprotected List<List<Double>> getAduConstraints(String key)
10000,11000,12000,9000;300,-1,100,200 is interprated as,
averages 10000,11000,12000,9000 for the four amplifiers and as variances
300,don't care, 100, and 200. It is used for the minima and maxima. If
the maxima is less then the minima, this means this moment for this
particular quadrant is ignored.