« lib/App/SeismicUnixGui/sunix/plot/suxcontour.pm
↑ Summary
lib/App/SeismicUnixGui/sunix/plot/suxpicker.pm »
| 1 | package App::SeismicUnixGui::sunix::plot::suxmax; | ||
| 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 | SUXMAX - X-windows graph of the MAX, min, or absolute max value on | ||
| 25 | |||
| 26 | each trace of a SEGY (SU) data set | ||
| 27 | |||
| 28 | |||
| 29 | |||
| 30 | suxmax <stdin [optional parameters] | ||
| 31 | |||
| 32 | |||
| 33 | |||
| 34 | Optional parameters: | ||
| 35 | |||
| 36 | mode=max max value | ||
| 37 | |||
| 38 | =min min value | ||
| 39 | |||
| 40 | =abs absolute max value | ||
| 41 | |||
| 42 | |||
| 43 | |||
| 44 | n2=tr.ntr or number of traces in the data set (ntr is an alias for n2) | ||
| 45 | |||
| 46 | |||
| 47 | |||
| 48 | d1=tr.d1 or tr.dt/10^6 sampling interval in the fast dimension | ||
| 49 | |||
| 50 | =.004 for seismic (if not set) | ||
| 51 | |||
| 52 | =1.0 for nonseismic (if not set) | ||
| 53 | |||
| 54 | |||
| 55 | |||
| 56 | d2=tr.d2 sampling interval in the slow dimension | ||
| 57 | |||
| 58 | =1.0 (if not set) | ||
| 59 | |||
| 60 | |||
| 61 | |||
| 62 | f1=tr.f1 or tr.delrt/10^3 or 0.0 first sample in the fast dimension | ||
| 63 | |||
| 64 | |||
| 65 | |||
| 66 | f2=tr.f2 or tr.tracr or tr.tracl first sample in the slow dimension | ||
| 67 | |||
| 68 | =1.0 for seismic (if not set) | ||
| 69 | |||
| 70 | =d2 for nonseismic (if not set) | ||
| 71 | |||
| 72 | |||
| 73 | |||
| 74 | verbose=0 =1 to print some useful information | ||
| 75 | |||
| 76 | |||
| 77 | |||
| 78 | tmpdir= if non-empty, use the value as a directory path | ||
| 79 | |||
| 80 | prefix for storing temporary files; else if the | ||
| 81 | |||
| 82 | the CWP_TMPDIR environment variable is set use | ||
| 83 | |||
| 84 | its value for the path; else use tmpfile() | ||
| 85 | |||
| 86 | |||
| 87 | |||
| 88 | Note that for seismic time domain data, the "fast dimension" is | ||
| 89 | |||
| 90 | time and the "slow dimension" is usually trace number or range. | ||
| 91 | |||
| 92 | Also note that "foreign" data tapes may have something unexpected | ||
| 93 | |||
| 94 | in the d2,f2 fields, use segyclean to clear these if you can afford | ||
| 95 | |||
| 96 | the processing time or use d2= f2= to over-ride the header values if | ||
| 97 | |||
| 98 | not. | ||
| 99 | |||
| 100 | |||
| 101 | |||
| 102 | See the sumax selfdoc for additional parameter. | ||
| 103 | |||
| 104 | See the xgraph selfdoc for the remaining parameters. | ||
| 105 | |||
| 106 | |||
| 107 | |||
| 108 | |||
| 109 | |||
| 110 | Credits: | ||
| 111 | |||
| 112 | |||
| 113 | |||
| 114 | CWP: John Stockwell, based on Jack Cohen's SU JACKet | ||
| 115 | |||
| 116 | |||
| 117 | |||
| 118 | Notes: | ||
| 119 | |||
| 120 | When the number of traces isn't known, we need to count | ||
| 121 | |||
| 122 | the traces for xgraph. You can make this value "known" | ||
| 123 | |||
| 124 | either by getparring n2 or by having the ntr field set | ||
| 125 | |||
| 126 | in the trace header. A getparred value takes precedence | ||
| 127 | |||
| 128 | over the value in the trace header. | ||
| 129 | |||
| 130 | |||
| 131 | |||
| 132 | When we do have to count the traces, we use the "tmpfile" | ||
| 133 | |||
| 134 | routine because on many machines it is implemented | ||
| 135 | |||
| 136 | as a memory area instead of a disk file. | ||
| 137 | |||
| 138 | |||
| 139 | |||
| 140 | =head2 User's notes (Juan Lorenzo) | ||
| 141 | untested | ||
| 142 | |||
| 143 | =cut | ||
| 144 | |||
| 145 | |||
| 146 | =head2 CHANGES and their DATES | ||
| 147 | |||
| 148 | =cut | ||
| 149 | |||
| 150 | use Moose; | ||
| 151 | our $VERSION = '0.0.1'; | ||
| 152 | |||
| 153 | |||
| 154 | =head2 Import packages | ||
| 155 | |||
| 156 | =cut | ||
| 157 | |||
| 158 | use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants'; | ||
| 159 | |||
| 160 | use App::SeismicUnixGui::misc::SeismicUnix qw($go $in $off $on $out $ps $to $suffix_ascii $suffix_bin $suffix_ps $suffix_segy $suffix_su); | ||
| 161 | use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config'; | ||
| 162 | |||
| 163 | |||
| 164 | =head2 instantiation of packages | ||
| 165 | |||
| 166 | =cut | ||
| 167 | |||
| 168 | my $get = L_SU_global_constants->new(); | ||
| 169 | my $Project = Project_config->new(); | ||
| 170 | my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU(); | ||
| 171 | my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN(); | ||
| 172 | my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT(); | ||
| 173 | |||
| 174 | my $PS_SEISMIC = $Project->PS_SEISMIC(); | ||
| 175 | |||
| 176 | my $var = $get->var(); | ||
| 177 | my $on = $var->{_on}; | ||
| 178 | my $off = $var->{_off}; | ||
| 179 | my $true = $var->{_true}; | ||
| 180 | my $false = $var->{_false}; | ||
| 181 | my $empty_string = $var->{_empty_string}; | ||
| 182 | |||
| 183 | =head2 Encapsulated | ||
| 184 | hash of private variables | ||
| 185 | |||
| 186 | =cut | ||
| 187 | |||
| 188 | my $suxmax = { | ||
| 189 | _d1 => '', | ||
| 190 | _d2 => '', | ||
| 191 | _f1 => '', | ||
| 192 | _f2 => '', | ||
| 193 | _mode => '', | ||
| 194 | _n2 => '', | ||
| 195 | _tmpdir => '', | ||
| 196 | _verbose => '', | ||
| 197 | _Step => '', | ||
| 198 | _note => '', | ||
| 199 | |||
| 200 | }; | ||
| 201 | |||
| 202 | =head2 sub Step | ||
| 203 | |||
| 204 | collects switches and assembles bash instructions | ||
| 205 | by adding the program name | ||
| 206 | |||
| 207 | =cut | ||
| 208 | |||
| 209 | sub Step { | ||
| 210 | |||
| 211 | $suxmax->{_Step} = 'suxmax'.$suxmax->{_Step}; | ||
| 212 | return ( $suxmax->{_Step} ); | ||
| 213 | |||
| 214 | } | ||
| 215 | |||
| 216 | |||
| 217 | =head2 sub note | ||
| 218 | |||
| 219 | collects switches and assembles bash instructions | ||
| 220 | by adding the program name | ||
| 221 | |||
| 222 | =cut | ||
| 223 | |||
| 224 | sub note { | ||
| 225 | |||
| 226 | $suxmax->{_note} = 'suxmax'.$suxmax->{_note}; | ||
| 227 | return ( $suxmax->{_note} ); | ||
| 228 | |||
| 229 | } | ||
| 230 | |||
| 231 | |||
| 232 | |||
| 233 | =head2 sub clear | ||
| 234 | |||
| 235 | =cut | ||
| 236 | |||
| 237 | sub clear { | ||
| 238 | |||
| 239 | $suxmax->{_d1} = ''; | ||
| 240 | $suxmax->{_d2} = ''; | ||
| 241 | $suxmax->{_f1} = ''; | ||
| 242 | $suxmax->{_f2} = ''; | ||
| 243 | $suxmax->{_mode} = ''; | ||
| 244 | $suxmax->{_n2} = ''; | ||
| 245 | $suxmax->{_tmpdir} = ''; | ||
| 246 | $suxmax->{_verbose} = ''; | ||
| 247 | $suxmax->{_Step} = ''; | ||
| 248 | $suxmax->{_note} = ''; | ||
| 249 | } | ||
| 250 | |||
| 251 | |||
| 252 | =head2 sub d1 | ||
| 253 | |||
| 254 | |||
| 255 | =cut | ||
| 256 | |||
| 257 | sub d1 { | ||
| 258 | |||
| 259 | my ( $self,$d1 ) = @_; | ||
| 260 | if ( $d1 ne $empty_string ) { | ||
| 261 | |||
| 262 | $suxmax->{_d1} = $d1; | ||
| 263 | $suxmax->{_note} = $suxmax->{_note}.' d1='.$suxmax->{_d1}; | ||
| 264 | $suxmax->{_Step} = $suxmax->{_Step}.' d1='.$suxmax->{_d1}; | ||
| 265 | |||
| 266 | } else { | ||
| 267 | print("suxmax, d1, missing d1,\n"); | ||
| 268 | } | ||
| 269 | } | ||
| 270 | |||
| 271 | |||
| 272 | =head2 sub d2 | ||
| 273 | |||
| 274 | |||
| 275 | =cut | ||
| 276 | |||
| 277 | sub d2 { | ||
| 278 | |||
| 279 | my ( $self,$d2 ) = @_; | ||
| 280 | if ( $d2 ne $empty_string ) { | ||
| 281 | |||
| 282 | $suxmax->{_d2} = $d2; | ||
| 283 | $suxmax->{_note} = $suxmax->{_note}.' d2='.$suxmax->{_d2}; | ||
| 284 | $suxmax->{_Step} = $suxmax->{_Step}.' d2='.$suxmax->{_d2}; | ||
| 285 | |||
| 286 | } else { | ||
| 287 | print("suxmax, d2, missing d2,\n"); | ||
| 288 | } | ||
| 289 | } | ||
| 290 | |||
| 291 | |||
| 292 | =head2 sub f1 | ||
| 293 | |||
| 294 | |||
| 295 | =cut | ||
| 296 | |||
| 297 | sub f1 { | ||
| 298 | |||
| 299 | my ( $self,$f1 ) = @_; | ||
| 300 | if ( $f1 ne $empty_string ) { | ||
| 301 | |||
| 302 | $suxmax->{_f1} = $f1; | ||
| 303 | $suxmax->{_note} = $suxmax->{_note}.' f1='.$suxmax->{_f1}; | ||
| 304 | $suxmax->{_Step} = $suxmax->{_Step}.' f1='.$suxmax->{_f1}; | ||
| 305 | |||
| 306 | } else { | ||
| 307 | print("suxmax, f1, missing f1,\n"); | ||
| 308 | } | ||
| 309 | } | ||
| 310 | |||
| 311 | |||
| 312 | =head2 sub f2 | ||
| 313 | |||
| 314 | |||
| 315 | =cut | ||
| 316 | |||
| 317 | sub f2 { | ||
| 318 | |||
| 319 | my ( $self,$f2 ) = @_; | ||
| 320 | if ( $f2 ne $empty_string ) { | ||
| 321 | |||
| 322 | $suxmax->{_f2} = $f2; | ||
| 323 | $suxmax->{_note} = $suxmax->{_note}.' f2='.$suxmax->{_f2}; | ||
| 324 | $suxmax->{_Step} = $suxmax->{_Step}.' f2='.$suxmax->{_f2}; | ||
| 325 | |||
| 326 | } else { | ||
| 327 | print("suxmax, f2, missing f2,\n"); | ||
| 328 | } | ||
| 329 | } | ||
| 330 | |||
| 331 | |||
| 332 | =head2 sub mode | ||
| 333 | |||
| 334 | |||
| 335 | =cut | ||
| 336 | |||
| 337 | sub mode { | ||
| 338 | |||
| 339 | my ( $self,$mode ) = @_; | ||
| 340 | if ( $mode ne $empty_string ) { | ||
| 341 | |||
| 342 | $suxmax->{_mode} = $mode; | ||
| 343 | $suxmax->{_note} = $suxmax->{_note}.' mode='.$suxmax->{_mode}; | ||
| 344 | $suxmax->{_Step} = $suxmax->{_Step}.' mode='.$suxmax->{_mode}; | ||
| 345 | |||
| 346 | } else { | ||
| 347 | print("suxmax, mode, missing mode,\n"); | ||
| 348 | } | ||
| 349 | } | ||
| 350 | |||
| 351 | |||
| 352 | =head2 sub n2 | ||
| 353 | |||
| 354 | |||
| 355 | =cut | ||
| 356 | |||
| 357 | sub n2 { | ||
| 358 | |||
| 359 | my ( $self,$n2 ) = @_; | ||
| 360 | if ( $n2 ne $empty_string ) { | ||
| 361 | |||
| 362 | $suxmax->{_n2} = $n2; | ||
| 363 | $suxmax->{_note} = $suxmax->{_note}.' n2='.$suxmax->{_n2}; | ||
| 364 | $suxmax->{_Step} = $suxmax->{_Step}.' n2='.$suxmax->{_n2}; | ||
| 365 | |||
| 366 | } else { | ||
| 367 | print("suxmax, n2, missing n2,\n"); | ||
| 368 | } | ||
| 369 | } | ||
| 370 | |||
| 371 | |||
| 372 | =head2 sub tmpdir | ||
| 373 | |||
| 374 | |||
| 375 | =cut | ||
| 376 | |||
| 377 | sub tmpdir { | ||
| 378 | |||
| 379 | my ( $self,$tmpdir ) = @_; | ||
| 380 | if ( $tmpdir ne $empty_string ) { | ||
| 381 | |||
| 382 | $suxmax->{_tmpdir} = $tmpdir; | ||
| 383 | $suxmax->{_note} = $suxmax->{_note}.' tmpdir='.$suxmax->{_tmpdir}; | ||
| 384 | $suxmax->{_Step} = $suxmax->{_Step}.' tmpdir='.$suxmax->{_tmpdir}; | ||
| 385 | |||
| 386 | } else { | ||
| 387 | print("suxmax, tmpdir, missing tmpdir,\n"); | ||
| 388 | } | ||
| 389 | } | ||
| 390 | |||
| 391 | |||
| 392 | =head2 sub verbose | ||
| 393 | |||
| 394 | |||
| 395 | =cut | ||
| 396 | |||
| 397 | sub verbose { | ||
| 398 | |||
| 399 | my ( $self,$verbose ) = @_; | ||
| 400 | if ( $verbose ne $empty_string ) { | ||
| 401 | |||
| 402 | $suxmax->{_verbose} = $verbose; | ||
| 403 | $suxmax->{_note} = $suxmax->{_note}.' verbose='.$suxmax->{_verbose}; | ||
| 404 | $suxmax->{_Step} = $suxmax->{_Step}.' verbose='.$suxmax->{_verbose}; | ||
| 405 | |||
| 406 | } else { | ||
| 407 | print("suxmax, verbose, missing verbose,\n"); | ||
| 408 | } | ||
| 409 | } | ||
| 410 | |||
| 411 | |||
| 412 | =head2 sub get_max_index | ||
| 413 | |||
| 414 | max index = number of input variables -1 | ||
| 415 | |||
| 416 | =cut | ||
| 417 | |||
| 418 | sub get_max_index { | ||
| 419 | my ($self) = @_; | ||
| 420 | my $max_index = 7; | ||
| 421 | |||
| 422 | return($max_index); | ||
| 423 | } | ||
| 424 | |||
| 425 | |||
| 426 | 1; |