« lib/App/SeismicUnixGui/sunix/model/suspike.pm
↑ Summary
lib/App/SeismicUnixGui/sunix/transform/sucwt.pm »
| 1 | package App::SeismicUnixGui::sunix::statsMath::cpftrend; | ||
| 2 | |||
| 3 | =head2 SYNOPSIS | ||
| 4 | |||
| 5 | PERL PROGRAM NAME: | ||
| 6 | |||
| 7 | AUTHOR: Juan Lorenzo (Perl module only) | ||
| 8 | |||
| 9 | DATE: | ||
| 10 | |||
| 11 | DESCRIPTION: | ||
| 12 | |||
| 13 | Version: | ||
| 14 | |||
| 15 | =head2 USE | ||
| 16 | |||
| 17 | =head3 NOTES | ||
| 18 | |||
| 19 | =head4 Examples | ||
| 20 | |||
| 21 | =head2 SYNOPSIS | ||
| 22 | |||
| 23 | =head3 SEISMIC UNIX NOTES | ||
| 24 | char* sdoc[] = { | ||
| 25 | |||
| 26 | |||
| 27 | |||
| 28 | CPFTREND - generate picks of the Cumulate Probability Function | ||
| 29 | |||
| 30 | |||
| 31 | |||
| 32 | Required parameters: | ||
| 33 | |||
| 34 | ix= - column containing X variable | ||
| 35 | |||
| 36 | iy= - column containing Y variable | ||
| 37 | |||
| 38 | min_x= - minimum X bin | ||
| 39 | |||
| 40 | max_x= - maximum X bin | ||
| 41 | |||
| 42 | min_y= - minimum Y bin | ||
| 43 | |||
| 44 | max_y= - maximum Y bin | ||
| 45 | |||
| 46 | |||
| 47 | |||
| 48 | Optional parameters: | ||
| 49 | |||
| 50 | nx=100 - number of X bins | ||
| 51 | |||
| 52 | ny=100 - number of Y bins | ||
| 53 | |||
| 54 | logx=0 - =1 use logarithmic scale for X axis | ||
| 55 | |||
| 56 | logy=0 - =1 use logarithmic scale for Y axis | ||
| 57 | |||
| 58 | ir= - column containing reject variable | ||
| 59 | |||
| 60 | rmin= - reject values below rmin | ||
| 61 | |||
| 62 | rmax= - reject values above rmax | ||
| 63 | |||
| 64 | NOTE: only one, rmin or rmax, may be used | ||
| 65 | |||
| 66 | NOTES: | ||
| 67 | |||
| 68 | cpftrend makes picks on the 2D cumulate representing the | ||
| 69 | |||
| 70 | probability density function of the input data. | ||
| 71 | |||
| 72 | |||
| 73 | |||
| 74 | Commandline options allow selecting any of several normalizations | ||
| 75 | |||
| 76 | to apply to the distributions. | ||
| 77 | |||
| 78 | |||
| 79 | |||
| 80 | |||
| 81 | |||
| 82 | cpftrend(1) makes picks on the 2D cumulate representing the | ||
| 83 | |||
| 84 | probability density function of the input data. | ||
| 85 | |||
| 86 | |||
| 87 | |||
| 88 | Commandline options allow selecting any of several normalizations | ||
| 89 | |||
| 90 | to apply to the distributions. | ||
| 91 | |||
| 92 | |||
| 93 | |||
| 94 | Credits: Reginald H. Beardsley rhb@acm.org | ||
| 95 | |||
| 96 | Copyright 2006 Exploration Software Consultants Inc. | ||
| 97 | |||
| 98 | =head2 User's notes (Juan Lorenzo) | ||
| 99 | untested | ||
| 100 | |||
| 101 | =cut | ||
| 102 | |||
| 103 | |||
| 104 | =head2 CHANGES and their DATES | ||
| 105 | |||
| 106 | =cut | ||
| 107 | |||
| 108 | use Moose; | ||
| 109 | our $VERSION = '0.0.1'; | ||
| 110 | |||
| 111 | |||
| 112 | =head2 Import packages | ||
| 113 | |||
| 114 | =cut | ||
| 115 | |||
| 116 | use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants'; | ||
| 117 | use App::SeismicUnixGui::misc::SeismicUnix qw($go $in $off $on $out $ps $to $suffix_ascii $suffix_bin $suffix_ps $suffix_segy $suffix_su); | ||
| 118 | use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config'; | ||
| 119 | |||
| 120 | |||
| 121 | =head2 instantiation of packages | ||
| 122 | |||
| 123 | =cut | ||
| 124 | |||
| 125 | my $get = L_SU_global_constants->new(); | ||
| 126 | my $Project = Project_config->new(); | ||
| 127 | my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU(); | ||
| 128 | my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN(); | ||
| 129 | my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT(); | ||
| 130 | |||
| 131 | my $PS_SEISMIC = $Project->PS_SEISMIC(); | ||
| 132 | |||
| 133 | my $var = $get->var(); | ||
| 134 | my $on = $var->{_on}; | ||
| 135 | my $off = $var->{_off}; | ||
| 136 | my $true = $var->{_true}; | ||
| 137 | my $false = $var->{_false}; | ||
| 138 | my $empty_string = $var->{_empty_string}; | ||
| 139 | |||
| 140 | =head2 Encapsulated | ||
| 141 | hash of private variables | ||
| 142 | |||
| 143 | =cut | ||
| 144 | |||
| 145 | my $cpftrend = { | ||
| 146 | _ir => '', | ||
| 147 | _ix => '', | ||
| 148 | _iy => '', | ||
| 149 | _logx => '', | ||
| 150 | _logy => '', | ||
| 151 | _max_x => '', | ||
| 152 | _max_y => '', | ||
| 153 | _min_x => '', | ||
| 154 | _min_y => '', | ||
| 155 | _nx => '', | ||
| 156 | _ny => '', | ||
| 157 | _rmax => '', | ||
| 158 | _rmin => '', | ||
| 159 | _Step => '', | ||
| 160 | _note => '', | ||
| 161 | |||
| 162 | }; | ||
| 163 | |||
| 164 | =head2 sub Step | ||
| 165 | |||
| 166 | collects switches and assembles bash instructions | ||
| 167 | by adding the program name | ||
| 168 | |||
| 169 | =cut | ||
| 170 | |||
| 171 | sub Step { | ||
| 172 | |||
| 173 | $cpftrend->{_Step} = 'cpftrend'.$cpftrend->{_Step}; | ||
| 174 | return ( $cpftrend->{_Step} ); | ||
| 175 | |||
| 176 | } | ||
| 177 | |||
| 178 | |||
| 179 | =head2 sub note | ||
| 180 | |||
| 181 | collects switches and assembles bash instructions | ||
| 182 | by adding the program name | ||
| 183 | |||
| 184 | =cut | ||
| 185 | |||
| 186 | sub note { | ||
| 187 | |||
| 188 | $cpftrend->{_note} = 'cpftrend'.$cpftrend->{_note}; | ||
| 189 | return ( $cpftrend->{_note} ); | ||
| 190 | |||
| 191 | } | ||
| 192 | |||
| 193 | |||
| 194 | |||
| 195 | =head2 sub clear | ||
| 196 | |||
| 197 | =cut | ||
| 198 | |||
| 199 | sub clear { | ||
| 200 | |||
| 201 | $cpftrend->{_ir} = ''; | ||
| 202 | $cpftrend->{_ix} = ''; | ||
| 203 | $cpftrend->{_iy} = ''; | ||
| 204 | $cpftrend->{_logx} = ''; | ||
| 205 | $cpftrend->{_logy} = ''; | ||
| 206 | $cpftrend->{_max_x} = ''; | ||
| 207 | $cpftrend->{_max_y} = ''; | ||
| 208 | $cpftrend->{_min_x} = ''; | ||
| 209 | $cpftrend->{_min_y} = ''; | ||
| 210 | $cpftrend->{_nx} = ''; | ||
| 211 | $cpftrend->{_ny} = ''; | ||
| 212 | $cpftrend->{_rmax} = ''; | ||
| 213 | $cpftrend->{_rmin} = ''; | ||
| 214 | $cpftrend->{_Step} = ''; | ||
| 215 | $cpftrend->{_note} = ''; | ||
| 216 | } | ||
| 217 | |||
| 218 | |||
| 219 | =head2 sub ir | ||
| 220 | |||
| 221 | |||
| 222 | =cut | ||
| 223 | |||
| 224 | sub ir { | ||
| 225 | |||
| 226 | my ( $self,$ir ) = @_; | ||
| 227 | if ( $ir ne $empty_string ) { | ||
| 228 | |||
| 229 | $cpftrend->{_ir} = $ir; | ||
| 230 | $cpftrend->{_note} = $cpftrend->{_note}.' ir='.$cpftrend->{_ir}; | ||
| 231 | $cpftrend->{_Step} = $cpftrend->{_Step}.' ir='.$cpftrend->{_ir}; | ||
| 232 | |||
| 233 | } else { | ||
| 234 | print("cpftrend, ir, missing ir,\n"); | ||
| 235 | } | ||
| 236 | } | ||
| 237 | |||
| 238 | |||
| 239 | =head2 sub ix | ||
| 240 | |||
| 241 | |||
| 242 | =cut | ||
| 243 | |||
| 244 | sub ix { | ||
| 245 | |||
| 246 | my ( $self,$ix ) = @_; | ||
| 247 | if ( $ix ne $empty_string ) { | ||
| 248 | |||
| 249 | $cpftrend->{_ix} = $ix; | ||
| 250 | $cpftrend->{_note} = $cpftrend->{_note}.' ix='.$cpftrend->{_ix}; | ||
| 251 | $cpftrend->{_Step} = $cpftrend->{_Step}.' ix='.$cpftrend->{_ix}; | ||
| 252 | |||
| 253 | } else { | ||
| 254 | print("cpftrend, ix, missing ix,\n"); | ||
| 255 | } | ||
| 256 | } | ||
| 257 | |||
| 258 | |||
| 259 | =head2 sub iy | ||
| 260 | |||
| 261 | |||
| 262 | =cut | ||
| 263 | |||
| 264 | sub iy { | ||
| 265 | |||
| 266 | my ( $self,$iy ) = @_; | ||
| 267 | if ( $iy ne $empty_string ) { | ||
| 268 | |||
| 269 | $cpftrend->{_iy} = $iy; | ||
| 270 | $cpftrend->{_note} = $cpftrend->{_note}.' iy='.$cpftrend->{_iy}; | ||
| 271 | $cpftrend->{_Step} = $cpftrend->{_Step}.' iy='.$cpftrend->{_iy}; | ||
| 272 | |||
| 273 | } else { | ||
| 274 | print("cpftrend, iy, missing iy,\n"); | ||
| 275 | } | ||
| 276 | } | ||
| 277 | |||
| 278 | |||
| 279 | =head2 sub logx | ||
| 280 | |||
| 281 | |||
| 282 | =cut | ||
| 283 | |||
| 284 | sub logx { | ||
| 285 | |||
| 286 | my ( $self,$logx ) = @_; | ||
| 287 | if ( $logx ne $empty_string ) { | ||
| 288 | |||
| 289 | $cpftrend->{_logx} = $logx; | ||
| 290 | $cpftrend->{_note} = $cpftrend->{_note}.' logx='.$cpftrend->{_logx}; | ||
| 291 | $cpftrend->{_Step} = $cpftrend->{_Step}.' logx='.$cpftrend->{_logx}; | ||
| 292 | |||
| 293 | } else { | ||
| 294 | print("cpftrend, logx, missing logx,\n"); | ||
| 295 | } | ||
| 296 | } | ||
| 297 | |||
| 298 | |||
| 299 | =head2 sub logy | ||
| 300 | |||
| 301 | |||
| 302 | =cut | ||
| 303 | |||
| 304 | sub logy { | ||
| 305 | |||
| 306 | my ( $self,$logy ) = @_; | ||
| 307 | if ( $logy ne $empty_string ) { | ||
| 308 | |||
| 309 | $cpftrend->{_logy} = $logy; | ||
| 310 | $cpftrend->{_note} = $cpftrend->{_note}.' logy='.$cpftrend->{_logy}; | ||
| 311 | $cpftrend->{_Step} = $cpftrend->{_Step}.' logy='.$cpftrend->{_logy}; | ||
| 312 | |||
| 313 | } else { | ||
| 314 | print("cpftrend, logy, missing logy,\n"); | ||
| 315 | } | ||
| 316 | } | ||
| 317 | |||
| 318 | |||
| 319 | =head2 sub max_x | ||
| 320 | |||
| 321 | |||
| 322 | =cut | ||
| 323 | |||
| 324 | sub max_x { | ||
| 325 | |||
| 326 | my ( $self,$max_x ) = @_; | ||
| 327 | if ( $max_x ne $empty_string ) { | ||
| 328 | |||
| 329 | $cpftrend->{_max_x} = $max_x; | ||
| 330 | $cpftrend->{_note} = $cpftrend->{_note}.' max_x='.$cpftrend->{_max_x}; | ||
| 331 | $cpftrend->{_Step} = $cpftrend->{_Step}.' max_x='.$cpftrend->{_max_x}; | ||
| 332 | |||
| 333 | } else { | ||
| 334 | print("cpftrend, max_x, missing max_x,\n"); | ||
| 335 | } | ||
| 336 | } | ||
| 337 | |||
| 338 | |||
| 339 | =head2 sub max_y | ||
| 340 | |||
| 341 | |||
| 342 | =cut | ||
| 343 | |||
| 344 | sub max_y { | ||
| 345 | |||
| 346 | my ( $self,$max_y ) = @_; | ||
| 347 | if ( $max_y ne $empty_string ) { | ||
| 348 | |||
| 349 | $cpftrend->{_max_y} = $max_y; | ||
| 350 | $cpftrend->{_note} = $cpftrend->{_note}.' max_y='.$cpftrend->{_max_y}; | ||
| 351 | $cpftrend->{_Step} = $cpftrend->{_Step}.' max_y='.$cpftrend->{_max_y}; | ||
| 352 | |||
| 353 | } else { | ||
| 354 | print("cpftrend, max_y, missing max_y,\n"); | ||
| 355 | } | ||
| 356 | } | ||
| 357 | |||
| 358 | |||
| 359 | =head2 sub min_x | ||
| 360 | |||
| 361 | |||
| 362 | =cut | ||
| 363 | |||
| 364 | sub min_x { | ||
| 365 | |||
| 366 | my ( $self,$min_x ) = @_; | ||
| 367 | if ( $min_x ne $empty_string ) { | ||
| 368 | |||
| 369 | $cpftrend->{_min_x} = $min_x; | ||
| 370 | $cpftrend->{_note} = $cpftrend->{_note}.' min_x='.$cpftrend->{_min_x}; | ||
| 371 | $cpftrend->{_Step} = $cpftrend->{_Step}.' min_x='.$cpftrend->{_min_x}; | ||
| 372 | |||
| 373 | } else { | ||
| 374 | print("cpftrend, min_x, missing min_x,\n"); | ||
| 375 | } | ||
| 376 | } | ||
| 377 | |||
| 378 | |||
| 379 | =head2 sub min_y | ||
| 380 | |||
| 381 | |||
| 382 | =cut | ||
| 383 | |||
| 384 | sub min_y { | ||
| 385 | |||
| 386 | my ( $self,$min_y ) = @_; | ||
| 387 | if ( $min_y ne $empty_string ) { | ||
| 388 | |||
| 389 | $cpftrend->{_min_y} = $min_y; | ||
| 390 | $cpftrend->{_note} = $cpftrend->{_note}.' min_y='.$cpftrend->{_min_y}; | ||
| 391 | $cpftrend->{_Step} = $cpftrend->{_Step}.' min_y='.$cpftrend->{_min_y}; | ||
| 392 | |||
| 393 | } else { | ||
| 394 | print("cpftrend, min_y, missing min_y,\n"); | ||
| 395 | } | ||
| 396 | } | ||
| 397 | |||
| 398 | |||
| 399 | =head2 sub nx | ||
| 400 | |||
| 401 | |||
| 402 | =cut | ||
| 403 | |||
| 404 | sub nx { | ||
| 405 | |||
| 406 | my ( $self,$nx ) = @_; | ||
| 407 | if ( $nx ne $empty_string ) { | ||
| 408 | |||
| 409 | $cpftrend->{_nx} = $nx; | ||
| 410 | $cpftrend->{_note} = $cpftrend->{_note}.' nx='.$cpftrend->{_nx}; | ||
| 411 | $cpftrend->{_Step} = $cpftrend->{_Step}.' nx='.$cpftrend->{_nx}; | ||
| 412 | |||
| 413 | } else { | ||
| 414 | print("cpftrend, nx, missing nx,\n"); | ||
| 415 | } | ||
| 416 | } | ||
| 417 | |||
| 418 | |||
| 419 | =head2 sub ny | ||
| 420 | |||
| 421 | |||
| 422 | =cut | ||
| 423 | |||
| 424 | sub ny { | ||
| 425 | |||
| 426 | my ( $self,$ny ) = @_; | ||
| 427 | if ( $ny ne $empty_string ) { | ||
| 428 | |||
| 429 | $cpftrend->{_ny} = $ny; | ||
| 430 | $cpftrend->{_note} = $cpftrend->{_note}.' ny='.$cpftrend->{_ny}; | ||
| 431 | $cpftrend->{_Step} = $cpftrend->{_Step}.' ny='.$cpftrend->{_ny}; | ||
| 432 | |||
| 433 | } else { | ||
| 434 | print("cpftrend, ny, missing ny,\n"); | ||
| 435 | } | ||
| 436 | } | ||
| 437 | |||
| 438 | |||
| 439 | =head2 sub rmax | ||
| 440 | |||
| 441 | |||
| 442 | =cut | ||
| 443 | |||
| 444 | sub rmax { | ||
| 445 | |||
| 446 | my ( $self,$rmax ) = @_; | ||
| 447 | if ( $rmax ne $empty_string ) { | ||
| 448 | |||
| 449 | $cpftrend->{_rmax} = $rmax; | ||
| 450 | $cpftrend->{_note} = $cpftrend->{_note}.' rmax='.$cpftrend->{_rmax}; | ||
| 451 | $cpftrend->{_Step} = $cpftrend->{_Step}.' rmax='.$cpftrend->{_rmax}; | ||
| 452 | |||
| 453 | } else { | ||
| 454 | print("cpftrend, rmax, missing rmax,\n"); | ||
| 455 | } | ||
| 456 | } | ||
| 457 | |||
| 458 | |||
| 459 | =head2 sub rmin | ||
| 460 | |||
| 461 | |||
| 462 | =cut | ||
| 463 | |||
| 464 | sub rmin { | ||
| 465 | |||
| 466 | my ( $self,$rmin ) = @_; | ||
| 467 | if ( $rmin ne $empty_string ) { | ||
| 468 | |||
| 469 | $cpftrend->{_rmin} = $rmin; | ||
| 470 | $cpftrend->{_note} = $cpftrend->{_note}.' rmin='.$cpftrend->{_rmin}; | ||
| 471 | $cpftrend->{_Step} = $cpftrend->{_Step}.' rmin='.$cpftrend->{_rmin}; | ||
| 472 | |||
| 473 | } else { | ||
| 474 | print("cpftrend, rmin, missing rmin,\n"); | ||
| 475 | } | ||
| 476 | } | ||
| 477 | |||
| 478 | |||
| 479 | =head2 sub get_max_index | ||
| 480 | |||
| 481 | max index = number of input variables -1 | ||
| 482 | |||
| 483 | =cut | ||
| 484 | |||
| 485 | sub get_max_index { | ||
| 486 | my ($self) = @_; | ||
| 487 | my $max_index = 12; | ||
| 488 | |||
| 489 | return($max_index); | ||
| 490 | } | ||
| 491 | |||
| 492 | |||
| 493 | 1; |