예제 #1
0
    def test_ifg_date_lookup(self):
        # check reverse lookup of ifg given a first and second date tuple
        date_pair = (date(2006, 8, 28), date(2006, 12, 11))
        i = ifg_date_lookup(self.ifgs, date_pair)
        self.assertEqual(self.ifgs[0], i)

        # test with reversed date tuple, should reorder it according to age
        date_pair = (date(2006, 12, 11), date(2006, 11, 6))
        i = ifg_date_lookup(self.ifgs, date_pair)
        self.assertEqual(self.ifgs[1], i)
예제 #2
0
def _mst_matrix_ifgs_only(ifgs):
    """
    Alternative method for producing 3D MST array
    """
    #Currently not used
    #The MSTs are stripped of connecting edge info, leaving just the ifgs.
    result = empty(shape=ifgs[0].phase_data.shape, dtype=object)

    for y, x, mst in mst_matrix_networkx(ifgs):
        if isinstance(mst, EdgeView):
            ifg_sub = [ifg_date_lookup(ifgs, d) for d in mst]
            result[(y, x)] = tuple(ifg_sub)
        else:
            result[(y, x)] = mst  # usually NaN
    return result