|
39 | 39 | "from copy import copy # deep copies"
|
40 | 40 | ]
|
41 | 41 | },
|
| 42 | + { |
| 43 | + "cell_type": "markdown", |
| 44 | + "metadata": {}, |
| 45 | + "source": [ |
| 46 | + "#### Some Truth Model Parameters" |
| 47 | + ] |
| 48 | + }, |
| 49 | + { |
| 50 | + "cell_type": "code", |
| 51 | + "execution_count": 6, |
| 52 | + "metadata": {}, |
| 53 | + "outputs": [], |
| 54 | + "source": [ |
| 55 | + "# Truth Model Parameters \n", |
| 56 | + "seed = 73073 # random number seed for repeatable random samples and rejection sampler \n", |
| 57 | + "name = 'Por' # name of the feature of interest\n", |
| 58 | + "mean = 0.13 # univariate distribution mean - assuming Gaussian distribution\n", |
| 59 | + "stdev = 0.03 # univariate standard deviation \n", |
| 60 | + "nug = 0.0 # nugget effect - variogram model\n", |
| 61 | + "it = 1 # type of structure (1 -spherical, 2 - exponential, 3 - Gaussian)\n", |
| 62 | + "azi = 45.0 # primary direction/azimuth of continuity (0 = y positive, 90 = x positive)\n", |
| 63 | + "hmaj = 800 # variogram range in the major direction\n", |
| 64 | + "hmin = 300 # variogram range in the minor direction (major direction + 90)\n", |
| 65 | + "corr1 = 0.90\n", |
| 66 | + "corr2 = -0.8\n", |
| 67 | + "\n", |
| 68 | + "# Make the variogram object\n", |
| 69 | + "vario = GSLIB.make_variogram(nug,nst=1,it1=it,cc1=1.0,azi1=azi,hmaj1=hmaj,hmin1=hmin) # make model object\n", |
| 70 | + "\n", |
| 71 | + "# Make the dummy dataset (should be outside the range of correlation of the model)\n", |
| 72 | + "df = pd.DataFrame({'X':np.full(100,-9999),'Y':np.full(100,-9999),name:np.random.normal(0.0,1.0,100)})\n", |
| 73 | + "\n", |
| 74 | + "# Truth Model Grid Parameters\n", |
| 75 | + "nx = 100; ny = 100 # number of cells in the x and y directions\n", |
| 76 | + "xsiz = 10.0; ysiz = 10.0 # size of the cells in the x and y directions\n", |
| 77 | + "xmn = xsiz * 0.5; ymn = ysiz * 0.5 # assume origin at 0,0, calculate the 1 cell centroid\n", |
| 78 | + "xmin = xmn - 0.5*xsiz; ymin = ymn - 0.5*ysiz # assume origin at 0,0, calculate the min and max x/y coordinates\n", |
| 79 | + "xmax = xmin + nx * xsiz; ymax = ymin + ny * ysiz;\n", |
| 80 | + "vmin = -3; vmax = 3 # feature min and max for color bars\n", |
| 81 | + "sim_ns = np.zeros([6,ny,nx])" |
| 82 | + ] |
| 83 | + }, |
42 | 84 | {
|
43 | 85 | "cell_type": "markdown",
|
44 | 86 | "metadata": {},
|
|
108 | 150 | },
|
109 | 151 | {
|
110 | 152 | "cell_type": "code",
|
111 |
| - "execution_count": 23, |
| 153 | + "execution_count": 7, |
112 | 154 | "metadata": {},
|
113 | 155 | "outputs": [],
|
114 | 156 | "source": [
|
115 |
| - "def regular_sample_MV(array,array2,array3,array4,xmin,xmax,ymin,ymax,spacing,minsx=xmin,maxsx=xmax,minsy=ymin,maxsy=ymax,name='Value',name2='Value2',name3='Value3',name4=\"Value4\"):\n", |
| 157 | + "def regular_sample_MV(array,array2,array3,array4,xmin,xmax,ymin,ymax,spacing,\n", |
| 158 | + " minsx=xmin,maxsx=xmax,minsy=ymin,maxsy=ymax,name='Value',name2='Value2',name3='Value3',name4=\"Value4\"):\n", |
116 | 159 | " x = []; y = []; v = []; v2 = []; v3 = []; v4 = []\n",
|
117 | 160 | " nx = array.shape[1]; ny = array.shape[0]\n",
|
118 | 161 | " xsiz = (xmax-xmin)/nx; ysiz = (ymax-ymin)/ny\n",
|
|
240 | 283 | "\n",
|
241 | 284 | " Data for SGSIM: Number of acceptable data = 100\n",
|
242 | 285 | " Number trimmed = 0\n",
|
243 |
| - " Weighted Average = -0.0678\n", |
244 |
| - " Weighted Variance = 0.9855\n", |
245 |
| - " Weighted Transformed Average = -0.0678\n", |
246 |
| - " Weighted Transformed Variance = 0.9855\n", |
| 286 | + " Weighted Average = 0.016\n", |
| 287 | + " Weighted Variance = 1.1133\n", |
| 288 | + " Weighted Transformed Average = 0.016\n", |
| 289 | + " Weighted Transformed Variance = 1.1133\n", |
247 | 290 | "Setting up rotation matrices for variogram and search\n",
|
248 | 291 | "Working on realization number 0\n",
|
249 | 292 | " currently on node 0\n",
|
|
264 | 307 | "\n",
|
265 | 308 | " Data for SGSIM: Number of acceptable data = 100\n",
|
266 | 309 | " Number trimmed = 0\n",
|
267 |
| - " Weighted Average = -0.0678\n", |
268 |
| - " Weighted Variance = 0.9855\n", |
269 |
| - " Weighted Transformed Average = -0.0678\n", |
270 |
| - " Weighted Transformed Variance = 0.9855\n", |
| 310 | + " Weighted Average = 0.016\n", |
| 311 | + " Weighted Variance = 1.1133\n", |
| 312 | + " Weighted Transformed Average = 0.016\n", |
| 313 | + " Weighted Transformed Variance = 1.1133\n", |
271 | 314 | " Secondary Data: Number of data = 10000\n",
|
272 | 315 | " Equal Weighted Average = 0.0\n",
|
273 | 316 | " Equal Weighted Variance = 1.0\n",
|
|
293 | 336 | "\n",
|
294 | 337 | " Data for SGSIM: Number of acceptable data = 100\n",
|
295 | 338 | " Number trimmed = 0\n",
|
296 |
| - " Weighted Average = -0.0678\n", |
297 |
| - " Weighted Variance = 0.9855\n", |
298 |
| - " Weighted Transformed Average = -0.0678\n", |
299 |
| - " Weighted Transformed Variance = 0.9855\n", |
| 339 | + " Weighted Average = 0.016\n", |
| 340 | + " Weighted Variance = 1.1133\n", |
| 341 | + " Weighted Transformed Average = 0.016\n", |
| 342 | + " Weighted Transformed Variance = 1.1133\n", |
300 | 343 | " Secondary Data: Number of data = 10000\n",
|
301 | 344 | " Equal Weighted Average = 0.0\n",
|
302 | 345 | " Equal Weighted Variance = 1.0\n",
|
|
322 | 365 | "\n",
|
323 | 366 | " Data for SGSIM: Number of acceptable data = 100\n",
|
324 | 367 | " Number trimmed = 0\n",
|
325 |
| - " Weighted Average = -0.0678\n", |
326 |
| - " Weighted Variance = 0.9855\n", |
327 |
| - " Weighted Transformed Average = -0.0678\n", |
328 |
| - " Weighted Transformed Variance = 0.9855\n", |
| 368 | + " Weighted Average = 0.016\n", |
| 369 | + " Weighted Variance = 1.1133\n", |
| 370 | + " Weighted Transformed Average = 0.016\n", |
| 371 | + " Weighted Transformed Variance = 1.1133\n", |
329 | 372 | "Setting up rotation matrices for variogram and search\n",
|
330 | 373 | "Working on realization number 0\n",
|
331 | 374 | " currently on node 0\n",
|
|
346 | 389 | "\n",
|
347 | 390 | " Data for SGSIM: Number of acceptable data = 100\n",
|
348 | 391 | " Number trimmed = 0\n",
|
349 |
| - " Weighted Average = -0.0678\n", |
350 |
| - " Weighted Variance = 0.9855\n", |
351 |
| - " Weighted Transformed Average = -0.0678\n", |
352 |
| - " Weighted Transformed Variance = 0.9855\n", |
| 392 | + " Weighted Average = 0.016\n", |
| 393 | + " Weighted Variance = 1.1133\n", |
| 394 | + " Weighted Transformed Average = 0.016\n", |
| 395 | + " Weighted Transformed Variance = 1.1133\n", |
353 | 396 | " Secondary Data: Number of data = 10000\n",
|
354 | 397 | " Equal Weighted Average = -0.0\n",
|
355 | 398 | " Equal Weighted Variance = 1.0\n",
|
|
375 | 418 | "\n",
|
376 | 419 | " Data for SGSIM: Number of acceptable data = 100\n",
|
377 | 420 | " Number trimmed = 0\n",
|
378 |
| - " Weighted Average = -0.0678\n", |
379 |
| - " Weighted Variance = 0.9855\n", |
380 |
| - " Weighted Transformed Average = -0.0678\n", |
381 |
| - " Weighted Transformed Variance = 0.9855\n", |
| 421 | + " Weighted Average = 0.016\n", |
| 422 | + " Weighted Variance = 1.1133\n", |
| 423 | + " Weighted Transformed Average = 0.016\n", |
| 424 | + " Weighted Transformed Variance = 1.1133\n", |
382 | 425 | " Secondary Data: Number of data = 10000\n",
|
383 | 426 | " Equal Weighted Average = -0.0\n",
|
384 | 427 | " Equal Weighted Variance = 1.0\n",
|
|
405 | 448 | }
|
406 | 449 | ],
|
407 | 450 | "source": [
|
408 |
| - "# Truth Model Parameters \n", |
409 |
| - "seed = 73073 # random number seed for repeatable random samples and rejection sampler \n", |
410 |
| - "name = 'Por' # name of the feature of interest\n", |
411 |
| - "mean = 0.13 # univariate distribution mean - assuming Gaussian distribution\n", |
412 |
| - "stdev = 0.03 # univariate standard deviation \n", |
413 |
| - "nug = 0.0 # nugget effect - variogram model\n", |
414 |
| - "it = 1 # type of structure (1 -spherical, 2 - exponential, 3 - Gaussian)\n", |
415 |
| - "azi = 45.0 # primary direction/azimuth of continuity (0 = y positive, 90 = x positive)\n", |
416 |
| - "hmaj = 800 # variogram range in the major direction\n", |
417 |
| - "hmin = 300 # variogram range in the minor direction (major direction + 90)\n", |
418 |
| - "corr1 = 0.90\n", |
419 |
| - "corr2 = -0.8\n", |
420 |
| - "\n", |
421 |
| - "# Make the variogram object\n", |
422 |
| - "vario = GSLIB.make_variogram(nug,nst=1,it1=it,cc1=1.0,azi1=azi,hmaj1=hmaj,hmin1=hmin) # make model object\n", |
423 |
| - "\n", |
424 |
| - "# Make the dummy dataset (should be outside the range of correlation of the model)\n", |
425 |
| - "df = pd.DataFrame({'X':np.full(100,-9999),'Y':np.full(100,-9999),name:np.random.normal(0.0,1.0,100)})\n", |
426 |
| - "\n", |
427 |
| - "# Truth Model Grid Parameters\n", |
428 |
| - "nx = 100; ny = 100 # number of cells in the x and y directions\n", |
429 |
| - "xsiz = 10.0; ysiz = 10.0 # size of the cells in the x and y directions\n", |
430 |
| - "xmn = xsiz * 0.5; ymn = ysiz * 0.5 # assume origin at 0,0, calculate the 1 cell centroid\n", |
431 |
| - "xmin = xmn - 0.5*xsiz; ymin = ymn - 0.5*ysiz # assume origin at 0,0, calculate the min and max x/y coordinates\n", |
432 |
| - "xmax = xmin + nx * xsiz; ymax = ymin + ny * ysiz;\n", |
433 |
| - "vmin = -3; vmax = 3 # feature min and max for color bars\n", |
434 |
| - "sim_ns = np.zeros([6,ny,nx])\n", |
435 |
| - "\n", |
436 |
| - "\n", |
437 | 451 | "# Calculate the Simulated Truth Model over the Specified Grid and Variogram \n",
|
438 | 452 | "sim_ns[0,:,:] = geostats.sgsim(df,'X','Y',name,wcol=-1,scol=-1,tmin=-9999,tmax=9999,itrans=0,ismooth=0,dftrans=0,tcol=0,\n",
|
439 | 453 | " twtcol=0,zmin=-3.0,zmax=3.0,ltail=1,ltpar=-3.0,utail=1,utpar=3.0,nsim=1,\n",
|
|
0 commit comments