    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class ncsa.horizon.coordinates.transforms.SphericalCoordTransform

    java.lang.Object
       |
       +----java.util.Observable
               |
               +----ncsa.horizon.coordinates.CoordTransform
                       |
                       +----ncsa.horizon.coordinates.transforms.SphericalCoordTransform

public class SphericalCoordTransform
extends CoordTransform

an object for transforming positions from one spherical coordinate system to another by shifting the pole and rotating.

In the documentation below, the terms "old" and "new" refer the to two systems relative to the direction of this transform; that is, the forward() method transforms a position in the "old" system to a position in the new system.

This class is a Horizon wrapper around the FITSWCS.SphericalTransform class.

##

name
sph

##

SphericalCoordTransform(double, double)
  Specify the transformation between two spherical coordinate systems using the "pole-positioning" method.
SphericalCoordTransform(double, double, double)
  Specify the transformation between two spherical coordinate systems using the "pole-positioning" method.
SphericalCoordTransform(double, double, double, boolean)
  Specify the transformation between two spherical coordinate systems using one of two descriptions: "Dip-and-Spin" or "Pole-Positioning".
SphericalCoordTransform(double, double, double, boolean, double)
  Specify the transformation between two spherical coordinate systems using a reference position of a point in the new system located else where along 0 degrees longitude other than the pole.

##

clone()
  create a copy of this Transform
determineConstraints(Metadata, boolean)
  make an educated guess as to the proper way to apply this transform to a coordinate system with the specified Metadata.
forward(double[])
  apply a forward tranform on an input position.
forward(double[], int[])
  apply a forward tranform on an input position
getInNaxes()
  return the minimum number of axes that the forward transform operates on.
getMaxNaxes()
  return the maximum number of axes this transform operates on
getMetadata(Metadata, boolean, int[])
  update the input Metadata object to reflect the changes that this tranform makes to a coordinate position.
getName()
  return the axis name to be given to a transformed axis.
getName(int)
  return the axis name to be given to a transformed axis, or null if the name is not updated by getMetadata().
getOutNaxes()
  return the minimum number of axes that results from the forward transform.
reverse(double[])
  apply a forward tranform on an input position.
reverse(double[], int[])
  apply a reverse tranform on an input position
setName(int, String)
  set the axis name to be given to a transformed axis.
setName(String[])
  set the axis names to be given to each transformed axis.

##

sph

      protected SphericalTransform sph

name

      protected String name[]

##

SphericalCoordTransform

      public SphericalCoordTransform(double angle1,
                                     double angle2,
                                     double angle3,
                                     boolean dipAndSpin)

  Specify the transformation between two spherical coordinate systems using one of two descriptions: "Dip-and-Spin" or "Pole-Positioning".
  Dip-and-Spin
    The transformation is described as a two step process of first shifting or "dipping" the pole by some angle, and then rotating the system around it new pole by another angle.
    Parameters:
      angle1 - longitude in old system to dip the pole towards, in degrees
      angle2 - angle to dip the pole by, in degrees.
      angle3 - angle to rotate the system by after dipping.
    Pole-Positioning
      The transformation is described by giving the location of the poles of the old and new systems with coordinates of the other system.
      angle1 - longitude of the new pole in the old system
      angle2 - latitude of the new pole in the old system
      angle3 - longitude of the old pole in the new system

    dipAndSpin - true if the three angles given refer to the "dip-and-spin" method.

SphericalCoordTransform

      public SphericalCoordTransform(double newpolelong,
                                     double newpolelat,
                                     double oldpolelong)

  Specify the transformation between two spherical coordinate systems using the "pole-positioning" method.
  Parameters:
    newpolelong - longitude of the new pole in the old system
    newpolelat - latitude of the new pole in the old system
    oldpolelong - longitude of the old pole in the new system

SphericalCoordTransform

      public SphericalCoordTransform(double newpolelong,
                                     double newpolelat)

  Specify the transformation between two spherical coordinate systems using the "pole-positioning" method. The longitude of the old pole in the new system is assumed to be 180 degrees.
  Parameters:
    newpolelong - longitude of the new pole in the old system
    newpolelat - latitude of the new pole in the old system

SphericalCoordTransform

      public SphericalCoordTransform(double reflong,
                                     double reflat,
                                     double poleref,
                                     boolean islongpole,
                                     double theta0) throws IllegalArgumentException

  Specify the transformation between two spherical coordinate systems using a reference position of a point in the new system located else where along 0 degrees longitude other than the pole.
  Parameters:
    reflong - longitude of reference point in the old system, in degrees
    reflat - latitude of reference point in the old system, in degrees
    poleref - either the longitude or latitude of the old pole in the new system, in degrees; a value of 999.0 indicates that this should be set to a default value.
    islongpole - true if poleref is a longitude;
    theta0 - latitude of reference point in the new system.

##

forward

      public double[] forward(double position[],
                              int axisIndices[]) throws TransformUndefinedException

  apply a forward tranform on an input position
  Parameters:
    position - an array giving the input position in the old system
    axisIndices - a 2-elementarray containing the indices of the position array that should be used in the tranformation. The first index should be for the longitude axis and the second, the latitude axis.
  Overrides:
    forward in class CoordTransform

forward

      public double[] forward(double position[]) throws TransformUndefinedException

  apply a forward tranform on an input position. The first axis is assumed to be the longitude axis, and the second, the latitude axis
  Parameters:
    position - an array giving the input position in the old system
  Overrides:
    forward in class CoordTransform

reverse

      public double[] reverse(double position[],
                              int axisIndices[]) throws TransformUndefinedException

  apply a reverse tranform on an input position
  Parameters:
    position - an array giving the input position in the new system
    axisIndices - a 2-element array containing the indices of the position array that should be used in the tranformation. The first index should be for the longitude axis and the second, the latitude axis.
  Overrides:
    reverse in class CoordTransform

reverse

      public double[] reverse(double position[]) throws TransformUndefinedException

  apply a forward tranform on an input position. The first axis is assumed to be the longitude axis, and the second, the latitude axis
  Parameters:
    position - an array giving the input position in the new system
  Overrides:
    reverse in class CoordTransform

getInNaxes

      public int getInNaxes()

  return the minimum number of axes that the forward transform operates on. This value is equal to the minimum number of axes that results from the reverse transform. This value is often equal to the that returned by getOutNaxes(), but is not required to.
  Overrides:
    getInNaxes in class CoordTransform

getOutNaxes

      public int getOutNaxes()

  return the minimum number of axes that results from the forward transform. This value is equal to the minimum number of axes that the reverse transform operates on. This value is often equal to the that returned by getInNaxes(), but is not required to.
  Overrides:
    getOutNaxes in class CoordTransform

getMaxNaxes

      public int getMaxNaxes()

  return the maximum number of axes this transform operates on

determineConstraints

      public CoordTransformConstraints determineConstraints(Metadata in,
                                                            boolean forwards)

  make an educated guess as to the proper way to apply this transform to a coordinate system with the specified Metadata. This is done by finding the first axes with types beginning with "longitude" and "latitude".
  Overrides:
    determineConstraints in class CoordTransform

setName

      public synchronized void setName(int axis,
                                       String in) throws ArrayIndexOutOfBoundsException

  set the axis name to be given to a transformed axis. Note that this name is only used by the getMetadatum() method and is applied regardless of the value of the forward argument to that method.
  Parameters:
    axis - the index of the axis to be set (first axis has index 0)
    in - the name to give to the axis, null means use the name of the untransformed axis

getName

      public synchronized String getName(int axis) throws ArrayIndexOutOfBoundsException

  return the axis name to be given to a transformed axis, or null if the name is not updated by getMetadata().
  Parameters:
    axis - the index of the axis (first axis has index 0)

setName

      public synchronized void setName(String in[])

  set the axis names to be given to each transformed axis. Note that these names are only used by the getMetadatum() method and are applied regardless of the value of the forward argument to that method.
  Parameters:
    in - values to be set

getName

      public synchronized String[] getName() throws ArrayIndexOutOfBoundsException

  return the axis name to be given to a transformed axis. Null values in the output array indicate that the name for that axis will not be updated by getMetadata().

clone

      public synchronized Object clone()

  create a copy of this Transform
  Overrides:
    clone in class CoordTransform

getMetadata

      public synchronized Metadata getMetadata(Metadata in,
                                               boolean forward,
                                               int axisIndices[])

  update the input Metadata object to reflect the changes that this tranform makes to a coordinate position. In general, this method will actually edit the contents of the input Metadata when changes are necessary.
  Overrides:
    getMetadata in class CoordTransform

    All Packages  Class Hierarchy  This Package  Previous  Next  Index