|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectutil.PropertyContainer
util.PropertyResources
util.PropertyBundles
mysql.AbstractSql
stella.sql.NightlyStatistic
stella.sql.OffLimitAlarm
public class OffLimitAlarm
A class that uses nighly statistics to check for abnoramlities in certain parameters. If gross off-limits are encountered, an e-mail notification is sent to the administrator.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class stella.sql.NightlyStatistic |
|---|
NightlyStatistic.Duty, NightlyStatistic.Env, NightlyStatistic.Night |
| Nested classes/interfaces inherited from class util.PropertyResources |
|---|
PropertyResources.URLResource |
| Field Summary | |
|---|---|
private Map<String,Statistic> |
env
The retrieved data as column names to statistics. |
private Map<String,Statistic> |
envtimes
The retrieved data as column names to statistics. |
static String |
KEY_DONELIST
The fields to query from the env table. |
static String |
KEY_DONENAMES
How the returned columns are named. |
static String |
KEY_DONEWHERE
Additional constraints for the done table query. |
static String |
KEY_ENVLIST
The fields to query from the env table. |
static String |
KEY_ENVNAMES
How the returned columns are named. |
static String |
KEY_JOINTLIST
The fields to query from the env table. |
static String |
KEY_JOINTNAMES
How the returned columns are named. |
static String |
KEY_JOINTWHERE
Additional constraints for the joint table query. |
static String |
KEY_OBSLIST
The fields to query from the obs table. |
static String |
KEY_OBSNAMES
How the returned columns are named. |
static String |
KEY_OBSWHERE
Additional constraints for the obs table query. |
static String |
KEY_SCILIST
The fields to query from the obs table, with imagetyp=1. |
static String |
KEY_SCINAMES
How the returned columns are named. |
static String |
KEY_SCIWHERE
Additional constraints for the sci query, should include imagetyp=1. |
static String |
KEY_TELESCOPE
The issuing telescopes. |
static String |
NULL
String instead of limits indicating that this has no meaning. |
private Map<String,Map<String,Statistic>> |
tel
The retrieved data as column names to statistics. |
static char |
TELESCOPESEPARATOR
character sparating telescope name from offending column name. |
private Map<String,Map<String,List<Object>>> |
telkeys
The retrieved data as column names to keys (unique ids). |
private Map<String,Map<String,Statistic>> |
teltimes
The retrieved data as column names to statistics. |
| Fields inherited from class stella.sql.NightlyStatistic |
|---|
DEFPASSWORD, DEFUSERNAME, KEY_RISETWILIGHT, KEY_SETTWILIGHT |
| Fields inherited from class mysql.AbstractSql |
|---|
KEY_TABLE |
| 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 | |
|---|---|
OffLimitAlarm(Map<String,String> prop)
Constructs a new off-limit alarm log. |
|
| Method Summary | |
|---|---|
void |
addDone(List<String> donelist,
List<String> doneas,
Map<String,Function> f,
String add,
Date now)
Retrieve and cache all information for the date in question. |
void |
addEnvironment(List<String> envlist,
List<String> envas,
Map<String,Function> f,
Date now)
Retrieve and cache all information for the date in question. |
void |
addJoint(List<String> jointlist,
List<String> jointas,
Map<String,Function> f,
String add,
Date now)
Retrieve and cache all information for the date in question. |
void |
addObs(List<String> obslist,
List<String> obsas,
Map<String,Function> f,
String add,
Date now)
Retrieve and cache all information for the date in question. |
void |
clearStats()
|
static Map<String,Statistic> |
convertToStatistic(Map<String,List<DataCard>> log,
int index)
Converts a mapping of strings to List of doubles into a mapping of strings to statistics. |
static Map<String,List<Object>> |
extractUnique(Map<String,List<DataCard>> log)
We take all the data cards and extract the unique IDs found for the given field names. |
Map<String,Double> |
getAverageEnvOffs(Map<String,Vector2D> avmap)
From the retireved mappings of column names to list of doubles, we return the column names of those whose average are outside the bounds mapped to the average. |
private Map<String,Double> |
getAverageOffenders(Map<String,Statistic> stats,
Map<String,Vector2D> avmap)
From the retireved mappings of column names to list of doubles, we return the column names of those whose average are outside the bounds mapped to the average. |
Map<String,Double> |
getAverageTelOffs(String telescope,
Map<String,Vector2D> avmap)
From the retireved mappings of column names to list of doubles, we return the column names of those whose average are outside the bounds mapped to the average. |
Statistic |
getEnvStatistic(String key)
Returns the statistic on a column in the env table. |
Statistic |
getEnvTimes(String key)
Returns the statistic on a column in the env table. |
Map<String,Double> |
getMinMaxEnvOffs(Map<String,Vector2D> avmap)
From the retireved mappings of column names to list of doubles, we return the column names of those whose average are outside the bounds mapped to the average. |
private Map<String,Double> |
getMinMaxOffenders(Map<String,Statistic> stats,
Map<String,Vector2D> avmap)
From the retireved mappings of column names to list of doubles, we return the column names of those whose min/max are outside the bounds mapped to the offending value. |
Map<String,Double> |
getMinMaxTelOffs(String telescope,
Map<String,Vector2D> avmap)
From the retireved mappings of column names to list of doubles, we return the column names of those whose min/max are outside the bounds mapped to the offending value. |
Map<String,Double> |
getSigmaEnvOffs(Map<String,Double> limit)
From the retireved mappings of column names to list of doubles, we return the column names of those whose average are outside the bounds mapped to the average. |
private Map<String,Double> |
getSigmaOffenders(Map<String,Statistic> stats,
Map<String,Double> limit)
From the retireved mappings of column names to list of doubles, we return the column names of those whose standard deviaition is higher than the allowed maximum, mapped to the offending value. |
Map<String,Double> |
getSigmaTelOffs(String telescope,
Map<String,Double> limit)
From the retireved mappings of column names to list of doubles, we return the column names of those whose standard deviaition is higher than the allowed maximum, mapped to the offending value. |
Map<String,Double> |
getSpanEnvOffs(Map<String,Double> limit)
From the retireved mappings of column names to list of doubles, we return the column names of those whose average are outside the bounds mapped to the average. |
private Map<String,Double> |
getSpanOffenders(Map<String,Statistic> stats,
Map<String,Double> limit)
From the retireved mappings of column names to list of doubles, we return the column names of those whose span deviaition is higher than the allowed maximum, mapped to the offending value. |
Map<String,Double> |
getSpanTelOffs(String telescope,
Map<String,Double> limit)
From the retireved mappings of column names to list of doubles, we return the column names of those whose span deviaition is higher than the allowed maximum, mapped to the offending value. |
List<Object> |
getTelescopeKeys(String telescope,
String key)
Returns the list of uniques for a telescope. |
List<String> |
getTelescopes()
Returns the list of telescopes. |
Statistic |
getTelescopeStatistic(String telescope,
String key)
Returns the statistic on a column in the env table. |
Statistic |
getTelescopeTimes(String telescope,
String key)
Returns the statistic on a column in the env table. |
void |
init()
If we are not the default user of the database, try to add ourself here. |
static Map<String,Map<String,Double>> |
telescopeDoubleMapping(List<String> tels,
String prop)
Converts a string-to-string mapping into a string-toVector2D mapping, using the telescope names provided. |
static Map<String,Map<String,Vector2D>> |
telescopeVectorMapping(List<String> tels,
String prop)
Converts a string-to-string mapping into a string-toVector2D mapping, using the telescope names provided. |
static Map<String,Vector2D> |
vectorMapping(String prop)
Converts a string-to-string mapping into a string-to Vector2D mapping |
| Methods inherited from class stella.sql.NightlyStatistic |
|---|
duskToDawn, duskToDawn, getDone, getDone, getDone, getEnvironment, getEnvironment, getEnvironment, getExposureTimeSum, getJoint, getJoint, getJoint, getNightCount, getObs, getObs, getObs, getRoofOpenCount, getScienceTimeSum |
| Methods inherited from class mysql.AbstractSql |
|---|
getPassword, getTable, getUserName, isEntry |
| 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 NULL
public static final char TELESCOPESEPARATOR
public static final String KEY_TELESCOPE
public static final String KEY_ENVLIST
public static final String KEY_ENVNAMES
public static final String KEY_OBSLIST
public static final String KEY_OBSNAMES
public static final String KEY_OBSWHERE
public static final String KEY_SCILIST
public static final String KEY_SCINAMES
public static final String KEY_SCIWHERE
public static final String KEY_DONELIST
public static final String KEY_DONENAMES
public static final String KEY_DONEWHERE
public static final String KEY_JOINTLIST
public static final String KEY_JOINTNAMES
public static final String KEY_JOINTWHERE
private Map<String,Statistic> env
private Map<String,Statistic> envtimes
private Map<String,Map<String,Statistic>> tel
private Map<String,Map<String,Statistic>> teltimes
private Map<String,Map<String,List<Object>>> telkeys
| Constructor Detail |
|---|
public OffLimitAlarm(Map<String,String> prop)
| Method Detail |
|---|
public void init()
AbstractSql
init in interface Initializableinit in class AbstractSqlpublic void clearStats()
public void addEnvironment(List<String> envlist,
List<String> envas,
Map<String,Function> f,
Date now)
public void addObs(List<String> obslist,
List<String> obsas,
Map<String,Function> f,
String add,
Date now)
public void addDone(List<String> donelist,
List<String> doneas,
Map<String,Function> f,
String add,
Date now)
public void addJoint(List<String> jointlist,
List<String> jointas,
Map<String,Function> f,
String add,
Date now)
public List<String> getTelescopes()
public Statistic getEnvStatistic(String key)
public Statistic getEnvTimes(String key)
public Statistic getTelescopeStatistic(String telescope,
String key)
public Statistic getTelescopeTimes(String telescope,
String key)
public List<Object> getTelescopeKeys(String telescope,
String key)
public static Map<String,Vector2D> vectorMapping(String prop)
throws ParseException
ParseException
public static Map<String,Map<String,Vector2D>> telescopeVectorMapping(List<String> tels,
String prop)
throws ParseException
dettemp=-200,-100;-220,-80:further keys
ParseException
public static Map<String,Map<String,Double>> telescopeDoubleMapping(List<String> tels,
String prop)
throws ParseException
dettemp=-200;-220:further keys
ParseExceptionpublic Map<String,Double> getAverageEnvOffs(Map<String,Vector2D> avmap)
public Map<String,Double> getMinMaxEnvOffs(Map<String,Vector2D> avmap)
public Map<String,Double> getSigmaEnvOffs(Map<String,Double> limit)
public Map<String,Double> getSpanEnvOffs(Map<String,Double> limit)
public Map<String,Double> getAverageTelOffs(String telescope,
Map<String,Vector2D> avmap)
public Map<String,Double> getMinMaxTelOffs(String telescope,
Map<String,Vector2D> avmap)
public Map<String,Double> getSigmaTelOffs(String telescope,
Map<String,Double> limit)
public Map<String,Double> getSpanTelOffs(String telescope,
Map<String,Double> limit)
public static Map<String,Statistic> convertToStatistic(Map<String,List<DataCard>> log,
int index)
public static Map<String,List<Object>> extractUnique(Map<String,List<DataCard>> log)
private Map<String,Double> getAverageOffenders(Map<String,Statistic> stats,
Map<String,Vector2D> avmap)
private Map<String,Double> getMinMaxOffenders(Map<String,Statistic> stats,
Map<String,Vector2D> avmap)
private Map<String,Double> getSigmaOffenders(Map<String,Statistic> stats,
Map<String,Double> limit)
private Map<String,Double> getSpanOffenders(Map<String,Statistic> stats,
Map<String,Double> limit)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||