Ejemplo n.º 1
0
def mst_calculation(ifg_paths_or_instance, params):
    if isinstance(ifg_paths_or_instance, list):
        ifgs = pre_prepare_ifgs(ifg_paths_or_instance, params)
        mst_grid = mst.mst_parallel(ifgs, params)
        # write mst output to a file
        mst_mat_binary_file = join(params[cf.OUT_DIR], 'mst_mat')
        np.save(file=mst_mat_binary_file, arr=mst_grid)

        for i in ifgs:
            i.close()
        return mst_grid
    return None
Ejemplo n.º 2
0
 def test_mst_multiprocessing(self):
     self.params[cf.PARALLEL] = True
     original_mst = mst.mst_boolean_array(self.ifgs)
     parallel_mst = mst.mst_parallel(self.ifgs, params=self.params)
     np.testing.assert_array_equal(original_mst, parallel_mst)