public class BitsetMask extends Object implements HealpixMask
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.
HealpixMask.PixelTester
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_ORDER
Suitable HEALPix order for general use.
|
Constructor and Description |
---|
BitsetMask()
Constructs a new empty mask with the default order.
|
BitsetMask(int order)
Constructs a new empty mask with a given order.
|
Modifier and Type | Method and Description |
---|---|
void |
addPixel(int order,
long ipix)
Adds the area corresponding to a HEALPix pixel to this mask.
|
HealpixMask.PixelTester |
createPixelTester()
Returns an object that can test inclusion in the sky area defined
by the current state of this mask.
|
int |
getOrder()
Returns the HEALPix order of the pixels stored by this mask.
|
int[] |
getPixels()
Returns an array of the pixels contained by this mask.
|
double |
getSkyFraction()
Returns the fraction of the sky currently covered by this mask.
|
void |
intersection(HealpixMask other)
Narrows this area to represent the intersection of this mask
and another compatible mask.
|
boolean |
isEmpty()
Returns true if this mask's area is empty.
|
void |
union(HealpixMask other)
Extends this area to represent the union of this mask
and another compatible mask.
|
public static final int DEFAULT_ORDER
public BitsetMask()
public BitsetMask(int order)
order
- HEALPix orderpublic boolean isEmpty()
HealpixMask
isEmpty
in interface HealpixMask
HealpixMask.createPixelTester()
test
is guaranteed to return falsepublic void intersection(HealpixMask other)
HealpixMask
intersection
in interface HealpixMask
other
- different mask of a type assumed compatible with this onepublic void union(HealpixMask other)
HealpixMask
union
in interface HealpixMask
other
- different mask of a type assumed compatible with this onepublic double getSkyFraction()
HealpixMask
getSkyFraction
in interface HealpixMask
public void addPixel(int order, long ipix)
HealpixMask
addPixel
in interface HealpixMask
order
- HEALPix orderipix
- HEALPix pixel index at order order
public HealpixMask.PixelTester createPixelTester()
HealpixMask
createPixelTester
in interface HealpixMask
public int getOrder()
public int[] getPixels()
Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.