geostatsguy / pythonnumericaldemos Goto Github PK
View Code? Open in Web Editor NEWWell-documented Python demonstrations for spatial data analytics, geostatistical and machine learning to support my courses.
License: MIT License
Well-documented Python demonstrations for spatial data analytics, geostatistical and machine learning to support my courses.
License: MIT License
Hi @GeostatsGuy, I've started watching the the videos of the Machine learning course. Would you consider creating a separate repository for each course? I think it would make it easier to identify which Notebooks belong to which course.
Cheers!
-Filippo
tmin = -9999.; tmax = 9999.;
lag_dist = 100.0; lag_tol = 100.0; nlag = 7; bandh = 9999.9; azi = 0; atol = 90.0; isill = 1
lag, por_sand_gamma, por_sand_npair = geostats.gamv(df_sand,"X","Y","NPor",tmin,tmax,lag_dist,lag_tol,nlag,azi,atol,bandh,isill)
lag, por_shale_gamma, por_shale_npair = geostats.gamv(df_shale,"X","Y","NPor",tmin,tmax,lag_dist,lag_tol,nlag,azi,atol,bandh,isill)
lag, por_gamma, por_npair = geostats.gamv(df,"X","Y","NPor",tmin,tmax,lag_dist,lag_tol,nlag,azi,atol,bandh,isill)
lag, perm_sand_gamma, perm_sand_npair = geostats.gamv(df_sand,"X","Y","NPerm",tmin,tmax,lag_dist,lag_tol,nlag,azi,atol,bandh,isill)
lag, perm_shale_gamma, perm_shale_npair = geostats.gamv(df_shale,"X","Y","NPerm",tmin,tmax,lag_dist,lag_tol,nlag,azi,atol,bandh,isill)
lag, perm_gamma, perm_npair = geostats.gamv(df,"X","Y","NPerm",tmin,tmax,lag_dist,lag_tol,nlag,azi,atol,bandh,isill)
plt.subplot(121)
plt.plot(lag,por_gamma,'x',color = 'black',label = 'All')
plt.plot(lag,por_sand_gamma,'x',color = 'orange',label = 'Sand')
plt.plot(lag,por_shale_gamma,'x',color = 'brown',label = 'Shale')
plt.plot([0,2000],[1.0,1.0],color = 'black')
plt.xlabel(r'Lag Distance
plt.ylabel(r'$\gamma \bf(h)$')
plt.title('Isotropic NSCORE Porosity Variogram')
plt.xlim([0,700])
plt.ylim([0,1.8])
plt.legend(loc='upper left')
plt.grid(True)
plt.subplot(122)
plt.plot(lag,perm_gamma,'x',color = 'black',label = 'All')
plt.plot(lag,perm_sand_gamma,'x',color = 'orange',label = 'Sand')
plt.plot(lag,perm_shale_gamma,'x',color = 'brown',label = 'Shale')
plt.plot([0,2000],[1.0,1.0],color = 'black')
plt.xlabel(r'Lag Distance
plt.ylabel(r'$\gamma \bf(h)$')
plt.title('Isotropic NSCORE Permeaiblity Variogram')
plt.xlim([0,700])
plt.ylim([0,1.8])
plt.legend(loc='upper left')
plt.grid(True)
plt.subplots_adjust(left=0.0, bottom=0.0, right=2.0, top=1.2, wspace=0.2, hspace=0.3)
plt.show()
Trying to run this block of code and getting the following error
TypeError Traceback (most recent call last)
TypeError: expected dtype object, got 'numpy.dtype[float64]'
The above exception was the direct cause of the following exception:
SystemError Traceback (most recent call last)
in
3 lag_dist = 100.0; lag_tol = 100.0; nlag = 7; bandh = 9999.9; azi = 0; atol = 90.0; isill = 1
4
----> 5 lag, por_sand_gamma, por_sand_npair = geostats.gamv(df_sand,"X","Y","NPor",tmin,tmax,lag_dist,lag_tol,nlag,azi,atol,bandh,isill)
6 lag, por_shale_gamma, por_shale_npair = geostats.gamv(df_shale,"X","Y","NPor",tmin,tmax,lag_dist,lag_tol,nlag,azi,atol,bandh,isill)
7 lag, por_gamma, por_npair = geostats.gamv(df,"X","Y","NPor",tmin,tmax,lag_dist,lag_tol,nlag,azi,atol,bandh,isill)
~/anaconda3/lib/python3.8/site-packages/geostatspy/geostats.py in gamv(df, xcol, ycol, vcol, tmin, tmax, xlag, xltol, nlag, azm, atol, bandwh, isill)
1795
1796 # Loop over combinatorial of data pairs to calculate the variogram
-> 1797 dis, vario, npp = variogram_loop(
1798 x, y, vr, xlag, xltol, nlag, azm, atol, bandwh
1799 )
SystemError: CPUDispatcher(<function variogram_loop at 0x7fc1b09b6160>) returned a result with an error set
@GeostatsGuy Do you have a list of libraries that can be called to install all the required libraries you are using in the notebooks?
It will be very helpful to have the list. Thanks a lot.
I tried running the GeostatsPy_variogram_calculation.ipynb
I cannot find the file sample_data.csv
Downloaded Anaconda 3 and did pip install geostatspy package. Opened ipykernel in Jupyter notebook and pasted code to install pymc3 in the box. The kernel then runs for a long time (30+ minutes), and then shows Unsatisfiable Error and No Module Found: pymc3. Appreciate your quick help as I need to use pymc3 for a Bayesian Linear Regression School Project.
hi Michael, I was trying to follow the Ripley's K example here: Ripley_K_demo.ipynb but I cannot find, import or run a ripley_K function on the GeostatsPy package. Has it been removed?
thanks very much
Carolyn
Hi, @GeostatsGuy ....I have detected an issue running this notebook (by the way, it's an excellent educational resource, as the rest of notebooks in your repositories). Matplotlib graphs do not clear correctly in events with clear_output(). If you run the notebook you can see that every time you click the widget controls, the frame is not cleared and the plot is replicated. In my case, I have fixed this issue replacing plt.plot() by plt.show()......
I think the inverse CDF graphics have switched axes, Values should be on the Y axis and probability on the x Axis.
On the Gaussian example I used:
plt.subplot(1,3,3)
plt.plot(p_values, x_values,'r-', lw=5, alpha=0.3, label='uniform pdf')
And the graph looked more like the inverse CDF graphs I searched on the Internet.
Please let me know if I am wrong.
And thanks for the wonderful studying material.
In Interactive_Model_Fitting.ipynb , you seem to have repeated the same text before eqn (1) and eqn (2).
I suspect eqn (2) should be something else.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.