Code Monkey home page Code Monkey logo

pygef's Introduction

PYGEF

Simple parser for *.gef files. These are ASCII based files used for soil properties measurements.

Installation

$ pip install pygef

$ pip install git+https://github.com/ritchie46/pygef.git

Usage

from pygef.gef import ParseGEF

# Read *.gef file
gef = ParseGEF("./my-gef-file.gef")
print(gef)

# Pandas dataframe is accessible via the `df` attribute
print(gef.df)

# Save to csv
gef.df.to_csv("my-file.csv")

# Some important attributes are the follows:

attributes= [
gef.zid, # height with respect to NAP
gef.type, # type of the gef file (borehole or cpt)
gef.x, # x coordinate with respect to the reference system
gef.y # y coordinate with respect to the reference system
]

# Plot cpt file and get soil classification
gef.plot_cpt('robertson', -1, 0.2, show=True) # the plot in figure

classification = ['robertson','been_jeffrey']

#type the name of the classification exactly as specified in the list classification, the inputs of plot_cpt are:
args = ['classification name', water_level_NAP, min_thickness] 
kwargs = [p_a=0.1, # atmospheric pressure, used in the new Robertson, default: 0.1 Mpa
          new=True, # set new to use the new Robertson classification, default: New
          show=False, # set show=True to shown the plot, default: False
          figsize=(12, 30), # set the desired figure size, default: (12, 30)
          df_group=None]  # if you want to plot a different filtered dataframe use this key argument
          
# Save the complete dataframe with classification to csv file
classified = gef.classify_robertson(water_level_NAP, new=True, p_a=0.1)
# or Been&Jeffrey
classified = gef.classify_been_jeffrey(water_level_NAP)    
                       
classified.df.to_csv("my_classified_cpt.csv")   

# Save the filtered Dataframe 

filtered = gef.group_classification(0.2, 'robertson', -1, True, 0.1)

args = [
min_thickness, # min thickness accepted for the layers, it is suggested not use a value bigger than 0.2 m.
classification, # Chosen soil classification
water_level_NAP # Water level with respect to NAP (my field)

]

filtered.df.to_csv("my_filtered_cpt.csv")   
       

pygef's People

Contributors

ritchie46 avatar martinapippi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.