gov.sns.tools.beam
Class PhaseMap

java.lang.Object
  |
  +--gov.sns.tools.beam.PhaseMap
All Implemented Interfaces:
IArchive

public class PhaseMap
extends java.lang.Object
implements IArchive

Represents a generalized map between homogeneous phase space coordinates. Note that it does not necessarily need to be symplectic.


Field Summary
static java.lang.String ATTR_DATA
          attribute marker for data
static java.lang.String LABEL_ONE
          label for first-order map component
static java.lang.String LABEL_THREE
          label for third-order map component
static java.lang.String LABEL_TWO
          label for second-order map component
static java.lang.String LABEL_ZERO
          label for zero-order map component (offset)
 
Constructor Summary
PhaseMap()
          Creates a new instance of PhaseMap - produces the identiy map
PhaseMap(PhaseMatrix matTrans)
          Create a new instance of PhaseMap which behaves as a linear transform given by the specified matrix.
PhaseMap(PhaseVector vecDispl)
          Create a new instance of PhaseMap which behaves as simple translation in phase space given by the specified displacement vector.
 
Method Summary
 PhaseVector apply(PhaseVector vecIn)
          Apply the full transform of map to phase coordinates.
 PhaseMap compose(PhaseMap mapRight)
          Non-destructive map composition - binary composition of two PhaseMaps
 void composeEquals(PhaseMap mapRight)
          In-place map composition - binary composition of two PhaseMaps
 PhaseMatrix getFirstOrder()
          Get the linear portion of the PhaseMap
 PhaseVector getZeroOrder()
          Get the zero offset vector of the map.
static PhaseMap identity()
          Create an identity phase map
 void load(DataAdaptor daptArchive)
          Restore the value of the this PhaseMatrix from the contents of a data archive.
 void save(DataAdaptor daptArchive)
          Save the value of this PhaseMatrix to a data sink represented by the DataAdaptor interface.
 void setFirstOrder(PhaseMatrix matLin)
          Set the linear part of the map
 void setZeroOrder(PhaseVector vecOff)
          Set the zero-order portion of the map
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LABEL_ZERO

public static final java.lang.String LABEL_ZERO
label for zero-order map component (offset)

See Also:
Constant Field Values

LABEL_ONE

public static final java.lang.String LABEL_ONE
label for first-order map component

See Also:
Constant Field Values

LABEL_TWO

public static final java.lang.String LABEL_TWO
label for second-order map component

See Also:
Constant Field Values

LABEL_THREE

public static final java.lang.String LABEL_THREE
label for third-order map component

See Also:
Constant Field Values

ATTR_DATA

public static final java.lang.String ATTR_DATA
attribute marker for data

See Also:
Constant Field Values
Constructor Detail

PhaseMap

public PhaseMap()
Creates a new instance of PhaseMap - produces the identiy map


PhaseMap

public PhaseMap(PhaseVector vecDispl)
Create a new instance of PhaseMap which behaves as simple translation in phase space given by the specified displacement vector.

Parameters:
vecDispl - displacement of the phase map

PhaseMap

public PhaseMap(PhaseMatrix matTrans)
Create a new instance of PhaseMap which behaves as a linear transform given by the specified matrix.

Parameters:
matTrans - linear portion of the phase map
Method Detail

identity

public static PhaseMap identity()
Create an identity phase map

Returns:
identity map for phase space

setZeroOrder

public void setZeroOrder(PhaseVector vecOff)
Set the zero-order portion of the map

Parameters:
vecOff - the output of the zero phase vector

setFirstOrder

public void setFirstOrder(PhaseMatrix matLin)
Set the linear part of the map

Parameters:
matLin - linear portion of phase map

save

public void save(DataAdaptor daptArchive)
Save the value of this PhaseMatrix to a data sink represented by the DataAdaptor interface.

Specified by:
save in interface IArchive
Parameters:
daptArchive - interface to data sink
See Also:
IArchive.save(gov.sns.tools.data.DataAdaptor)

load

public void load(DataAdaptor daptArchive)
          throws DataFormatException,
                 java.lang.IllegalArgumentException
Restore the value of the this PhaseMatrix from the contents of a data archive.

Specified by:
load in interface IArchive
Parameters:
daptArchive - interface to data source
Throws:
DataFormatException - malformed data
java.lang.IllegalArgumentException - wrong number of string tokens
See Also:
IArchive.load(gov.sns.tools.data.DataAdaptor)

getZeroOrder

public PhaseVector getZeroOrder()
Get the zero offset vector of the map.

Returns:
the phase coordinates of the zero map

getFirstOrder

public PhaseMatrix getFirstOrder()
Get the linear portion of the PhaseMap

Returns:
linear part of map

compose

public PhaseMap compose(PhaseMap mapRight)
Non-destructive map composition - binary composition of two PhaseMaps

Parameters:
mapRight - right argument to map composition
Returns:
composition this*mapRight

composeEquals

public void composeEquals(PhaseMap mapRight)
In-place map composition - binary composition of two PhaseMaps

Parameters:
mapRight - right argument to map composition

apply

public PhaseVector apply(PhaseVector vecIn)
Apply the full transform of map to phase coordinates.

Parameters:
vecIn - phase vector input to map
Returns:
output phase coordinates