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 implementingHashComputer
are probably NOT THREAD-SAFE. So you MUST have one such implementation object per thread.- Author:
- F.-X. Pineau
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
depth()
Returns the depth of the hash computed byhash(double, double)
method.long
hash(double lonRad, double latRad)
Returns the HEALPix hash value of the given coordinate at this object depth.
-
-
-
Method Detail
-
depth
int depth()
Returns the depth of the hash computed byhash(double, double)
method.- Specified by:
depth
in interfaceHierarchyItem
- 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.
-
-