HiRISE

HiRISE.HiVali
Class Channel

java.lang.Object
  extended by HiRISE.HiVali.Channel
All Implemented Interfaces:
Cloneable, Comparable<Channel>

public class Channel
extends Object
implements Cloneable, Comparable<Channel>

Represents a Channel. An Observation will have multiple Channels.

Version:
1.14
Author:
guym

Field Summary
static String CHANNEL_SUFFIX
          file name suffix
static Pattern hexIdPattern
          Pattern to match hex form of Channel IDs
static String ID
          CVS ID
static Pattern idPattern
          Pattern to match non-hex form of Channel IDs
static String MRO_HiRISE_RSDS_PREFIX
          prefix specific to MRO HiRISE
 
Constructor Summary
Channel(Observation observation, int cpmmNumber, int channel)
          Construct a new Channel for the given Observation, CPMM number and channel number.
Channel(Observation observation, String ccdName, int channel)
          Construct a new Channel for the given Observation, CCD name and channel number.
 
Method Summary
 Object clone()
          Clone this Channel
 int compareTo(Channel channel)
           
 boolean equals(Object object)
          Compare this Channel to another for equality.
 String getCcdName()
          Get the CCD name for this channel.
 int getChannelNumber()
          Get the channel number for this channel
 int getCpmmNumber()
          Get the CPMM number
 String getFilterName()
          Get the filter name for this channel
 String getName()
          Get the name of this channel, e.g.
 Observation getObservation()
          Get the observation that this Channel is a part of.
 String getRsdsFilename(boolean gapped)
          Get the filename for this Channel as it would appear on the RSDS.
 int getVersion()
          Get the version number for this channel, which defaults to 1 if it has not been set.
 int hashCode()
          Get a hash code for this Channel
static Channel parse(String id)
          Construct a new Channel
static Channel parseHex(String id)
          Construct a new Channel
 void setVersion(int version)
          Set the version number for this channel, used in the hex form of the ID.
 String toString()
          Get the String form of the channel.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ID

public static final String ID
CVS ID

See Also:
Constant Field Values

MRO_HiRISE_RSDS_PREFIX

public static final String MRO_HiRISE_RSDS_PREFIX
prefix specific to MRO HiRISE

See Also:
Constant Field Values

CHANNEL_SUFFIX

public static final String CHANNEL_SUFFIX
file name suffix

See Also:
Constant Field Values

idPattern

public static final Pattern idPattern
Pattern to match non-hex form of Channel IDs


hexIdPattern

public static final Pattern hexIdPattern
Pattern to match hex form of Channel IDs

Constructor Detail

Channel

public Channel(Observation observation,
               int cpmmNumber,
               int channel)
        throws Invalid_Argument_Exception
Construct a new Channel for the given Observation, CPMM number and channel number.

Parameters:
observation - The observation
cpmmNumber - Index into the Instrument.CCD_NAMES array
channel - 0 or 1
Throws:
Invalid_Argument_Exception - Bad channel or CPMM number

Channel

public Channel(Observation observation,
               String ccdName,
               int channel)
        throws Invalid_Argument_Exception
Construct a new Channel for the given Observation, CCD name and channel number.

Parameters:
observation - Observation instance
ccdName - Name of CCD
channel - Channel Number
Throws:
Invalid_Argument_Exception - Bad channel number or CCD name
Method Detail

parse

public static Channel parse(String id)
                     throws Invalid_Argument_Exception
Construct a new Channel

Parameters:
id - String containing Channel id
Returns:
Channel instance
Throws:
Invalid_Argument_Exception - Bad Channel ID

parseHex

public static Channel parseHex(String id)
                        throws Invalid_Argument_Exception
Construct a new Channel

Parameters:
id - String containing Channel id
Returns:
Channel instance
Throws:
Invalid_Argument_Exception - Bad hex Channel ID

getRsdsFilename

public String getRsdsFilename(boolean gapped)
Get the filename for this Channel as it would appear on the RSDS.

Parameters:
gapped - True if this is a gapped channel
Returns:
RSDS filename for channel

getName

public String getName()
Get the name of this channel, e.g. RED0_0

Returns:
Channel Name

getVersion

public int getVersion()
Get the version number for this channel, which defaults to 1 if it has not been set.

Returns:
version number

setVersion

public void setVersion(int version)
                throws Invalid_Argument_Exception
Set the version number for this channel, used in the hex form of the ID.

Parameters:
version - Number
Throws:
Invalid_Argument_Exception - Bad version number

toString

public String toString()
Get the String form of the channel.

Overrides:
toString in class Object

getObservation

public Observation getObservation()
Get the observation that this Channel is a part of.

Returns:
Observation instance

clone

public final Object clone()
                   throws CloneNotSupportedException
Clone this Channel

Overrides:
clone in class Object
Throws:
CloneNotSupportedException

equals

public boolean equals(Object object)
Compare this Channel to another for equality.

Overrides:
equals in class Object

hashCode

public int hashCode()
Get a hash code for this Channel

Overrides:
hashCode in class Object

compareTo

public int compareTo(Channel channel)
Specified by:
compareTo in interface Comparable<Channel>
See Also:
Comparable

getCpmmNumber

public int getCpmmNumber()
Get the CPMM number

Returns:
CPMM number

getCcdName

public String getCcdName()
Get the CCD name for this channel.

Returns:
CCD name

getChannelNumber

public int getChannelNumber()
Get the channel number for this channel

Returns:
channel number

getFilterName

public String getFilterName()
Get the filter name for this channel

Returns:
filter name

HiRISE

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