Exemplo n.º 1
0
    def test_normalization(self):
        p = Particle()

        dt = datetime(2012, 8, 15, 0, tzinfo=pytz.utc)
        norms = [dt]

        last_real_movement = Location4D(latitude=38,
                                        longitude=-76,
                                        depth=0,
                                        time=dt)

        p.location = Location4D(latitude=100, longitude=-100, depth=0, time=dt)
        p.location = Location4D(latitude=101, longitude=-101, depth=0, time=dt)
        p.location = last_real_movement

        for x in range(1, 10):
            norm = (dt + timedelta(hours=x)).replace(tzinfo=pytz.utc)
            norms.append(norm)
            p.location = Location4D(latitude=38 + x,
                                    longitude=-76 + x,
                                    depth=x,
                                    time=norm)

        locs = p.normalized_locations(norms)
        assert locs[0] == last_real_movement
Exemplo n.º 2
0
    def test_normalization(self):
        p = Particle()

        dt = datetime(2012, 8, 15, 0, tzinfo=pytz.utc)
        norms =[dt]

        last_real_movement = Location4D(latitude=38, longitude=-76, depth=0, time=dt)

        p.location = Location4D(latitude=100, longitude=-100, depth=0, time=dt)
        p.location = Location4D(latitude=101, longitude=-101, depth=0, time=dt)
        p.location = last_real_movement

        for x in xrange(1,10):
            norm = (dt + timedelta(hours=x)).replace(tzinfo=pytz.utc)
            norms.append(norm)
            p.location = Location4D(latitude=38 + x, longitude=-76 + x, depth=x, time=norm)
            
        locs = p.normalized_locations(norms)
        assert locs[0] == last_real_movement