def testGalaxyCatalog(self):
     test_cat = testGalaxies(self.galaxy, obs_metadata=self.obs_metadata)
     with lsst.utils.tests.getTempFilePath('.txt') as catName:
         test_cat.write_catalog(catName)
         with open(catName) as cat:
             lines = cat.readlines()
     self.assertGreater(len(lines), 1)  # to make sure we did not write an empty catalog
     results = self.galaxy.query_columns(obs_metadata=self.obs_metadata)
     result = getOneChunk(results)
     self.assertGreater(len(result), 0)  # to make sure some results are returned
 def testStarVariability(self):
     starcat = testStars(self.star, obs_metadata=self.obs_metadata)
     results = self.star.query_columns(['varParamStr'], obs_metadata=self.obs_metadata,
                                       constraint='VarParamStr is not NULL')
     result = getOneChunk(results)
     ct = 0
     for row in result:
         ct += 1
         # apply variability to make sure it doesn't fall down
         starcat.applyVariability([row['varParamStr']])
     self.assertGreater(ct, 0)  # to make sure that the test was actually performed
    def testGalaxyVariability(self):

        galcat = testGalaxies(self.galaxy, obs_metadata=self.obs_metadata)
        results = self.galaxy.query_columns(['varParamStr'], obs_metadata=self.obs_metadata,
                                            constraint='VarParamStr is not NULL')
        result = getOneChunk(results)
        ct = 0
        for row in result:
            # apply variability to make sure that it does not fall down
            galcat.applyVariability([row['varParamStr']])
            ct += 1
        self.assertGreater(ct, 0)  # to make sure that the test was actually performed
示例#4
0
 def testGalaxyCatalog(self):
     test_cat = testGalaxies(self.galaxy, obs_metadata=self.obs_metadata)
     with lsst.utils.tests.getTempFilePath('.txt') as catName:
         test_cat.write_catalog(catName)
         with open(catName) as cat:
             lines = cat.readlines()
     self.assertGreater(len(lines),
                        1)  # to make sure we did not write an empty catalog
     results = self.galaxy.query_columns(obs_metadata=self.obs_metadata)
     result = getOneChunk(results)
     self.assertGreater(len(result),
                        0)  # to make sure some results are returned
示例#5
0
 def testStarVariability(self):
     starcat = testStars(self.star, obs_metadata=self.obs_metadata)
     results = self.star.query_columns(['varParamStr'],
                                       obs_metadata=self.obs_metadata,
                                       constraint='VarParamStr is not NULL')
     result = getOneChunk(results)
     ct = 0
     for row in result:
         ct += 1
         # apply variability to make sure it doesn't fall down
         starcat.applyVariability([row['varParamStr']])
     self.assertGreater(
         ct, 0)  # to make sure that the test was actually performed
示例#6
0
    def testGalaxyVariability(self):

        galcat = testGalaxies(self.galaxy, obs_metadata=self.obs_metadata)
        results = self.galaxy.query_columns(
            ['varParamStr'],
            obs_metadata=self.obs_metadata,
            constraint='VarParamStr is not NULL')
        result = getOneChunk(results)
        ct = 0
        for row in result:
            # apply variability to make sure that it does not fall down
            galcat.applyVariability([row['varParamStr']])
            ct += 1
        self.assertGreater(
            ct, 0)  # to make sure that the test was actually performed
示例#7
0
    def testGalaxyCatalog(self):
        catName = os.path.join(getPackageDir('sims_catUtils'), 'tests',
                               'scratchSpace', 'testPhotMixTestGalCat.txt')

        if os.path.exists(catName):
            os.unlink(catName)
        test_cat = testGalaxies(self.galaxy, obs_metadata=self.obs_metadata)
        test_cat.write_catalog(catName)
        cat = open(catName)
        lines = cat.readlines()
        self.assertGreater(len(lines),
                           1)  # to make sure we did not write an empty catalog
        cat.close()
        results = self.galaxy.query_columns(obs_metadata=self.obs_metadata)
        result = getOneChunk(results)
        self.assertGreater(len(result),
                           0)  # to make sure some results are returned

        if os.path.exists(catName):
            os.unlink(catName)