« lib/App/SeismicUnixGui/sunix/NMO_Vel_Stk/suintvel.pm
↑ Summary
lib/App/SeismicUnixGui/sunix/filter/sufxdecon.pm »
| 1 | package App::SeismicUnixGui::sunix::data::dt1tosu; | ||
| 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 | DT1TOSU - Convert ground-penetrating radar data in the | ||
| 25 | |||
| 26 | Sensors & Software X.DT1 GPR format to SU format. | ||
| 27 | |||
| 28 | |||
| 29 | |||
| 30 | dt1tosu < gpr_data_in_dt1_format > stdout | ||
| 31 | |||
| 32 | |||
| 33 | |||
| 34 | Optional parameters: | ||
| 35 | |||
| 36 | ns=from header number of samples per trace | ||
| 37 | |||
| 38 | dt=.8 time sample interval (see below) | ||
| 39 | |||
| 40 | swap=endian endian is auto-determined =1 (big endian) swap | ||
| 41 | |||
| 42 | =0 don't swap bytes (little endian machines) | ||
| 43 | |||
| 44 | verbose=0 silent | ||
| 45 | |||
| 46 | =1 S & S header values from first trace | ||
| 47 | |||
| 48 | sent to outpar | ||
| 49 | |||
| 50 | =2 S & S header values from all traces | ||
| 51 | |||
| 52 | sent to outpar | ||
| 53 | |||
| 54 | outpar=/dev/tty output parameter file | ||
| 55 | |||
| 56 | list=0 silent | ||
| 57 | |||
| 58 | =1 list explaining labels used in verbose | ||
| 59 | |||
| 60 | is printed to stderr | ||
| 61 | |||
| 62 | |||
| 63 | |||
| 64 | Caution: An incorrect ns field will munge subsequent processing. | ||
| 65 | |||
| 66 | |||
| 67 | |||
| 68 | Notes: | ||
| 69 | |||
| 70 | For compatiblity with SEGY header, apparent dt is set to | ||
| 71 | |||
| 72 | .8 ms (800 microsecs). Actual dt is .8 nanosecs. | ||
| 73 | |||
| 74 | Using TRUE DISTANCES, this scales velocity | ||
| 75 | |||
| 76 | and frequency by a factor of 1 million. | ||
| 77 | |||
| 78 | Example: v_air = 9.83X10^8 ft/s (real) | ||
| 79 | |||
| 80 | v_air = 983 ft/s (apparent for su) | ||
| 81 | |||
| 82 | Example: fnyquist = 625 MHz (real) | ||
| 83 | |||
| 84 | fnyquist = 625 Hz (apparent for su) | ||
| 85 | |||
| 86 | |||
| 87 | |||
| 88 | IBM RS6000, NeXT, SUN are examples of big endian machines | ||
| 89 | |||
| 90 | PC's and DEC are examples of little endian machines | ||
| 91 | |||
| 92 | |||
| 93 | |||
| 94 | Caveat: | ||
| 95 | |||
| 96 | This program has not been tested on DEC, some modification of the | ||
| 97 | |||
| 98 | byte swapping routines may be required. | ||
| 99 | |||
| 100 | |||
| 101 | |||
| 102 | |||
| 103 | |||
| 104 | Credits: | ||
| 105 | |||
| 106 | CWP: John Stockwell, Jan 1994 Based on a code "sugpr" by | ||
| 107 | |||
| 108 | UTULSA: Chris Liner & Bill Underwood (Dec93) | ||
| 109 | |||
| 110 | modifications permit S & S dt1 header information to be transferred | ||
| 111 | |||
| 112 | directly to SU header | ||
| 113 | |||
| 114 | |||
| 115 | |||
| 116 | March 2012: CWP John Stockwell updated for the revised | ||
| 117 | |||
| 118 | S&S DT1, which they still call "DT1" though it is different. | ||
| 119 | |||
| 120 | |||
| 121 | |||
| 122 | Trace header fields set: ns, tracl, tracr, dt, delrt, trid, | ||
| 123 | |||
| 124 | hour, minute, second | ||
| 125 | |||
| 126 | |||
| 127 | |||
| 128 | Reference: Sensors & Software pulseEKKO and Noggin^plus Data File | ||
| 129 | |||
| 130 | Formats | ||
| 131 | |||
| 132 | Publication of: | ||
| 133 | |||
| 134 | Sensors & Software: suburface imaging solutions | ||
| 135 | |||
| 136 | 1091 Brevik Place | ||
| 137 | |||
| 138 | Mississauga, ON L4W 3R7 Canada | ||
| 139 | |||
| 140 | Sensors & Software In | ||
| 141 | |||
| 142 | Tel: (905) 624-8909 | ||
| 143 | |||
| 144 | Fax (905) 624-9365 | ||
| 145 | |||
| 146 | E-mail: sales@sensoft.ca | ||
| 147 | |||
| 148 | Website: www.sensoft.ca | ||
| 149 | |||
| 150 | |||
| 151 | =head2 User's Notes (Juan Lorenzo) | ||
| 152 | |||
| 153 | Untested | ||
| 154 | |||
| 155 | |||
| 156 | =head2 CHANGES and their DATES | ||
| 157 | |||
| 158 | =cut | ||
| 159 | |||
| 160 | use Moose; | ||
| 161 | our $VERSION = '0.0.1'; | ||
| 162 | |||
| 163 | |||
| 164 | =head2 Import packages | ||
| 165 | |||
| 166 | =cut | ||
| 167 | |||
| 168 | use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants'; | ||
| 169 | |||
| 170 | use App::SeismicUnixGui::misc::SeismicUnix qw($in $out $on $go $to $suffix_ascii $off $suffix_su $suffix_bin); | ||
| 171 | use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config'; | ||
| 172 | |||
| 173 | |||
| 174 | =head2 instantiation of packages | ||
| 175 | |||
| 176 | =cut | ||
| 177 | |||
| 178 | my $get = L_SU_global_constants->new(); | ||
| 179 | my $Project = Project_config->new(); | ||
| 180 | my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU(); | ||
| 181 | my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN(); | ||
| 182 | my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT(); | ||
| 183 | |||
| 184 | my $var = $get->var(); | ||
| 185 | my $on = $var->{_on}; | ||
| 186 | my $off = $var->{_off}; | ||
| 187 | my $true = $var->{_true}; | ||
| 188 | my $false = $var->{_false}; | ||
| 189 | my $empty_string = $var->{_empty_string}; | ||
| 190 | |||
| 191 | =head2 Encapsulated | ||
| 192 | hash of private variables | ||
| 193 | |||
| 194 | =cut | ||
| 195 | |||
| 196 | my $dt1tosu = { | ||
| 197 | _dt => '', | ||
| 198 | _fnyquist => '', | ||
| 199 | _list => '', | ||
| 200 | _ns => '', | ||
| 201 | _outpar => '', | ||
| 202 | _swap => '', | ||
| 203 | _v_air => '', | ||
| 204 | _verbose => '', | ||
| 205 | _Step => '', | ||
| 206 | _note => '', | ||
| 207 | |||
| 208 | }; | ||
| 209 | |||
| 210 | =head2 sub Step | ||
| 211 | |||
| 212 | collects switches and assembles bash instructions | ||
| 213 | by adding the program name | ||
| 214 | |||
| 215 | =cut | ||
| 216 | |||
| 217 | sub Step { | ||
| 218 | |||
| 219 | $dt1tosu->{_Step} = 'dt1tosu'.$dt1tosu->{_Step}; | ||
| 220 | return ( $dt1tosu->{_Step} ); | ||
| 221 | |||
| 222 | } | ||
| 223 | |||
| 224 | |||
| 225 | =head2 sub note | ||
| 226 | |||
| 227 | collects switches and assembles bash instructions | ||
| 228 | by adding the program name | ||
| 229 | |||
| 230 | =cut | ||
| 231 | |||
| 232 | sub note { | ||
| 233 | |||
| 234 | $dt1tosu->{_note} = 'dt1tosu'.$dt1tosu->{_note}; | ||
| 235 | return ( $dt1tosu->{_note} ); | ||
| 236 | |||
| 237 | } | ||
| 238 | |||
| 239 | |||
| 240 | |||
| 241 | =head2 sub clear | ||
| 242 | |||
| 243 | =cut | ||
| 244 | |||
| 245 | sub clear { | ||
| 246 | |||
| 247 | $dt1tosu->{_dt} = ''; | ||
| 248 | $dt1tosu->{_fnyquist} = ''; | ||
| 249 | $dt1tosu->{_list} = ''; | ||
| 250 | $dt1tosu->{_ns} = ''; | ||
| 251 | $dt1tosu->{_outpar} = ''; | ||
| 252 | $dt1tosu->{_swap} = ''; | ||
| 253 | $dt1tosu->{_v_air} = ''; | ||
| 254 | $dt1tosu->{_verbose} = ''; | ||
| 255 | $dt1tosu->{_Step} = ''; | ||
| 256 | $dt1tosu->{_note} = ''; | ||
| 257 | } | ||
| 258 | |||
| 259 | |||
| 260 | =head2 sub dt | ||
| 261 | |||
| 262 | |||
| 263 | =cut | ||
| 264 | |||
| 265 | sub dt { | ||
| 266 | |||
| 267 | my ( $self,$dt ) = @_; | ||
| 268 | if ( $dt ne $empty_string ) { | ||
| 269 | |||
| 270 | $dt1tosu->{_dt} = $dt; | ||
| 271 | $dt1tosu->{_note} = $dt1tosu->{_note}.' dt='.$dt1tosu->{_dt}; | ||
| 272 | $dt1tosu->{_Step} = $dt1tosu->{_Step}.' dt='.$dt1tosu->{_dt}; | ||
| 273 | |||
| 274 | } else { | ||
| 275 | print("dt1tosu, dt, missing dt,\n"); | ||
| 276 | } | ||
| 277 | } | ||
| 278 | |||
| 279 | |||
| 280 | =head2 sub fnyquist | ||
| 281 | |||
| 282 | |||
| 283 | =cut | ||
| 284 | |||
| 285 | sub fnyquist { | ||
| 286 | |||
| 287 | my ( $self,$fnyquist ) = @_; | ||
| 288 | if ( $fnyquist ne $empty_string ) { | ||
| 289 | |||
| 290 | $dt1tosu->{_fnyquist} = $fnyquist; | ||
| 291 | $dt1tosu->{_note} = $dt1tosu->{_note}.' fnyquist='.$dt1tosu->{_fnyquist}; | ||
| 292 | $dt1tosu->{_Step} = $dt1tosu->{_Step}.' fnyquist='.$dt1tosu->{_fnyquist}; | ||
| 293 | |||
| 294 | } else { | ||
| 295 | print("dt1tosu, fnyquist, missing fnyquist,\n"); | ||
| 296 | } | ||
| 297 | } | ||
| 298 | |||
| 299 | |||
| 300 | =head2 sub list | ||
| 301 | |||
| 302 | |||
| 303 | =cut | ||
| 304 | |||
| 305 | sub list { | ||
| 306 | |||
| 307 | my ( $self,$list ) = @_; | ||
| 308 | if ( $list ne $empty_string ) { | ||
| 309 | |||
| 310 | $dt1tosu->{_list} = $list; | ||
| 311 | $dt1tosu->{_note} = $dt1tosu->{_note}.' list='.$dt1tosu->{_list}; | ||
| 312 | $dt1tosu->{_Step} = $dt1tosu->{_Step}.' list='.$dt1tosu->{_list}; | ||
| 313 | |||
| 314 | } else { | ||
| 315 | print("dt1tosu, list, missing list,\n"); | ||
| 316 | } | ||
| 317 | } | ||
| 318 | |||
| 319 | |||
| 320 | =head2 sub ns | ||
| 321 | |||
| 322 | |||
| 323 | =cut | ||
| 324 | |||
| 325 | sub ns { | ||
| 326 | |||
| 327 | my ( $self,$ns ) = @_; | ||
| 328 | if ( $ns ne $empty_string ) { | ||
| 329 | |||
| 330 | $dt1tosu->{_ns} = $ns; | ||
| 331 | $dt1tosu->{_note} = $dt1tosu->{_note}.' ns='.$dt1tosu->{_ns}; | ||
| 332 | $dt1tosu->{_Step} = $dt1tosu->{_Step}.' ns='.$dt1tosu->{_ns}; | ||
| 333 | |||
| 334 | } else { | ||
| 335 | print("dt1tosu, ns, missing ns,\n"); | ||
| 336 | } | ||
| 337 | } | ||
| 338 | |||
| 339 | |||
| 340 | =head2 sub outpar | ||
| 341 | |||
| 342 | |||
| 343 | =cut | ||
| 344 | |||
| 345 | sub outpar { | ||
| 346 | |||
| 347 | my ( $self,$outpar ) = @_; | ||
| 348 | if ( $outpar ne $empty_string ) { | ||
| 349 | |||
| 350 | $dt1tosu->{_outpar} = $outpar; | ||
| 351 | $dt1tosu->{_note} = $dt1tosu->{_note}.' outpar='.$dt1tosu->{_outpar}; | ||
| 352 | $dt1tosu->{_Step} = $dt1tosu->{_Step}.' outpar='.$dt1tosu->{_outpar}; | ||
| 353 | |||
| 354 | } else { | ||
| 355 | print("dt1tosu, outpar, missing outpar,\n"); | ||
| 356 | } | ||
| 357 | } | ||
| 358 | |||
| 359 | |||
| 360 | =head2 sub swap | ||
| 361 | |||
| 362 | |||
| 363 | =cut | ||
| 364 | |||
| 365 | sub swap { | ||
| 366 | |||
| 367 | my ( $self,$swap ) = @_; | ||
| 368 | if ( $swap ne $empty_string ) { | ||
| 369 | |||
| 370 | $dt1tosu->{_swap} = $swap; | ||
| 371 | $dt1tosu->{_note} = $dt1tosu->{_note}.' swap='.$dt1tosu->{_swap}; | ||
| 372 | $dt1tosu->{_Step} = $dt1tosu->{_Step}.' swap='.$dt1tosu->{_swap}; | ||
| 373 | |||
| 374 | } else { | ||
| 375 | print("dt1tosu, swap, missing swap,\n"); | ||
| 376 | } | ||
| 377 | } | ||
| 378 | |||
| 379 | |||
| 380 | =head2 sub v_air | ||
| 381 | |||
| 382 | |||
| 383 | =cut | ||
| 384 | |||
| 385 | sub v_air { | ||
| 386 | |||
| 387 | my ( $self,$v_air ) = @_; | ||
| 388 | if ( $v_air ne $empty_string ) { | ||
| 389 | |||
| 390 | $dt1tosu->{_v_air} = $v_air; | ||
| 391 | $dt1tosu->{_note} = $dt1tosu->{_note}.' v_air='.$dt1tosu->{_v_air}; | ||
| 392 | $dt1tosu->{_Step} = $dt1tosu->{_Step}.' v_air='.$dt1tosu->{_v_air}; | ||
| 393 | |||
| 394 | } else { | ||
| 395 | print("dt1tosu, v_air, missing v_air,\n"); | ||
| 396 | } | ||
| 397 | } | ||
| 398 | |||
| 399 | |||
| 400 | =head2 sub verbose | ||
| 401 | |||
| 402 | |||
| 403 | =cut | ||
| 404 | |||
| 405 | sub verbose { | ||
| 406 | |||
| 407 | my ( $self,$verbose ) = @_; | ||
| 408 | if ( $verbose ne $empty_string ) { | ||
| 409 | |||
| 410 | $dt1tosu->{_verbose} = $verbose; | ||
| 411 | $dt1tosu->{_note} = $dt1tosu->{_note}.' verbose='.$dt1tosu->{_verbose}; | ||
| 412 | $dt1tosu->{_Step} = $dt1tosu->{_Step}.' verbose='.$dt1tosu->{_verbose}; | ||
| 413 | |||
| 414 | } else { | ||
| 415 | print("dt1tosu, verbose, missing verbose,\n"); | ||
| 416 | } | ||
| 417 | } | ||
| 418 | |||
| 419 | |||
| 420 | =head2 sub get_max_index | ||
| 421 | |||
| 422 | max index = number of input variables -1 | ||
| 423 | |||
| 424 | =cut | ||
| 425 | |||
| 426 | sub get_max_index { | ||
| 427 | my ($self) = @_; | ||
| 428 | my $max_index = 7; | ||
| 429 | |||
| 430 | return($max_index); | ||
| 431 | } | ||
| 432 | |||
| 433 | |||
| 434 | 1; |