Package cds.healpix

Interface HashComputer

All Superinterfaces:
HierarchyItem
All Known Implementing Classes:
HealpixNested, HealpixNestedFast

public interface HashComputer extends HierarchyItem
Computing a hash value may implies objects creations. We define this interface in order to reuse objects inside an instance. It means that object implementing HashComputer are probably NOT THREAD-SAFE. So you MUST have one such implementation object per thread.
Author:
F.-X. Pineau
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the depth of the hash computed by hash(double, double) method.
    long
    hash(double lonRad, double latRad)
    Returns the HEALPix hash value of the given coordinate at this object depth.
  • Method Details

    • depth

      int depth()
      Returns the depth of the hash computed by hash(double, double) method.
      Specified by:
      depth in interface HierarchyItem
      Returns:
      the depth of the hash computed by hash(double, double) method.
    • hash

      long hash(double lonRad, double latRad)
      Returns the HEALPix hash value of the given coordinate at this object depth. WARNING: depending on the implementation, this method may or may not be thread-safe.
      Parameters:
      lonRad - longitude in radians, must support reasonably large positive and negative values producing accurate results with a naive range reduction like modulo 2*pi (i.e. without having to resort on Cody-Waite or Payne Hanek range reduction).
      latRad - latitude in [-pi/2, pi/2] radians
      Returns:
      the hash value associated to the given coordinate, at this object depth.