« lib/App/SeismicUnixGui/sunix/NMO_Vel_Stk/suztot.pm
↑ Summary
lib/App/SeismicUnixGui/sunix/header/suahw.pm »
| 1 | package App::SeismicUnixGui::sunix::data::wptcomp; | ||
| 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 | WPTCOMP - Compression by Wavelet Packet Compression | ||
| 25 | |||
| 26 | |||
| 27 | |||
| 28 | wptcomp < stdin n1= n2= [optional parameter] > sdtout | ||
| 29 | |||
| 30 | |||
| 31 | |||
| 32 | Required Parameters: | ||
| 33 | |||
| 34 | n1= number of samples in the fast (first) dimension | ||
| 35 | |||
| 36 | n2= number of samples in the slow (second) dimension | ||
| 37 | |||
| 38 | |||
| 39 | |||
| 40 | Optional Parameters: | ||
| 41 | |||
| 42 | nfilter1=11 number of filters in direction 1 | ||
| 43 | |||
| 44 | nfilter2=11 number of filters in direction 2 | ||
| 45 | |||
| 46 | nstage1= filter stages (automatically set based on n1) | ||
| 47 | |||
| 48 | nstage2= filter stages (automatically set based on n2) | ||
| 49 | |||
| 50 | error=0.01 acceptable error | ||
| 51 | |||
| 52 | |||
| 53 | |||
| 54 | |||
| 55 | |||
| 56 | |||
| 57 | |||
| 58 | Author: CWP: Tong Chen, Dec 1995 | ||
| 59 | |||
| 60 | |||
| 61 | |||
| 62 | =head2 User's notes (Juan Lorenzo) | ||
| 63 | untested | ||
| 64 | |||
| 65 | =cut | ||
| 66 | |||
| 67 | |||
| 68 | =head2 CHANGES and their DATES | ||
| 69 | |||
| 70 | =cut | ||
| 71 | |||
| 72 | use Moose; | ||
| 73 | our $VERSION = '0.0.1'; | ||
| 74 | |||
| 75 | |||
| 76 | =head2 Import packages | ||
| 77 | |||
| 78 | =cut | ||
| 79 | |||
| 80 | use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants'; | ||
| 81 | |||
| 82 | use App::SeismicUnixGui::misc::SeismicUnix qw($in $out $on $go $to $suffix_ascii $off $suffix_su $suffix_bin); | ||
| 83 | use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config'; | ||
| 84 | |||
| 85 | |||
| 86 | =head2 instantiation of packages | ||
| 87 | |||
| 88 | =cut | ||
| 89 | |||
| 90 | my $get = L_SU_global_constants->new(); | ||
| 91 | my $Project = Project_config->new(); | ||
| 92 | my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU(); | ||
| 93 | my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN(); | ||
| 94 | my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT(); | ||
| 95 | |||
| 96 | my $var = $get->var(); | ||
| 97 | my $on = $var->{_on}; | ||
| 98 | my $off = $var->{_off}; | ||
| 99 | my $true = $var->{_true}; | ||
| 100 | my $false = $var->{_false}; | ||
| 101 | my $empty_string = $var->{_empty_string}; | ||
| 102 | |||
| 103 | =head2 Encapsulated | ||
| 104 | hash of private variables | ||
| 105 | |||
| 106 | =cut | ||
| 107 | |||
| 108 | my $wptcomp = { | ||
| 109 | _error => '', | ||
| 110 | _n1 => '', | ||
| 111 | _n2 => '', | ||
| 112 | _nfilter1 => '', | ||
| 113 | _nfilter2 => '', | ||
| 114 | _nstage1 => '', | ||
| 115 | _nstage2 => '', | ||
| 116 | _Step => '', | ||
| 117 | _note => '', | ||
| 118 | |||
| 119 | }; | ||
| 120 | |||
| 121 | =head2 sub Step | ||
| 122 | |||
| 123 | collects switches and assembles bash instructions | ||
| 124 | by adding the program name | ||
| 125 | |||
| 126 | =cut | ||
| 127 | |||
| 128 | sub Step { | ||
| 129 | |||
| 130 | $wptcomp->{_Step} = 'wptcomp'.$wptcomp->{_Step}; | ||
| 131 | return ( $wptcomp->{_Step} ); | ||
| 132 | |||
| 133 | } | ||
| 134 | |||
| 135 | |||
| 136 | =head2 sub note | ||
| 137 | |||
| 138 | collects switches and assembles bash instructions | ||
| 139 | by adding the program name | ||
| 140 | |||
| 141 | =cut | ||
| 142 | |||
| 143 | sub note { | ||
| 144 | |||
| 145 | $wptcomp->{_note} = 'wptcomp'.$wptcomp->{_note}; | ||
| 146 | return ( $wptcomp->{_note} ); | ||
| 147 | |||
| 148 | } | ||
| 149 | |||
| 150 | |||
| 151 | |||
| 152 | =head2 sub clear | ||
| 153 | |||
| 154 | =cut | ||
| 155 | |||
| 156 | sub clear { | ||
| 157 | |||
| 158 | $wptcomp->{_error} = ''; | ||
| 159 | $wptcomp->{_n1} = ''; | ||
| 160 | $wptcomp->{_n2} = ''; | ||
| 161 | $wptcomp->{_nfilter1} = ''; | ||
| 162 | $wptcomp->{_nfilter2} = ''; | ||
| 163 | $wptcomp->{_nstage1} = ''; | ||
| 164 | $wptcomp->{_nstage2} = ''; | ||
| 165 | $wptcomp->{_Step} = ''; | ||
| 166 | $wptcomp->{_note} = ''; | ||
| 167 | } | ||
| 168 | |||
| 169 | |||
| 170 | =head2 sub error | ||
| 171 | |||
| 172 | |||
| 173 | =cut | ||
| 174 | |||
| 175 | sub error { | ||
| 176 | |||
| 177 | my ( $self,$error ) = @_; | ||
| 178 | if ( $error ne $empty_string ) { | ||
| 179 | |||
| 180 | $wptcomp->{_error} = $error; | ||
| 181 | $wptcomp->{_note} = $wptcomp->{_note}.' error='.$wptcomp->{_error}; | ||
| 182 | $wptcomp->{_Step} = $wptcomp->{_Step}.' error='.$wptcomp->{_error}; | ||
| 183 | |||
| 184 | } else { | ||
| 185 | print("wptcomp, error, missing error,\n"); | ||
| 186 | } | ||
| 187 | } | ||
| 188 | |||
| 189 | |||
| 190 | =head2 sub n1 | ||
| 191 | |||
| 192 | |||
| 193 | =cut | ||
| 194 | |||
| 195 | sub n1 { | ||
| 196 | |||
| 197 | my ( $self,$n1 ) = @_; | ||
| 198 | if ( $n1 ne $empty_string ) { | ||
| 199 | |||
| 200 | $wptcomp->{_n1} = $n1; | ||
| 201 | $wptcomp->{_note} = $wptcomp->{_note}.' n1='.$wptcomp->{_n1}; | ||
| 202 | $wptcomp->{_Step} = $wptcomp->{_Step}.' n1='.$wptcomp->{_n1}; | ||
| 203 | |||
| 204 | } else { | ||
| 205 | print("wptcomp, n1, missing n1,\n"); | ||
| 206 | } | ||
| 207 | } | ||
| 208 | |||
| 209 | |||
| 210 | =head2 sub n2 | ||
| 211 | |||
| 212 | |||
| 213 | =cut | ||
| 214 | |||
| 215 | sub n2 { | ||
| 216 | |||
| 217 | my ( $self,$n2 ) = @_; | ||
| 218 | if ( $n2 ne $empty_string ) { | ||
| 219 | |||
| 220 | $wptcomp->{_n2} = $n2; | ||
| 221 | $wptcomp->{_note} = $wptcomp->{_note}.' n2='.$wptcomp->{_n2}; | ||
| 222 | $wptcomp->{_Step} = $wptcomp->{_Step}.' n2='.$wptcomp->{_n2}; | ||
| 223 | |||
| 224 | } else { | ||
| 225 | print("wptcomp, n2, missing n2,\n"); | ||
| 226 | } | ||
| 227 | } | ||
| 228 | |||
| 229 | |||
| 230 | =head2 sub nfilter1 | ||
| 231 | |||
| 232 | |||
| 233 | =cut | ||
| 234 | |||
| 235 | sub nfilter1 { | ||
| 236 | |||
| 237 | my ( $self,$nfilter1 ) = @_; | ||
| 238 | if ( $nfilter1 ne $empty_string ) { | ||
| 239 | |||
| 240 | $wptcomp->{_nfilter1} = $nfilter1; | ||
| 241 | $wptcomp->{_note} = $wptcomp->{_note}.' nfilter1='.$wptcomp->{_nfilter1}; | ||
| 242 | $wptcomp->{_Step} = $wptcomp->{_Step}.' nfilter1='.$wptcomp->{_nfilter1}; | ||
| 243 | |||
| 244 | } else { | ||
| 245 | print("wptcomp, nfilter1, missing nfilter1,\n"); | ||
| 246 | } | ||
| 247 | } | ||
| 248 | |||
| 249 | |||
| 250 | =head2 sub nfilter2 | ||
| 251 | |||
| 252 | |||
| 253 | =cut | ||
| 254 | |||
| 255 | sub nfilter2 { | ||
| 256 | |||
| 257 | my ( $self,$nfilter2 ) = @_; | ||
| 258 | if ( $nfilter2 ne $empty_string ) { | ||
| 259 | |||
| 260 | $wptcomp->{_nfilter2} = $nfilter2; | ||
| 261 | $wptcomp->{_note} = $wptcomp->{_note}.' nfilter2='.$wptcomp->{_nfilter2}; | ||
| 262 | $wptcomp->{_Step} = $wptcomp->{_Step}.' nfilter2='.$wptcomp->{_nfilter2}; | ||
| 263 | |||
| 264 | } else { | ||
| 265 | print("wptcomp, nfilter2, missing nfilter2,\n"); | ||
| 266 | } | ||
| 267 | } | ||
| 268 | |||
| 269 | |||
| 270 | =head2 sub nstage1 | ||
| 271 | |||
| 272 | |||
| 273 | =cut | ||
| 274 | |||
| 275 | sub nstage1 { | ||
| 276 | |||
| 277 | my ( $self,$nstage1 ) = @_; | ||
| 278 | if ( $nstage1 ne $empty_string ) { | ||
| 279 | |||
| 280 | $wptcomp->{_nstage1} = $nstage1; | ||
| 281 | $wptcomp->{_note} = $wptcomp->{_note}.' nstage1='.$wptcomp->{_nstage1}; | ||
| 282 | $wptcomp->{_Step} = $wptcomp->{_Step}.' nstage1='.$wptcomp->{_nstage1}; | ||
| 283 | |||
| 284 | } else { | ||
| 285 | print("wptcomp, nstage1, missing nstage1,\n"); | ||
| 286 | } | ||
| 287 | } | ||
| 288 | |||
| 289 | |||
| 290 | =head2 sub nstage2 | ||
| 291 | |||
| 292 | |||
| 293 | =cut | ||
| 294 | |||
| 295 | sub nstage2 { | ||
| 296 | |||
| 297 | my ( $self,$nstage2 ) = @_; | ||
| 298 | if ( $nstage2 ne $empty_string ) { | ||
| 299 | |||
| 300 | $wptcomp->{_nstage2} = $nstage2; | ||
| 301 | $wptcomp->{_note} = $wptcomp->{_note}.' nstage2='.$wptcomp->{_nstage2}; | ||
| 302 | $wptcomp->{_Step} = $wptcomp->{_Step}.' nstage2='.$wptcomp->{_nstage2}; | ||
| 303 | |||
| 304 | } else { | ||
| 305 | print("wptcomp, nstage2, missing nstage2,\n"); | ||
| 306 | } | ||
| 307 | } | ||
| 308 | |||
| 309 | |||
| 310 | =head2 sub get_max_index | ||
| 311 | |||
| 312 | max index = number of input variables -1 | ||
| 313 | |||
| 314 | =cut | ||
| 315 | |||
| 316 | sub get_max_index { | ||
| 317 | my ($self) = @_; | ||
| 318 | my $max_index = 6; | ||
| 319 | |||
| 320 | return($max_index); | ||
| 321 | } | ||
| 322 | |||
| 323 | |||
| 324 | 1; |