Package uk.ac.starlink.table.join
Class BitsetMask
java.lang.Object
uk.ac.starlink.table.join.BitsetMask
- All Implemented Interfaces:
HealpixMask
HealpixMask implementation based on a BitSet representing all the
pixels at a given HEALPix order.
This implementation is not very sophisticated (it doesn't attempt a multi-order representation), but it's fairly efficient as long as the order (resolution) required is modest. A value like 6 is probably reasonable; 49k pixels, 6kbyte storage.
- Since:
- 8 Jun 2022
- Author:
- Mark Taylor
-
Nested Class Summary
Nested classes/interfaces inherited from interface uk.ac.starlink.table.join.HealpixMask
HealpixMask.PixelTester -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intSuitable HEALPix order for general use. -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new empty mask with the default order.BitsetMask(int order) Constructs a new empty mask with a given order. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPixel(int order, long ipix) Adds the area corresponding to a HEALPix pixel to this mask.Returns an object that can test inclusion in the sky area defined by the current state of this mask.intgetOrder()Returns the HEALPix order of the pixels stored by this mask.int[]Returns an array of the pixels contained by this mask.doubleReturns the fraction of the sky currently covered by this mask.voidintersection(HealpixMask other) Narrows this area to represent the intersection of this mask and another compatible mask.booleanisEmpty()Returns true if this mask's area is empty.voidunion(HealpixMask other) Extends this area to represent the union of this mask and another compatible mask.
-
Field Details
-
DEFAULT_ORDER
public static final int DEFAULT_ORDERSuitable HEALPix order for general use.- See Also:
-
-
Constructor Details
-
BitsetMask
public BitsetMask()Constructs a new empty mask with the default order. -
BitsetMask
public BitsetMask(int order) Constructs a new empty mask with a given order.- Parameters:
order- HEALPix order
-
-
Method Details
-
isEmpty
public boolean isEmpty()Description copied from interface:HealpixMaskReturns true if this mask's area is empty.- Specified by:
isEmptyin interfaceHealpixMask- Returns:
- true iff the
HealpixMask.createPixelTester()test is guaranteed to return false
-
intersection
Description copied from interface:HealpixMaskNarrows this area to represent the intersection of this mask and another compatible mask.- Specified by:
intersectionin interfaceHealpixMask- Parameters:
other- different mask of a type assumed compatible with this one
-
union
Description copied from interface:HealpixMaskExtends this area to represent the union of this mask and another compatible mask.- Specified by:
unionin interfaceHealpixMask- Parameters:
other- different mask of a type assumed compatible with this one
-
getSkyFraction
public double getSkyFraction()Description copied from interface:HealpixMaskReturns the fraction of the sky currently covered by this mask.- Specified by:
getSkyFractionin interfaceHealpixMask- Returns:
- sky fraction between 0 and 1
-
addPixel
public void addPixel(int order, long ipix) Description copied from interface:HealpixMaskAdds the area corresponding to a HEALPix pixel to this mask.- Specified by:
addPixelin interfaceHealpixMask- Parameters:
order- HEALPix orderipix- HEALPix pixel index at orderorder
-
createPixelTester
Description copied from interface:HealpixMaskReturns an object that can test inclusion in the sky area defined by the current state of this mask.- Specified by:
createPixelTesterin interfaceHealpixMask- Returns:
- thread-safe test for sky area inclusion
-
getOrder
public int getOrder()Returns the HEALPix order of the pixels stored by this mask.- Returns:
- healpix order
-
getPixels
public int[] getPixels()Returns an array of the pixels contained by this mask. This is mainly intended for diagnostic purposes, it may not be very efficient.- Returns:
- pixel list at this mask's order
-