util
Class ColumnCalculator

java.lang.Object
  extended by util.CommandLineParser
      extended by util.ColumnCalculator

public class ColumnCalculator
extends CommandLineParser

This class acts like a column reader and re-formatter, but allows also some calculations to be done with the columns. The "-col" switch defines the columns to read, they are addressable via n variable names t1, t2, t3,...,tn. If an expression via "-calc" is given, it must follow the format t1*t2,t3-t1,...,exp_mresulting in m new columns. If number formats are given with -nf, their number must match the number of expressions rather than columns read. If -o is given, the data is writtn to that file, otherwise they are dumped to standard out.


Nested Class Summary
 
Nested classes/interfaces inherited from class util.CommandLineParser
CommandLineParser.Test
 
Field Summary
private static String FOOT
          The footer message.
private static String ONESWITCHES
          The switches.
private static Map<String,String> USE
          The usage map.
 
Constructor Summary
ColumnCalculator()
          Constructs a new column calculator.
 
Method Summary
private static Double evaluate(String expression, Map<String,Double> vars)
          Evaluates a single expression giving the variables as name value pairs in the map.
static void main(String[] arg)
          Entry point.
 boolean process(String[] arg)
          Processes the command line arguments.
 VectorG v841CenR(Map<String,Double> tdv)
          The fit for V841Cen, sIRAIT campaign in July, 2007, Dome-C.
 VectorG v841CenV(Map<String,Double> tdv)
          The fit for V841Cen, sIRAIT campaign in July, 2007, Dome-C.
 
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

ONESWITCHES

private static final String ONESWITCHES
The switches.

See Also:
Constant Field Values

USE

private static final Map<String,String> USE
The usage map.


FOOT

private static final String FOOT
The footer message.

See Also:
Constant Field Values
Constructor Detail

ColumnCalculator

public ColumnCalculator()
Constructs a new column calculator. The command line switches understood are registered here.

Method Detail

process

public boolean process(String[] arg)
                throws ParseException,
                       IOException
Processes the command line arguments. First, the file is read for double columns. Then, calculations are performed and data is directly put out.

Throws:
ParseException
IOException

evaluate

private static Double evaluate(String expression,
                               Map<String,Double> vars)
                        throws ParseException
Evaluates a single expression giving the variables as name value pairs in the map.

Throws:
ParseException

v841CenV

public VectorG v841CenV(Map<String,Double> tdv)
The fit for V841Cen, sIRAIT campaign in July, 2007, Dome-C. We have a varaible t1 which is HJD-2454000.0 and a variable t2 which is the Vmag of V841-V1034, t3 is the error of the measure. We return a 'polished' magnitude and an area indicator. The magnitude is polished in the following way, where x and y are HJD minus average HJD and y is differentail magnitude minus average. The following areas could be distinguished: Additionally, the difference from y' to a model fit using three Fourier frequencies y'-yF is given as:
       yF=Σn=1,3A_n*cos(2π*n*f*x)+B_n*sin(2π*n*f*x)
       


v841CenR

public VectorG v841CenR(Map<String,Double> tdv)
The fit for V841Cen, sIRAIT campaign in July, 2007, Dome-C. We have a varaible t1 which is HJD-2454000.0 and a variable t2 which is the Rmag of V841-V1034, t3 is the error of the measure. We return a 'polished' magnitude and an area indicator. The magnitude is polished in the following way, where x and y are HJD minus average HJD and y is differentail magnitude minus average. The following areas could be distinguished: Additionally, the difference from y' to a model fit using three Fourier frequencies y'-yF is given as:
       yF=Σn=1,3A_n*cos(2π*n*f*x)+B_n*sin(2π*n*f*x)
       


main

public static void main(String[] arg)
                 throws ParseException,
                        IOException
Entry point.

Throws:
ParseException
IOException