2
2
3
3
4
4
# 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.
6
7
7
8
## Installation
8
9
@@ -23,3 +24,56 @@ Library can be installed also by `git clone` / downloading zip.
23
24
To install inplace for development work, use ` -e ` command.
24
25
25
26
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