# This file just sends the exit command from pythonMCMC.CraterRequest import CraterRequest from pythonMCMC.CraterRequest import CreaterParams craterRequest = CraterRequest() x, y = 0.1, 644 sediment, w = 0, 55.4 # 0.19*1024.0 # 0.33 # 0.36 curvature = 0 h, sigma = 18.89, 26.26 # .2, 0.1 crater = CreaterParams(x, y, sediment, curvature, w, h, sigma) craterRequest.requestLikelihood(crater) craterRequest.loadImage("C:\\CraterGenerator\\img2.dat") craterRequest.requestLikelihood(crater) craterRequest.loadImage("C:\\Miauu\\img2.dat") craterRequest.e()
import matplotlib.pyplot as plt from pythonMCMC.CraterRequest import CraterRequest from pythonMorphologyUI.meloshTest import plotCraterProfile import numpy as np craterRequest = CraterRequest() crater = craterRequest.getCrater() bumps = craterRequest.getBumps() n_pts = 100 d = crater.D2*2.6 theta = 0 line_x = np.linspace(0.0,d,n_pts)/crater.getTransformRadious(theta) plt.xlim([0,crater.D2*2.4]) # plt.legend(handles=[le, l],loc=4) # crater.getTransformHr() for theta in np.arange(0,np.pi*2,0.1): l, = plt.plot(line_x) plotCraterProfile(l,crater,bumps,theta) # def plotCraterProfile(line,crater,bumps,angle): plt.show()
import time import sys import numpy as np # import emcee import matplotlib.pyplot as plt from pythonMCMC.CraterRequest import CreaterParams from pythonMCMC.CraterRequest import CraterRequest from pymc import Uniform, stochastic,deterministic, Normal craterRequest = CraterRequest() ''' def lnlikefn(x,y,r,w,w2): # if(-4 < x < 4 and -4 < y < 4 and -4 < w0 < 4 and -4 < w1 < 4 and -4 < w2 < 4 and -4 < w3 < 4 and -4 < w4 < 4 and 1.8 < r < 5.0): if(-5 < x < 5 and -5 < y < 5): l = craterRequest.requestLikelihood2(x,y,r,w,w2) # print "x: "+str(x)+" y: "+str(y) + "r: "+str(r) + " l: " +str( l) return np.log(1.0/l) else: return -np.inf x_pos = Uniform("x_pos",lower=-3,upper=3) y_pos = Uniform("y_pos",lower=-3.9,upper=3.9) # rU = Normal("rU",mu=2.35,tau=1) # # rU = Uniform("rU",lower=1.8,upper=6) # w0 = Uniform("w0",lower=-4,upper=6) # w1 = Uniform("w1",lower=-4,upper=6) # w2 = Uniform("w2",lower=-4,upper=6) # w3 = Uniform("w3",lower=-4,upper=6) # w4 = Uniform("w4",lower=-4,upper=6)
def test_sharedPDS(): craterRequest = CraterRequest() pds = craterRequest.getPDS() pds.printPDS() craterRequest.loadRawPDS(pds)
import numpy as np import matplotlib.pyplot as plt from matplotlib.widgets import Slider, Button, RadioButtons import matplotlib.patches as patches from meloshTest import meloshCurve,initMeloshCurve,polyPlot from gaussianTest import gaussian,initGaussian from pythonMCMC.CraterRequest import CraterRequest import os # from pythonMCMC.CraterRequest import SceneProperties craterRequest = CraterRequest() fig, axCentral = plt.subplots() plt.subplots_adjust(left=0.15, bottom=0.15,top=0.9) # plt.subplots_adjust(left=0.25, bottom=0.5,top=1.0) t = np.arange(0.0, 1.0, 0.001) a0 = 5 f0 = 3 s = a0*np.sin(2*np.pi*f0*t) size = 512.0 # ,'g^') l, = plt.plot([0,size],[-20,130],'g^') #lw=1, color='black') # lground, = plt.plot([0,size],[-20,130],'r--')#lw=1, color='read') plt.xlabel('lenght [m]') plt.ylabel('height [m]') # plt.title('Histogram of IQ') # (t,t,lw=2, color='red') # l, = plt.plot(t,s, lw=2, color='red') axcolor = 'lightgoldenrodyellow' vOff = 0.175 axRadio = plt.axes([0.25, 0.25+vOff, 0.65, 0.03], axisbg=axcolor) axH = plt.axes([0.25, 0.2+vOff, 0.65, 0.03], axisbg=axcolor)
# pymcCraterMelosh import time import sys import numpy as np # import emcee import matplotlib.pyplot as plt # from pythonMCMC.CraterRequest import CreaterParams from pythonMCMC.CraterRequest import CraterRequest from pythonSocket.SceneObjects import Crater from pythonSocket.SceneObjects import Scene # from pymc import Uniform, stochastic,deterministic, Normal craterRequest = CraterRequest() # craterRequest.cleanBuffer() curvature = 0 # x,y = 491,953 x,y = 195.00, 722.00 hs=5.19 D2=78.48 hr=14.72 aRepose=3.14/6 lTheta = 0.64 lInt=1.91 lDiff=0.57 # sc = Scene(lTheta,lInt,lDiff) # craterRequest.loadSceneProperties(sc) # create crater # crater = Crater(x,y,hs,D2,hr,aRepose,0) # load crater crater = craterRequest.getCrater() crater2 = crater.cTranslate(0,0)