Class FITSWCS.SphericalTransform
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class FITSWCS.SphericalTransform

java.lang.Object
   |
   +----FITSWCS.SphericalTransform

public class SphericalTransform
extends Object
This class provides support for spherical coordinate transformations used by the FITS "World Coordinate System" (WCS) convention.

The FITSWCS package was translated from the WCSLIB C library. This original library was written in support for coordinate systems used by astronomical data stored in FITS format. For more information on these coordinate systems, refer to the paper by Greisen and Calabretta at:

ftp://fits.cv.nrao.edu/fits/documents/wcs/wcs.all.ps.Z
Nomenclature

In WCSLIB the "forward" direction is from (lng,lat) celestial coordinates to (x,y) coordinates in the plane of projection. This accords with the notion that spherical projections are a projection of the sphere onto a plane, the "reverse" direction is therefore that of deprojection from plane to sphere.

Unfortunately, this is opposite to what is generally understood to be the forward direction for FITS, namely that of transforming pixel coordinates to world coordinates. However, the ordering of function argument lists should make it clear what is intended.


COPYRIGHT NOTICE

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.

You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

Correspondence concerning WCSLIB may be directed to:

     Internet email: mcalabre@atnf.csiro.au
     Postal address: Dr. Mark Calabretta,
                     Australia Telescope National Facility,
                     P.O. Box 76,
                     Epping, NSW, 2121,
                     AUSTRALIA
Correspondence concerning the Java implementation may be directed to Raymond L. Plante (rplante@ncsa.uiuc.edu).

Variable Index

 o euler

Constructor Index

 o SphericalTransform(double, double)
Create a SphericalTransform object (storing euler angles internally) assuming the reference point is at the native pole and taking defaults for the longitude & latitude of the pole of the reference system.
 o SphericalTransform(double, double, String)
Create a SphericalTransform object (storing euler angles internally) taking defaults for the longitude & latitude of the pole of the reference system.
 o SphericalTransform(double, double, double)
Create a SphericalTransform object (storing euler angles internally) taking defaults for the longitude & latitude of the pole of the reference system.
 o SphericalTransform(double, double, double, boolean, double)
Create a SphericalTransform object (storing euler angles internally)
 o SphericalTransform(double[], String)
Create a SphericalTransform object (storing euler angles internally)
 o SphericalTransform(double[])
Create a SphericalTransform object, using the given (5) euler angles

Method Index

 o fwd(double, double)
Do a forward transformation, returning the result, phi and theta, as a double
 o fwd(double[])
same as fwd(lnglat[0], lnglat[1])
 o fwd(double, double, double[])
Do a forward transformation, returning the result, phi and theta, as a double
 o getEuler()
return a copy of the euler angles in use by this object
 o getEuler(double, double, double, boolean, double)
Compute the euler angles for a given set of reference angles
 o getEuler(double, double, double)
Compute the euler angles for a given set of reference angles, taking defaults for the longitude & latitude of the pole of the reference system.
 o getEuler(double, double)
Compute the euler angles for a given set of reference angles, assuming the reference point is at the native pole and taking defaults for the longitude & latitude of the pole of the reference system.
 o getEuler(double, double, String)
Compute the euler angles for a given set of reference angles, taking defaults for the longitude & latitude of the pole of the reference system.
 o getEuler(double, double, double, boolean, String)
Compute the euler angles for a given set of reference angles
 o getTheta0(String)
determine the proper value of theta0 (used by getEuler() and the SphericalTransform constructor) for a given projection code.
 o rev(double, double)
Do a reverse transformation
 o rev(double[])
same as rev(phitheta[0], phitheta[1])
 o rev(double, double, double[])
Do a reverse transformation

Variables

 o euler
  protected double euler[]

Constructors

 o SphericalTransform
  public SphericalTransform(double reflong,
                            double reflat) throws BadReferenceParameterException
Create a SphericalTransform object (storing euler angles internally) assuming the reference point is at the native pole and taking defaults for the longitude & latitude of the pole of the reference system.
Parameters:
reflong - celestial longitude (usually right ascension) of the reference point of the projection, in degrees
reflat - celestial latitude (usually declination) of the reference point of the projection, in degrees
 o SphericalTransform
  public SphericalTransform(double reflong,
                            double reflat,
                            String pcode) throws BadReferenceParameterException, UnsupportedProjectionException
Create a SphericalTransform object (storing euler angles internally) taking defaults for the longitude & latitude of the pole of the reference system.
Parameters:
reflong - celestial longitude (usually right ascension) of the reference point of the projection, in degrees
reflat - celestial latitude (usually declination) of the reference point of the projection, in degrees
pcode - the projection code of applied to the celestial system
 o SphericalTransform
  public SphericalTransform(double reflong,
                            double reflat,
                            double theta0) throws BadReferenceParameterException
Create a SphericalTransform object (storing euler angles internally) taking defaults for the longitude & latitude of the pole of the reference system.
Parameters:
reflong - celestial longitude (usually right ascension) of the reference point of the projection, in degrees
reflat - celestial latitude (usually declination) of the reference point of the projection, in degrees
theta0 - native latitude of reference point
 o SphericalTransform
  public SphericalTransform(double reflong,
                            double reflat,
                            double poleref,
                            boolean islongpole,
                            double theta0) throws BadReferenceParameterException
Create a SphericalTransform object (storing euler angles internally)
Parameters:
reflong - celestial longitude (usually right ascension) of the reference point of the projection, in degrees
reflat - celestial latitude (usually declination) of the reference point of the projection, in degrees
poleref - either the native longitude or native latitude of the celestial coordinate system, in degrees; a value of 999.0 indicates that this should be set to a default value.
islongpole - true if poleref refers to the native longitude; otherwise, its the native latitude.
theta0 - native latitude of reference point
 o SphericalTransform
  public SphericalTransform(double ref[],
                            String pcode) throws BadReferenceParameterException, UnsupportedProjectionException
Create a SphericalTransform object (storing euler angles internally)
Parameters:
ref[4] - an array containing the reference point parameters:
ref[0,1]
celestial longitude & latitude (usually right ascension) of the reference point of the projection, in degrees
ref[2,3]
native longitude & latitude of the pole of the celestial coordinate system, in degrees; either or both may have a value of 999.0, indicating that a default value should be calulated.
pcode - the projection code of applied to the celestial system
 o SphericalTransform
  public SphericalTransform(double euler[]) throws ArrayIndexOutOfBoundsException
Create a SphericalTransform object, using the given (5) euler angles

Methods

 o getEuler
  public double[] getEuler()
return a copy of the euler angles in use by this object
 o fwd
  public double[] fwd(double lng,
                      double lat)
Do a forward transformation, returning the result, phi and theta, as a double
Parameters:
lng - spherical longitude in degrees
lat - spherical latitude in degrees
Returns:
phi and theta, the longitude and latitude in the native coordinate system of the projection in degrees, returned as a two element array
 o fwd
  public double[] fwd(double lnglat[])
same as fwd(lnglat[0], lnglat[1])
 o rev
  public double[] rev(double phi,
                      double theta)
Do a reverse transformation
Parameters:
phi - Longitude in the native coordinate system of the projection, in degrees.
theta - Latitude in the native coordinate system of the projection, in degrees.
Returns:
spherical longitude and latitude in degrees, returned as a two element array
 o rev
  public double[] rev(double phitheta[])
same as rev(phitheta[0], phitheta[1])
 o fwd
  public static double[] fwd(double lng,
                             double lat,
                             double eul[])
Do a forward transformation, returning the result, phi and theta, as a double
Parameters:
lng - spherical longitude in degrees
lat - spherical latitude in degrees
eul[5] - Euler angles for the transformation:
                 0: Celestial longitude of the native pole, in
                    degrees.
                 1: Celestial colatitude of the native pole, or
                    native colatitude of the celestial pole, in
                    degrees.
                 2: Native longitude of the celestial pole, in
                    degrees.
                 3: cos(eul[1])
                 4: sin(eul[1])
              
Returns:
phi and theta, the longitude and latitude in the native coordinate system of the projection in degrees, returned as a two element array
Throws: ArrayIndexOutOfBoundsException
if eul has less than 5 elements
 o rev
  public static double[] rev(double phi,
                             double theta,
                             double eul[])
Do a reverse transformation
Parameters:
phi - Longitude in the native coordinate system of the projection, in degrees.
theta - Latitude in the native coordinate system of the projection, in degrees.
eul[5] - Euler angles for the transformation:
                 0: Celestial longitude of the native pole, in
                    degrees.
                 1: Celestial colatitude of the native pole, or
                    native colatitude of the celestial pole, in
                    degrees.
                 2: Native longitude of the celestial pole, in
                    degrees.
                 3: cos(eul[1])
                 4: sin(eul[1])
              
Returns:
spherical longitude and latitude in degrees, returned as a two element array
Throws: ArrayIndexOutOfBoundsException
if eul has less than 5 elements
 o getEuler
  public final static double[] getEuler(double reflong,
                                        double reflat,
                                        double poleref,
                                        boolean islongpole,
                                        double theta0) throws BadReferenceParameterException
Compute the euler angles for a given set of reference angles
Parameters:
reflong - celestial longitude (usually right ascension) of the reference point of the projection, in degrees
reflat - celestial latitude (usually declination) of the reference point of the projection, in degrees
poleref - either the native longitude or native latitude of the celestial coordinate system, in degrees; a value of 999.0 indicates that this should be set to a default value.
islongpole - true if poleref refers to the native longitude; otherwise, its the native latitude.
theta0 - native latitude of reference point
 o getEuler
  public final static double[] getEuler(double reflong,
                                        double reflat,
                                        double theta0) throws BadReferenceParameterException
Compute the euler angles for a given set of reference angles, taking defaults for the longitude & latitude of the pole of the reference system.
Parameters:
reflong - celestial longitude (usually right ascension) of the reference point of the projection, in degrees
reflat - celestial latitude (usually declination) of the reference point of the projection, in degrees
theta0 - native latitude of reference point
 o getEuler
  public final static double[] getEuler(double reflong,
                                        double reflat) throws BadReferenceParameterException
Compute the euler angles for a given set of reference angles, assuming the reference point is at the native pole and taking defaults for the longitude & latitude of the pole of the reference system.
Parameters:
reflong - celestial longitude (usually right ascension) of the reference point of the projection, in degrees
reflat - celestial latitude (usually declination) of the reference point of the projection, in degrees
 o getEuler
  public final static double[] getEuler(double reflong,
                                        double reflat,
                                        String pcode) throws BadReferenceParameterException, UnsupportedProjectionException
Compute the euler angles for a given set of reference angles, taking defaults for the longitude & latitude of the pole of the reference system.
Parameters:
reflong - celestial longitude (usually right ascension) of the reference point of the projection, in degrees
reflat - celestial latitude (usually declination) of the reference point of the projection, in degrees
pcode - the projection code of applied to the celestial system
 o getEuler
  public final static double[] getEuler(double reflong,
                                        double reflat,
                                        double poleref,
                                        boolean islongpole,
                                        String pcode) throws BadReferenceParameterException, UnsupportedProjectionException
Compute the euler angles for a given set of reference angles
Parameters:
reflong - celestial longitude (usually right ascension) of the reference point of the projection, in degrees
reflat - celestial latitude (usually declination) of the reference point of the projection, in degrees
poleref - either the native longitude or native latitude of the pole of the celestial coordinate system, in degrees; a value of 999.0 indicates that this should be set to a default value.
islongpole - true if poleref refers to the native longitude; otherwise, its the native latitude.
pcode - the projection code of applied to the celestial system
 o getTheta0
  public static double getTheta0(String pcode) throws UnsupportedProjectionException
determine the proper value of theta0 (used by getEuler() and the SphericalTransform constructor) for a given projection code.

All Packages  Class Hierarchy  This Package  Previous  Next  Index