Пример #1
0
 def test_mst_equal(self):
     from pyrate import mst
     ifgs = common.small_data_setup(datafiles=self.dest_paths)
     mst_original_p = mst.mst_boolean_array(ifgs)
     ifgs_s = common.small_data_setup(datafiles=self.dest_paths_s)
     mst_original_s = mst.mst_boolean_array(ifgs_s)
     np.testing.assert_array_equal(self.mst, mst_original_p)
     np.testing.assert_array_equal(self.mst, mst_original_s)
     np.testing.assert_array_equal(self.mst, self.mst_p)
Пример #2
0
    def test_mst_boolean_array(self):
        nan_conversion = 1
        for i in self.small_ifgs:
            if not i.is_open:
                i.open(readonly=False)
            if nan_conversion:  # nan conversion happens here in networkx mst
                i.nodata_value = 0
                i.convert_to_nans()
            if not i.mm_converted:
                i.convert_to_mm()
                i.write_modified_phase()
        mst_nx = mst.mst_boolean_array(self.small_ifgs)

        small_ifg_instance = IfgList(datafiles=self.small_files)
        ifgs = small_ifg_instance.ifgs
        for i in ifgs:
            if not i.mm_converted:
                i.convert_to_mm()
                i.write_modified_phase()
        ifg_instance_updated, epoch_list = \
            get_nml(small_ifg_instance, nodata_value=0,
                    nan_conversion=nan_conversion)

        mst_matlab = matlab_mst_bool(ifg_instance_updated)
        np.testing.assert_array_equal(mst_matlab, mst_nx)

        # close ifgs for windows
        for i in self.small_ifgs:
            i.close()
Пример #3
0
 def setUpClass(cls):
     cls.ifgs = common.small_data_setup()
     cls.params = default_params()
     cls.mstmat = mst.mst_boolean_array(cls.ifgs)
     r_dist = covariance.RDist(cls.ifgs[0])()
     cls.maxvar = [
         covariance.cvd(i, cls.params, r_dist)[0] for i in cls.ifgs
     ]
     cls.vcmt = covariance.get_vcmt(cls.ifgs, cls.maxvar)
Пример #4
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)
Пример #5
0
 def setUpClass(cls):
     cls.ifgs = common.small_data_setup()
     cls.params = default_params()
     cls.mstmat = mst.mst_boolean_array(cls.ifgs)
     cls.maxvar = [vcm.cvd(i, cls.params)[0] for i in cls.ifgs]
     cls.vcmt = vcm.get_vcmt(cls.ifgs, cls.maxvar)