Package uk.ac.starlink.ttools.cone
Class MocCoverage
java.lang.Object
uk.ac.starlink.ttools.cone.MocCoverage
- All Implemented Interfaces:
Coverage
- Direct Known Subclasses:
AsciiMocCoverage
,ConeQueryCoverage
,UrlMocCoverage
Abstract superclass for Coverage implementations based on MOC
(HEALPix Multi-Order Coverage) objects.
- Since:
- 9 Jan 2012
- Author:
- Mark Taylor
-
Nested Class Summary
Nested classes/interfaces inherited from interface uk.ac.starlink.ttools.cone.Coverage
Coverage.Amount
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final cds.moc.HealpixImpl
Default Healpix implementation. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Constructs a MocCoverage with default HEALPix implementation.protected
MocCoverage
(cds.moc.HealpixImpl hpi) Constructs a MocCoverage with specified HEALPix implementation. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract cds.moc.HealpixMoc
Constructs the MOC which will define this object's coverage.boolean
discOverlaps
(double alphaDeg, double deltaDeg, double radiusDeg) Indicates whether a given disc on the sphere overlaps, or may overlap with this coverage.Returns the amount category for coverage.cds.moc.HealpixMoc
getMoc()
Returns the MOC object associated with this footprint.void
Must be called before any of the query methods are used.
-
Field Details
-
DFLT_HPI
public static final cds.moc.HealpixImpl DFLT_HPIDefault Healpix implementation.
-
-
Constructor Details
-
MocCoverage
protected MocCoverage()Constructs a MocCoverage with default HEALPix implementation. -
MocCoverage
protected MocCoverage(cds.moc.HealpixImpl hpi) Constructs a MocCoverage with specified HEALPix implementation.- Parameters:
hpi
- HEALPix implementation to use for calculations
-
-
Method Details
-
createMoc
Constructs the MOC which will define this object's coverage. This method, which may be time-consuming, will be called a maximum of once by theinitCoverage()
method ofMocCoverage
, and should not be called by anyone else.- Returns:
- new MOC defining footprint, or null
- Throws:
IOException
-
initCoverage
Description copied from interface:Coverage
Must be called before any of the query methods are used. May be time consuming (it may contact an external service). It is legal to call this method multiple times from the same or different threads. IfCoverage.getAmount()
returns non-null, this method will return directly. Following a successful or error return of this method,Coverage.getAmount()
will return non-null.- Specified by:
initCoverage
in interfaceCoverage
- Throws:
IOException
-
getAmount
Description copied from interface:Coverage
Returns the amount category for coverage. If the footprint is not ready for use, null is returned. In that case,Coverage.initCoverage()
must be called before use. -
discOverlaps
public boolean discOverlaps(double alphaDeg, double deltaDeg, double radiusDeg) Description copied from interface:Coverage
Indicates whether a given disc on the sphere overlaps, or may overlap with this coverage. False positives are permitted.- Specified by:
discOverlaps
in interfaceCoverage
- Parameters:
alphaDeg
- central longitude in degreesdeltaDeg
- central latitude in degreesradiusDeg
- radius in degrees- Returns:
- false if the given disc definitely does not overlap this footprint; otherwise true
-
getMoc
public cds.moc.HealpixMoc getMoc()Returns the MOC object associated with this footprint.- Returns:
- moc
-