Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 4

!

START S ample selection

!let $dh#=holes_ddh
!let $ch#=holes_ch

!onerr goto FIN

!varload Ra_SelSamp.var,@merge=1

!prompt
0
0 Seleccion de Las Muestras
0 =========================
0
1 Archivo de Referencia Principal [$azref#].csv >'$azref#',a,20
0
1 Archivo de Referencia Subzones [$szref#].csv >'$szref#',a,20
0
1 Pantalla activado - Si(1) o No(0) [$scr#] >'$scr#',n,0,1

!varsave Ra_SelSamp.var

!if $scr#=0, then


!scroff
!endif

#
# Summary Reference
#
!inpfil &out(xxdd)
Ref list
RUN n y 0
CARPETA a 8 y ' '
AZONE a 8 y ' '
PROTO a 12 Y ' '
PLANE a 4 y ' '
SPLITS n y 0
RESOL n y 0
SPA a 12 Y ' '
DISC_X n y 0
DISC_Y n y 0
DISC_Z n y 0
DENSFILE a 12 Y ' '
DENSITY n y 0
PERIM a 12 y ' '
GRID_ANG n y 0
]
ok

!indata &in(XXdd),&out(xx)
$azref#.csv

!c &in(xx),&out(xxsum_ref),RUN>0.5

#
# Zone Reference
#
!inpfil &out(xxdd)
Ref list
AZONE a 8 y ' '
SUBZONE a 4 y ' '
WF A 36 y ' '
]
ok

!indata &in(XXdd),&out(xxzone_ref)
$szref#.csv

#
# Start Summary Loop
#
!c &in(xxsum_ref),&out(xxsumList)

!file $1#=xxsumlist,$numsum#=recs

!let $nsum#= 1

!SUMLOOP:field $1#=xxsumlist,$r#=$nsum#,$az#=AZONE
!field $1#=xxsumList,$r#=$nsum#,$car#=CARPETA

!gosub APP

!c &in(xxzone_ref),&out(xxzonList),AZONE='$az#'

!file $1#=xxzonlist,$numzon#=recs

!if $numzon#=0, then


!prompt
0
1 No hay SUBZONEs para el AZONE $az#
!gosub FIN
!endif

!let $nzon#= 1
!let $first#=0
!let $smi#=xxallsamp

!ZONLOOP:field $1#=xxzonlist,$r#=$nzon#,$zon#=AZONE

!field $1#=xxzonlist,$r#=$nzon#,$subz#=SUBZONE
!field $1#=xxzonlist,$r#=$nzon#,$wf#=WF

!gosub SEL
!let $nzon#=$nzon#+1
!if $nzon#<=$numzon#,goto ZONLOOP

!sort &in(xxselsamp),&out(xxs),
*key1(BHID),*key2(FROM)

!seldel &in(xxs),
&out($car#/samp_$az#),*f1(RECORDNO)

!extra &in(xxs),&out(xxse)
SELECT=1
GO

!selcop &in(xxse),&out(xxsc),*f1(BHID),*f2(FROM),*f3(SELECT)
!j &in1(xxallsamp),&in2(xxsc),&out(xxj),*key1(BHID),*key2(FROM)
!setval &in(xxj),&out(xxj),SELECT<0
SELECT
0
!extra &in(xxj),&out(xxtestsamp)
FLAG=0
if (SELECT==0 and next(SELECT)==1) FLAG=1 end
if (SELECT==1 and prev(SELECT)==0) FLAG=2 end
if (SELECT==1 and next(SELECT)==0) FLAG=2 end
if (SELECT==0 and prev(SELECT)==1) FLAG=1 end
go
!c &in(xxtestsamp),
&out($car#/contact_$az#),FLAG>0.5

!let $nsum#=$nsum#+1

!if $nsum#<=$numsum#,goto SUMLOOP

!if $scr#=0, then


!gosub PURGEX
!endif

!scron

!echo Hecho seleccion

!gosub FIN

!rem ==========================================================================
!APP:rem
!rem =========================================================================
#
# Append samples together
#
!extra &in($car#/$dh#),&out(xxdh)
STYPE;a4="DH"
go
!extra &in($car#/$ch#),&out(xxch)
STYPE;a4="CH"
BHNEW;a20=BHID
erase(BHID)
go
!e &in(xxch)
c
BHNEW
BHID
e
!a &in1(xxdh),&in2(xxch),&out(xx)
!sort &in(xx),&out(xxs),*key1(BHID),*key2(FROM)
!copynr &in(xxs),&out(xxallsamp)

!return

!rem ==========================================================================
!SEL:rem
!rem =========================================================================
!SELWF &IN($smi#),
&WIRETR($car#/$wf#tr),
&WIREPT($car#/$wf#pt),
&OUT(xxsel),*X(X),*Y(Y),*Z(Z),@SELECT=3.0,@EXCLUDE=0.0,
@TOLERANC=0.2

!extra &in(xxSEL),&out(xxsamp)
AZONE;a8="$zon#"
SUBZONE;a4="$subz#"
go

!sort &in(xxsamp),&out(xxs),*key1(RECORDNO)

!diffrn &in1($smi#),&in2(xxs),&out(xxremsamp),*key1(RECORDNO)

!let $smi#=xxremsamp

!if $first#=0, then


!c &in(xxsamp),&out(xxselsamp)
!let $first#=1
!else
!a &in1(xxselsamp),&in2(xxsamp),&out(xxselsamp)
!endif

!echo Done $car# $wf#

!return

# =============================================================================
!PURGEX:rem Borrar archivos temporales:
# =============================================================================

!dir &out(xxcat),xx?
!del &in(xxcat)

!return

!FIN:end

You might also like