« lib/App/SeismicUnixGui/misc/redisplay.pm
↑ Summary
lib/App/SeismicUnixGui/sunix/data/suswapbytes.pm »
| 1 | package App::SeismicUnixGui::sunix::data::segbread; | ||
| 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 | SEGBREAD - read an SEG-B tape | ||
| 25 | |||
| 26 | |||
| 27 | |||
| 28 | segbread > stdout tape= | ||
| 29 | |||
| 30 | |||
| 31 | |||
| 32 | |||
| 33 | |||
| 34 | Required parameters: | ||
| 35 | |||
| 36 | tape= input tape device | ||
| 37 | |||
| 38 | Optional parameters: | ||
| 39 | |||
| 40 | |||
| 41 | |||
| 42 | ns= number of samples.This overrides the number | ||
| 43 | |||
| 44 | that is obtained from the file header | ||
| 45 | |||
| 46 | Usefull for variable trace length | ||
| 47 | |||
| 48 | |||
| 49 | |||
| 50 | auxf=0 1 output auxiliary channels | ||
| 51 | |||
| 52 | ntro=0 Number of traces per record.This overrides the | ||
| 53 | |||
| 54 | computed value (useful for some DFS-V | ||
| 55 | |||
| 56 | instruments) if specified. | ||
| 57 | |||
| 58 | |||
| 59 | |||
| 60 | ONLY READS DISK SEGB FILES! I tested it on files created by | ||
| 61 | |||
| 62 | TransMedia Technologies Calgary Alberta, Canada | ||
| 63 | |||
| 64 | In their format each data block is preceded by an eight byte header | ||
| 65 | |||
| 66 | 2 unsigned 32 bit IBM format integer. | ||
| 67 | |||
| 68 | First number is the block number, second is the length of block given | ||
| 69 | |||
| 70 | in bytes. | ||
| 71 | |||
| 72 | (This program is largely untested. Testing reports on SEG B data | ||
| 73 | |||
| 74 | and improvements to the code | ||
| 75 | |||
| 76 | |||
| 77 | |||
| 78 | |||
| 79 | |||
| 80 | Credits: Balasz Nemeth, Potash Corporation Saskatechwan | ||
| 81 | |||
| 82 | given to CWP in 2008 | ||
| 83 | |||
| 84 | Based on SEGDREAD by Stew Levin of Landmark Graphics and others. | ||
| 85 | |||
| 86 | |||
| 87 | |||
| 88 | =head2 User's (Juan Lorenzo) notes | ||
| 89 | |||
| 90 | Untested | ||
| 91 | |||
| 92 | |||
| 93 | |||
| 94 | =head2 CHANGES and their DATES | ||
| 95 | |||
| 96 | =cut | ||
| 97 | |||
| 98 | use Moose; | ||
| 99 | our $VERSION = '0.0.1'; | ||
| 100 | |||
| 101 | |||
| 102 | =head2 Import packages | ||
| 103 | |||
| 104 | =cut | ||
| 105 | |||
| 106 | use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants'; | ||
| 107 | |||
| 108 | use App::SeismicUnixGui::misc::SeismicUnix qw($in $out $on $go $to $suffix_ascii $off $suffix_su $suffix_bin); | ||
| 109 | use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config'; | ||
| 110 | |||
| 111 | |||
| 112 | =head2 instantiation of packages | ||
| 113 | |||
| 114 | =cut | ||
| 115 | |||
| 116 | my $get = L_SU_global_constants->new(); | ||
| 117 | my $Project = Project_config->new(); | ||
| 118 | my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU(); | ||
| 119 | my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN(); | ||
| 120 | my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT(); | ||
| 121 | |||
| 122 | my $var = $get->var(); | ||
| 123 | my $on = $var->{_on}; | ||
| 124 | my $off = $var->{_off}; | ||
| 125 | my $true = $var->{_true}; | ||
| 126 | my $false = $var->{_false}; | ||
| 127 | my $empty_string = $var->{_empty_string}; | ||
| 128 | |||
| 129 | =head2 Encapsulated | ||
| 130 | hash of private variables | ||
| 131 | |||
| 132 | =cut | ||
| 133 | |||
| 134 | my $segbread = { | ||
| 135 | _auxf => '', | ||
| 136 | _ns => '', | ||
| 137 | _ntro => '', | ||
| 138 | _tape => '', | ||
| 139 | _Step => '', | ||
| 140 | _note => '', | ||
| 141 | |||
| 142 | }; | ||
| 143 | |||
| 144 | =head2 sub Step | ||
| 145 | |||
| 146 | collects switches and assembles bash instructions | ||
| 147 | by adding the program name | ||
| 148 | |||
| 149 | =cut | ||
| 150 | |||
| 151 | sub Step { | ||
| 152 | |||
| 153 | $segbread->{_Step} = 'segbread'.$segbread->{_Step}; | ||
| 154 | return ( $segbread->{_Step} ); | ||
| 155 | |||
| 156 | } | ||
| 157 | |||
| 158 | |||
| 159 | =head2 sub note | ||
| 160 | |||
| 161 | collects switches and assembles bash instructions | ||
| 162 | by adding the program name | ||
| 163 | |||
| 164 | =cut | ||
| 165 | |||
| 166 | sub note { | ||
| 167 | |||
| 168 | $segbread->{_note} = 'segbread'.$segbread->{_note}; | ||
| 169 | return ( $segbread->{_note} ); | ||
| 170 | |||
| 171 | } | ||
| 172 | |||
| 173 | |||
| 174 | |||
| 175 | =head2 sub clear | ||
| 176 | |||
| 177 | =cut | ||
| 178 | |||
| 179 | sub clear { | ||
| 180 | |||
| 181 | $segbread->{_auxf} = ''; | ||
| 182 | $segbread->{_ns} = ''; | ||
| 183 | $segbread->{_ntro} = ''; | ||
| 184 | $segbread->{_tape} = ''; | ||
| 185 | $segbread->{_Step} = ''; | ||
| 186 | $segbread->{_note} = ''; | ||
| 187 | } | ||
| 188 | |||
| 189 | |||
| 190 | =head2 sub auxf | ||
| 191 | |||
| 192 | |||
| 193 | =cut | ||
| 194 | |||
| 195 | sub auxf { | ||
| 196 | |||
| 197 | my ( $self,$auxf ) = @_; | ||
| 198 | if ( $auxf ne $empty_string ) { | ||
| 199 | |||
| 200 | $segbread->{_auxf} = $auxf; | ||
| 201 | $segbread->{_note} = $segbread->{_note}.' auxf='.$segbread->{_auxf}; | ||
| 202 | $segbread->{_Step} = $segbread->{_Step}.' auxf='.$segbread->{_auxf}; | ||
| 203 | |||
| 204 | } else { | ||
| 205 | print("segbread, auxf, missing auxf,\n"); | ||
| 206 | } | ||
| 207 | } | ||
| 208 | |||
| 209 | |||
| 210 | =head2 sub ns | ||
| 211 | |||
| 212 | |||
| 213 | =cut | ||
| 214 | |||
| 215 | sub ns { | ||
| 216 | |||
| 217 | my ( $self,$ns ) = @_; | ||
| 218 | if ( $ns ne $empty_string ) { | ||
| 219 | |||
| 220 | $segbread->{_ns} = $ns; | ||
| 221 | $segbread->{_note} = $segbread->{_note}.' ns='.$segbread->{_ns}; | ||
| 222 | $segbread->{_Step} = $segbread->{_Step}.' ns='.$segbread->{_ns}; | ||
| 223 | |||
| 224 | } else { | ||
| 225 | print("segbread, ns, missing ns,\n"); | ||
| 226 | } | ||
| 227 | } | ||
| 228 | |||
| 229 | |||
| 230 | =head2 sub ntro | ||
| 231 | |||
| 232 | |||
| 233 | =cut | ||
| 234 | |||
| 235 | sub ntro { | ||
| 236 | |||
| 237 | my ( $self,$ntro ) = @_; | ||
| 238 | if ( $ntro ne $empty_string ) { | ||
| 239 | |||
| 240 | $segbread->{_ntro} = $ntro; | ||
| 241 | $segbread->{_note} = $segbread->{_note}.' ntro='.$segbread->{_ntro}; | ||
| 242 | $segbread->{_Step} = $segbread->{_Step}.' ntro='.$segbread->{_ntro}; | ||
| 243 | |||
| 244 | } else { | ||
| 245 | print("segbread, ntro, missing ntro,\n"); | ||
| 246 | } | ||
| 247 | } | ||
| 248 | |||
| 249 | |||
| 250 | =head2 sub tape | ||
| 251 | |||
| 252 | |||
| 253 | =cut | ||
| 254 | |||
| 255 | sub tape { | ||
| 256 | |||
| 257 | my ( $self,$tape ) = @_; | ||
| 258 | if ( $tape ne $empty_string ) { | ||
| 259 | |||
| 260 | $segbread->{_tape} = $tape; | ||
| 261 | $segbread->{_note} = $segbread->{_note}.' tape='.$segbread->{_tape}; | ||
| 262 | $segbread->{_Step} = $segbread->{_Step}.' tape='.$segbread->{_tape}; | ||
| 263 | |||
| 264 | } else { | ||
| 265 | print("segbread, tape, missing tape,\n"); | ||
| 266 | } | ||
| 267 | } | ||
| 268 | |||
| 269 | |||
| 270 | =head2 sub get_max_index | ||
| 271 | |||
| 272 | max index = number of input variables -1 | ||
| 273 | |||
| 274 | =cut | ||
| 275 | |||
| 276 | sub get_max_index { | ||
| 277 | my ($self) = @_; | ||
| 278 | my $max_index = 3; | ||
| 279 | |||
| 280 | return($max_index); | ||
| 281 | } | ||
| 282 | |||
| 283 | |||
| 284 | 1; |