Package healpix.essentials
Class Moc
- java.lang.Object
-
- healpix.essentials.Moc
-
public class Moc extends java.lang.ObjectSupport for MOC algorithms.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPixel(int order, long p)voidaddPixelRange(int order, long p1, long p2)Adds a range of pixels at a given HEALPix order to the Moc.Moccomplement()Returns the complement of this Moc.booleancontains(Moc other)MocdegradedToOrder(int order, boolean keepPartialCells)Returns a Moc with degraded resolution.booleanequals(java.lang.Object obj)static MocfromCompressed(byte[] data)static MocfromUniq(long[] u)static MocfromUniqRS(RangeSet ru)RangeSetgetRangeSet()Returns the internal range set.inthashCode()Mocintersection(Moc other)Returns a new Moc that contains the intersection of this Moc and "other".intmaxOrder()Returns the maximum HEALPix order necessary to describe the Moc exactly.intnranges()booleanoverlaps(Moc other)Mocsubtraction(Moc other)Returns a new Moc that contains all parts of this Moc that are not contained in "other".byte[]toCompressed()long[]toUniq()RangeSettoUniqRS()Mocunion(Moc other)Returns a new Moc that contains the union of this Moc and "other".
-
-
-
Method Detail
-
getRangeSet
public RangeSet getRangeSet()
Returns the internal range set.
-
maxOrder
public int maxOrder()
Returns the maximum HEALPix order necessary to describe the Moc exactly.
-
degradedToOrder
public Moc degradedToOrder(int order, boolean keepPartialCells)
Returns a Moc with degraded resolution.- Parameters:
order- the maximum HEALPix order used for the resultkeepPartialCells- if true, partially filled cells will be included in the output Moc; if false, they will be ignored.
-
addPixelRange
public void addPixelRange(int order, long p1, long p2)Adds a range of pixels at a given HEALPix order to the Moc.- Parameters:
order- the HEALPix order of the added pixelsp1- the first pixel of the rangep2- the one-after-last pixel of the range
-
addPixel
public void addPixel(int order, long p)
-
union
public Moc union(Moc other)
Returns a new Moc that contains the union of this Moc and "other".
-
intersection
public Moc intersection(Moc other)
Returns a new Moc that contains the intersection of this Moc and "other".
-
subtraction
public Moc subtraction(Moc other)
Returns a new Moc that contains all parts of this Moc that are not contained in "other".
-
complement
public Moc complement()
Returns the complement of this Moc.
-
contains
public boolean contains(Moc other)
- Returns:
- true, if "other" is a subset of this Moc, else false.
-
overlaps
public boolean overlaps(Moc other)
- Returns:
- true, if the intersection of this Moc and "other" is not empty.
-
toUniqRS
public RangeSet toUniqRS()
- Returns:
- A RangeSet containing all HEALPix pixels (in NUNIQ order) covered by this Moc. The result is well-formed in the sense that every pixel is given at its lowest possible HEALPix order.
-
toUniq
public long[] toUniq()
-
fromUniqRS
public static Moc fromUniqRS(RangeSet ru)
- Returns:
- A Moc built from the RangeSet of NUNIQ HEALPix pixels given in "ru". "ru" need not be well-formed.
-
fromUniq
public static Moc fromUniq(long[] u)
-
toCompressed
public byte[] toCompressed() throws java.lang.Exception- Returns:
- A compressed representation of the Moc obtained by interpolative coding.
- Throws:
java.lang.Exception
-
fromCompressed
public static Moc fromCompressed(byte[] data) throws java.lang.Exception
- Returns:
- A Moc built from the compressed representation given in "data".
- Throws:
java.lang.Exception
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
nranges
public int nranges()
-
-