HiRISE

HiRISE.HiPlan.HiTemp
Class Observation_Event

java.lang.Object
  extended by HiRISE.HiPlan.HiTemp.Observation_Event
All Implemented Interfaces:
Comparable<Observation_Event>

public class Observation_Event
extends Object
implements Comparable<Observation_Event>

An object that represents an observation as an event in time. An observation event has a unique identifier, a start time, and a duration. The identifier is typically the string form of the observation's Observation_ID, but it is not required to be so. The start time and the duration are assumed to be in units of seconds.

The observation event implements the Comparable interface for sorting. The natural sort order of an event is its start time, not its identifier as one might expect. In practice, the start time of most HiRISE observations will be tightly coupled to their Observation_IDs, but this situation applies only to observations of the surface of Mars from Mars orbit, when the ID includes an orbit number and an orbit phase.

Version:
1.12
Author:
Christian Schaller - UA/PIRL

Field Summary
static String ID
          Class identification name with source code version and date.
 
Constructor Summary
Observation_Event(Observation_Record observation)
          Creates a new event from an observation record.
Observation_Event(String identifier, Date predictTime, double startTime, double duration)
          Creates a new event from a unique identifier, predict time, start time, and duration.
Observation_Event(String identifier, double startTime, double duration)
          Creates a new event from a unique identifier, start time, and duration.
 
Method Summary
 int compareTo(Observation_Event compEvent)
          Compares this observation event to the specified observation event for order.
 Category getCategory()
           
 double getDuration()
          Gets the duration.
 String getIdentifier()
          Gets the unique identifier.
 Date getPredictTime()
          Gets the predict time.
 double getStartTime()
          Gets the start time.
 boolean isArbitrary()
          Indicates whether this observation is a so-called arbitrary observation.
 void setArbitrary(boolean isArbitrary)
          Sets whether this observation is a so-called arbitrary observation.
 void setCategory(Category category)
           
 void setDuration(double duration)
          Sets the duration.
 void setIdentifier(String identifier)
          Sets the unique identifier.
 void setPredictTime(Date predictTime)
          Sets the predict time.
 void setStartTime(double startTime)
          Sets the start time.
 String toString()
          Gets a brief description of this observation event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ID

public static final String ID
Class identification name with source code version and date.

See Also:
Constant Field Values
Constructor Detail

Observation_Event

public Observation_Event(Observation_Record observation)
                  throws Invalid_Argument_Exception
Creates a new event from an observation record. The record must have a non-null observation ID, predict time, observation duration, and setup duration. If any of these is null, an Invalid_Argument_Exception is thrown.

Parameters:
observation - the observation record.
Throws:
Invalid_Argument_Exception - if the observation lacks the information neeeded to construct an event.

Observation_Event

public Observation_Event(String identifier,
                         Date predictTime,
                         double startTime,
                         double duration)
Creates a new event from a unique identifier, predict time, start time, and duration. If predict time is null, start time is used as an approximation. Doing so is not strictly accurate, but it is sufficient for rudimentary thermal modeling.

Parameters:
identifier - the unique identifier for this event.
predictTime - the predict time for this event.
startTime - the start time of this event, in seconds.
duration - the duration of this event, in seconds.

Observation_Event

public Observation_Event(String identifier,
                         double startTime,
                         double duration)
Creates a new event from a unique identifier, start time, and duration. The predict time is set to the start time; doing so is not accurate, but with no predict time specified, it is sufficient for rudimentary thermal modeling.

Parameters:
identifier - the unique identifier for this event.
startTime - the start time of this event.
duration - the duration of this event.
Method Detail

getIdentifier

public String getIdentifier()
Gets the unique identifier.

Returns:
the observation event's unique identifier.

setIdentifier

public void setIdentifier(String identifier)
Sets the unique identifier.

Parameters:
identifier - the observation event's unique identifier.

getPredictTime

public Date getPredictTime()
Gets the predict time. This time is the center of the observation as the spacecraft knows it. HiRISE Observation_Record.delay_by() time can offset this slightly, and the actual start time of the observation is found by the startTime method.

Returns:
the observation event's predict time.

setPredictTime

public void setPredictTime(Date predictTime)
Sets the predict time. This time is the center of the observation as the spacecraft knows it. HiRISE Observation_Record.delay_by() time can offset this slightly, and the actual start time of the observation is found by the startTime method.

Parameters:
predictTime - the new predict time.

getStartTime

public double getStartTime()
Gets the start time.

Returns:
the observation event's start time.

setStartTime

public void setStartTime(double startTime)
Sets the start time.

Parameters:
startTime - the observation event's start time.

getDuration

public double getDuration()
Gets the duration.

Returns:
the observation event's duration.

setDuration

public void setDuration(double duration)
Sets the duration.

Parameters:
duration - the observation event's duration.

isArbitrary

public boolean isArbitrary()
Indicates whether this observation is a so-called arbitrary observation. An arbitrary observation is not represented in HiCat.

Returns:
true if the observation is arbitrary; false otherwise.

setArbitrary

public void setArbitrary(boolean isArbitrary)
Sets whether this observation is a so-called arbitrary observation. An arbitrary observation is not represented in HiCat.

Parameters:
isArbitrary - true if the observation is arbitrary; false otherwise.

getCategory

public Category getCategory()

setCategory

public void setCategory(Category category)

compareTo

public int compareTo(Observation_Event compEvent)
Compares this observation event to the specified observation event for order. The natural sorting order for an observation event is its start time, not its identifier.

Specified by:
compareTo in interface Comparable<Observation_Event>
Parameters:
compEvent - the observation event to compare to this observation event.
Returns:
-1 if this observation event's start time is less than that of compEvent, 0 if the two are identical, and +1 if it is greater.

toString

public String toString()
Gets a brief description of this observation event.

Overrides:
toString in class Object
Returns:
a descriptive string.

HiRISE

Copyright (C) Arizona Board of Regents on behalf of the Planetary Image Research Laboratory, Lunar and Planetary Laboratory at the University of Arizona