Class Lookup

java.lang.Object
  extended by Lookup

public class Lookup
extends java.lang.Object

Multi-function lookup utility. This application is designed to function as a plug-in the the PPI Rulesets. This plug-in supports a variety of lookup related functions including the lookup of values in ASCII comma seperated value (CSV) tables.

The general form of usage is:

lookup service [parameters...]
where service is the name of the service to run and parameters is one or more parameters required by the service.

Supported lookup services are:

Table: Lookup values in from a file which contains ASCII, comma seperated values.

Since:
1.0

Constructor Summary
Lookup()
          Creates an instance.
 
Method Summary
static void main(java.lang.String[] args)
          Entry point for application.
static void Table(java.lang.String[] args)
          Lookup values in an ASCII CSV table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Lookup

public Lookup()
Creates an instance.

Method Detail

main

public static void main(java.lang.String[] args)
Entry point for application.


Table

public static void Table(java.lang.String[] args)
Lookup values in an ASCII CSV table. The lookup plug-in returns a PDS label parameter compatible with the PDS/PPI ruleset language. Returned values are based upon a lookup table search. Results are returned as a ruleset assignment and are in the form:
$<parameter> = value
Returned values are formatted according to PDS implementation of ODL lexical standards. This means that strings are enclosed in double quotes, and multiple value sets are enclosed in brackets "{}".

Command line options

Required command line options:

source
[character string] Name (includ ing path) of the lookup table. Lookup tables should be ASCII CSV files with the format: start_time,stop_time,value. Here start_time and start_time are in PDS format (truncated at the minutes), and value is the return value assigned to that interval.
start
[PDS time*] Start time of the file to be labeled
stop
[PDS time*] Stop time of the file to be labeled
fudge
[integer] Size of the tolerance (in minutes) used in matching the start and stop to intervals in the lookup table. The way the fudge factor is applied depends upon the search method (see section describing search method below)
parameter
[character string] Parameter to return (e.g. TARG_LIST).
method
[character string] Name of the method to use in search of lookup table. Options:
Phase - Selection criteria: start >= start_time - fudge && stop <= stop_time + fudge_factor.
Target - Selection criteria: start <= stop_time - fudge && stop >= start_time + fudge_factor.
return
[character string] Indicates whether to return value will consist of a list or a single item. Options:
LIST - multiple values may be returned in a comma-separated list
SINGLE - only a single value will be returned
Default for return depends upon the choice of search method.
If method=0, then the default return is SINGLE. If method=1, then the default return is LIST.

Optional command line options:

order
[character string] Way in which a LIST will be sorted. If return_type=SINGLE any value given for list_order is ignored. Options:
CHRON_ASCENDING - ascending by start_time
CHRON_DESCENDING - descending by start_time
ALPHA_ASCENDING - ascending by ASCII sort of return value
ALPHA_DESCENDING - descending by ASCII sort of return value
AS_IS - preserve order of items in the lookup table
single
[character string] Method by which to reduce the return value from multiple items to a single item. Options:
MAX_LOOKUP - value corresponding to the interval from lookup table of longest duration
MIN_LOOKUP - value corresponding to the interval from lookup table of shortest duration
MAX_DATA - value from lookup table covering the greatest amount (time span) of data interval
MIN_DATA - value from lookup table covering the least amount (time span) of data interval
max
[integer] Maximum number of items to include in a list. After a list is sorted according to the list_order parameter, items in excess of max_list_items will be dropped. The first item is considered item 1. max_list_items = 1 is equivalent to return_type = SINGLE, using list_order rather than single_method to determine what value is returned.
Defaults
fudge=0
return:
if method=Phase, return=SINGLE
if method=Target, return=LIST
order = AS_IS
single=MIN_LOOKUP
max=No maximum (all items will be returned)
PDS Time Note: Both year-month-day or year-day of year format PDS times are supported.

Examples
excerpt from targets lookup table "GLL_TARGET.TAB" ...

 1995-07-01T00:00,             EOM , JUPITER
 1997-12-16T11:30, 1997-12-16T12:45, EUROPA
 1997-12-15T09:30, 1997-12-15T10:30, GANYMEDE
 LAUNCH          , 1995-12-06T00:00, SOLAR_WIND
 

Example 1:
excerpt from rule set ...

 $lookup = "GLL_TARGET.TAB"
 $start = "1997-12-15T00:00"
 $stop = "1998-02-09T00:00"
 $fudge = 720
 $parameter = "TARG_LIST"
 $search = 1
 $return = "LIST"

 <RUN java lookup table source=$lookup start=$start
    stop=$stop fudge=$fudge parameter=$parameter
    method=$search return=$return>
 

would return:

 $TARG_LIST = {"JUPITER","EUROPA","GANYMEDE"}
 
Example 2:
excerpt from rule set ...
 [same as Example 1, except]
 $order = "CHRON_ASCENDING"

 <RUN java lookup table source=$lookup start=$start
    stop=$stop fudge=$fudge parameter=$parameter
    method=$search return=$return order=$order>
 

would return:

 $TARG_LIST = {"JUPITER","GANYMEDE","EUROPA"}
 
Example 3:
excerpt from rule set ...
 [same as Example 1, except]
 $order = "CHRON_DESCENDING"
 $max = 1

 <RUN java lookup table source=$lookup start=$start
    stop=$stop fudge=$fudge parameter=$parameter
    method=$search return=$return order=$order
    max=$max>
 

would return:

 $TARG_LIST = "EUROPA"
 
Example 4:
excerpt from rule set ...
 [same as Example 1, except]
 $search = 1
 $return = "SINGLE"
 $single = "MIN_LOOKUP"

 <RUN java lookup table source=$lookup start=$start
    stop=$stop fudge=$fudge parameter=$parameter
    method=$search return=$return single=$single>
 

would return:

 $TARG_LIST = "GANYMEDE"
 
Example 5 (differs from example 4 only in search method):
excerpt from rule set ...
 [same as Example 1, except]
 $search = 0
 $return = "SINGLE"
 $single = "MIN_LOOKUP"

 <RUN java lookup table source=$lookup start=$start
    stop=$stop fudge=$fudge parameter=$parameter
    method=$search return=$return single=$single>
 

would return:

 $TARG_LIST = "JUPITER"

Since:
1.0