Class TimeJELFunction

java.lang.Object
uk.ac.starlink.ttools.plot2.geom.TimeJELFunction
All Implemented Interfaces:
DoubleUnaryOperator

public class TimeJELFunction extends Object implements DoubleUnaryOperator
Function operating on a time value as used in a Time plot. The input value of the function is in unix seconds. A number of variables representing time and based on that input value are available, currently: "mjd", "jd", "unixSec" and "decYear". Typically the expression will simply be one of these terms.
Since:
15 Dec 2022
Author:
Mark Taylor
  • Constructor Details

    • TimeJELFunction

      public TimeJELFunction(String fexpr) throws gnu.jel.CompilationException
      Constructor.
      Parameters:
      fexpr - JEL expression in terms of a time variable
      Throws:
      gnu.jel.CompilationException
  • Method Details

    • applyAsDouble

      public double applyAsDouble(double unixSec)
      Function of time in seconds since the Unix epoch.
      Specified by:
      applyAsDouble in interface DoubleUnaryOperator
      Parameters:
      unixSec - unix seconds
      Returns:
      time representation as defined by this function
    • getExpression

      public String getExpression()
      Returns the text of the function expression.
      Returns:
      function expression
    • getTimeQuantities

      public static TimeJELFunction.TimeQuantity[] getTimeQuantities()
      Returns a list of TimeQuantity objects that can be referred to by name from expressions used by this class.
      Returns:
      ordered list of time quantities