Deltares / GEOLib-Plus

GEOLib+ is built on top of GEOLib and provides CPT (both GEF and XML) intepretation, among other useful tooling.
https://deltares.github.io/GEOLib-Plus
8 stars 9 forks source link

Relative density function not working properly #34

Open MattBrst opened 6 days ago

MattBrst commented 6 days ago

Problem The recently added 'relative density calculation' yields a None value, which is not what I expect. Please find below my code and GEF file:

# Read file
cpt_file_gef = <GEF filename including path>
from geolib_plus.gef_cpt import GefCpt
cpt_gef = GefCpt()
cpt_gef.read(cpt_file_gef)
cpt_gef.pre_process_data()

# Interpretation
from geolib_plus.robertson_cpt_interpretation import RobertsonCptInterpretation
interpreter = RobertsonCptInterpretation()
cpt_gef.interpret_cpt(interpreter)

# Show results
print('Lithology: ', cpt_gef.lithology)
print('Relative density: ', cpt_gef.relative_density)`

GEF file: CPT000000092361_IMBRO.zip

Workaround When I paste the whole contents of the file 'robertson_cpt_interpretation.py' at the top of this script (and remove the import statement on line 12) I actually get a relative density value, However, I would be happy if anyone has a more elegant solution or suggestions.

EleniSmyrniou commented 5 days ago

Just a few days ago I had a similar problem. The interpret_cpt does not call the relative_density_calc which is probably a bug. My workaround is as follows

cpt = geolib_plus.gef_cpt.GefCpt() cpt.read(filepath=filename_cpt) cpt.pre_process_data() interpreter = geolib_plus.robertson_cpt_interpretation.RobertsonCptInterpretation() cpt.interpret_cpt(interpreter) interpreter.relative_density_calc(method=geolib_plus.robertson_cpt_interpretation.RelativeDensityMethod.BALDI)

Does this help?

MattBrst commented 5 days ago

Your workaround works.

When I compare the different methods, I notice a difference between line 589 and line 730. In 589 the default method is mentioned, whereas this is missing in 730.

I would expect line 730 to become: method: RelativeDensityMethod **_= RelativeDensityMethod.BALDI_**,