예제 #1
0
    def testMakeAnalysis(self):
    #         ai = self.manager.db.get_analyses(18)
        ln = self.manager.db.get_labnumber('61311')

        aa = timethis(self.manager.make_analyses, args=(ln.analyses,))
        timethis(self.manager.load_analyses, args=(aa,),
                 kwargs={'open_progress': False})
        na = aa[0]
        #         timethis(na.load_isotopes)
        self.assertEqual(na.labnumber, '61311')
예제 #2
0
def convex_hull_area(pts):
    """
        http://en.wikipedia.org/wiki/Polygon#Area_and_centroid
    """
    from pychron.core.codetools.simple_timeit import timethis
    hull = timethis(convex_hull, args=(pts,))
#    hull = convex_hull(pts)
    x, y = zip(*hull)
    ind_arr = np.arange(len(x)) - 1  # for indexing convenience
    s = np.sum([x[ii] * y[ii + 1] - x[ii + 1] * y[ii] for ii in ind_arr])
    return abs(s) * 0.5
예제 #3
0
def convex_hull_area(pts):
    """
        http://en.wikipedia.org/wiki/Polygon#Area_and_centroid
    """
    from pychron.core.codetools.simple_timeit import timethis
    hull = timethis(convex_hull, args=(pts, ))
    #    hull = convex_hull(pts)
    x, y = zip(*hull)
    ind_arr = np.arange(len(x)) - 1  # for indexing convenience
    s = np.sum([x[ii] * y[ii + 1] - x[ii + 1] * y[ii] for ii in ind_arr])
    return abs(s) * 0.5