Package cds.moc
Class HealpixMoc
- java.lang.Object
-
- cds.moc.HealpixMoc
-
- All Implemented Interfaces:
java.lang.Cloneable,java.lang.Comparable,java.lang.Iterable<MocCell>
public class HealpixMoc extends java.lang.Object implements java.lang.Iterable<MocCell>, java.lang.Cloneable, java.lang.Comparable
HEALPix Multi Order Coverage Map (MOC) This object provides read, write and process methods to manipulate an HEALPix Multi Order Coverage Map (MOC) A MOC is used to define a sky region by using HEALPix sky tesselation
-
-
Field Summary
Fields Modifier and Type Field Description static intASCIIASCII encoding format (IVOA REC 1.0 suggestion)static intFITSFITS encoding format (IVOA REC 1.0 compliante)static intINTstatic intJSONJSON encoding format (IVOA REC 1.0 suggestion)static intJSON0JSON obsoleted encoding format (only reading supported for compatibility)static intLONGstatic intMAXORDERMaximal HEALPix order supported by the libraryhealpix.essentials.RangeSetrangeSetOperations on MOCsstatic intSHORTstatic java.lang.StringVERSIONHealpix MOC API version number
-
Constructor Summary
Constructors Constructor Description HealpixMoc()HEALPix Multi Order Coverage Map (MOC) creationHealpixMoc(int maxLimitOrder)Moc Creation with a specified max limitOrder (by default 29)HealpixMoc(int minLimitOrder, int maxLimitOrder)Moc Creation with a specified min and max limitOrder (by default 0..29)HealpixMoc(java.io.InputStream in)HEALPix Multi Order Coverage Map (MOC) creation and initialisation via a streamHealpixMoc(java.io.InputStream in, int mode)HEALPix Multi Order Coverage Map (MOC) creation and initialisation via a stream, either in JSON encoded format , ASCII encoded format or in FITS encoded formatHealpixMoc(java.lang.String s)HEALPix Multi Order Coverage Map (MOC) creation and initialisation via a string following ASCII or JSON MOC syntax ex JSON: { "order1":[npix1,npix2,...], "order2":[npix3...] } ex basic ASCII: order1/npix1-npix2 npix3 ...HealpixMoc(java.lang.String coordSys, int minLimitOrder, int maxLimitOrder)Deprecated.Standard MOC must be equatorial
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanadd(int order, long npix)Add a MOC pixel Recursive addition : since with have the 3 brothers, we remove them and add recursively their fathervoidadd(int order, long[] npixs)Add a collection of npix, all of them at the same order.voidadd(int order, java.util.Collection<java.lang.Long> a)Add a collection of npix, all of them at the same order.booleanadd(HealpixImpl healpix, double alpha, double delta)Add a Moc pixel (at max order) corresponding to the alpha,delta position Recursive addition : since with have the 3 brothers, we remove them and add recursively their fathervoidadd(HealpixMoc moc)Add directly a full Moc.booleanadd(MocCell cell)Add a Moc pixel Recursive addition : since with have the 3 brothers, we remove them and add recursively their fathervoidadd(java.lang.String s)Add a list of MOC pixels provided in a string format (JSON format or basic ASCII format) ex JSON: { "order1":[npix1,npix2,...], "order2":[npix3...] } ex basic ASCII: order1/npix1-npix2 npix3 ...protected voidaddHpix(java.lang.String s)voidcheckAndFix()Check and fix the consistency of the moc => remove cell redundancies => factorize 4 brothers as 1 father (recursively) => check and fix descendance consistancy [REMOVED => Trim the limitOrder if required ]voidclear()Clear the MOCjava.lang.Objectclone()Deep copyintcompareTo(java.lang.Object o)HealpixMoccomplement()booleancontains(HealpixImpl healpix, double alpha, double delta)Check if the spherical coord is inside the MOC.booleandelete(int order, long npix)Remove a MOC pixelvoiddelete(java.lang.String s)remove a list of MOC pixels provided in a string format (ex: "order1/npix1-npix2 npix3 ...booleandeleteDescendant(int order, long npix)Remove all descendants of a MOC PixelHealpixMocdifference(HealpixMoc moc)booleanequals(java.lang.Object moc)Equality testdoublegetAngularRes()Provide the angular resolution (in degrees) of the MOC (sqrt of the smallest pixel area)longgetArea()return the area of the Moc computed in pixels at the most low levelArraygetArray(int order)Provide the Array of a dedicated orderjava.lang.StringgetCoordSys()Return the coordinate system (HEALPix convention: G-galactic, C-Equatorial, E-Ecliptic)doublegetCoverage()Return the fraction of the sky covered by the Moc [0..1]intgetDescendantOrder(int order, long npix)return the order of the first descendant, otherwise -1intgetLimitOrder()Deprecated.see getMaxLimitOrder()intgetMaxLimitOrder()Deprecated.see getMocOrder()intgetMaxOrder()Provide the greatest order really used by the MOC WARNING: use getMocOrder() to know the MOC resolutionlonggetMem()Return approximatively the memory used for this moc (in bytes)longgetMem(int order)Provide the memory used for a dedicated orderintgetMinLimitOrder()Provide the minimal limit order supported by the Moc (by default 0)intgetMocOrder()Provide the MOC order.long[]getPixLevel(int order)Provide a copy of the pixel list at the specified order (in longs)java.lang.StringgetProperty(java.lang.String key)Provide MOC property value.intgetSize()Provide the number of Healpix pixels (for all MOC orders)intgetSize(int order)Provide the number of Healpix pixels for a dedicated orderstatic intgetType(int order)Provide the integer type for a given orderlonggetUsedArea()Return the number of low level pixels of the Mocstatic longhpix2uniq(int order, long npix)Code a couple (order,npix) into a unique long integerHealpixMocintersection(HealpixMoc moc)booleanisAllSky()Return true if the MOC covers the whole skybooleanisAscendant(int order, long npix)True is the MOC pixel is an ascendantbooleanisDescendant(int order, long npix)True if the MOC pixel is a descendantbooleanisEmpty()Return true if the MOC is emptybooleanisIn(int order, long npix)True if the MOC pixel is present at this orderbooleanisIncluding(HealpixMoc moc)Fast test for checking if the parameter MOC is totally inside the current MOC objectbooleanisIntersecting(int order, long npix)Fast test for checking if the cell is intersecting the current MOC objectbooleanisIntersecting(HealpixMoc moc)Fast test for checking if the parameter MOC is intersecting the current MOC objectbooleanisInTree(int order, long npix)Deprecated.see isIntersecting(...)booleanisInTree(HealpixMoc moc)Deprecated.see isIntersecting(...)booleanisSorted()Return true if all Moc level is sortedjava.util.Iterator<MocCell>iterator()Provide an Iterator on the MOC pixel List.static longlog2(long nside)java.util.Iterator<java.lang.Long>pixelIterator()Provide an Iterator on the low level pixel list covering all the MOC area.static longpow2(long order)HealpixMocqueryCell(int order, long npix)HealpixMocqueryDisc(HealpixImpl healpix, double alpha, double delta, double radius)Provide Moc pixels totally or partially inside a circlevoidread(java.io.InputStream in)Read HEALPix MOC from a stream Support all MOC syntax: FITS standard or any other old syntax (JSON or ASCII)voidread(java.io.InputStream in, int mode)Deprecated.see read(InputStream)voidread(java.lang.String filename)Read HEALPix MOC from a file.voidread(java.lang.String filename, int mode)Deprecated.see read(String)voidreadASCII(java.io.InputStream in)Deprecated.see read(InputStream)voidreadFits(java.io.InputStream in)Deprecated.see read(InputStream)voidreadJSON(java.io.InputStream in)Deprecated.see read(InputStream)voidsetCheckConsistencyFlag(boolean flag)Set the check consistency flag.voidsetCoordSys(java.lang.String coordSys)Deprecated.Standard MOC must be equatorialprotected voidsetCurrentOrder(int order)voidsetLimitOrder(int limitOrder)Deprecated.see setMaxLimitOrder()voidsetMaxLimitOrder(int limitOrder)Deprecated.see setMocOrder(int)voidsetMinLimitOrder(int limitOrder)Set the Min limit order supported by the Moc (by default 0) (and automatically switch on the testConsistency) Any future addition of pixel with order smallest than minLimitOrder will be automatically replaced by the addition of its 4 sons.voidsetMocOrder(int order)Set the limit order supported by the Moc (-1 for Healpix library implementation) (and automatically switch on the testConsistency) Any future addition of pixel with order exceeding limitOrder will be automatically replaced by the addition of the corresponding pixel at the limitOrder.voidsetMocOrder(java.lang.String mocOrder)Set the MOC order.voidsetPixLevel(int order, int[] val)Set the pixel list at the specified order (6<=order<=13 ) (Dedicated for fast initialisation)voidsetPixLevel(int order, long[] val)Set the pixel list at the specified order (order>13 ) (Dedicated for fast initialisation)voidsetPixLevel(int order, short[] val)Set the pixel list at the specified order (order<6) (Dedicated for fast initialisation)voidsetProperty(java.lang.String key, java.lang.String value)MOC propertie settervoidsort()Sort each level of the MocHealpixMocsubtraction(HealpixMoc moc)java.lang.Stringtodebug()voidtoHealpixMoc()voidtoRangeSet()java.lang.StringtoString()voidtrim()Remove all the unused space (allocation reservation)HealpixMocunion(HealpixMoc moc)static long[]uniq2hpix(long uniq)Uncode a long integer into a couple (order,npix)static long[]uniq2hpix(long uniq, long[] hpix)Uncode a long integer into a couple (order,npix)voidwrite(java.io.OutputStream out, int mode)Deprecated.voidwrite(java.lang.String filename)Write HEALPix MOC to a filevoidwrite(java.lang.String filename, int mode)Deprecated.voidwriteASCII(java.io.OutputStream out)Deprecated.see write(OutputStream)voidwriteFits(java.io.OutputStream out)Write HEALPix MOC to an output stream in FITS encoded formatvoidwriteFITS(java.io.OutputStream out)deprecatedvoidwriteJSON(java.io.OutputStream out)Write HEALPix MOC to an output stream IN JSON encoded format
-
-
-
Field Detail
-
VERSION
public static final java.lang.String VERSION
Healpix MOC API version number- See Also:
- Constant Field Values
-
FITS
public static final int FITS
FITS encoding format (IVOA REC 1.0 compliante)- See Also:
- Constant Field Values
-
JSON
public static final int JSON
JSON encoding format (IVOA REC 1.0 suggestion)- See Also:
- Constant Field Values
-
ASCII
public static final int ASCII
ASCII encoding format (IVOA REC 1.0 suggestion)- See Also:
- Constant Field Values
-
JSON0
public static final int JSON0
JSON obsoleted encoding format (only reading supported for compatibility)- See Also:
- Constant Field Values
-
MAXORDER
public static final int MAXORDER
Maximal HEALPix order supported by the library- See Also:
- Constant Field Values
-
SHORT
public static final int SHORT
- See Also:
- Constant Field Values
-
INT
public static final int INT
- See Also:
- Constant Field Values
-
LONG
public static final int LONG
- See Also:
- Constant Field Values
-
rangeSet
public healpix.essentials.RangeSet rangeSet
Operations on MOCs
-
-
Constructor Detail
-
HealpixMoc
public HealpixMoc()
HEALPix Multi Order Coverage Map (MOC) creation
-
HealpixMoc
public HealpixMoc(int maxLimitOrder) throws java.lang.ExceptionMoc Creation with a specified max limitOrder (by default 29)- Throws:
java.lang.Exception
-
HealpixMoc
public HealpixMoc(int minLimitOrder, int maxLimitOrder) throws java.lang.ExceptionMoc Creation with a specified min and max limitOrder (by default 0..29)- Throws:
java.lang.Exception
-
HealpixMoc
public HealpixMoc(java.lang.String coordSys, int minLimitOrder, int maxLimitOrder) throws java.lang.ExceptionDeprecated.Standard MOC must be equatorialMoc Creation with a specified min and max limitOrder (by default 0..29)- Throws:
java.lang.Exception
-
HealpixMoc
public HealpixMoc(java.lang.String s) throws java.lang.ExceptionHEALPix Multi Order Coverage Map (MOC) creation and initialisation via a string following ASCII or JSON MOC syntax ex JSON: { "order1":[npix1,npix2,...], "order2":[npix3...] } ex basic ASCII: order1/npix1-npix2 npix3 ... order2/npix4 ...- Parameters:
s- list of MOC pixels- Throws:
java.lang.Exception
-
HealpixMoc
public HealpixMoc(java.io.InputStream in) throws java.lang.ExceptionHEALPix Multi Order Coverage Map (MOC) creation and initialisation via a stream- Parameters:
in- input stream- Throws:
java.lang.Exception
-
HealpixMoc
public HealpixMoc(java.io.InputStream in, int mode) throws java.lang.ExceptionHEALPix Multi Order Coverage Map (MOC) creation and initialisation via a stream, either in JSON encoded format , ASCII encoded format or in FITS encoded format- Parameters:
in- input streammode- ASCII - ASCII encoded format, JSON encoded format, FITS - Fits encoded format- Throws:
java.lang.Exception
-
-
Method Detail
-
getType
public static int getType(int order)
Provide the integer type for a given order
-
clear
public void clear()
Clear the MOC
-
clone
public java.lang.Object clone()
Deep copy- Overrides:
clonein classjava.lang.Object
-
setMinLimitOrder
public void setMinLimitOrder(int limitOrder) throws java.lang.ExceptionSet the Min limit order supported by the Moc (by default 0) (and automatically switch on the testConsistency) Any future addition of pixel with order smallest than minLimitOrder will be automatically replaced by the addition of its 4 sons.- Throws:
java.lang.Exception
-
setMocOrder
public void setMocOrder(int order) throws java.lang.ExceptionSet the limit order supported by the Moc (-1 for Healpix library implementation) (and automatically switch on the testConsistency) Any future addition of pixel with order exceeding limitOrder will be automatically replaced by the addition of the corresponding pixel at the limitOrder. If there is no limitOrder set (-1), an exception will thrown.- Throws:
java.lang.Exception
-
setMaxLimitOrder
public void setMaxLimitOrder(int limitOrder) throws java.lang.ExceptionDeprecated.see setMocOrder(int)Set the limit order supported by the Moc (-1 for Healpix library implementation) (and automatically switch on the testConsistency) Any future addition of pixel with order exceeding limitOrder will be automatically replaced by the addition of the corresponding pixel at the limitOrder. If there is no limitOrder set (-1), an exception will thrown.- Throws:
java.lang.Exception
-
getMinLimitOrder
public int getMinLimitOrder()
Provide the minimal limit order supported by the Moc (by default 0)
-
getMaxLimitOrder
public int getMaxLimitOrder()
Deprecated.see getMocOrder()Provide the limit order supported by the Moc (by default depends of the Healpix library implementation)
-
getMocOrder
public int getMocOrder()
Provide the MOC order. By default 29- Returns:
- Provide the MOC order (by default 29 = HEALPix lib limit)
-
setMocOrder
public void setMocOrder(java.lang.String mocOrder) throws java.lang.ExceptionSet the MOC order. By default 29. If the MOC already contains smaller cells, these cells will be replaced by their first parent corresponding to the new MOC order- Parameters:
mocOrder- MOC order (best cells order)- Throws:
java.lang.Exception
-
getLimitOrder
public int getLimitOrder()
Deprecated.see getMaxLimitOrder()
-
setLimitOrder
public void setLimitOrder(int limitOrder) throws java.lang.ExceptionDeprecated.see setMaxLimitOrder()- Throws:
java.lang.Exception
-
getCoordSys
public java.lang.String getCoordSys()
Return the coordinate system (HEALPix convention: G-galactic, C-Equatorial, E-Ecliptic)
-
setCoordSys
public void setCoordSys(java.lang.String coordSys)
Deprecated.Standard MOC must be equatorialSpecify the coordinate system (HEALPix convention: G-galactic, C-Equatorial, E-Ecliptic)
-
setCurrentOrder
protected void setCurrentOrder(int order)
-
getSize
public int getSize()
Provide the number of Healpix pixels (for all MOC orders)- Returns:
- number of pixels
-
getMem
public long getMem()
Return approximatively the memory used for this moc (in bytes)
-
getMem
public long getMem(int order)
Provide the memory used for a dedicated order
-
getSize
public int getSize(int order)
Provide the number of Healpix pixels for a dedicated order
-
getArray
public Array getArray(int order)
Provide the Array of a dedicated order
-
getAngularRes
public double getAngularRes()
Provide the angular resolution (in degrees) of the MOC (sqrt of the smallest pixel area)
-
getMaxOrder
public int getMaxOrder()
Provide the greatest order really used by the MOC WARNING: use getMocOrder() to know the MOC resolution- Returns:
- greatest MOC order, -1 if no order used
-
setCheckConsistencyFlag
public void setCheckConsistencyFlag(boolean flag) throws java.lang.ExceptionSet the check consistency flag. "true" by default => redundancy check and hierarchy consistency check during addition (=> slower)- Parameters:
flag-- Throws:
java.lang.Exception
-
getDescendantOrder
public int getDescendantOrder(int order, long npix)return the order of the first descendant, otherwise -1
-
add
public void add(java.lang.String s) throws java.lang.ExceptionAdd a list of MOC pixels provided in a string format (JSON format or basic ASCII format) ex JSON: { "order1":[npix1,npix2,...], "order2":[npix3...] } ex basic ASCII: order1/npix1-npix2 npix3 ... order2/npix4 ... Note : The string can be submitted in several times. In this case, the insertion will use the last current order Note : in JSON, the syntax is not checked ( in fact {, [ and " are ignored)- Throws:
java.lang.Exception
-
add
public void add(HealpixMoc moc) throws java.lang.Exception
Add directly a full Moc. Note: The MOC consistency is checked and possibly fixed at the end of the insertion process- Parameters:
moc- The Moc to be added- Throws:
java.lang.Exception
-
add
public void add(int order, long[] npixs) throws java.lang.ExceptionAdd a collection of npix, all of them at the same order. Note: The MOC consistency is checked and possibly fixed at the end of the insertion process- Parameters:
order- order of insertionnpixs- list of npix to be inserted- Throws:
java.lang.Exception
-
add
public void add(int order, java.util.Collection<java.lang.Long> a) throws java.lang.ExceptionAdd a collection of npix, all of them at the same order. Note: The MOC consistency is checked and possibly fixed at the end of the insertion process- Parameters:
order- order of insertionnpixs- list of npix to be inserted- Throws:
java.lang.Exception
-
add
public boolean add(MocCell cell) throws java.lang.Exception
Add a Moc pixel Recursive addition : since with have the 3 brothers, we remove them and add recursively their father- Parameters:
cell- Moc cell- Returns:
- true if the cell (or its father) has been effectively inserted
- Throws:
java.lang.Exception
-
add
public boolean add(HealpixImpl healpix, double alpha, double delta) throws java.lang.Exception
Add a Moc pixel (at max order) corresponding to the alpha,delta position Recursive addition : since with have the 3 brothers, we remove them and add recursively their father- Parameters:
alpha- , delta position- Returns:
- true if the cell (or its father) has been effectively inserted
- Throws:
java.lang.Exception
-
add
public boolean add(int order, long npix) throws java.lang.ExceptionAdd a MOC pixel Recursive addition : since with have the 3 brothers, we remove them and add recursively their father- Parameters:
order- HEALPix ordernpix- Healpix number (-1 if no number => just for memorizing max MocOrder)testHierarchy- true if the ascendance and descendance consistance test must be done- Returns:
- true if something has been really inserted (npix or ascendant)
- Throws:
java.lang.Exception
-
delete
public void delete(java.lang.String s)
remove a list of MOC pixels provided in a string format (ex: "order1/npix1-npix2 npix3 ... order2/npix4 ...")
-
delete
public boolean delete(int order, long npix)Remove a MOC pixel- Parameters:
order- HEALPix ordernpix- Healpix number- Returns:
- true if the deletion has been effectively done
-
deleteDescendant
public boolean deleteDescendant(int order, long npix)Remove all descendants of a MOC Pixel- Parameters:
order-npix-- Returns:
- true if at least one descendant has been removed
-
sort
public void sort()
Sort each level of the Moc
-
isSorted
public boolean isSorted()
Return true if all Moc level is sorted
-
isInTree
public boolean isInTree(int order, long npix)Deprecated.see isIntersecting(...)Fast test for checking if the HEALPix cell is intersecting the current MOC object
-
isInTree
public boolean isInTree(HealpixMoc moc)
Deprecated.see isIntersecting(...)Fast test for checking if the parameter MOC is intersecting the current MOC object
-
checkAndFix
public void checkAndFix() throws java.lang.ExceptionCheck and fix the consistency of the moc => remove cell redundancies => factorize 4 brothers as 1 father (recursively) => check and fix descendance consistancy [REMOVED => Trim the limitOrder if required ]- Throws:
java.lang.Exception
-
isAscendant
public boolean isAscendant(int order, long npix)True is the MOC pixel is an ascendant
-
isDescendant
public boolean isDescendant(int order, long npix)True if the MOC pixel is a descendant
-
isIn
public boolean isIn(int order, long npix)True if the MOC pixel is present at this order
-
setProperty
public void setProperty(java.lang.String key, java.lang.String value) throws java.lang.ExceptionMOC propertie setter- Parameters:
key- => MOCORDER, COORDSYS, MOCTOOL, MOCTYPE, MOCID, DATE, ORIGIN, EXTNAMEvalue-- Throws:
java.lang.Exception
-
getProperty
public java.lang.String getProperty(java.lang.String key)
Provide MOC property value. Available key properties are: => MOCORDER, COORDSYS, MOCTOOL, MOCTYPE, MOCID, DATE, ORIGIN, EXTNAME- Parameters:
key-- Returns:
-
getCoverage
public double getCoverage()
Return the fraction of the sky covered by the Moc [0..1]
-
getUsedArea
public long getUsedArea()
Return the number of low level pixels of the Moc
-
getArea
public long getArea()
return the area of the Moc computed in pixels at the most low level
-
iterator
public java.util.Iterator<MocCell> iterator()
Provide an Iterator on the MOC pixel List. Each Item is a couple of longs, the first long is the order, the second long is the pixel number- Specified by:
iteratorin interfacejava.lang.Iterable<MocCell>
-
pixelIterator
public java.util.Iterator<java.lang.Long> pixelIterator()
Provide an Iterator on the low level pixel list covering all the MOC area. => pixel are provided in ascending order
-
trim
public void trim()
Remove all the unused space (allocation reservation)
-
todebug
public java.lang.String todebug()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
toRangeSet
public void toRangeSet()
-
toHealpixMoc
public void toHealpixMoc() throws java.lang.Exception- Throws:
java.lang.Exception
-
isIntersecting
public boolean isIntersecting(int order, long npix)Fast test for checking if the cell is intersecting the current MOC object- Returns:
- true if the intersection is not null
-
isIntersecting
public boolean isIntersecting(HealpixMoc moc)
Fast test for checking if the parameter MOC is intersecting the current MOC object- Returns:
- true if the intersection is not null
-
isIncluding
public boolean isIncluding(HealpixMoc moc)
Fast test for checking if the parameter MOC is totally inside the current MOC object- Returns:
- true if MOC is totally inside
-
union
public HealpixMoc union(HealpixMoc moc) throws java.lang.Exception
- Throws:
java.lang.Exception
-
intersection
public HealpixMoc intersection(HealpixMoc moc) throws java.lang.Exception
- Throws:
java.lang.Exception
-
subtraction
public HealpixMoc subtraction(HealpixMoc moc) throws java.lang.Exception
- Throws:
java.lang.Exception
-
complement
public HealpixMoc complement() throws java.lang.Exception
- Throws:
java.lang.Exception
-
difference
public HealpixMoc difference(HealpixMoc moc) throws java.lang.Exception
- Throws:
java.lang.Exception
-
isAllSky
public boolean isAllSky()
Return true if the MOC covers the whole sky
-
isEmpty
public boolean isEmpty()
Return true if the MOC is empty
-
equals
public boolean equals(java.lang.Object moc)
Equality test- Overrides:
equalsin classjava.lang.Object
-
contains
public boolean contains(HealpixImpl healpix, double alpha, double delta) throws java.lang.Exception
Check if the spherical coord is inside the MOC. The coordinate system must be compatible with the MOC coordinate system.- Parameters:
alpha- in degreesdelta- in degrees- Returns:
- true if the coordinates is in one MOC pixel
- Throws:
java.lang.Exception
-
queryDisc
public HealpixMoc queryDisc(HealpixImpl healpix, double alpha, double delta, double radius) throws java.lang.Exception
Provide Moc pixels totally or partially inside a circle- Parameters:
alpha- circle center (in degrees)delta- circle center (in degrees)radius- circle radius (in degrees)- Returns:
- an HealpixMox containing the list of pixels
- Throws:
java.lang.Exception
-
queryCell
public HealpixMoc queryCell(int order, long npix) throws java.lang.Exception
- Throws:
java.lang.Exception
-
setPixLevel
public void setPixLevel(int order, long[] val) throws java.lang.ExceptionSet the pixel list at the specified order (order>13 ) (Dedicated for fast initialisation)- Throws:
java.lang.Exception
-
setPixLevel
public void setPixLevel(int order, int[] val) throws java.lang.ExceptionSet the pixel list at the specified order (6<=order<=13 ) (Dedicated for fast initialisation)- Throws:
java.lang.Exception
-
setPixLevel
public void setPixLevel(int order, short[] val) throws java.lang.ExceptionSet the pixel list at the specified order (order<6) (Dedicated for fast initialisation)- Throws:
java.lang.Exception
-
getPixLevel
public long[] getPixLevel(int order)
Provide a copy of the pixel list at the specified order (in longs)
-
read
public void read(java.lang.String filename) throws java.lang.ExceptionRead HEALPix MOC from a file. Support all MOC syntax: FITS standard or any other old syntax (JSON or ASCII)- Parameters:
filename- file name- Throws:
java.lang.Exception
-
read
public void read(java.lang.String filename, int mode) throws java.lang.ExceptionDeprecated.see read(String)Read HEALPix MOC from a file.- Parameters:
filename- file namemode- ASCII, JSON, FITS encoded format- Throws:
java.lang.Exception
-
read
public void read(java.io.InputStream in) throws java.lang.ExceptionRead HEALPix MOC from a stream Support all MOC syntax: FITS standard or any other old syntax (JSON or ASCII)- Throws:
java.lang.Exception
-
read
public void read(java.io.InputStream in, int mode) throws java.lang.ExceptionDeprecated.see read(InputStream)Read HEALPix MOC from a stream.- Parameters:
in- input streammode- ASCII, JSON, FITS encoded format- Throws:
java.lang.Exception
-
readASCII
public void readASCII(java.io.InputStream in) throws java.lang.ExceptionDeprecated.see read(InputStream)- Throws:
java.lang.Exception
-
readJSON
public void readJSON(java.io.InputStream in) throws java.lang.ExceptionDeprecated.see read(InputStream)- Throws:
java.lang.Exception
-
readFits
public void readFits(java.io.InputStream in) throws java.lang.ExceptionDeprecated.see read(InputStream)Read HEALPix MOC from an Binary FITS stream- Throws:
java.lang.Exception
-
write
public void write(java.lang.String filename) throws java.lang.ExceptionWrite HEALPix MOC to a file- Parameters:
filename- name of file- Throws:
java.lang.Exception
-
write
public void write(java.lang.String filename, int mode) throws java.lang.ExceptionDeprecated.Write HEALPix MOC to a file- Parameters:
filename- name of filemode- encoded format (JSON or FITS)- Throws:
java.lang.Exception
-
write
public void write(java.io.OutputStream out, int mode) throws java.lang.ExceptionDeprecated.Write HEALPix MOC to an output stream- Parameters:
out- output streammode- encoded format (JSON or FITS)- Throws:
java.lang.Exception
-
writeASCII
public void writeASCII(java.io.OutputStream out) throws java.lang.ExceptionDeprecated.see write(OutputStream)Write HEALPix MOC to an output stream IN JSON encoded format- Parameters:
out- output stream- Throws:
java.lang.Exception
-
writeJSON
public void writeJSON(java.io.OutputStream out) throws java.lang.ExceptionWrite HEALPix MOC to an output stream IN JSON encoded format- Parameters:
out- output stream- Throws:
java.lang.Exception
-
writeFits
public void writeFits(java.io.OutputStream out) throws java.lang.ExceptionWrite HEALPix MOC to an output stream in FITS encoded format- Parameters:
out- output stream- Throws:
java.lang.Exception
-
writeFITS
public void writeFITS(java.io.OutputStream out) throws java.lang.Exceptiondeprecated- Throws:
java.lang.Exception
-
addHpix
protected void addHpix(java.lang.String s) throws java.lang.Exception- Throws:
java.lang.Exception
-
hpix2uniq
public static long hpix2uniq(int order, long npix)Code a couple (order,npix) into a unique long integer- Parameters:
order- HEALPix ordernpix- HEALPix number- Returns:
- Uniq long ordering
-
uniq2hpix
public static long[] uniq2hpix(long uniq)
Uncode a long integer into a couple (order,npix)- Parameters:
uniq- Uniq long ordering- Returns:
- HEALPix order,number
-
uniq2hpix
public static long[] uniq2hpix(long uniq, long[] hpix)Uncode a long integer into a couple (order,npix)- Parameters:
uniq- Uniq long orderinghpix- null for reallocating target couple- Returns:
- HEALPix order,number
-
pow2
public static final long pow2(long order)
-
log2
public static final long log2(long nside)
-
compareTo
public int compareTo(java.lang.Object o)
- Specified by:
compareToin interfacejava.lang.Comparable
-
-