Skip to content

Commit 5d8b801

Browse files
authored
Update README.md
Add description and quickstart guide
1 parent 88cfa6b commit 5d8b801

File tree

1 file changed

+54
-1
lines changed

1 file changed

+54
-1
lines changed

README.md

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33

44
# pyinfraformat
5-
Python library for Finnish Infraformat (version 2.5)
5+
Python library for reading, writing and analyzing Finnish borehole format Infraformat (version 2.5).
6+
Well suited for scientific and research applications.
67

78
## Installation
89

@@ -23,3 +24,55 @@ Library can be installed also by `git clone` / downloading zip.
2324
To install inplace for development work, use `-e` command.
2425

2526
python -m pip install -e .
27+
28+
## Quickstart
29+
Basic usage
30+
```python
31+
import pyinfraformat as pif
32+
pif.set_logger_level(50) # Suppress non-critical warnings, recommended for large files
33+
holes = pif.from_infraformat("*.tek")
34+
holes = holes.project("TM35FIN")
35+
bounds = holes.bounds
36+
37+
bounds = [6672242-200 , 385795-200, 6672242 +200, 385795+200]
38+
gtk_holes = pif.from_gtk_wfs(bounds, "TM35Fin")
39+
print(gtk_holes) # View holes object
40+
#Infraformat Holes -object:
41+
# Total of 203 holes
42+
# - PO ......... 161
43+
# - HP ......... 13
44+
# - PA ......... 12
45+
# - NO ......... 2
46+
# - NE ......... 1
47+
# - KE ......... 5
48+
# - KR ......... 9
49+
50+
51+
html_map = gtk_holes.plot_map()
52+
html_map.save("soundings.html")
53+
html_map # View map in jupyter
54+
```
55+
![image](https://github.com/user-attachments/assets/a463e181-4ab4-479d-94f6-edcb19c0f598)
56+
57+
```python
58+
hole_figure = gtk_holes[10].plot()
59+
hole_figure # View hole in jupyter
60+
```
61+
62+
![image](https://github.com/user-attachments/assets/33b9c797-b084-44b2-88c8-dadd15fc540f)
63+
64+
Plot histograms from labratory tests
65+
```python
66+
import pandas as pd
67+
bounds = [6672242-2000 , 385795-2000, 6672242 +2000, 385795+2000]
68+
gtk_holes = pif.from_gtk_wfs(bounds, "TM35FIN", maxholes=25_000)
69+
labratory_tests = gtk_holes.filter_holes(hole_type=["NO", "NE"], start="1990-01-01")
70+
df = labratory_tests.get_dataframe()
71+
df['data_Soil type'] = df['data_Soil type'].astype("string")
72+
clay_samples = df[df['data_Soil type'].str.endswith("Sa", na=False)].reset_index()
73+
clay_samples['data_Laboratory w'] = pd.to_numeric(clay_samples['data_Laboratory w'])
74+
fig = clay_samples['data_Laboratory w'].plot.hist(bins='fd')
75+
fig.set_title("Clay samples water content, %")
76+
fig
77+
```
78+
![image](https://github.com/user-attachments/assets/e3e6030b-ccfc-4c59-9929-40a7f9900fa4)

0 commit comments

Comments
 (0)