|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectutil.CommandLineParser
util.PropertyParser
util.DataFileReader
public abstract class DataFileReader
Convenience class for parsing command lines to read in from a data file.
| Nested Class Summary | |
|---|---|
static class |
DataFileReader.Ascii
Does spline/filtering etc. |
| Nested classes/interfaces inherited from class util.CommandLineParser |
|---|
CommandLineParser.Test |
| Field Summary | |
|---|---|
static double |
DEFSPLITSIGMA
Default split sigma. |
protected static String |
FOOT
A footer message. |
private static String |
FOURSWITCHES
The switches for adding properties. |
protected static Map<String,String> |
MAP
|
protected NumberFormat[] |
nf
The number formatters. |
private static String |
ONESWITCHES
The switches for adding properties. |
protected PrintWriter |
out
The print-stream. |
private Map<String,String> |
props
The properties parsed. |
private VectorG[] |
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 |
DataFileReader(Map<String,String> shortcuts)
Constructs the parser to the sensor tester. |
| Method Summary | |
|---|---|
protected VectorG[] |
getData()
Returns the input data. |
protected VectorG[] |
getLinearFit(VectorG[] data,
int column,
int mesh)
Replaces a single data column with a spline fit of specified mesh-length. |
protected VectorG[] |
getLinearFit(VectorG[] data,
List<Integer> cols,
int len)
Returns a new data array, where the specified columns are replaced with a linear fit of the original data. |
protected Map<String,String> |
getParsedProperties()
Returns parsed properties, if there are any. |
protected VectorG[] |
getPiecewisePolynomialFit(VectorG[] data,
int column,
int poly,
double tl,
double tr,
int deriv)
|
protected VectorG[] |
getPiecewisePolynomialFit(VectorG[] data,
List<Integer> columns,
int poly,
double tl,
double tr,
int deriv)
|
protected VectorG[] |
getSplineFit(VectorG[] data,
int column,
int mesh)
Replaces a single data column with a spline fit of specified mesh-length. |
protected VectorG[] |
getSplineFit(VectorG[] data,
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 VectorG[] |
getWhiteNoise(VectorG[] data,
int cc)
Replaces a single data column with white noise. |
protected VectorG[] |
getWhiteNoise(VectorG[] 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. |
protected void |
print(VectorG[] v,
String head,
int[] complex)
Prints a data set using the parsed settings. |
private static void |
printModel(VectorG x,
VectorG y,
VectorG fit)
|
static void |
printOut(NumberFormat[] nf,
PrintWriter out,
VectorG[] v,
String head,
int[] comp)
Prints an array of a multidimensional vector to the given print stream. |
static void |
printOut(PrintWriter out,
VectorG[] v,
String head,
int[] comp)
Prints an array of a multidimensional vector to the given print stream. |
boolean |
process(String[] arg)
Process the switches. |
protected boolean |
processData(VectorG[] data)
Processes a single junk of data, provided as an array of VectorG
If parsed with process(java.lang.String[]), 2dim and 3-dim data are arrays of
Vector2D and Vector3D, respectively. |
protected abstract boolean |
processSingleData(VectorG[] workon)
After filtering/splining/splitting or smoothing of the data, this is the method that processes the single data. |
protected boolean |
processSingleData(VectorG[] workon,
VectorG[] data)
After the base class supported so many filtering options, this method was additionally introduced as a escape-pod for data processors that need the original data along with the pre-processed, i.e. |
private VectorG[] |
rejectData(VectorG[] org,
VectorG[] workon,
double losig,
double hisig,
double loabs,
double hiabs,
int yc)
If workon and org are of same size, we reject from the original set the data that is too far off |
private boolean |
splitDataSet(int ilo,
int ihi,
int splitnr,
VectorG[] 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, registerLine, 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
private static final String FOURSWITCHES
protected static final Map<String,String> USE
protected static final Map<String,String> MAP
protected static final String FOOT
private VectorG[] set
Vector2D.
private Map<String,String> props
protected PrintWriter out
protected NumberFormat[] nf
| Constructor Detail |
|---|
protected DataFileReader(Map<String,String> shortcuts)
| Method Detail |
|---|
public boolean process(String[] arg)
throws ParseException
ParseException
private boolean splitDataSet(int ilo,
int ihi,
int splitnr,
VectorG[] data)
throws ParseException
ParseExceptionprotected Map<String,String> getParsedProperties()
protected boolean processData(VectorG[] data)
throws ParseException
VectorG
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
principal data and the processed and visualized data can be retrieved.
ParseException
protected abstract boolean processSingleData(VectorG[] workon)
throws ParseException
processSingleData(VectorG[], VectorG[]).
workon -
ParseException
protected boolean processSingleData(VectorG[] workon,
VectorG[] data)
throws ParseException
processSingleData(VectorG[]),
suppressing simply the raw data.
workon - The pre-processed, i.e. filtered datadata - The original data.
ParseException
protected void print(VectorG[] v,
String head,
int[] complex)
protected VectorG[] getWhiteNoise(VectorG[] data,
int cc)
getWhiteNoise(VectorG[], List) instead.
protected VectorG[] getWhiteNoise(VectorG[] data,
List<Integer> columns)
protected VectorG[] getPiecewisePolynomialFit(VectorG[] data,
int column,
int poly,
double tl,
double tr,
int deriv)
protected VectorG[] getPiecewisePolynomialFit(VectorG[] data,
List<Integer> columns,
int poly,
double tl,
double tr,
int deriv)
private VectorG[] rejectData(VectorG[] org,
VectorG[] workon,
double losig,
double hisig,
double loabs,
double hiabs,
int yc)
private static final void printModel(VectorG x,
VectorG y,
VectorG fit)
protected VectorG[] getSplineFit(VectorG[] data,
int column,
int mesh)
getSplineFit(VectorG[], List, int) instead.
protected VectorG[] getSplineFit(VectorG[] data,
List<Integer> cols,
int len)
protected VectorG[] getLinearFit(VectorG[] data,
int column,
int mesh)
getSplineFit(VectorG[], List, int) instead.
protected VectorG[] getLinearFit(VectorG[] data,
List<Integer> cols,
int len)
public static void printOut(PrintWriter out,
VectorG[] v,
String head,
int[] comp)
public static void printOut(NumberFormat[] nf,
PrintWriter out,
VectorG[] v,
String head,
int[] comp)
protected VectorG[] getData()
process(java.lang.String[]).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||