Example #1
0
    def test_bug_depth(self):
        cpt = """
#FILEDATE= 2011, 5, 13
#PROJECTID= CPT, 4015110
#COLUMN= 5
#COLUMNINFO= 1, m, Sondeerlengte, 1
#COLUMNINFO= 2, MPa, Conuswaarde, 2
#COLUMNINFO= 3, MPa, Wrijvingsweerstand, 3
#COLUMNINFO= 4, Deg, Helling, 8
#COLUMNINFO= 5, %, Wrijvingsgetal, 4
#XYID= 31000, 116371.70, 514039.34, 0.02, 0.02
#ZID= 31000, -2.21, 0.05
#MEASUREMENTTEXT= 4, S10CFI518, conusnummer
#MEASUREMENTTEXT= 6, NEN 5140 klasse2, gehanteerde norm en klasse sondering
#MEASUREMENTTEXT= 9, maaiveld, vast horizontaal vlak
#MEASUREMENTVAR= 1, 1000.000000, mm2, nom. oppervlak conuspunt
#MEASUREMENTVAR= 12, 0.000000, -, elektrische sondering
#MEASUREMENTVAR= 13, 1.500000, m, voorgeboorde/voorgegraven diepte
#TESTID= 29
#PROJECTNAME= Herinrichting van de N243
#REPORTCODE= GEF-CPT-Report, 1, 1, 0, -
#REPORTTEXT= 201, Mos Grondmechanica B.V.
#REPORTTEXT= 202, Herinrichting van de N243 te Schermer en Beemster
#REPORTTEXT= 203, Sondering 29
#STARTDATE= 2010, 12, 7
#STARTTIME= 9, 0, 21.000000
#OS= DOS
#EOH=
0.0000e+000 -9.9990e+003 -9.9990e+003 -9.9990e+003 -9.9990e+003
1.5100e+000 3.6954e-001 3.7981e-003 9.9502e-002 9.2308e-001
1.5300e+000 4.0370e-001 5.5589e-003 1.1194e-001 1.3260e+000
1.5500e+000 4.2854e-001 7.5360e-003 1.1194e-001 1.8315e+000
1.5700e+000 4.4407e-001 1.0028e-002 1.1194e-001 2.5117e+000
1.5900e+000 4.5028e-001 9.4163e-003 9.9502e-002 2.4202e+000
1.6100e+000 3.7265e-001 8.6356e-003 9.9502e-002 2.3201e+000
1.6300e+000 3.2607e-001 7.9297e-003 1.1194e-001 2.2770e+000
1.6500e+000 2.9812e-001 7.9607e-003 9.9502e-002 2.4315e+000
1.6700e+000 2.8570e-001 7.0938e-003 1.2438e-001 2.2649e+000
1.6900e+000 2.6085e-001 6.4691e-003 1.1194e-001 1.9653e+000
1.7100e+000 2.9812e-001 5.9068e-003 9.9502e-002 1.6748e+000
1.7300e+000 3.5091e-001 5.2480e-003 9.9502e-002 1.4391e+000
1.7500e+000 4.8444e-001 3.8332e-003 9.9502e-002 1.0214e+000
1.7700e+000 4.9065e-001 3.5531e-003 9.9502e-002 9.0498e-001
1.7900e+000 3.8196e-001 3.4469e-003 1.1194e-001 8.5759e-001
1.8100e+000 3.6023e-001 4.1928e-003 9.9502e-002 1.0363e+000
1.8300e+000 3.8196e-001 4.5735e-003 1.1194e-001 1.1782e+000
1.8500e+000 3.6333e-001 5.2490e-003 1.1194e-001 1.4342e+000
1.8700e+000 3.6954e-001 5.2590e-003 9.9502e-002 1.4635e+000
1.8900e+000 3.6954e-001 5.8176e-003 1.1194e-001 1.5781e+000
        """
        cpt = Cpt(content=dict(string=cpt, file_type="gef"))
        assert np.isclose(cpt.df[0, "depth"], 1.51)
Example #2
0
class TestRobertson(unittest.TestCase):
    def setUp(self):
        self.gef = Cpt("./pygef/test_files/example.gef")

    def test_nan_dropped(self):
        self.assertAlmostEqual(self.gef.df["qc"][0], 16.72)

    def test_water_pressure(self):
        """
        depth starts at 6 meters, So -7 should lead to water pressure of 0
        """
        df = self.gef.classify("robertson",
                               water_level_NAP=None,
                               water_level_wrt_depth=-7)
        self.assertEqual(df["water_pressure"][0], 0)
Example #3
0
    def test_parse_cpt(self):
        cpt = Cpt(content=dict(
            string="""
#GEFID= 1, 1, 0
#FILEOWNER= Wagen 2
#FILEDATE= 2004, 1, 14
#PROJECTID= CPT, 146203
#COLUMN= 3
#COLUMNINFO= 1, m, Sondeerlengte, 1
#COLUMNINFO= 2, MPa, Conuswaarde, 2
#COLUMNINFO= 3, MPa, Wrijvingsweerstand, 3
#XYID= 31000, 132127.181, 458102.351, 0.000, 0.000
#ZID= 31000, 1.3, 0.0
#MEASUREMENTTEXT= 4, 030919, Conusnummer
#MEASUREMENTTEXT= 6, NEN 5140, Norm
#MEASUREMENTTEXT= 9, MV, fixed horizontal level
#MEASUREMENTVAR= 20, 0.000000, MPa, Nulpunt conus voor sondering
#MEASUREMENTVAR= 22, 0.000000, MPa, Nulpunt kleef voor sondering
#MEASUREMENTVAR= 30, 0.000000, deg, Nulpunt helling voor sondering
#PROCEDURECODE= GEF-CPT-Report, 1, 0, 0, -
#TESTID= 4
#PROJECTNAME= Uitbreiding Rijksweg 2
#OS= DOS
#EOH=
0.0000e+000 0.0000e+000 0.0000e+000
1.0200e+000 7.1000e-001 4.6500e-002
1.0400e+000 7.3000e-001 4.2750e-002
1.0600e+000 6.9000e-001 3.9000e-002
""",
            file_type="gef",
        ))
        df_calculated = cpt.df
        df = pl.DataFrame({
            "penetration_length":
            [0.0000e000, 1.0200e000, 1.0400e000, 1.0600e000],
            "qc": [0.0000e000, 7.1000e-001, 7.3000e-001, 6.9000e-001],
            "fs": [0.0000e000, 4.6500e-002, 4.2750e-002, 3.9000e-002],
            "depth": [0.0000e000, 1.0200e000, 1.0400e000, 1.0600e000],
            "elevation_with_respect_to_nap": [1.3, 0.28, 0.26, 0.24],
            "friction_number": [np.nan, 6.54929577, 5.85616438, 5.65217391],
        })

        # TODO: replace with frame_equal when rounding is supported
        # assert df_calculated.frame_equal(df, null_equal=True)
        for column in df.columns:
            assert df_calculated[column].round(6) == df[column]
Example #4
0
    def test_parse_pre_excavated_dept_with_void_inclination(self):
        cpt = Cpt(content=dict(
            string="""
#COLUMN= 6
#COLUMNINFO= 1, m, Sondeerlengte, 1
#COLUMNINFO= 2, MPa, Conuswaarde, 2
#COLUMNINFO= 3, MPa, Wrijvingsweerstand, 3
#COLUMNINFO= 4, Deg, Helling, 8
#COLUMNINFO= 5, %, Wrijvingsgetal, 4
#COLUMNINFO= 6, MPa, Waterspanning, 5
#COLUMNVOID= 2, -9999.000000
#COLUMNVOID= 3, -9999.000000
#COLUMNVOID= 4, -9999.000000
#COLUMNVOID= 5, -9999.000000
#COLUMNVOID= 6, -9999.000000
#LASTSCAN= 3
#ZID= 31000, -0.39, 0.05
#MEASUREMENTVAR= 13, 1.500000, m, voorgeboorde/voorgegraven diepte
#REPORTCODE= GEF-CPT-Report, 1, 1, 0, -
#EOH=
0.0000e+000 -9.9990e+003 -9.9990e+003 -9.9990e+003 -9.9990e+003 -9.9990e+003
1.5100e+000 9.1800e+000 5.3238e-002 5.8398e-001 5.7314e-001 3.0107e-003
1.5300e+000 9.3044e+000 5.3803e-002 8.2007e-001 5.7986e-001 3.3362e-003
""",
            file_type="gef",
        ))
        expected = pl.DataFrame({
            "penetration_length": [1.51, 1.53],
            "qc": [9.1800, 9.3044],
            "fs": [0.053238, 0.053803],
            "inclination": [0.58398, 0.82007],
            "friction_number": [0.579935, 0.578253],
            "u1": [0.003011, 0.003336],
            "depth": [1.510000, 1.529999],
            "elevation_with_respect_to_nap": [-1.90, -1.919999],
        })
        # TODO: replace with frame_equal when rounding is supported
        # assert cpt.df.frame_equal(expected, null_equal=True)
        for column in cpt.df.columns:
            assert expected[column].round(6) == cpt.df[column]
Example #5
0
 def test_xy(self):
     cpt3 = Cpt("./pygef/test_files/cpt3.gef")
     self.assertEqual(cpt3.x, 110885)
     self.assertEqual(cpt3.y, 493345)
Example #6
0
 def setUp(self):
     self.gef = Cpt("./pygef/test_files/example.gef")
Example #7
0
    def test_plot_classification(self):
        gef = Cpt("./pygef/test_files/example.gef")
        gef.plot(show=False,
                 classification="robertson",
                 water_level_wrt_depth=-1)

        gef = Cpt("./pygef/test_files/cpt.gef")
        gef.plot(show=False,
                 classification="robertson",
                 water_level_wrt_depth=-1)

        gef = Cpt("./pygef/test_files/cpt2.gef")
        gef.plot(show=False,
                 classification="robertson",
                 water_level_wrt_depth=-1)
Example #8
0
 def test_plot_cpt(self):
     gef = Cpt("./pygef/test_files/example.gef")
     gef.plot(show=False)