« lib/App/SeismicUnixGui/sunix/data/supack2.pm
↑ Summary
lib/App/SeismicUnixGui/sunix/header/sucountkey.pm »
| 1 | package App::SeismicUnixGui::sunix::filter::susmgauss2; | ||
| 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 | SUSMGAUSS2 --- SMOOTH a uniformly sampled 2d array of velocities | ||
| 25 | |||
| 26 | using a Gaussian filter specified with correlation | ||
| 27 | |||
| 28 | lengths a1 and a2. | ||
| 29 | |||
| 30 | |||
| 31 | |||
| 32 | susmgauss2 < stdin [optional parameters ] > stdout | ||
| 33 | |||
| 34 | |||
| 35 | |||
| 36 | Optional Parameters: | ||
| 37 | |||
| 38 | a1=0 smoothing parameter in the 1 direction | ||
| 39 | |||
| 40 | a2=0 smoothing parameter in the 2 direction | ||
| 41 | |||
| 42 | |||
| 43 | |||
| 44 | Notes: | ||
| 45 | |||
| 46 | Larger a1 and a2 result in a smoother velocity. The velocities are | ||
| 47 | |||
| 48 | first transformed to slowness and then a Gaussian filter is applied | ||
| 49 | |||
| 50 | in the wavenumber domain. | ||
| 51 | |||
| 52 | |||
| 53 | |||
| 54 | Input file must be in SU format. The output file is smoothed velocity | ||
| 55 | |||
| 56 | |||
| 57 | |||
| 58 | |||
| 59 | |||
| 60 | |||
| 61 | |||
| 62 | Credits: | ||
| 63 | |||
| 64 | CWP: Carlos Pacheco, 2005 | ||
| 65 | |||
| 66 | |||
| 67 | |||
| 68 | =head2 User's notes (Juan Lorenzo) | ||
| 69 | untested | ||
| 70 | |||
| 71 | =cut | ||
| 72 | |||
| 73 | |||
| 74 | =head2 CHANGES and their DATES | ||
| 75 | |||
| 76 | =cut | ||
| 77 | |||
| 78 | use Moose; | ||
| 79 | our $VERSION = '0.0.1'; | ||
| 80 | |||
| 81 | |||
| 82 | =head2 Import packages | ||
| 83 | |||
| 84 | =cut | ||
| 85 | |||
| 86 | use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants'; | ||
| 87 | |||
| 88 | use App::SeismicUnixGui::misc::SeismicUnix qw($go $in $off $on $out $ps $to $suffix_ascii $suffix_bin $suffix_ps $suffix_segy $suffix_su); | ||
| 89 | use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config'; | ||
| 90 | |||
| 91 | |||
| 92 | =head2 instantiation of packages | ||
| 93 | |||
| 94 | =cut | ||
| 95 | |||
| 96 | my $get = L_SU_global_constants->new(); | ||
| 97 | my $Project = Project_config->new(); | ||
| 98 | my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU(); | ||
| 99 | my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN(); | ||
| 100 | my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT(); | ||
| 101 | |||
| 102 | my $PS_SEISMIC = $Project->PS_SEISMIC(); | ||
| 103 | |||
| 104 | my $var = $get->var(); | ||
| 105 | my $on = $var->{_on}; | ||
| 106 | my $off = $var->{_off}; | ||
| 107 | my $true = $var->{_true}; | ||
| 108 | my $false = $var->{_false}; | ||
| 109 | my $empty_string = $var->{_empty_string}; | ||
| 110 | |||
| 111 | =head2 Encapsulated | ||
| 112 | hash of private variables | ||
| 113 | |||
| 114 | =cut | ||
| 115 | |||
| 116 | my $susmgauss2 = { | ||
| 117 | _a1 => '', | ||
| 118 | _a2 => '', | ||
| 119 | _Step => '', | ||
| 120 | _note => '', | ||
| 121 | |||
| 122 | }; | ||
| 123 | |||
| 124 | =head2 sub Step | ||
| 125 | |||
| 126 | collects switches and assembles bash instructions | ||
| 127 | by adding the program name | ||
| 128 | |||
| 129 | =cut | ||
| 130 | |||
| 131 | sub Step { | ||
| 132 | |||
| 133 | $susmgauss2->{_Step} = 'susmgauss2'.$susmgauss2->{_Step}; | ||
| 134 | return ( $susmgauss2->{_Step} ); | ||
| 135 | |||
| 136 | } | ||
| 137 | |||
| 138 | |||
| 139 | =head2 sub note | ||
| 140 | |||
| 141 | collects switches and assembles bash instructions | ||
| 142 | by adding the program name | ||
| 143 | |||
| 144 | =cut | ||
| 145 | |||
| 146 | sub note { | ||
| 147 | |||
| 148 | $susmgauss2->{_note} = 'susmgauss2'.$susmgauss2->{_note}; | ||
| 149 | return ( $susmgauss2->{_note} ); | ||
| 150 | |||
| 151 | } | ||
| 152 | |||
| 153 | |||
| 154 | |||
| 155 | =head2 sub clear | ||
| 156 | |||
| 157 | =cut | ||
| 158 | |||
| 159 | sub clear { | ||
| 160 | |||
| 161 | $susmgauss2->{_a1} = ''; | ||
| 162 | $susmgauss2->{_a2} = ''; | ||
| 163 | $susmgauss2->{_Step} = ''; | ||
| 164 | $susmgauss2->{_note} = ''; | ||
| 165 | } | ||
| 166 | |||
| 167 | |||
| 168 | =head2 sub a1 | ||
| 169 | |||
| 170 | |||
| 171 | =cut | ||
| 172 | |||
| 173 | sub a1 { | ||
| 174 | |||
| 175 | my ( $self,$a1 ) = @_; | ||
| 176 | if ( $a1 ne $empty_string ) { | ||
| 177 | |||
| 178 | $susmgauss2->{_a1} = $a1; | ||
| 179 | $susmgauss2->{_note} = $susmgauss2->{_note}.' a1='.$susmgauss2->{_a1}; | ||
| 180 | $susmgauss2->{_Step} = $susmgauss2->{_Step}.' a1='.$susmgauss2->{_a1}; | ||
| 181 | |||
| 182 | } else { | ||
| 183 | print("susmgauss2, a1, missing a1,\n"); | ||
| 184 | } | ||
| 185 | } | ||
| 186 | |||
| 187 | |||
| 188 | =head2 sub a2 | ||
| 189 | |||
| 190 | |||
| 191 | =cut | ||
| 192 | |||
| 193 | sub a2 { | ||
| 194 | |||
| 195 | my ( $self,$a2 ) = @_; | ||
| 196 | if ( $a2 ne $empty_string ) { | ||
| 197 | |||
| 198 | $susmgauss2->{_a2} = $a2; | ||
| 199 | $susmgauss2->{_note} = $susmgauss2->{_note}.' a2='.$susmgauss2->{_a2}; | ||
| 200 | $susmgauss2->{_Step} = $susmgauss2->{_Step}.' a2='.$susmgauss2->{_a2}; | ||
| 201 | |||
| 202 | } else { | ||
| 203 | print("susmgauss2, a2, missing a2,\n"); | ||
| 204 | } | ||
| 205 | } | ||
| 206 | |||
| 207 | |||
| 208 | =head2 sub get_max_index | ||
| 209 | |||
| 210 | max index = number of input variables -1 | ||
| 211 | |||
| 212 | =cut | ||
| 213 | |||
| 214 | sub get_max_index { | ||
| 215 | my ($self) = @_; | ||
| 216 | my $max_index = 1; | ||
| 217 | |||
| 218 | return($max_index); | ||
| 219 | } | ||
| 220 | |||
| 221 | |||
| 222 | 1; |