| 1 | package App::SeismicUnixGui::sunix::transform::suphasevel; | ||
| 2 | |||
| 3 | =head1 DOCUMENTATION | ||
| 4 | |||
| 5 | =head2 SYNOPSIS | ||
| 6 | |||
| 7 | PERL PROGRAM NAME: SUPHASEVEL - Multi-mode PHASE VELocity dispersion map computed | ||
| 8 | AUTHOR: Juan Lorenzo, Derek Goff (Perl module only) | ||
| 9 | DATE: OCT 24 2013 | ||
| 10 | DESCRIPTION: A package that makes using and understanding suphasevel easier | ||
| 11 | Version: | ||
| 12 | |||
| 13 | =head2 USE | ||
| 14 | |||
| 15 | =head3 NOTES | ||
| 16 | This Program derives from suphasevel in Seismic Unix | ||
| 17 | '_note' keeps track of actions for use in graphics | ||
| 18 | '_Step' keeps track of actions for execution in the system | ||
| 19 | |||
| 20 | =head4 Examples | ||
| 21 | |||
| 22 | =head3 SEISMIC UNIX NOTES | ||
| 23 | |||
| 24 | SUPHASEVEL - Multi-mode PHASE VELocity dispersion map computed | ||
| 25 | from shot record(s) | ||
| 26 | |||
| 27 | suphasevel <infile >outfile [optional parameters] | ||
| 28 | |||
| 29 | Optional parameters: | ||
| 30 | fv=330 minimum phase velocity (m/s) | ||
| 31 | nv=100 number of phase velocities | ||
| 32 | dv=25 phase velocity step (m/s) | ||
| 33 | fmax=50 maximum frequency to process (Hz) | ||
| 34 | =0 process to nyquist | ||
| 35 | norm=0 do not normalize by amplitude spectrum | ||
| 36 | =1 normalize by amplitude spectrum | ||
| 37 | verbose=0 verbose = 1 echoes information | ||
| 38 | |||
| 39 | Notes: Offsets read from headers. | ||
| 40 | 1. output is complex frequency data | ||
| 41 | 2. offset header word must be set (signed offset is ok) | ||
| 42 | 3. norm=1 tends to blow up aliasing and other artifacts | ||
| 43 | 4. For correct suifft later, use fmax=0 | ||
| 44 | 5. For later processing outtrace.dt=domega | ||
| 45 | 6. works for 2D or 3D shots in any offset order | ||
| 46 | |||
| 47 | Using this program: | ||
| 48 | |||
| 49 | First: use | ||
| 50 | suspecfx < shotrecord.su | suximage | ||
| 51 | to see what the maximum bandwidth is in your data. This will | ||
| 52 | give you an idea about the possible value for fmax. | ||
| 53 | |||
| 54 | Second: Plot your data or some subset of your data via: | ||
| 55 | suxwigb < shotrecord.su key=offset | ||
| 56 | |||
| 57 | You can then estimate the range of phase velocities by looking | ||
| 58 | at the maximum and minimum slopes of arrivals in your data. | ||
| 59 | This will allow you do set first velocity fv and the increment | ||
| 60 | in velocity dv, that make sense for your data. | ||
| 61 | |||
| 62 | You can pick values of offset and time by placing the cursor | ||
| 63 | on the desired location on the plot and pressing the \'s\' key | ||
| 64 | The picks will appear in your terminal window. | ||
| 65 | |||
| 66 | When displaying, don't forget to use suamp to compute the | ||
| 67 | modulus of the complex values that this program puts out. | ||
| 68 | |||
| 69 | suphasevel < shotrecord.su [parameters] | suamp | suximage | ||
| 70 | |||
| 71 | |||
| 72 | |||
| 73 | Credits: | ||
| 74 | |||
| 75 | UHouston: Chris Liner June2008 (cloned from suspecfk) | ||
| 76 | |||
| 77 | This code implements the following integral transform | ||
| 78 | _ | ||
| 79 | / | ||
| 80 | u(w,v) = / k(w,x,v) u(w,x) dx | ||
| 81 | _/ | ||
| 82 | where | ||
| 83 | u(w,v) is the phase velocity dispersion image | ||
| 84 | k(w,x,v) is the transform kernel.... exp(-i w x / v) | ||
| 85 | u(w,x) = FT[u(t,x)] is the input shot record(s) | ||
| 86 | _/ | ||
| 87 | Reference: Park, Miller, and Xia (1998, SEG Abstracts) | ||
| 88 | |||
| 89 | Trace header fields accessed: dt, offset, ns | ||
| 90 | Trace header fields modified: nx,dt,trid,d1,f1,d2,f2,tracl | ||
| 91 | |||
| 92 | Before this can be run, the trace offset must be set | ||
| 93 | This is done by using the command 'sushw' to adjust | ||
| 94 | # the headers | ||
| 95 | |||
| 96 | =head2 User's notes | ||
| 97 | |||
| 98 | In the following case where shotpoint lies inthe middle of the data set | ||
| 99 | Change from: | ||
| 100 | sx=100 | ||
| 101 | offset= -100 to 99 | ||
| 102 | |||
| 103 | Change to | ||
| 104 | gx=-100 to 99 | ||
| 105 | sx=0 | ||
| 106 | offset=-100 to 99 | ||
| 107 | |||
| 108 | =head2 CHANGES and their DATES | ||
| 109 | |||
| 110 | =cut | ||
| 111 | |||
| 112 | use Moose; | ||
| 113 | our $VERSION = '0.0.1'; | ||
| 114 | use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants'; | ||
| 115 | |||
| 116 | my $get = L_SU_global_constants->new(); | ||
| 117 | |||
| 118 | my $var = $get->var(); | ||
| 119 | my $empty_string = $var->{_empty_string}; | ||
| 120 | |||
| 121 | my $suphasevel = { | ||
| 122 | _dv => '', | ||
| 123 | _fmax => '', | ||
| 124 | _fv => '', | ||
| 125 | _norm => '', | ||
| 126 | _nv => '', | ||
| 127 | _verbose => '', | ||
| 128 | _Step => '', | ||
| 129 | _note => '', | ||
| 130 | }; | ||
| 131 | |||
| 132 | =head2 sub Step | ||
| 133 | |||
| 134 | collects switches and assembles bash instructions | ||
| 135 | by adding the program name | ||
| 136 | Keeps track of actions for execution in the system | ||
| 137 | |||
| 138 | =cut | ||
| 139 | |||
| 140 | sub Step { | ||
| 141 | |||
| 142 | $suphasevel->{_Step} = 'suphasevel' . $suphasevel->{_Step}; | ||
| 143 | return ( $suphasevel->{_Step} ); | ||
| 144 | |||
| 145 | } | ||
| 146 | |||
| 147 | =head2 sub note | ||
| 148 | |||
| 149 | collects switches and assembles bash instructions | ||
| 150 | by adding the program name | ||
| 151 | Keeps track of actions for possible use in graphics | ||
| 152 | |||
| 153 | =cut | ||
| 154 | |||
| 155 | sub note { | ||
| 156 | |||
| 157 | $suphasevel->{_note} = 'suphasevel' . $suphasevel->{_note}; | ||
| 158 | return ( $suphasevel->{_note} ); | ||
| 159 | |||
| 160 | } | ||
| 161 | |||
| 162 | =head2 sub clear | ||
| 163 | |||
| 164 | Sets all variable strings to '' (nothing) | ||
| 165 | =cut | ||
| 166 | |||
| 167 | sub clear { | ||
| 168 | |||
| 169 | $suphasevel->{_dv} = ''; | ||
| 170 | $suphasevel->{_fmax} = ''; | ||
| 171 | $suphasevel->{_fv} = ''; | ||
| 172 | $suphasevel->{_norm} = ''; | ||
| 173 | $suphasevel->{_nv} = ''; | ||
| 174 | $suphasevel->{_verbose} = ''; | ||
| 175 | $suphasevel->{_Step} = ''; | ||
| 176 | $suphasevel->{_note} = ''; | ||
| 177 | } | ||
| 178 | |||
| 179 | =head2 sub dt | ||
| 180 | |||
| 181 | |||
| 182 | =cut | ||
| 183 | |||
| 184 | sub dt { | ||
| 185 | |||
| 186 | my ( $self, $dt ) = @_; | ||
| 187 | if ( $dt ne $empty_string ) { | ||
| 188 | |||
| 189 | $suphasevel->{_dt} = $dt; | ||
| 190 | $suphasevel->{_note} = | ||
| 191 | $suphasevel->{_note} . ' dt=' . $suphasevel->{_dt}; | ||
| 192 | $suphasevel->{_Step} = | ||
| 193 | $suphasevel->{_Step} . ' dt=' . $suphasevel->{_dt}; | ||
| 194 | |||
| 195 | } | ||
| 196 | else { | ||
| 197 | print("suphasevel, dt, missing dt,\n"); | ||
| 198 | } | ||
| 199 | } | ||
| 200 | |||
| 201 | =head2 sub dv | ||
| 202 | |||
| 203 | Defines the step size between phase velocities while | ||
| 204 | performing the integral transformation | ||
| 205 | |||
| 206 | =cut | ||
| 207 | |||
| 208 | sub dv { | ||
| 209 | |||
| 210 | my ( $self, $dv ) = @_; | ||
| 211 | if ( $dv ne $empty_string ) { | ||
| 212 | |||
| 213 | $suphasevel->{_dv} = $dv; | ||
| 214 | $suphasevel->{_note} = | ||
| 215 | $suphasevel->{_note} . ' dv=' . $suphasevel->{_dv}; | ||
| 216 | $suphasevel->{_Step} = | ||
| 217 | $suphasevel->{_Step} . ' dv=' . $suphasevel->{_dv}; | ||
| 218 | |||
| 219 | } | ||
| 220 | else { | ||
| 221 | print("suphasevel, dv, missing dv,\n"); | ||
| 222 | } | ||
| 223 | } | ||
| 224 | |||
| 225 | =head2 sub fmax | ||
| 226 | |||
| 227 | Defines maximum frequency to process | ||
| 228 | (or =0 for nyquist) | ||
| 229 | |||
| 230 | =cut | ||
| 231 | |||
| 232 | sub fmax { | ||
| 233 | |||
| 234 | my ( $self, $fmax ) = @_; | ||
| 235 | if ( $fmax ne $empty_string ) { | ||
| 236 | |||
| 237 | $suphasevel->{_fmax} = $fmax; | ||
| 238 | $suphasevel->{_note} = | ||
| 239 | $suphasevel->{_note} . ' fmax=' . $suphasevel->{_fmax}; | ||
| 240 | $suphasevel->{_Step} = | ||
| 241 | $suphasevel->{_Step} . ' fmax=' . $suphasevel->{_fmax}; | ||
| 242 | |||
| 243 | } | ||
| 244 | else { | ||
| 245 | print("suphasevel, fmax, missing fmax,\n"); | ||
| 246 | } | ||
| 247 | } | ||
| 248 | |||
| 249 | =head2 sub fv | ||
| 250 | |||
| 251 | Defines the minimum phase velocity to process | ||
| 252 | AKA first phase velocity | ||
| 253 | |||
| 254 | =cut | ||
| 255 | |||
| 256 | sub fv { | ||
| 257 | |||
| 258 | my ( $self, $fv ) = @_; | ||
| 259 | if ( $fv ne $empty_string ) { | ||
| 260 | |||
| 261 | $suphasevel->{_fv} = $fv; | ||
| 262 | $suphasevel->{_note} = | ||
| 263 | $suphasevel->{_note} . ' fv=' . $suphasevel->{_fv}; | ||
| 264 | $suphasevel->{_Step} = | ||
| 265 | $suphasevel->{_Step} . ' fv=' . $suphasevel->{_fv}; | ||
| 266 | |||
| 267 | } | ||
| 268 | else { | ||
| 269 | print("suphasevel, fv, missing fv,\n"); | ||
| 270 | } | ||
| 271 | } | ||
| 272 | |||
| 273 | =head2 sub key | ||
| 274 | |||
| 275 | |||
| 276 | =cut | ||
| 277 | |||
| 278 | sub key { | ||
| 279 | |||
| 280 | my ( $self, $key ) = @_; | ||
| 281 | if ( $key ne $empty_string ) { | ||
| 282 | |||
| 283 | $suphasevel->{_key} = $key; | ||
| 284 | $suphasevel->{_note} = | ||
| 285 | $suphasevel->{_note} . ' key=' . $suphasevel->{_key}; | ||
| 286 | $suphasevel->{_Step} = | ||
| 287 | $suphasevel->{_Step} . ' key=' . $suphasevel->{_key}; | ||
| 288 | |||
| 289 | } | ||
| 290 | else { | ||
| 291 | print("suphasevel, key, missing key,\n"); | ||
| 292 | } | ||
| 293 | } | ||
| 294 | |||
| 295 | =head2 sub norm | ||
| 296 | |||
| 297 | Determine whether to use amplitude spectrum to normalize | ||
| 298 | =0 is off (do not normalize by amplitude spectrum) | ||
| 299 | =1 is on (normalize by amplitude spectrum) | ||
| 300 | |||
| 301 | =cut | ||
| 302 | |||
| 303 | sub norm { | ||
| 304 | |||
| 305 | my ( $self, $norm ) = @_; | ||
| 306 | if ( $norm ne $empty_string ) { | ||
| 307 | |||
| 308 | $suphasevel->{_norm} = $norm; | ||
| 309 | $suphasevel->{_note} = | ||
| 310 | $suphasevel->{_note} . ' norm=' . $suphasevel->{_norm}; | ||
| 311 | $suphasevel->{_Step} = | ||
| 312 | $suphasevel->{_Step} . ' norm=' . $suphasevel->{_norm}; | ||
| 313 | |||
| 314 | } | ||
| 315 | else { | ||
| 316 | print("suphasevel, norm, missing norm,\n"); | ||
| 317 | } | ||
| 318 | } | ||
| 319 | |||
| 320 | =head2 sub nv | ||
| 321 | |||
| 322 | Defines the number of phase velocities to test | ||
| 323 | AKA total number of steps to take | ||
| 324 | |||
| 325 | =cut | ||
| 326 | |||
| 327 | sub nv { | ||
| 328 | |||
| 329 | my ( $self, $nv ) = @_; | ||
| 330 | if ( $nv ne $empty_string ) { | ||
| 331 | |||
| 332 | $suphasevel->{_nv} = $nv; | ||
| 333 | $suphasevel->{_note} = | ||
| 334 | $suphasevel->{_note} . ' nv=' . $suphasevel->{_nv}; | ||
| 335 | $suphasevel->{_Step} = | ||
| 336 | $suphasevel->{_Step} . ' nv=' . $suphasevel->{_nv}; | ||
| 337 | |||
| 338 | } | ||
| 339 | else { | ||
| 340 | print("suphasevel, nv, missing nv,\n"); | ||
| 341 | } | ||
| 342 | } | ||
| 343 | |||
| 344 | =head2 sub verb | ||
| 345 | |||
| 346 | Decide whether to echo information | ||
| 347 | |||
| 348 | =cut | ||
| 349 | |||
| 350 | sub verb { | ||
| 351 | |||
| 352 | my ( $self, $verbose ) = @_; | ||
| 353 | if ( $verbose ne $empty_string ) { | ||
| 354 | |||
| 355 | $suphasevel->{_verbose} = $verbose; | ||
| 356 | $suphasevel->{_note} = | ||
| 357 | $suphasevel->{_note} . ' verbose=' . $suphasevel->{_verbose}; | ||
| 358 | $suphasevel->{_Step} = | ||
| 359 | $suphasevel->{_Step} . ' verbose=' . $suphasevel->{_verbose}; | ||
| 360 | |||
| 361 | } | ||
| 362 | else { | ||
| 363 | print("suphasevel, verbose, missing verbose,\n"); | ||
| 364 | } | ||
| 365 | } | ||
| 366 | |||
| 367 | =head2 sub verbose | ||
| 368 | |||
| 369 | Decide whether to echo information | ||
| 370 | |||
| 371 | =cut | ||
| 372 | |||
| 373 | sub verbose { | ||
| 374 | |||
| 375 | my ( $self, $verbose ) = @_; | ||
| 376 | if ( $verbose ne $empty_string ) { | ||
| 377 | |||
| 378 | $suphasevel->{_verbose} = $verbose; | ||
| 379 | $suphasevel->{_note} = | ||
| 380 | $suphasevel->{_note} . ' verbose=' . $suphasevel->{_verbose}; | ||
| 381 | $suphasevel->{_Step} = | ||
| 382 | $suphasevel->{_Step} . ' verbose=' . $suphasevel->{_verbose}; | ||
| 383 | |||
| 384 | } | ||
| 385 | else { | ||
| 386 | print("suphasevel, verbose, missing verbose,\n"); | ||
| 387 | } | ||
| 388 | } | ||
| 389 | |||
| 390 | =head2 sub get_max_index | ||
| 391 | |||
| 392 | max index = number of input variables -1 | ||
| 393 | |||
| 394 | =cut | ||
| 395 | |||
| 396 | sub get_max_index { | ||
| 397 | my ($self) = @_; | ||
| 398 | my $max_index = 5; | ||
| 399 | |||
| 400 | return ($max_index); | ||
| 401 | } | ||
| 402 | |||
| 403 | 1; |