コード例 #1
0
    def testSia(self):
        results = sia.search(neat, pos=(0,0), size=(0.25,0.25))
        self.assert_(isinstance(results, sia.SIAResults))
        self.assertEquals(results.nrecs, 5)

        rec = results.getrecord(0)
        self.assertEquals(rec.ra, 0.0)
        self.assertEquals(rec.dec, 0.0)
        self.assertEquals(rec.title, "neat")
        self.assert_(rec.dateobs is None)
        self.assertEquals(rec.naxes, 2)
        self.assertEquals(rec.naxis, (300, 300))
        self.assert_(rec.instr is None)
        self.assert_(rec.format is not None)
        # self.assertEquals(rec.acref, self.acref)

        qurl = rec.getdataurl()
        self.assert_(qurl is not None and len(qurl) > 0)
        self.assert_(not os.path.exists(self.imfile))
        # print qurl
        rec.cachedataset(self.imfile)
        self.assert_(os.path.exists(self.imfile))

        if rec.format == "image/fits":
            with open(self.imfile) as fits:
                hdr = fits.read(20)
                self.assert_(hdr.startswith("SIMPLE  ="), "Not a FITS image?")
コード例 #2
0
 def testSia(self):
     results = sia.search("http://localhost:%d/sia" % testserverport,
                          pos=(0,0), size=(1.0,1.0))
     self.assert_(isinstance(results, sia.SIAResults))
     self.assertEquals(results.nrecs, 2)