Package cds.healpix

# Class HealpixNestedFixedRadiusCone4XMatch

java.lang.Object
cds.healpix.HealpixNestedFixedRadiusCone4XMatch

public final class HealpixNestedFixedRadiusCone4XMatch extends Object
The idea of this class is to avoid making multiple time the same operations (like selecting the optimal starting depth) in case of fixed radius cross-match. This is especially made for cross-matches with the following ideas: - the list of cells returned is small (maximum 9 elements, but more likely maximum 4) - we assume that cells are not fully overlapped by the xmatch cone - we accept false positives (i.e. cell which are close but do not overlap the xmatch cone) The idea is to have a function which is a quick as possible (not much longer than looking into a HashMap).

Author:
  F.-X. Pineau

## Method Summary

Modifier and Type
Method
Description
`double`
`getRadius()`
Returns the radius of the cones, in radians.
`int`
`getResultDepth()`
`HealpixNestedFixedRadiusCone4XMatch`
`newComputer()`
To obtain new instances in case we want to use multi-threading, since an object is possibly not thread-safe.
`int`
`overlappingCells(double coneCenterLonRad, double coneCenterLatRad, long[] result)`
Fill the given array with the cells overlapping the cone of given center (may include false positive).

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

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

## Method Details

### getRadius

public double getRadius()
Returns the radius of the cones, in radians.

Returns:
  he radius of the cones, in radians.

### getResultDepth

public int getResultDepth()

### overlappingCells

public int overlappingCells(double coneCenterLonRad, double coneCenterLatRad, long[] result)
Fill the given array with the cells overlapping the cone of given center (may include false positive). We assume that the size of a cell at the depth of the returned hashs is large compared to the cone radius.

Parameters:
  `coneCenterLonRad` - longitude of the center of the cone, in radians
  `coneCenterLatRad` - latitude of the center of the cone, in radians
  `result` - an array of size al least 9 that will store overlapping cell from index 0, the content of the array is NOT sorted.
Returns:
  the number of elements to be read in the list

### newComputer

public HealpixNestedFixedRadiusCone4XMatch newComputer()
To obtain new instances in case we want to use multi-threading, since an object is possibly not thread-safe. If the objectis thread-safe, the method can simply return `this`.

Returns:
  a new instance of this class.