前一陣去捷克參加了數學地質年會(IAMG2018),聽完匯報,發現在數學地質領域用python的越來越多了,他們的很多成果都是用python做出來的。不管喜不喜歡,這個語言已經成了主流,特別是在人工智能領域,幾乎所有的框架都有python接口,用起來很方便。秉承“人生苦短,我用python”的理念,也踏上了python學習之路,盡管感覺C#比python更優雅。
學習python的目的是幫助油氣開發的智能化,特別是智能油田管理相關領域,為了避免重復造輪子,有必要了解目前有哪些開源的python包可以用。下面從數值岩心、測井解釋、地質建模、地震處理解釋、數值模擬、裂縫模擬幾個方面介紹。
1、數字岩心
數字岩心是表征岩石微觀動態和靜態特征的關鍵,對掃描得到的數字岩心進行建模和各種模擬需要岩心重建,孔隙網絡模型是常見的岩心重建方法,該方法的python包有OpenPNM和Poreflow等。
http://www.gslib.com/
https://github.com/PMEAL
https://github.com/pmeal/openpnm
https://github.com/ggorman/poreflow
2 測井解釋
包括測井數據的讀寫、各類解釋方法、圖形顯示等,比如標准的las格式數據讀寫的python包lasio,各種深度轉換的包las,各種濾波處理的logging,基本的測井解釋,用excel和簡單的幾行python腳本就可以,復雜的解釋可以借助專門的解釋包,比如petropy等。

https://lasio.readthedocs.io/en/latest/
https://github.com/petroGG/Basic-Well-Log-Interpretation
https://github.com/petroGG/Basic-Well-Log-Interpretation/blob/master/Basic%20well%20log%20interpretation.ipynb
http://www.cwls.org/las/
https://github.com/WarrenWeckesser/las
https://github.com/WalBytes/PyLogFinder_Package
https://github.com/toddheitmann/petropy
3 地質建模
地質建模方面,主要是地質統計學方面,以前的Gslib是地質統計學中使用最廣泛的fortran開源代碼,目前也已經封裝成為python包,有PyGSLIB,GeostatsPy,除此之外還有基於gslib的擁有更高級接口的Pygeostat,pyGeoStatistics,也有不依賴GSLIB python包,比如pykriging, krige, geostatsmodels, HPGL,scikit-gstat,利用這些python包可以進行變差函數求取,各種克里金插值,序貫高斯模擬、序貫指示模擬等。近兩年來大名鼎鼎的Michael Pyrcz(代表作是 Geostatistical Reservoir Modeling 2nd Edition )在twitter上一直很活躍地在分享它從GSLIB轉向python的學習過程(@GeostatsGuy)。

https://github.com/opengeostat/pygslib
https://github.com/GeostatsGuy/GeostatsPy
https://opengeostat.github.io/pygslib/
http://www.ccgalberta.com/pygeostat/index.html
https://github.com/whimian/pyGeoStatistics
https://github.com/cjohnson318/geostatsmodels/
https://github.com/hpgl/hpgl
http://hpgl.mit-ufa.com/
https://github.com/mmaelicke/scikit-gstat/tree/v0.2.1
http://pykriging.com/
https://twitter.com/GeostatsGuy
下圖是測試kriging包的代碼及運算結果

4、 地震資料解釋處理
地震資料讀寫、處理、解釋和反演方面也有不少包,比如地震資料讀寫的segpy、segyio,岩石物理的pyrocko,合成地震記錄的ricker,處理解釋的ObsPy,屬性解釋的interpies、geoprobe、d2geo,地震反演與成像的pysit,nessi,時深轉換的TotalDepth,地震層次成像的pytomo3d,地震數據3D顯示的seisplot等,以及三維解釋Java包3d-painting。
https://github.com/sixty-north/segpy
https://github.com/Statoil/segyio
https://pyrocko.org/
https://github.com/pyrocko
https://github.com/lijuhttps://github.com/computational-seismology/pytomo3dnzh/ricker
https://github.com/obspy/obspy/wiki
https://github.com/jobar8/interpies
https://github.com/joferkington/python-geoprobe
https://github.com/dfitzgerald3/d2geo
http://pysit.org/
https://github.com/pysit/pysit
https://github.com/PageotD/nessi
https://github.com/paulross/TotalDepth
https://github.com/computational-seismology/pytomo3d
https://github.com/agile-geosci培養桃紅ence/seisplot
https://github.com/chrisengelsma/3d-painting
5、數值模擬
油藏數值模擬的難度相對較大,相應的包也比較少,能找到的有單相裂縫-孔隙介質流動模擬的PorePy,單相2D模擬的SimplePetro,單相3D模擬的PRESTO。
https://pypi.org/project/porepy/#porepy-features
https://github.com/ishovkun/SimplePetro
https://github.com/padmec-reservoir/PRESTO
6、裂縫表征
裂縫特征統計的geo_frac_analysis,裂縫生成模擬的fracture。

https://github.com/TerminusEst/geo_frac_analysis
https://github.com/inconvergent/fracture
