forked from opengeostat/pygslib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdif.txt
933 lines (856 loc) · 33.6 KB
/
dif.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
diff --git a/cython_code/drillhole.pyx b/cython_code/drillhole.pyx
index baba018..269e952 100644
--- a/cython_code/drillhole.pyx
+++ b/cython_code/drillhole.pyx
@@ -160,6 +160,7 @@ cpdef cart2ang( float x,
float EPSLON=1.0e-4
if abs(x)+EPSLON>1.001 or abs(y)+EPSLON>1.001 or abs(z)+EPSLON>1.001:
+ #print x,y,z
warnings.warn('cart2ang: a coordinate x, y or z is outside the interval [-1,1]')
# check the values are in interval [-1,1] and truncate if necessary
@@ -306,7 +307,7 @@ cpdef __dsmincurb( float len12,
-------
out : tuple of floats, ``(dz,dn,de)``
Differences in elevation, north coordinate (or y) and
- east coordinate (or x) in a Euclidean coordinate system.
+ east coordinate (or x) in an Euclidean coordinate system.
Example
--------
@@ -318,7 +319,6 @@ cpdef __dsmincurb( float len12,
See Also
--------
ang2cart
- __dstangential
Note
-----
@@ -347,9 +347,11 @@ cpdef __dsmincurb( float len12,
float a1
float i2
float a2
+ float DEG2RAD
float rf
float dl
- float DEG2RAD=3.141592654/180.0
+
+ DEG2RAD=3.141592654/180.0
i1 = (90 - dip1) * DEG2RAD
a1 = azm1 * DEG2RAD
@@ -370,97 +372,83 @@ cpdef __dsmincurb( float len12,
dz = 0.5*len12*(cos(i1)+cos(i2))*rf
dn = 0.5*len12*(sin(i1)*cos(a1)+sin(i2)*cos(a2))*rf
de = 0.5*len12*(sin(i1)*sin(a1)+sin(i2)*sin(a2))*rf
-
- #print dz, dn, de, i1,a1,i2,a2,dl,rf
return dz,dn,de
+
+cpdef __desurv1dh(int indbs,
+ int indes,
+ np.ndarray[double, ndim=1] ats,
+ np.ndarray[double, ndim=1] azs,
+ np.ndarray[double, ndim=1] dips,
+ float xc,
+ float yc,
+ float zc,
+ float lpt,
+ bint warns=True):
+
+ """__desurv1dh(int indbs, int indes, np.ndarray[double, ndim=1] ats, np.ndarray[double, ndim=1] azs, np.ndarray[double, ndim=1] dips, float xc, float yc, float zc, float lpt, bint warns=True)
+ Desurveys one point with minimum curvature given survey array
+ and collar coordinates
-cpdef __dstangential( float len12,
- float azm1,
- float dip1):
-
- """__dstangential( float len12, float azm1, float dip1)
-
- Desurveys one interval with tangential method
+ It takes an array of survey points ``ats, azs, dips`` with a given
+ drillhole starting and ending at index ``indbs,indes``, the
+ coordinates of the collar xc, xy, zc and derurvey a point at depth
+ ``lpt`` (any point at interval table, ex. a FROM interval in assay).
+
+ Warning
+ --------
+ The survey may have ats==0 at index indbs but this is not
+ checked at this function.
- Given a line with length ``len12`` and endpoints p1,p2 with
- direction angle ``azm1, dip1``, this function returns
- the differences in coordinate ``dz,dn,de`` of p2, assuming
- p1 with coordinates (0,0,0)
Parameters
----------
- len12,azm1,dip1: float
+ len12,azm1,dip1,azm2,dip2: float
len12 is the length between a point 1 and a point 2.
- azm1, dip1, are direction angle azimuth, with 0 or
- 360 pointing north and dip angle measured from horizontal
+ azm1, dip1, azm2, dip2 are direction angles azimuth, with 0 or
+ 360 pointing north and dip angles measured from horizontal
surface positive downward. All these angles are in degrees.
-
-
+
+
Returns
-------
- out : tuple of floats, ``(dz,dn,de)``
- Differences in elevation, north coordinate (or y) and
- east coordinate (or x) in a Euclidean coordinate system.
+ out : tuple of floats, ``(azt,dipt,xt,yt,zt)``
+ Direction angles and coordinates at a point lpt
-
+ Example
+ -------
+ >>>
+ >>> azt,dipt,xt,yt,zt = __desurv1dh(indbs,
+ indes,
+ ats,
+ azs,
+ dips,
+ xc,
+ yc,
+ zc,
+ lpt,
+ warns=True)
+ >>>
+
See Also
--------
- ang2cart
- __dsmincurb
-
+ Drillhole.desurvey
Note
-----
- The equations were derived from the paper
-
- `http://www.cgg.com/data//1/rec_docs/2269_MinimumCurvatureWellPaths.pdf`
-
- The tangential method has limitations but the error may be small
- for short intervals with direction angles interpolated from two
- desurvey points.
-
-
+ This function is a convenience function call by Drillhole.desurvey
+ it was exposed here for validation purpose.
+
"""
-
- # output
- cdef:
- float dz
- float dn
- float de
-
-
- # internal
- cdef:
- float i1
- float a1
- float DEG2RAD = 3.141592654/180.0
-
-
- i1 = (90 - dip1) * DEG2RAD
- a1 = azm1 * DEG2RAD
-
-
- dz = len12*cos(i1)
- dn = len12*sin(i1)*cos(a1)
- de = len12*sin(i1)*sin(a1)
-
- return dz,dn,de
-
-cpdef __angleson1dh(int indbs,
- int indes,
- np.ndarray[double, ndim=1] ats,
- np.ndarray[double, ndim=1] azs,
- np.ndarray[double, ndim=1] dips,
- float lpt,
- bint warns=True):
-
# output (angles at begin, mid and end interval)
cdef:
float azt
float dipt
+ float xt
+ float yt
+ float zt
# internal
cdef:
@@ -475,15 +463,20 @@ cpdef __angleson1dh(int indbs,
float len12
float d1
float EPSLON=1.0e-4
+ float xa
+ float ya
+ float za
+ float xb
+ float yb
+ float zb
+ float dz
+ float dn
+ float de
assert ats[indbs]<EPSLON, 'first survey > 0 at %d' % indbs
-
- # for each point on desurvey
for i in range (indbs,indes):
-
-
# get the segment [a-b] to test interval
a=ats[i]
b=ats[i+1]
@@ -492,33 +485,67 @@ cpdef __angleson1dh(int indbs,
azm2 = azs[i+1]
dip2 = dips[i+1]
len12 = ats[i+1]-ats[i]
-
-
+ # desurvey at survey table
+ if ats[i]>=-EPSLON and ats[i]<=EPSLON: #zero interval?
+ xa = xc
+ ya = yc
+ za = zc
+ # desurvey interval at survey... table
+
+ dz,dn,de = __dsmincurb(len12,azm1,dip1,azm2,dip2)
+
+ xb = xa+de
+ yb = ya+dn
+ zb = za-dz
+
+ else:
+ xa = xb
+ ya = yb
+ za = zb
+ # desurvey interval at zurvey... table
+
+ dz,dn,de = __dsmincurb(len12,azm1,dip1,azm2,dip2)
+ xb = xa+de
+ yb = ya+dn
+ zb = za-dz
+
# test if we are in the interval, interpolate angles
- if lpt>=a and lpt<b:
+ if lpt>=a and lpt<b:
d1= lpt- a
azt,dipt = interp_ang1D(azm1,dip1,azm2,dip2,len12,d1)
-
- return azt, dipt
+
+ # desurvey at interval table
+ dz,dn,de = __dsmincurb(d1,azm1,dip1,azt,dipt)
+
+ xt = xa+de
+ yt = ya+dn
+ zt = za-dz
+
+ return azt, dipt, xt, yt, zt
- # no interva detected, we must be beyond the last survey!
a=ats[indes]
- azt = azs[indes]
- dipt = dips[indes]
+ azm1 = azs[indes]
+ dip1 = dips[indes]
+ azt = azm1
+ dipt = dip1
# the point is beyond the last survey?
if lpt>=a:
+ d1= lpt- a
+ # desurvey at interval table
+ dz,dn,de = __dsmincurb(d1,azm1,dip1,azt,dipt)
+ xt = xb+de
+ yt = yb+dn
+ zt = zb-dz
- return azt, dipt
-
if warns==True:
warnings.warn('\n point beyond the last survey point at %s' % indes)
else:
if warns==True:
warnings.warn('\n not interval found at survey, at %s' % indes)
- return np.nan, np.nan
+ return azt, dipt, xt, yt, zt
#-------------------------------------------------------------------
@@ -704,7 +731,7 @@ cdef __min_int(double la,
Given two complete drillholes A, B (no gaps and up to the end of
the drillhole), this function returns the smaller of two
intervals la = FromA[ia] lb = FromB[ib] and updates the
- indices ia and ib. There are three possible outcomes
+ indices ia and ib. There are three posible outcomes
- FromA[ia] == FromB[ib]+/- tol. Returns mean of FromA[ia], FromB[ib] and ia+1, ib+1
- FromA[ia] < FromB[ib]. Returns FromA[ia] and ia+1, ib
@@ -745,7 +772,7 @@ cdef __merge_one_dhole(double[:] la,
Note
----
- - Full drillhole is required (no gaps) and note that lengths are used
+ - Full drillhole is required (no gaps) and note that length are used
instead From-To.
- The length at the end of the drillhole must be the same
@@ -819,7 +846,7 @@ cdef __fillgap1Dhole(double[:] in_f,
Parameters
----------
in_f,in_t,id: from, to intervals and interval ID.
- The interval ID is required to link back sample values after
+ The insterval ID is required to link back sample values after
adding gaps
tol: default 0.01. Tolerance
gaps and overlaps <= tolerance will be ignored
@@ -928,7 +955,7 @@ cdef __fillgap1Dhole(double[:] in_f,
# large overlap?
else:
#whe discard next interval by making it 0 length interval
- # this will happen only in unsorted array...
+ # this will happend only in unsorted array...
noverlap+=1
overlap[noverlap]=id[i]
# update to keep consistency in next loopondh
@@ -1231,7 +1258,7 @@ cdef class Drillhole:
Note
----
- You may run this validation before doing desurvey
- - Only few validation tests are implemented
+ - Only few validation test are implemented
- Validation errors will raise a python error
TODO
@@ -1310,7 +1337,7 @@ cdef class Drillhole:
self.survey.sort_values(by=['BHID','AT'], inplace=True)
error = self.__checkAt0(self.survey['BHID'].values, self.survey['AT'].values)
if error>-1:
- raise NameError('Firts interval AT!=0 at survey table, position %d' %error)
+ raise NameError('Firts inteval AT!=0 at survey table, positiom %d' %error)
#check survey with only one survey occurrence per drillholes: this produces error in desurvey
for i in self.survey['BHID'].unique():
@@ -1338,7 +1365,7 @@ cdef class Drillhole:
cdef __checkAt0(self,np.ndarray BHID, np.ndarray[double, ndim=1] AT):
"""
- This function checks if the first interval is approximately zero
+ This function checks if the first interval is approximatelly zero
"""
# this is a hide function
# the input data is assumed sorted
@@ -1569,7 +1596,7 @@ cdef class Drillhole:
cpdef desurvey(self, str table_name, bint endpoints=False,
- bint warns=True, int method=1):
+ bint warns=True):
"""desurvey(str table_name, bint endpoints=False, bint warns=True)
Desurvey a drillhole table.
@@ -1582,14 +1609,7 @@ cdef class Drillhole:
Parameters
----------
table_name : str
- a table name existing in drillhole object
- endpoints : boolean, optional, default False
- if True coordinates at beginning and end intervals are also created
- warns : boolean, optional, default True
- if True warns will be raised if inconsistencies are detected
- method : int, optional, default 1 (minimum curvature)
- the desurvey method: 1 is minimum curvature and 2 is tangential
-
+ endpoints : boolean
Examples
--------
@@ -1598,7 +1618,7 @@ cdef class Drillhole:
>>> mydrillhole.survey.sort(['BHID', 'AT'], inplace=True)
>>> mydrillhole.table['assay'].sort(['BHID', 'FROM'], inplace=True)
>>> # desurvey
- >>> mydrillhole.desurvey('assay', endpoints=True, method=1)
+ >>> mydrillhole.desurvey('assay', endpoints=True)
>>>
Note
@@ -1607,26 +1627,16 @@ cdef class Drillhole:
If you call the function with `endpoints=False` end points already
desurveyed may not be overwritten.
- This function calls __dsmincurb() and __desurv1dh() or
- __dstangential() functions to calculate the desurvey value.
-
- Both desurvey methods (tangential and minimum curvature) use
- angles interpolated from two desurvey points at Survey table.
+ This function calls __dsmincurb() and __desurv1dh() functions to
+ calculate the desurvey value.
"""
- # check the input is correct
- assert table_name in self.table, "table %s not exist" % table_name
- assert method==1 or method==2, " invalid parameter method=%, valid inputs are 1 or 2 " % method
-
- # sort tables
- self.collar.sort_values(by=['BHID'], inplace=True)
- self.survey.sort_values(by=['BHID', 'AT'], inplace=True)
- self.table[table_name].sort_values(by=['BHID', 'FROM'], inplace=True)
+ #check the input is correct
+ assert table_name in self.table, "table %s not exist" % table_name
- # define arrays
cdef idc = self.collar['BHID'].values
cdef np.ndarray[double, ndim=1] xc = self.collar['XCOLLAR'].values
cdef np.ndarray[double, ndim=1] yc = self.collar['YCOLLAR'].values
@@ -1652,19 +1662,8 @@ cdef class Drillhole:
cdef int indet
cdef int inds,
cdef int indt
- cdef double mid
- cdef double de
- cdef double dn
- cdef double dz
- cdef double x
- cdef double y
- cdef double z
- cdef double azm1
- cdef double azm2
- cdef double dip1
- cdef double dip2
- cdef double at
-
+ cdef float mid
+
# otput
cdef np.ndarray[double, ndim=1] azmt = np.empty([nt], dtype=float)
cdef np.ndarray[double, ndim=1] dipmt = np.empty([nt], dtype=float)
@@ -1674,13 +1673,10 @@ cdef class Drillhole:
#if endpoints==true:
- cdef np.ndarray[double, ndim=1] azbt = np.empty([nt], dtype=float)
- cdef np.ndarray[double, ndim=1] dipbt = np.empty([nt], dtype=float)
+ cdef float tmpaz, tmpdip
cdef np.ndarray[double, ndim=1] xbt = np.empty([nt], dtype=float)
cdef np.ndarray[double, ndim=1] ybt = np.empty([nt], dtype=float)
cdef np.ndarray[double, ndim=1] zbt = np.empty([nt], dtype=float)
- cdef np.ndarray[double, ndim=1] azet = np.empty([nt], dtype=float)
- cdef np.ndarray[double, ndim=1] dipet = np.empty([nt], dtype=float)
cdef np.ndarray[double, ndim=1] xet = np.empty([nt], dtype=float)
cdef np.ndarray[double, ndim=1] yet = np.empty([nt], dtype=float)
cdef np.ndarray[double, ndim=1] zet = np.empty([nt], dtype=float)
@@ -1688,10 +1684,6 @@ cdef class Drillhole:
# initialize output to nans
azmt[:] = np.nan
dipmt[:] = np.nan
- azbt[:] = np.nan
- dipbt[:] = np.nan
- azet[:] = np.nan
- dipet[:] = np.nan
xmt[:] = np.nan
ymt[:] = np.nan
zmt[:] = np.nan
@@ -1701,16 +1693,12 @@ cdef class Drillhole:
xet[:] = np.nan
yet[:] = np.nan
zet[:] = np.nan
-
-
- # first pass calculate angles and de,dn,dz
indbt = 0
indet = 0
inds = 0
indt = 0
for jc in range(nc): # for each collar
-
indbs = -1
indes = -1
# get first index of the collar jc in survey
@@ -1730,161 +1718,63 @@ cdef class Drillhole:
inds = js
indes = js
- # if survey not found then skip this drillhole
+ # this is not working but check included in validation
if indbs==-1 or indes==-1:
# do not desurvey this drillhole
warnings.warn('! collar {} without survey, table not desurveyed'.format(idc[jc]))
continue
-
- # angles over 1st desurvey point == collar
- azm1 = azs[indbs]
- dip1 = dips[indbs]
- at = 0.
-
-
- # TODO: remove this and allow desurvey with only one record
-
- # if only one survey points then skip this dillhole
+ # this is not working but check included in validation
if indbs==indes:
# do not desurvey this drillhole
warnings.warn('! collar {} without survey at end collar, table not desurveyed'.format(idc[jc]))
continue
- # initialize coordinates
- x = xc[jc]
- y = yc[jc]
- z = zc[jc]
- # for each point in the table
+ # with the index indbs and indes we desurvey each collar
for jt in range(indt, nt):
# the table id is similar to collar? Then desurvey
-
-
+
if idc[jc]==idt[jt]:
-
+ #desurvey this point
indt = jt # do not loop again before this index
- # a) beginning interval
- azm2,dip2 = __angleson1dh(indbs,indes,ats,azs,dips,fromt[jt],warns)
- azbt[jt] = azm2
- dipbt[jt] = dip2
- len12 = float(fromt[jt]) - at
-
- if method == 1 :
- dz,dn,de = __dsmincurb(len12,azm1,dip1,azm2,dip2)
- elif method == 2 :
- dz,dn,de = __dstangential(len12,azm1,dip1)
-
- xbt[jt] = de
- ybt[jt] = dn
- zbt[jt] = dz
-
-
- # update for next interval
- azm1 = azm2
- dip1 = dip2
- at = float(fromt[jt])
-
-
- # b) mid interv
-
- mid = float(fromt[jt]) + float(tot[jt]-fromt[jt])/2.
-
- azm2, dip2 = __angleson1dh(indbs,indes,ats,azs,dips,mid,warns)
- azmt[jt] = azm2
- dipmt[jt]= dip2
- len12 = mid - at
-
- if method == 1 :
- dz,dn,de = __dsmincurb(len12,azm1,dip1,azm2,dip2)
- elif method == 2 :
- dz,dn,de = __dstangential(len12,azm1,dip1)
-
- xmt[jt] = de + xbt[jt]
- ymt[jt] = dn + ybt[jt]
- zmt[jt] = dz + zbt[jt]
-
- # update for next interval
- azm1 = azm2
- dip1 = dip2
- at = mid
+ # desurvey mid interv
+ mid = fromt[jt] + (tot[jt]-fromt[jt])/2.
- # c) end interval
+ azmt[jt],dipmt[jt],xmt[jt],ymt[jt],zmt[jt] = \
+ __desurv1dh(indbs,indes,ats,azs,dips,xc[jc],yc[jc],zc[jc],mid,warns)
- azm2, dip2 = __angleson1dh(indbs,indes,ats,azs,dips,float(tot[jt]),warns)
- azet[jt] = azm2
- dipet[jt] = dip2
- len12 = float(tot[jt]) - at
-
- if method == 1 :
- dz,dn,de = __dsmincurb(len12,azm1,dip1,azm2,dip2)
- elif method == 2 :
- dz,dn,de = __dstangential(len12,azm1,dip1)
-
- xet[jt] = de + xmt[jt]
- yet[jt] = dn + ymt[jt]
- zet[jt] = dz + zmt[jt]
-
- # update for next interval
- azm1 = azm2
- dip1 = dip2
- at = float(tot[jt])
-
-
- # now we calculate coordinates
- xbt[jt] = x+float(xbt[jt])
- ybt[jt] = y+float(ybt[jt])
- zbt[jt] = z-float(zbt[jt])
- xmt[jt] = x+float(xmt[jt])
- ymt[jt] = y+float(ymt[jt])
- zmt[jt] = z-float(zmt[jt])
- xet[jt] = x+float(xet[jt])
- yet[jt] = y+float(yet[jt])
- zet[jt] = z-float(zet[jt])
-
- #print jt, xbt[jt],ybt[jt],zbt[jt]
- #print jt, xmt[jt],ymt[jt],zmt[jt]
- #print jt, xet[jt],yet[jt],zet[jt]
-
- # update for next interval
- x = xet[jt]
- y = yet[jt]
- z = zet[jt]
-
-
- self.table[table_name]['azmm'] = azmt
+ if endpoints==True:
+ tmpaz,tmpdip,xbt[jt],ybt[jt],zbt[jt] = \
+ __desurv1dh(indbs,indes,ats,azs,dips,xc[jc],yc[jc],zc[jc],fromt[jt],warns)
+
+ tmpaz,tmpdip,xet[jt],yet[jt],zet[jt] = \
+ __desurv1dh(indbs,indes,ats,azs,dips,xc[jc],yc[jc],zc[jc],tot[jt],warns)
+
+
+ self.table[table_name]['azm'] = azmt
self.table[table_name]['dipm']= dipmt
self.table[table_name]['xm']= xmt
self.table[table_name]['ym']= ymt
self.table[table_name]['zm']= zmt
if endpoints==True:
- self.table[table_name]['azmb'] = azbt
- self.table[table_name]['dipb']= dipbt
self.table[table_name]['xb']= xbt
self.table[table_name]['yb']= ybt
self.table[table_name]['zb']= zbt
- self.table[table_name]['azme'] = azet
- self.table[table_name]['dipe']= dipet
self.table[table_name]['xe']= xet
self.table[table_name]['ye']= yet
self.table[table_name]['ze']= zet
-
# this is to produce a warning if some intervals where not desurvey
try:
- assert np.isfinite(self.table[table_name]['xm'].values).all(), "nofinite coordinates at xb, please filter out nonfinite coordinates and try again"
+ assert np.isfinite(self.table[table_name]['xm'].values).all(), "no finite coordinates at xb, please filter out non finite coordinates and try again"
except:
warnings.warn('Some intervals where non-desurveyed and NAN coordinates where created, check errors in collar or survey')
-
-
-
-
-
#-------------------------------------------------------------------
# Table gap, compositing and merging
#-------------------------------------------------------------------
@@ -2611,12 +2501,12 @@ cdef class Drillhole:
# this will work if all coordinates defined
- assert np.isfinite(self.table[table_name]['xb'].values).all(), "no finite coordinates at xb, please filter out nonfinite coordinates and try again"
- assert np.isfinite(self.table[table_name]['yb'].values).all(), "no finite coordinates at yb, please filter out nonfinite coordinates and try again"
- assert np.isfinite(self.table[table_name]['zb'].values).all(), "no finite coordinates at zb, please filter out nonfinite coordinates and try again"
- assert np.isfinite(self.table[table_name]['xe'].values).all(), "no finite coordinates at xe, please filter out nonfinite coordinates and try again"
- assert np.isfinite(self.table[table_name]['ye'].values).all(), "no finite coordinates at ye, please filter out nonfinite coordinates and try again"
- assert np.isfinite(self.table[table_name]['ze'].values).all(), "no finite coordinates at ze, please filter out nonfinite coordinates and try again"
+ assert np.isfinite(self.table[table_name]['xb'].values).all(), "no finite coordinates at xb, please filter out non finite coordinates and try again"
+ assert np.isfinite(self.table[table_name]['yb'].values).all(), "no finite coordinates at yb, please filter out non finite coordinates and try again"
+ assert np.isfinite(self.table[table_name]['zb'].values).all(), "no finite coordinates at zb, please filter out non finite coordinates and try again"
+ assert np.isfinite(self.table[table_name]['xe'].values).all(), "no finite coordinates at xe, please filter out non finite coordinates and try again"
+ assert np.isfinite(self.table[table_name]['ye'].values).all(), "no finite coordinates at ye, please filter out non finite coordinates and try again"
+ assert np.isfinite(self.table[table_name]['ze'].values).all(), "no finite coordinates at ze, please filter out non finite coordinates and try again"
#create array views
xb = self.table[table_name]['xb'].values
@@ -2653,7 +2543,7 @@ cdef class Drillhole:
ye = self.table[table_name]['ye'].values
ze = self.table[table_name]['ze'].values
- # if ther are undefined values at yb,zb, xe,ye,ze the output will be wrong, here we check this
+ # if ther are undefined values at yb,zb, xe,ye,ze the output will be wrong, here whe check this
assert np.isfinite(self.table[table_name]['xb'].values).all(), "no finite coordinates at xb after nan at xm,ym,zm removed"
assert np.isfinite(self.table[table_name]['yb'].values).all(), "no finite coordinates at yb after nan at xm,ym,zm removed"
assert np.isfinite(self.table[table_name]['zb'].values).all(), "no finite coordinates at zb after nan at xm,ym,zm removed"
diff --git a/doc/source/Tutorial.rst b/doc/source/Tutorial.rst
index c80caa7..cfd2493 100644
--- a/doc/source/Tutorial.rst
+++ b/doc/source/Tutorial.rst
@@ -439,8 +439,8 @@ create those blocks you may:
- create a block model object ``pygslib.blockmodel.Blockmodel``
- fill the mineralized domain with blocks
-In PyGSLIB we use percent blocks, similar to GEMS. In the future we
-will implement subcell style, similar to Surpac, using Adaptive Mesh
+In PyGSLIB we use percent blocks, similar to GEMS ®. In the future we
+will implement subcell style, similar to Surpac ®, using Adaptive Mesh
Refinement (AMR).
Blocks are stored in the class member ``bmtable``, this is a Pandas
@@ -454,7 +454,7 @@ Only one table will be available in a block model object.
The block model definition is stored in the members
``nx, ny, nz, xorg, yorg, zorg, dx, dy, dz``. The origin
``xorg, yorg, zorg`` refers to the lower left corner of the lower left
-block (not the centroid), like in Datamine Studio.
+block (not the centroid), like in Datamine Studio ®.
.. code:: python
@@ -511,7 +511,7 @@ Some basic stats
You may spend some time doing exploratory data analysis, looking at
statistical plots, 3D views and 2D sections of your data. A good
comersial software for this is `Supervisor
-<http://opengeostat.com/software-solutions/>`__, open source options
+® <http://opengeostat.com/software-solutions/>`__, open source options
are Pandas, `Statsmodels <http://statsmodels.sourceforge.net/>`__,
`Seaborn <https://stanford.edu/~mwaskom/software/seaborn/>`__ and
`glueviz <http://glueviz.org/en/stable/>`__.
@@ -687,7 +687,7 @@ output will be correct but the running time may be longer.
The variogram model was modeled with `Supervisor
-<http://opengeostat.com/software-solutions/>`__.
+® <http://opengeostat.com/software-solutions/>`__.
.. figure:: Tutorial_files/figure5.JPG
:alt: Variograms
@@ -792,7 +792,7 @@ validations you can use Paraview, for example:
The swath plots and the global change of support were calculated with
-`Supervisor <http://opengeostat.com/software-solutions/>`__. These
+`Supervisor ® <http://opengeostat.com/software-solutions/>`__. These
validation tests show that the model is not good enough.
To fix the estimate you can rerun this Ipython Notebook after changing
diff --git a/doc/source/index.rst b/doc/source/index.rst
index f173c79..5612b25 100644
--- a/doc/source/index.rst
+++ b/doc/source/index.rst
@@ -7,7 +7,7 @@ Welcome to PyGSLIB documentation!
=================================================
PyGSLIB is an open source python package designed to do Mineral Resource Estimations with scripts.
-It was inspired by Datamine Studio macros. Its philosophy is reproducibility and auditability.
+It was inspired by Datamine Studio ® macros. Its philosophy is reproducibility and auditability.
With PyGSLIB you can write a script to do the entire resource estimate process,
from reading drillhole tables to estimation and validation.
You can rerun the entire script with different parameters until you get the desired output,
diff --git a/pygslib_conda/pygslib_Linux64/meta.yaml b/pygslib_conda/pygslib_Linux64/meta.yaml
index 68001ee..ca9a748 100755
--- a/pygslib_conda/pygslib_Linux64/meta.yaml
+++ b/pygslib_conda/pygslib_Linux64/meta.yaml
@@ -1,11 +1,30 @@
-
+# TODO: Remove constraint scipy 0.16 after Anaconda get fixed the isue with libgfortran3
package:
name: pygslib
- version: "0.0.0.3.8.3"
+ version: "0.0.0.3.8.2"
source:
- path: ../../
+ path: /home/adrian/bitbucket/public/pygslib
+
+# patches:
+ # List any patch files here
+ # - fix.patch
+
+# build:
+ # noarch_python: True
+ # preserve_egg_dir: True
+ # entry_points:
+ # Put any entry points (scripts to be generated automatically) here. The
+ # syntax is module:function. For example
+ #
+ # - pygslib = pygslib:main
+ #
+ # Would create an entry point called pygslib that calls pygslib.main()
+
+ # If this is a new build for the same version, increment the build
+ # number. If you do not include this key, it defaults to 0.
+ # number: 1
requirements:
build:
@@ -14,19 +33,19 @@ requirements:
- numpy
- pandas
- matplotlib
- - scipy
- - libgfortran
+ - scipy 0.16.0
+ - libgfortran 1.0
run:
- python
- numpy
- pandas
- matplotlib
- - scipy
+ - scipy 0.16.0
- vtk
- ipython
- pyevtk
- - libgfortran
+ - libgfortran 1.0
test:
# Python imports
@@ -47,8 +66,8 @@ test:
- nose
- numpy
- pandas >=0.17
- - scipy
- - libgfortran
+ - scipy 0.16.0
+ - libgfortran 1.0
# Put any additional test requirements here. For example
# - nose
diff --git a/pygslib_conda/pygslib_OSX/build.sh b/pygslib_conda/pygslib_OSX/build.sh
deleted file mode 100644
index 8d6b2d1..0000000
--- a/pygslib_conda/pygslib_OSX/build.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-
-conda config --add channels https://conda.anaconda.org/opengeostat
-
-# this is to fix error in conda build... see https://github.com/numpy/numpy/issues/7427
-LDFLAGS="$LDFLAGS -undefined dynamic_lookup -bundle"
-
-$PYTHON setup.py install
-
-# Add more build steps here, if they are necessary.
-
-# See
-# http://docs.continuum.io/conda/build.html
-# for a list of environment variables that are set during the build process.
diff --git a/pygslib_conda/pygslib_OSX/meta.yaml b/pygslib_conda/pygslib_OSX/meta.yaml
deleted file mode 100644
index 21cfa36..0000000
--- a/pygslib_conda/pygslib_OSX/meta.yaml
+++ /dev/null
@@ -1,58 +0,0 @@
-
-package:
- name: pygslib
- version: "0.0.0.3.8.3"
-
-source:
- path: ../../
-
-requirements:
- build:
- - python
- - setuptools
- - numpy
- - pandas
- - matplotlib
- - scipy
-
- run:
- - python
- - numpy
- - pandas
- - matplotlib
- - scipy
- - vtk
- - ipython
- - pyevtk
-
-test:
- # Python imports
- #imports:
- # - pygslib
-
- # commands:
- # You can put test commands to be run here. Use this to test that the
- # entry points work.
-
-
- # You can also put a file called run_test.py in the recipe that will be run
- # at test time.
-
- requires:
- - matplotlib
- - mock
- - nose
- - numpy
- - pandas >=0.17
- - scipy
- # Put any additional test requirements here. For example
- # - nose
-
-about:
- home: https://github.com/opengeostat/pygslib
- license: MIT License
- summary: 'Python wrap of GSLIB modified code and general geostatistical package'
-
-# See
-# http://docs.continuum.io/conda/build.html for
-# more information about meta.yaml
diff --git a/setup.py b/setup.py
index 294abcb..82757ca 100644
--- a/setup.py
+++ b/setup.py
@@ -54,7 +54,7 @@ class PyTest(TestCommand):
2 for release candidate
3 for (final) release
"""
-version = '0.0.0.3.8.4'
+version = '0.0.0.3.8.3'
description = 'Python wrap of GSLIB modified code and general geostatistical package'
name='pygslib'
long_description=open("README.rst").read()