def test_gensrf(self): """ Test Irikura rupture generator """ a_ref_dir = os.path.join(self.install.A_TEST_REF_DIR, "irikura") a_res_dir = os.path.join(self.install.A_OUT_DATA_DIR, str(self.sim_id)) # Run rupture generator gen_srf = IrikuraGenSrf(self.velmodel, self.srcfile, self.outsrf, "LABasin500", sim_id=self.sim_id) gen_srf.run() # # Check results # a_ref_file = os.path.join(a_ref_dir, self.outsrf) a_newfile = os.path.join(a_res_dir, self.outsrf) errmsg = ("Output file %s does not match reference file %s" % (a_newfile, a_ref_file)) self.failIf( not cmp_bbp.cmp_srf(a_ref_file, a_newfile, tolerance=0.0011) == 0, errmsg)
def test_rmg(self): a_ref_dir = os.path.join(self.install.A_TEST_REF_DIR, "song") a_res_dir = os.path.join(self.install.A_TMP_DATA_DIR, str(self.sim_id)) rmg = RMG(None, self.srcfile, self.outsrf, None, sim_id=self.sim_id) rmg.run() # # Test conversion from RMG to srf file # a_ref_file = os.path.join(a_ref_dir, "song_test_whittier.srf") a_newfile = os.path.join(a_res_dir, self.outsrf) errmsg = ("Output file %s does not match reference file %s" % (a_newfile, a_ref_file)) self.failIf(not cmp_bbp.cmp_srf(a_ref_file, a_newfile, tolerance=0.0011) == 0, errmsg)
def test_rmg(self): a_ref_dir = os.path.join(self.install.A_TEST_REF_DIR, "song") a_res_dir = os.path.join(self.install.A_TMP_DATA_DIR, str(self.sim_id)) rmg = RMG(None, self.srcfile, self.outsrf, None, sim_id=self.sim_id) rmg.run() # # Test conversion from RMG to srf file # a_ref_file = os.path.join(a_ref_dir, "song_test_whittier.srf") a_newfile = os.path.join(a_res_dir, self.outsrf) errmsg = ("Output file %s does not match reference file %s" % (a_newfile, a_ref_file)) self.failIf( not cmp_bbp.cmp_srf(a_ref_file, a_newfile, tolerance=0.0011) == 0, errmsg)
def test_genslip(self): """ Test GP rupture generator """ a_ref_dir = os.path.join(self.install.A_TEST_REF_DIR, "gp") a_res_dir = os.path.join(self.install.A_TMP_DATA_DIR, str(self.sim_id)) gen = Genslip(self.velmodel, self.srcfile, self.outsrf, "LABasin500", sim_id=self.sim_id) gen.run() # # Test conversion from genslip to srf file # a_ref_file = os.path.join(a_ref_dir, "m5.89-0.20x0.20_s2379646.srf") a_newfile = os.path.join(a_res_dir, self.outsrf) errmsg = ("Output file %s does not match reference file %s" % (a_newfile, a_ref_file)) self.failIf(not cmp_bbp.cmp_srf(a_ref_file, a_newfile, tolerance=0.0011) == 0, errmsg)
def test_gensrf(self): """ Test GP rupture generator """ a_ref_dir = os.path.join(self.install.A_TEST_REF_DIR, "gp") a_res_dir = os.path.join(self.install.A_TMP_DATA_DIR, str(self.sim_id)) gen = Genslip(self.velmodel, self.srcfile, self.outsrf, "LABasin", sim_id=self.sim_id) gen.run() # # Test conversion from genslip to srf file # a_ref_file = os.path.join(a_ref_dir, "m5.89-0.20x0.20_s2379646.srf") a_newfile = os.path.join(a_res_dir, self.outsrf) errmsg = ("Output file %s does not match reference file %s" % (a_newfile, a_ref_file)) self.failIf(not cmp_bbp.cmp_srf(a_ref_file, a_newfile, tolerance=0.0011) == 0, errmsg)