def search(self, dstpath, **params):
        """
        For compatibility with generic image catalog search.
        """

        self.logger.debug("search params=%s" % (str(params)))
        ra, dec = params['ra'], params['dec']
        if not (':' in ra):
            # Assume RA and DEC are in degrees
            ra_deg = float(ra)
            dec_deg = float(dec)
        else:
            # Assume RA and DEC are in standard string notation
            ra_deg = wcs.hmsStrToDeg(ra)
            dec_deg = wcs.dmsStrToDeg(dec)

        # Convert to degrees for search
        wd_deg = float(params['width']) / 60.0
        ht_deg = float(params['height']) / 60.0
        # wd_deg = float(params['width'])
        # ht_deg = float(params['height'])

        # initialize our query object with the service's base URL
        query = pyvo.sia.SIAQuery(self.url)
        query.ra = ra_deg
        query.dec = dec_deg
        query.size = (wd_deg, ht_deg)
        query.format = 'image/fits'
        self.logger.info("Will query: %s" % query.getqueryurl(True))

        results = query.execute()
        if len(results) > 0:
            self.logger.info("Found %d images" % len(results))
        else:
            self.logger.warning("Found no images in this area" % len(results))
            return None

        # For now, we pick the first one found

        # REQUIRES FIX IN PYVO:
        # imfile = results[0].cachedataset(dir="/tmp")
        #
        # Workaround:
        fitspath = results[0].make_dataset_filename(dir="/tmp")
        results[0].cachedataset(fitspath)

        # explicit return
        return fitspath
def search ( self , dstpath , ** params ) : self . logger . debug ( "search params=%s" % ( str ( params ) ) ) ra , dec = params [ 'ra' ] , params [ 'dec' ] if not ( ':' in ra ) : ra_deg = float ( ra ) dec_deg = float ( dec ) else : ra_deg = wcs . hmsStrToDeg ( ra ) dec_deg = wcs . dmsStrToDeg ( dec ) wd_deg = float ( params [ 'width' ] ) / 60.0 ht_deg = float ( params [ 'height' ] ) / 60.0 query = pyvo . sia . SIAQuery ( self . url ) query . ra = ra_deg query . dec = dec_deg query . size = ( wd_deg , ht_deg ) query . format = 'image/fits' self . logger . info ( "Will query: %s" % query . getqueryurl ( True ) ) results = query . execute ( ) if len ( results ) > 0 : self . logger . info ( "Found %d images" % len ( results ) ) else : self . logger . warning ( "Found no images in this area" % len ( results ) ) return None fitspath = results [ 0 ] . make_dataset_filename ( dir = "/tmp" ) results [ 0 ] . cachedataset ( fitspath ) return fitspath
For compatibility with generic image catalog search.