Skip to content

Commit 4b3708b

Browse files
Update README.md (#68)
* Update README.md Add description and quickstart guide * Update README.md * Update README.md Co-authored-by: Ari Hartikainen <ahartikainen@users.noreply.github.com> * Update README.md Co-authored-by: Ari Hartikainen <ahartikainen@users.noreply.github.com> * Update README.md Co-authored-by: Ari Hartikainen <ahartikainen@users.noreply.github.com> --------- Co-authored-by: Ari Hartikainen <ahartikainen@users.noreply.github.com>
1 parent 88cfa6b commit 4b3708b

File tree

1 file changed

+55
-1
lines changed

1 file changed

+55
-1
lines changed

README.md

Lines changed: 55 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,56 @@ 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+
holes.to_infraformat("holes_tm35fin.tek")
37+
38+
bounds = [6672242-200 , 385795-200, 6672242 +200, 385795+200]
39+
gtk_holes = pif.from_gtk_wfs(bounds, "TM35Fin")
40+
print(gtk_holes) # View holes object
41+
#Infraformat Holes -object:
42+
# Total of 203 holes
43+
# - PO ......... 161
44+
# - HP ......... 13
45+
# - PA ......... 12
46+
# - NO ......... 2
47+
# - NE ......... 1
48+
# - KE ......... 5
49+
# - KR ......... 9
50+
51+
52+
html_map = gtk_holes.plot_map()
53+
html_map.save("soundings.html")
54+
html_map # View map in jupyter
55+
```
56+
![image](https://github.com/user-attachments/assets/a463e181-4ab4-479d-94f6-edcb19c0f598)
57+
58+
```python
59+
hole_figure = gtk_holes[10].plot()
60+
hole_figure # View hole in jupyter
61+
```
62+
63+
![image](https://github.com/user-attachments/assets/33b9c797-b084-44b2-88c8-dadd15fc540f)
64+
65+
#### Plot histograms from laboratory tests
66+
```python
67+
import pandas as pd
68+
bounds = [6672242-2000 , 385795-2000, 6672242 +2000, 385795+2000]
69+
gtk_holes = pif.from_gtk_wfs(bounds, "TM35FIN", maxholes=25_000)
70+
laboratory_tests = gtk_holes.filter_holes(hole_type=["NO", "NE"], start="1990-01-01")
71+
df = laboratory_tests.get_dataframe()
72+
df['data_Soil type'] = df['data_Soil type'].astype("string")
73+
clay_samples = df[df['data_Soil type'].str.endswith("Sa", na=False)].reset_index()
74+
clay_samples['data_Laboratory w'] = pd.to_numeric(clay_samples['data_Laboratory w'])
75+
fig = clay_samples['data_Laboratory w'].plot.hist(bins='fd')
76+
fig.set_title("Clay samples water content, %")
77+
fig
78+
```
79+
![image](https://github.com/user-attachments/assets/e3e6030b-ccfc-4c59-9929-40a7f9900fa4)

0 commit comments

Comments
 (0)