« lib/App/SeismicUnixGui/sunix/header/setbhed.pm
↑ Summary
lib/App/SeismicUnixGui/sunix/migration/sumigtk.pm »
| 1 | package App::SeismicUnixGui::sunix::header::suaddstatics; | ||
| 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 | SUADDSTATICS - ADD random STATICS on seismic data | ||
| 25 | |||
| 26 | |||
| 27 | |||
| 28 | suaddstatics required parameters [optional parameters] > stdout | ||
| 29 | |||
| 30 | |||
| 31 | |||
| 32 | Required parameters: | ||
| 33 | |||
| 34 | shift= the static shift will be generated | ||
| 35 | |||
| 36 | randomly in the interval [+shift,-shif] (ms) | ||
| 37 | |||
| 38 | sources= number of source locations | ||
| 39 | |||
| 40 | receivers= number of receiver locations | ||
| 41 | |||
| 42 | cmps= number of common mid point locations | ||
| 43 | |||
| 44 | maxfold= maximum fold of input data | ||
| 45 | |||
| 46 | datafile= name and COMPLETE path of the input file | ||
| 47 | |||
| 48 | |||
| 49 | |||
| 50 | Optional parameters: | ||
| 51 | |||
| 52 | dt=tr.dt time sampling interval (ms) | ||
| 53 | |||
| 54 | seed=getpid() seed for random number generator | ||
| 55 | |||
| 56 | verbose=0 =1 print useful information | ||
| 57 | |||
| 58 | |||
| 59 | |||
| 60 | Notes: | ||
| 61 | |||
| 62 | Input data should be sorted into cdp gathers. | ||
| 63 | |||
| 64 | |||
| 65 | |||
| 66 | SUADDSTATICS applies static time shifts in a surface consistent way on | ||
| 67 | |||
| 68 | seismic data sets. SUADDSTATICS writes the static time shifts in the | ||
| 69 | |||
| 70 | header field TSTAT. To perform the actual shifts the user should use | ||
| 71 | |||
| 72 | the program SUSTATIC after SUADDSTATICS. SUADDSTATICS outputs the | ||
| 73 | |||
| 74 | corrupted data set to stdout. | ||
| 75 | |||
| 76 | |||
| 77 | |||
| 78 | Header field used by SUADDSTATICS: cdp, sx, gx, tstat, dt. | ||
| 79 | |||
| 80 | |||
| 81 | |||
| 82 | |||
| 83 | |||
| 84 | |||
| 85 | |||
| 86 | Credits: CWP Wences Gouveia, 11/07/94, Colorado School of Mines | ||
| 87 | |||
| 88 | |||
| 89 | |||
| 90 | =head2 User's notes (Juan Lorenzo) | ||
| 91 | untested | ||
| 92 | |||
| 93 | =cut | ||
| 94 | |||
| 95 | |||
| 96 | =head2 CHANGES and their DATES | ||
| 97 | |||
| 98 | =cut | ||
| 99 | |||
| 100 | use Moose; | ||
| 101 | our $VERSION = '0.0.1'; | ||
| 102 | |||
| 103 | |||
| 104 | =head2 Import packages | ||
| 105 | |||
| 106 | =cut | ||
| 107 | |||
| 108 | use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants'; | ||
| 109 | |||
| 110 | use App::SeismicUnixGui::misc::SeismicUnix qw($go $in $off $on $out $ps $to $suffix_ascii $suffix_bin $suffix_ps $suffix_segy $suffix_su); | ||
| 111 | use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config'; | ||
| 112 | |||
| 113 | |||
| 114 | =head2 instantiation of packages | ||
| 115 | |||
| 116 | =cut | ||
| 117 | |||
| 118 | my $get = L_SU_global_constants->new(); | ||
| 119 | my $Project = Project_config->new(); | ||
| 120 | my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU(); | ||
| 121 | my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN(); | ||
| 122 | my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT(); | ||
| 123 | |||
| 124 | my $PS_SEISMIC = $Project->PS_SEISMIC(); | ||
| 125 | |||
| 126 | my $var = $get->var(); | ||
| 127 | my $on = $var->{_on}; | ||
| 128 | my $off = $var->{_off}; | ||
| 129 | my $true = $var->{_true}; | ||
| 130 | my $false = $var->{_false}; | ||
| 131 | my $empty_string = $var->{_empty_string}; | ||
| 132 | |||
| 133 | =head2 Encapsulated | ||
| 134 | hash of private variables | ||
| 135 | |||
| 136 | =cut | ||
| 137 | |||
| 138 | my $suaddstatics = { | ||
| 139 | _cmps => '', | ||
| 140 | _datafile => '', | ||
| 141 | _dt => '', | ||
| 142 | _maxfold => '', | ||
| 143 | _receivers => '', | ||
| 144 | _seed => '', | ||
| 145 | _shift => '', | ||
| 146 | _sources => '', | ||
| 147 | _verbose => '', | ||
| 148 | _Step => '', | ||
| 149 | _note => '', | ||
| 150 | |||
| 151 | }; | ||
| 152 | |||
| 153 | =head2 sub Step | ||
| 154 | |||
| 155 | collects switches and assembles bash instructions | ||
| 156 | by adding the program name | ||
| 157 | |||
| 158 | =cut | ||
| 159 | |||
| 160 | sub Step { | ||
| 161 | |||
| 162 | $suaddstatics->{_Step} = 'suaddstatics'.$suaddstatics->{_Step}; | ||
| 163 | return ( $suaddstatics->{_Step} ); | ||
| 164 | |||
| 165 | } | ||
| 166 | |||
| 167 | |||
| 168 | =head2 sub note | ||
| 169 | |||
| 170 | collects switches and assembles bash instructions | ||
| 171 | by adding the program name | ||
| 172 | |||
| 173 | =cut | ||
| 174 | |||
| 175 | sub note { | ||
| 176 | |||
| 177 | $suaddstatics->{_note} = 'suaddstatics'.$suaddstatics->{_note}; | ||
| 178 | return ( $suaddstatics->{_note} ); | ||
| 179 | |||
| 180 | } | ||
| 181 | |||
| 182 | |||
| 183 | |||
| 184 | =head2 sub clear | ||
| 185 | |||
| 186 | =cut | ||
| 187 | |||
| 188 | sub clear { | ||
| 189 | |||
| 190 | $suaddstatics->{_cmps} = ''; | ||
| 191 | $suaddstatics->{_datafile} = ''; | ||
| 192 | $suaddstatics->{_dt} = ''; | ||
| 193 | $suaddstatics->{_maxfold} = ''; | ||
| 194 | $suaddstatics->{_receivers} = ''; | ||
| 195 | $suaddstatics->{_seed} = ''; | ||
| 196 | $suaddstatics->{_shift} = ''; | ||
| 197 | $suaddstatics->{_sources} = ''; | ||
| 198 | $suaddstatics->{_verbose} = ''; | ||
| 199 | $suaddstatics->{_Step} = ''; | ||
| 200 | $suaddstatics->{_note} = ''; | ||
| 201 | } | ||
| 202 | |||
| 203 | |||
| 204 | =head2 sub cmps | ||
| 205 | |||
| 206 | |||
| 207 | =cut | ||
| 208 | |||
| 209 | sub cmps { | ||
| 210 | |||
| 211 | my ( $self,$cmps ) = @_; | ||
| 212 | if ( $cmps ne $empty_string ) { | ||
| 213 | |||
| 214 | $suaddstatics->{_cmps} = $cmps; | ||
| 215 | $suaddstatics->{_note} = $suaddstatics->{_note}.' cmps='.$suaddstatics->{_cmps}; | ||
| 216 | $suaddstatics->{_Step} = $suaddstatics->{_Step}.' cmps='.$suaddstatics->{_cmps}; | ||
| 217 | |||
| 218 | } else { | ||
| 219 | print("suaddstatics, cmps, missing cmps,\n"); | ||
| 220 | } | ||
| 221 | } | ||
| 222 | |||
| 223 | |||
| 224 | =head2 sub datafile | ||
| 225 | |||
| 226 | |||
| 227 | =cut | ||
| 228 | |||
| 229 | sub datafile { | ||
| 230 | |||
| 231 | my ( $self,$datafile ) = @_; | ||
| 232 | if ( $datafile ne $empty_string ) { | ||
| 233 | |||
| 234 | $suaddstatics->{_datafile} = $datafile; | ||
| 235 | $suaddstatics->{_note} = $suaddstatics->{_note}.' datafile='.$suaddstatics->{_datafile}; | ||
| 236 | $suaddstatics->{_Step} = $suaddstatics->{_Step}.' datafile='.$suaddstatics->{_datafile}; | ||
| 237 | |||
| 238 | } else { | ||
| 239 | print("suaddstatics, datafile, missing datafile,\n"); | ||
| 240 | } | ||
| 241 | } | ||
| 242 | |||
| 243 | |||
| 244 | =head2 sub dt | ||
| 245 | |||
| 246 | |||
| 247 | =cut | ||
| 248 | |||
| 249 | sub dt { | ||
| 250 | |||
| 251 | my ( $self,$dt ) = @_; | ||
| 252 | if ( $dt ne $empty_string ) { | ||
| 253 | |||
| 254 | $suaddstatics->{_dt} = $dt; | ||
| 255 | $suaddstatics->{_note} = $suaddstatics->{_note}.' dt='.$suaddstatics->{_dt}; | ||
| 256 | $suaddstatics->{_Step} = $suaddstatics->{_Step}.' dt='.$suaddstatics->{_dt}; | ||
| 257 | |||
| 258 | } else { | ||
| 259 | print("suaddstatics, dt, missing dt,\n"); | ||
| 260 | } | ||
| 261 | } | ||
| 262 | |||
| 263 | |||
| 264 | =head2 sub maxfold | ||
| 265 | |||
| 266 | |||
| 267 | =cut | ||
| 268 | |||
| 269 | sub maxfold { | ||
| 270 | |||
| 271 | my ( $self,$maxfold ) = @_; | ||
| 272 | if ( $maxfold ne $empty_string ) { | ||
| 273 | |||
| 274 | $suaddstatics->{_maxfold} = $maxfold; | ||
| 275 | $suaddstatics->{_note} = $suaddstatics->{_note}.' maxfold='.$suaddstatics->{_maxfold}; | ||
| 276 | $suaddstatics->{_Step} = $suaddstatics->{_Step}.' maxfold='.$suaddstatics->{_maxfold}; | ||
| 277 | |||
| 278 | } else { | ||
| 279 | print("suaddstatics, maxfold, missing maxfold,\n"); | ||
| 280 | } | ||
| 281 | } | ||
| 282 | |||
| 283 | |||
| 284 | =head2 sub receivers | ||
| 285 | |||
| 286 | |||
| 287 | =cut | ||
| 288 | |||
| 289 | sub receivers { | ||
| 290 | |||
| 291 | my ( $self,$receivers ) = @_; | ||
| 292 | if ( $receivers ne $empty_string ) { | ||
| 293 | |||
| 294 | $suaddstatics->{_receivers} = $receivers; | ||
| 295 | $suaddstatics->{_note} = $suaddstatics->{_note}.' receivers='.$suaddstatics->{_receivers}; | ||
| 296 | $suaddstatics->{_Step} = $suaddstatics->{_Step}.' receivers='.$suaddstatics->{_receivers}; | ||
| 297 | |||
| 298 | } else { | ||
| 299 | print("suaddstatics, receivers, missing receivers,\n"); | ||
| 300 | } | ||
| 301 | } | ||
| 302 | |||
| 303 | |||
| 304 | =head2 sub seed | ||
| 305 | |||
| 306 | |||
| 307 | =cut | ||
| 308 | |||
| 309 | sub seed { | ||
| 310 | |||
| 311 | my ( $self,$seed ) = @_; | ||
| 312 | if ( $seed ne $empty_string ) { | ||
| 313 | |||
| 314 | $suaddstatics->{_seed} = $seed; | ||
| 315 | $suaddstatics->{_note} = $suaddstatics->{_note}.' seed='.$suaddstatics->{_seed}; | ||
| 316 | $suaddstatics->{_Step} = $suaddstatics->{_Step}.' seed='.$suaddstatics->{_seed}; | ||
| 317 | |||
| 318 | } else { | ||
| 319 | print("suaddstatics, seed, missing seed,\n"); | ||
| 320 | } | ||
| 321 | } | ||
| 322 | |||
| 323 | |||
| 324 | =head2 sub shift | ||
| 325 | |||
| 326 | |||
| 327 | =cut | ||
| 328 | |||
| 329 | sub shift { | ||
| 330 | |||
| 331 | my ( $self,$shift ) = @_; | ||
| 332 | if ( $shift ne $empty_string ) { | ||
| 333 | |||
| 334 | $suaddstatics->{_shift} = $shift; | ||
| 335 | $suaddstatics->{_note} = $suaddstatics->{_note}.' shift='.$suaddstatics->{_shift}; | ||
| 336 | $suaddstatics->{_Step} = $suaddstatics->{_Step}.' shift='.$suaddstatics->{_shift}; | ||
| 337 | |||
| 338 | } else { | ||
| 339 | print("suaddstatics, shift, missing shift,\n"); | ||
| 340 | } | ||
| 341 | } | ||
| 342 | |||
| 343 | |||
| 344 | =head2 sub sources | ||
| 345 | |||
| 346 | |||
| 347 | =cut | ||
| 348 | |||
| 349 | sub sources { | ||
| 350 | |||
| 351 | my ( $self,$sources ) = @_; | ||
| 352 | if ( $sources ne $empty_string ) { | ||
| 353 | |||
| 354 | $suaddstatics->{_sources} = $sources; | ||
| 355 | $suaddstatics->{_note} = $suaddstatics->{_note}.' sources='.$suaddstatics->{_sources}; | ||
| 356 | $suaddstatics->{_Step} = $suaddstatics->{_Step}.' sources='.$suaddstatics->{_sources}; | ||
| 357 | |||
| 358 | } else { | ||
| 359 | print("suaddstatics, sources, missing sources,\n"); | ||
| 360 | } | ||
| 361 | } | ||
| 362 | |||
| 363 | |||
| 364 | =head2 sub verbose | ||
| 365 | |||
| 366 | |||
| 367 | =cut | ||
| 368 | |||
| 369 | sub verbose { | ||
| 370 | |||
| 371 | my ( $self,$verbose ) = @_; | ||
| 372 | if ( $verbose ne $empty_string ) { | ||
| 373 | |||
| 374 | $suaddstatics->{_verbose} = $verbose; | ||
| 375 | $suaddstatics->{_note} = $suaddstatics->{_note}.' verbose='.$suaddstatics->{_verbose}; | ||
| 376 | $suaddstatics->{_Step} = $suaddstatics->{_Step}.' verbose='.$suaddstatics->{_verbose}; | ||
| 377 | |||
| 378 | } else { | ||
| 379 | print("suaddstatics, verbose, missing verbose,\n"); | ||
| 380 | } | ||
| 381 | } | ||
| 382 | |||
| 383 | |||
| 384 | =head2 sub get_max_index | ||
| 385 | |||
| 386 | max index = number of input variables -1 | ||
| 387 | |||
| 388 | =cut | ||
| 389 | |||
| 390 | sub get_max_index { | ||
| 391 | my ($self) = @_; | ||
| 392 | my $max_index = 8; | ||
| 393 | |||
| 394 | return($max_index); | ||
| 395 | } | ||
| 396 | |||
| 397 | |||
| 398 | 1; |