|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectutil.CommandLineParser
util.PropertyParser
util.DataFileParser
public class DataFileParser
Convenience class for parsing command lines to read in from a data file.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class util.CommandLineParser |
|---|
CommandLineParser.Test |
| Field Summary | |
|---|---|
private Analyser |
anal
The analyser constructed from the properties. |
static double |
DEFSPLITSIGMA
Default split sigma. |
protected static String |
FOOT
A footer message. |
protected static Map<String,String> |
MAP
|
private ModelFitting |
mf
The model fitter constructed from the properties. |
private NumberFormat[] |
nf
The number formatters. |
private static String |
ONESWITCHES
The switches for adding properties. |
private PrintWriter |
out
The print-stream. |
private NVector[] |
post
The data post-processed. |
private NVector[] |
pre
The data as precessed by the analyser. |
private Map<String,String> |
props
The properties parsed. |
private NVector[] |
set
The data. |
private static String |
THREESWITCHES
The switches for adding properties. |
private static String |
TWOSWITCHES
The switches for adding properties. |
protected static Map<String,String> |
USE
Detailed use of switches. |
private static String |
ZEROSWITCHES
The switches for adding properties. |
| Constructor Summary | |
|---|---|
protected |
DataFileParser(Map<String,String> shortcuts)
Constructs the parser to the sensor tester. |
| Method Summary | |
|---|---|
protected Analyser |
createAnalyser(Map<String,String> prop)
Creates the analyser to use out of parsed properties. |
protected double |
extremalValue(double ev)
Reformat the extremal Value to a different meaning? |
protected Analyser |
getAnalyser()
Returns the data analyser. |
protected NVector[] |
getData()
Returns the input data. |
protected int[] |
getForwardComplex()
If the analysier's processed data is complex and we want to see that in the printout, return the indices as an integer array here. |
protected String |
getForwardHead()
Returns a description of the analysers processed data. |
protected NVector[] |
getLinearFit(NVector[] data,
int column,
int mesh)
Replaces a single data column with a spline fit of specified mesh-length. |
protected NVector[] |
getLinearFit(NVector[] data,
int x,
List<Integer> cols,
int len)
Returns a new data array, where the specified columns are replaced with a natural cubic spline fit of the original data. |
protected int[] |
getPostComplex()
If the analysier's visualized data is complex and we want to see that in the printout, return the indices as an integer array here. |
protected String |
getPostHead()
Returns a description of the analysers processed data. |
protected String |
getProcessable()
Returns the switches that should trigger a data processing. |
protected NVector[] |
getProcessedData()
Returns the processed data. |
protected NVector[] |
getSplineFit(NVector[] data,
int column,
int mesh)
Replaces a single data column with a spline fit of specified mesh-length. |
protected NVector[] |
getSplineFit(NVector[] data,
int x,
List<Integer> cols,
int len)
Returns a new data array, where the specified columns are replaced with a natural cubic spline fit of the original data. |
protected NVector[] |
getVisualizedData()
Returns the visualizable data. |
protected NVector[] |
getWhiteNoise(NVector[] data,
int cc)
Replaces a single data column with white noise. |
protected NVector[] |
getWhiteNoise(NVector[] data,
List<Integer> columns)
Returns a new data array, where the specified columns are replaced with white noise of the same average and sigma as the original data. |
static void |
main(String[] arg)
Parses the command line and prints output to standard out. |
protected void |
print(NVector[] v,
String head,
int[] complex)
Prints a data set using the parsed settings. |
static void |
printOut(NumberFormat[] nf,
PrintWriter out,
NVector[] v,
String head,
int[] comp)
Prints an array of a multidimensional vector to the given print stream. |
static void |
printOut(PrintWriter out,
NVector[] v,
String head,
int[] comp)
Prints an array of a multidimensional vector to the given print stream. |
protected boolean |
process(String[] arg)
Process the switches. |
protected boolean |
processData(NVector[] data)
Processes a single junk of data, provided as an array of NVector
If parsed with process(java.lang.String[]), 2dim and 3-dim data are arrays of
Vector2D and Vector3D, respectively. |
protected boolean |
processSingleData(NVector[] workon)
|
private boolean |
splitDataSet(int ilo,
int ihi,
int splitnr,
NVector[] data)
Splite a data set and processes the splitted set. |
| Methods inherited from class util.PropertyParser |
|---|
parseMap, parseMap, parseProperties, parseProperties, parseProperties |
| Methods inherited from class util.CommandLineParser |
|---|
getArguments, getCommandLine, getCommands, getRegisteredSwitches, hasAnySwitch, hasSwitch, hasSwitch, haveAllSwitches, parse, printCommandLine, registerSwitches, setCommands, staticUsage, usage |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final double DEFSPLITSIGMA
private static final String ZEROSWITCHES
private static final String ONESWITCHES
private static final String TWOSWITCHES
private static final String THREESWITCHES
protected static final Map<String,String> USE
protected static final Map<String,String> MAP
protected static final String FOOT
private NVector[] set
Vector2D.
private NVector[] pre
private NVector[] post
private Map<String,String> props
private Analyser anal
private ModelFitting mf
private PrintWriter out
private NumberFormat[] nf
| Constructor Detail |
|---|
protected DataFileParser(Map<String,String> shortcuts)
| Method Detail |
|---|
protected Analyser createAnalyser(Map<String,String> prop)
protected boolean process(String[] arg)
throws ParseException
ParseException
private boolean splitDataSet(int ilo,
int ihi,
int splitnr,
NVector[] data)
throws ParseException
ParseException
protected boolean processData(NVector[] data)
throws ParseException
NVector
If parsed with process(java.lang.String[]), 2dim and 3-dim data are arrays of
Vector2D and Vector3D, respectively. The data, spline
and linear interpolation fits and even white noise data can be retrieved
using the appropriate methods. Only after this method is called,
the principial data and the processed and visualized data can be
retrieved.
ParseException
protected boolean processSingleData(NVector[] workon)
throws ParseException
ParseExceptionprotected String getProcessable()
protected void print(NVector[] v,
String head,
int[] complex)
protected NVector[] getWhiteNoise(NVector[] data,
int cc)
getWhiteNoise(NVector[], List) instead.
protected NVector[] getWhiteNoise(NVector[] data,
List<Integer> columns)
protected NVector[] getSplineFit(NVector[] data,
int column,
int mesh)
#getSplineFit(NVector[], List, int) instead.
protected NVector[] getSplineFit(NVector[] data,
int x,
List<Integer> cols,
int len)
protected NVector[] getLinearFit(NVector[] data,
int column,
int mesh)
#getSplineFit(NVector[], List, int) instead.
protected NVector[] getLinearFit(NVector[] data,
int x,
List<Integer> cols,
int len)
public static void printOut(PrintWriter out,
NVector[] v,
String head,
int[] comp)
public static void printOut(NumberFormat[] nf,
PrintWriter out,
NVector[] v,
String head,
int[] comp)
protected Analyser getAnalyser()
protected int[] getForwardComplex()
protected String getForwardHead()
protected int[] getPostComplex()
protected String getPostHead()
protected double extremalValue(double ev)
protected NVector[] getData()
process(java.lang.String[]).
protected NVector[] getProcessedData()
process(java.lang.String[]).
protected NVector[] getVisualizedData()
process(java.lang.String[]).
public static void main(String[] arg)
throws ParseException,
IOException
ParseException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||