Package cds.healpix

Interface Projection

  • All Known Implementing Classes:
    Healpix

    public interface Projection
    Define a projection of spherical coordinates (in the unit sphere) to the Euclidean plane, together with the reverse operation. Remark: we use arrays instead of objects because HEALPix is a low level library focused on performances. Accessing an element in an array is faster than accessing a class attribute.
    Author:
    F.-X. Pineau
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int LAT_INDEX
      Index of the lattitude in the array containing the result of an unproject method.
      static int LON_INDEX
      Index of the longitude in the array containing the result of an unproject method.
      static int X_INDEX
      Index of the x coordinate in the array containing the result of a project method.
      static int Y_INDEX
      Index of the y coordinate in the array containing the result of a project method.
    • Field Detail

      • LON_INDEX

        static final int LON_INDEX
        Index of the longitude in the array containing the result of an unproject method.
        See Also:
        Constant Field Values
      • LAT_INDEX

        static final int LAT_INDEX
        Index of the lattitude in the array containing the result of an unproject method.
        See Also:
        Constant Field Values
      • X_INDEX

        static final int X_INDEX
        Index of the x coordinate in the array containing the result of a project method.
        See Also:
        Constant Field Values
      • Y_INDEX

        static final int Y_INDEX
        Index of the y coordinate in the array containing the result of a project method.
        See Also:
        Constant Field Values
    • Method Detail

      • project

        double[] project​(double lonRad,
                         double latRad)
        Project the given spherical coordinates into the Euclidean plane.
        Parameters:
        lonRad - longitude in radians (the accepted value range is implementation dependent)
        latRad - latitude in [-pi/2, pi/2] radians
        Returns:
        the projection of the given spherical coordinate into the Euclidean plane. The x and y coordinate are stored in the returned array at indices X_INDEX and Y_INDEX respectively. The range of possible value for x and y is implementation dependent.
      • unproject

        double[] unproject​(double x,
                           double y)
        Reverse projection: we look for spherical coordinates from their projected coordinates (project(double, double).
        Parameters:
        x - the x coordinate of the projected spherical point we are looking for, the accepted value range is implementation dependent
        y - the y coordinate of the projected spherical point we are looking for, must be in [-2, 2].
        Returns:
        the spherical coordinates leading to the given projection coordinates. The lon and lat coordinate are stored in the returned array at indices LON_INDEX and LAT_INDEX respectively. Lat is in [-pi/2, pi/2] radians, lon is also in radians but it possible value range is implementation dependent).