Class UrlMocCoverage

  • All Implemented Interfaces:
    Coverage

    public class UrlMocCoverage
    extends MocCoverage
    MOC coverage implementation which reads a MOC from a given URL. MOCs are cached by URL, so the same one won't be read twice.

    Note: MOCs are cached indefinitely per service, beware that this constitutes a potential memory leak. Some smarter caching scheme may be introduced if this causes problems.

    Since:
    9 Jun 2014
    Author:
    Mark Taylor
    • Nested Class Summary

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String FOOT_SERVICE_URL
      Footprint service base URL provided by CDS.
    • Constructor Summary

      Constructors 
      Constructor Description
      UrlMocCoverage​(java.net.URL mocUrl)
      Constructor.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected cds.moc.HealpixMoc createMoc()
      Constructs the MOC which will define this object's coverage.
      static cds.moc.HealpixImpl getDefaultHealpixImpl()
      Returns the HEALPix implementation used for MOC service queries.
      static UrlMocCoverage getServiceMoc​(java.net.URL serviceUrl, int nside)
      Returns an instance which gives coverage for a data service with a given access URL.
      static UrlMocCoverage getVizierMoc​(java.lang.String vizierId, int nside)
      Returns an instance which gives coverage for a named Vizier table.
      static void setDefaultHealpixImpl​(cds.moc.HealpixImpl hpi)
      Sets the HEALPix implementation used for MOC service queries.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • FOOT_SERVICE_URL

        public static final java.lang.String FOOT_SERVICE_URL
        Footprint service base URL provided by CDS.
        See Also:
        Constant Field Values
    • Constructor Detail

      • UrlMocCoverage

        public UrlMocCoverage​(java.net.URL mocUrl)
        Constructor.
        Parameters:
        mocUrl - URL of MOC file
    • Method Detail

      • createMoc

        protected cds.moc.HealpixMoc createMoc()
                                        throws java.io.IOException
        Description copied from class: MocCoverage
        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 the MocCoverage.initCoverage() method of MocCoverage, and should not be called by anyone else.
        Specified by:
        createMoc in class MocCoverage
        Returns:
        new MOC defining footprint
        Throws:
        java.io.IOException
      • getServiceMoc

        public static UrlMocCoverage getServiceMoc​(java.net.URL serviceUrl,
                                                   int nside)
        Returns an instance which gives coverage for a data service with a given access URL. This queries the CDS service for MOCs, which at time of writing has information for all the various VizieR cone search services, plus a few other registered cone search services (UKIDSS etc).
        Parameters:
        serviceUrl - URL of cone search service
        nside - requiested HEALPix nside for MOC, or -1 for default
      • getVizierMoc

        public static UrlMocCoverage getVizierMoc​(java.lang.String vizierId,
                                                  int nside)
        Returns an instance which gives coverage for a named Vizier table. The name may be a vizier table name (like "V/139/sdss9") or alias as used by the CDS Xmatch service (like "SDSS DR9").
        Parameters:
        vizierId - vizier table name or alias
        nside - requiested HEALPix nside for MOC, or -1 for default
      • getDefaultHealpixImpl

        public static cds.moc.HealpixImpl getDefaultHealpixImpl()
        Returns the HEALPix implementation used for MOC service queries.
        Returns:
        indexing implementation
      • setDefaultHealpixImpl

        public static void setDefaultHealpixImpl​(cds.moc.HealpixImpl hpi)
        Sets the HEALPix implementation used for MOC service queries.
        Parameters:
        hpi - indexing implementation