# ---------------------------------------------------------------------- # FindBoundsRecursively proc FindBoundsRecursively {lowerBoundName upperBoundName {noData -9.999000000e+003}} { upvar var var upvar 2 $lowerBoundName lowerBound upvar 2 $upperBoundName upperBound foreach x $var { if [string equal $noData $x] {continue} if {$x < $lowerBound} { set lowerBound $x } elseif {$x > $upperBound} { set upperBound $x } } return 0 } # FindBoundsRecursively - end # ---------------------------------------------------------------------- # FindBounds proc FindBounds {filePath resultRepository} { set argv 0 set initial [clock milliseconds] set filePath0 ../../../../../$resultRepository/doc/[file rootname [file tail $filePath]](bounds).txt file delete $filePath0 set contentType {} lappend contentType "date = [clock format [clock seconds] -format %Y-%m-%d]" lappend contentType "localtime = [clock format [clock seconds] -format %H:%M:%S]" lappend contentType "file path = $filePath" lappend contentType "action = FindBoundsRecursively" source ../../../../../urlib.net/www/2021/07.02.22.22/doc/GetSizeRecursively.tcl set lowerBound 1000000 set upperBound -1000000 set action {FindBoundsRecursively lowerBound upperBound} ProcessRecursively $filePath $action set final [clock milliseconds] lappend contentType [DisplayProcessingTime [expr $final - $initial]] lappend contentType "lowerBound = $lowerBound" lappend contentType "upperBound = $upperBound" set contentType [join $contentType \n] puts $contentType Store contentType $filePath0 } # FindBounds - end # ---------------------------------------------------------------------- if $argv { # usage examples console show source ../../../../../dpi.inpe.br/banon/1998/08.02.08.56/doc/utilities1.tcl ;# Store and StoreArray set imageDirectory ../../../../../urlib.net/www/2021/07.14.21.56/doc set resultRepository urlib.net/www/2021/07.14.21.56 set switchNumber 1 switch $switchNumber 1 { set filePath $imageDirectory/arquivo_masc-Teste_.txt ;# data } 2 { set filePath $imageDirectory/_masc_distCanaArAbertaAgua_MB2016F5x5_GRR.txt } 3 { set filePath $imageDirectory/MCP_masc-dist-agua-aberta-cana_GRR.txt ;# 69203 ms - -9.999000000e+003 161935.890625 } 4 { set filePath $imageDirectory/SP_masc-dist-agua-aberta-cana_GRR.txt ;# 30 mn and 41 s - -9.999000000e+003 325588.531250 } FindBounds $filePath $resultRepository } if 0 { file path = ../../../../../urlib.net/www/2021/07.14.21.56/doc/MCP_masc-dist-agua-aberta-cana_GRR.txt action = FindBoundsRecursively processing time = 1 mn and 36 s 0.000000 161935.890625 }