public class NightlyStatistic extends AbstractSql
| Modifier and Type | Class and Description |
|---|---|
static class |
NightlyStatistic.Duty |
static class |
NightlyStatistic.Env
Test only if the rise and set time is correctly calculated.
|
static class |
NightlyStatistic.Night
Test only if the rise and set time is correctly calculated.
|
AbstractSql.Columns, AbstractSql.ExtractPropertyResources.Load, PropertyResources.URLResource| Modifier and Type | Field and Description |
|---|---|
private static String |
DEFPASSWORD
The key to the password for db-acces if not default.
|
private static String |
DEFUSERNAME
The key to the user name for db-acces if not default.
|
private static String |
KEY_PASSWORD
The password used for identifying the user.
|
static String |
KEY_RISETWILIGHT
The key to the good-weather toggle height of the sun.
|
static String |
KEY_SETTWILIGHT
The key to the good-weather toggle height of the sun.
|
private static String |
KEY_USERNAME
The user name to identify the class on the database.
|
KEY_TABLE, SQLBATCHDIR, SQLFAILDIRKEY_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 |
|---|
NightlyStatistic(Map<String,String> prop) |
| Modifier and Type | Method and Description |
|---|---|
Date[] |
duskToDawn(Date around)
From a given date we calculate the starting and ending date of the night,
whose center is closest to the specified date.
|
Date[] |
duskToDawn(Date around,
double hset,
double hrise)
From a given date we calculate the starting and ending date of the night,
whose center is closest to the specified date.
|
private String |
getDateRestriciton(String begin,
String end,
Date night,
double hset,
double hrise)
Returns a date restriciton for a given night and twilight zones.
|
Map<String,List<DataCard>> |
getDone(List<String> col,
List<String> as,
Map<String,Function> f,
String add,
Date around) |
Map<String,List<DataCard>> |
getDone(List<String> col,
List<String> as,
Map<String,Function> f,
String add,
Date around,
double hset,
double hrise)
Returns the queried columns from the done table as mapping from
'retreived-as' columns to list of doubles.If the timestamp is queried via
the
start column, this is converted to a Double holding the
ms since 1970. |
Map<String,List<DataCard>> |
getDone(List<String> col,
String add,
Date around) |
private double |
getEnvCount(Date now,
String addsel)
Get the roof-open time at that night.
|
Map<String,List<DataCard>> |
getEnvironment(List<String> col,
Date around)
Returns the named environement column as a list of doubles.
|
Map<String,List<DataCard>> |
getEnvironment(List<String> col,
List<String> as,
Map<String,Function> f,
Date around)
Returns the named environement column as a list of doubles.
|
Map<String,List<DataCard>> |
getEnvironment(List<String> col,
List<String> as,
Map<String,Function> f,
Date around,
double hset,
double hrise)
Returns the named environement column as a list of doubles.
|
double |
getExposureTimeSum(Date night)
Get the sum of all exposure times at a given night in seconds.
|
private double |
getExpSum(Date night,
String addsel) |
Map<String,List<DataCard>> |
getJoint(List<String> col,
List<String> as,
Map<String,Function> f,
String add,
Date around) |
Map<String,List<DataCard>> |
getJoint(List<String> col,
List<String> as,
Map<String,Function> f,
String add,
Date around,
double hset,
double hrise)
Returns the queried columns from the done and obs table as mapping from
'retreived-as' columns to list of doubles.
|
Map<String,List<DataCard>> |
getJoint(List<String> col,
Map<String,Function> f,
String add,
Date around) |
Map<String,List<DataCard>> |
getMultiple(List<String> col,
List<String> as,
Map<String,Function> f,
String add,
Date around) |
Map<String,List<DataCard>> |
getMultiple(List<String> col,
List<String> as,
Map<String,Function> f,
String add,
Date around,
double hset,
double hrise)
Returns the queried columns from the done and obs table as mapping from
'retreived-as' columns to list of doubles.
|
double |
getNightCount(Date night,
double solz)
Get the maximum time for sun below horizon at that night.
|
Map<String,List<DataCard>> |
getObs(List<String> col,
List<String> as,
Map<String,Function> f,
String add,
Date around) |
Map<String,List<DataCard>> |
getObs(List<String> col,
List<String> as,
Map<String,Function> f,
String add,
Date around,
double hset,
double hrise)
Returns the queried columns from the obs table as mapping from
'retreived-as' columns to list of doubles.
|
Map<String,List<DataCard>> |
getObs(List<String> col,
String add,
Date around) |
double |
getRoofOpenCount(Date night)
Get the roof-open time at that night.
|
double |
getScienceTimeSum(Date night)
Get the sum of all scientific times at a given night in seconds.
|
private Map<String,List<DataCard>> |
parseToMap(String id,
String datekey,
List<String> query,
List<String> as,
Map<String,Function> f,
String table,
String where,
String group)
We parse a result set to a mapping of column names to doubles.
|
delete, distinct, distinct, exit, getAccess, getDefaultArchive, getDefaultFormat, getTable, init, insert, isEntry, release, release, replace, retrieve, retrieve, retrieve, single, singleclone, 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_SETTWILIGHT
public static final String KEY_RISETWILIGHT
private static final String DEFUSERNAME
private static final String DEFPASSWORD
private static final String KEY_USERNAME
private static final String KEY_PASSWORD
public double getExposureTimeSum(Date night)
night - midnight of the day in question.public double getScienceTimeSum(Date night)
public double getNightCount(Date night, double solz)
public double getRoofOpenCount(Date night)
public Map<String,List<DataCard>> getObs(List<String> col, List<String> as, Map<String,Function> f, String add, Date around)
public Map<String,List<DataCard>> getObs(List<String> col, List<String> as, Map<String,Function> f, String add, Date around, double hset, double hrise)
dateobs column, this is converted to a Double
holding the ms since 1970.public Map<String,List<DataCard>> getDone(List<String> col, List<String> as, Map<String,Function> f, String add, Date around)
public Map<String,List<DataCard>> getDone(List<String> col, List<String> as, Map<String,Function> f, String add, Date around, double hset, double hrise)
start column, this is converted to a Double holding the
ms since 1970.public Map<String,List<DataCard>> getJoint(List<String> col, Map<String,Function> f, String add, Date around)
public Map<String,List<DataCard>> getJoint(List<String> col, List<String> as, Map<String,Function> f, String add, Date around)
public Map<String,List<DataCard>> getJoint(List<String> col, List<String> as, Map<String,Function> f, String add, Date around, double hset, double hrise)
dateobs column, this is converted to a Double
holding the ms since 1970.public Map<String,List<DataCard>> getMultiple(List<String> col, List<String> as, Map<String,Function> f, String add, Date around)
public Map<String,List<DataCard>> getMultiple(List<String> col, List<String> as, Map<String,Function> f, String add, Date around, double hset, double hrise)
dateobs column, this is converted to a Double
holding the ms since 1970.public Map<String,List<DataCard>> getEnvironment(List<String> col, Date around)
public Map<String,List<DataCard>> getEnvironment(List<String> col, List<String> as, Map<String,Function> f, Date around)
public Map<String,List<DataCard>> getEnvironment(List<String> col, List<String> as, Map<String,Function> f, Date around, double hset, double hrise)
date column, this is converted
to a Double holding the ms since 1970.private Map<String,List<DataCard>> parseToMap(String id, String datekey, List<String> query, List<String> as, Map<String,Function> f, String table, String where, String group)
public Date[] duskToDawn(Date around)
public Date[] duskToDawn(Date around, double hset, double hrise)
private String getDateRestriciton(String begin, String end, Date night, double hset, double hrise)
select start,duration,start+CAST(textcat(text(duration/1000), text('
seconds')) as interval) as end from done where
start+CAST(textcat(text(duration/1000), text(' seconds')) as interval) <
'2009-11-01' limit 10;
results in
start | duration | end
-------------------------+----------+-------------------------
2009-01-02 16:52:40.57 | 2543 | 2009-01-02 16:52:42.57
2009-01-02 16:52:43.298 | 100846 | 2009-01-02 16:54:23.298
2009-01-02 16:54:24.331 | 100971 | 2009-01-02 16:56:04.331
2009-01-02 16:56:05.486 | 99852 | 2009-01-02 16:57:44.486
2009-01-02 16:57:45.521 | 100834 | 2009-01-02 16:59:25.521
2009-01-02 16:59:26.533 | 99857 | 2009-01-02 17:01:05.533
2009-01-02 17:01:06.577 | 99813 | 2009-01-02 17:02:45.577
2009-01-02 17:02:46.571 | 100828 | 2009-01-02 17:04:26.571
2009-01-02 17:04:27.652 | 99830 | 2009-01-02 17:06:06.652
2009-01-02 17:06:07.667 | 99828 | 2009-01-02 17:07:46.667
private double getEnvCount(Date now, String addsel)