Package uk.ac.starlink.table.join

## Class HtmSkyPixellator

- java.lang.Object
- - uk.ac.starlink.table.join.HtmSkyPixellator

- All Implemented Interfaces:
    `SkyPixellator`

      public class HtmSkyPixellator
      extends java.lang.Object
      implements SkyPixellator

  Implements sky pixellisation using the HTM (Hierarchical Triangular Mesh) indexing scheme.

  Note that the `HealpixSkyPixellator` implementation normally gives much faster matching than this and should generally be used in preference.

  Author:
    Mark Taylor (Starlink)
  See Also:
    http://www.skyserver.org/htm/doc/java/index.html

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `HtmSkyPixellator()` | Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `int` | `calculateDefaultLevel​(double scale)` | Determines a default value to use for the level paramer based on a given scale.
    `int` | `getLevel()` | Returns the HTM level, which determines sky pixel size.
    `java.lang.Object[]` | `getPixels​(double alpha, double delta, double radius)` | Returns an array of objects representing pixels in a given region.
    `double` | `getScale()` | Returns the most recently set angular scale.
    `uk.ac.starlink.table.DescribedValue` | `getTuningParameter()` | Returns a parameter whose value may be adjusted to alter the pixellisation scale.
    `void` | `setLevel​(int level)` | Sets the HTM level value, which determines sky pixel size.
    `void` | `setScale​(double scale)` | Sets the characteristic angular scale for this pixellator.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### HtmSkyPixellator

          public HtmSkyPixellator()

      Constructor.

  - ### Method Detail

    - #### setScale

          public void setScale​(double scale)

      Description copied from interface: `SkyPixellator`
      Sets the characteristic angular scale for this pixellator. Pixels should be approximately the size given, so that a larger scale corresponds to larger pixel sizes. The details of pixel size are determined by the details of the pixellation scheme however.
      Specified by:
        `setScale` in interface `SkyPixellator`
      Parameters:
        `scale` - pixel length scale in radians

    - #### getScale

          public double getScale()

      Description copied from interface: `SkyPixellator`
      Returns the most recently set angular scale.
      Specified by:
        `getScale` in interface `SkyPixellator`
      Returns:
        pixel length scale in radians

    - #### getTuningParameter

          public uk.ac.starlink.table.DescribedValue getTuningParameter()

      Description copied from interface: `SkyPixellator`
      Returns a parameter whose value may be adjusted to alter the pixellisation scale. This is not necessarily the same as the scale attribute (its value need not be an angle).
      Specified by:
        `getTuningParameter` in interface `SkyPixellator`
      Returns:
        tuning parameter

    - #### getPixels

          public java.lang.Object[] getPixels​(double alpha,
                                              double delta,
                                              double radius)

      Description copied from interface: `SkyPixellator`
      Returns an array of objects representing pixels in a given region. The parameters specify a small circle on the sphere; any pixels which overlap this circle must be returned (additional pixels may also be returned). The output objects are of some opaque type, but must implement the `equals` and `hashCode` methods appropriately, so that objects returned from one call can be compared for identity with objects returned from a subsequent call. This comparability is only guaranteed to work if the pixel scale is not changed in between calls.
      Specified by:
        `getPixels` in interface `SkyPixellator`
      Parameters:
        `alpha` - right ascension of circle centre in radians
        `delta` - declination of circle centre in radians
        `radius` - radius of circle in radians
      Returns:
        array of opaque but comparable pixel objects

    - #### setLevel

          public void setLevel​(int level)

      Sets the HTM level value, which determines sky pixel size. May be in the range 0 (90deg) to 24 (0.01"). If set to -1, a suitable value will be used based on the scale.
      Parameters:
        `level` - new level value

    - #### getLevel

          public int getLevel()

      Returns the HTM level, which determines sky pixel size. The returned value may be the result of a default determination based on scale if no explicit level has been set hitherto, and a non-zero scale is available.
      Returns:
        level level value used by this engine

    - #### calculateDefaultLevel

          public int calculateDefaultLevel​(double scale)

      Determines a default value to use for the level paramer based on a given scale.
      Parameters:
        `scale` - sky distance scale angle, in radians