« lib/App/SeismicUnixGui/sunix/header/su3dchart.pm
↑ Summary
lib/App/SeismicUnixGui/sunix/header/suchart.pm »
| 1 | package App::SeismicUnixGui::sunix::header::sucdpbin; | ||
| 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 | SUCDPBIN - Compute CDP bin number | ||
| 25 | |||
| 26 | |||
| 27 | |||
| 28 | sucdpbin <stdin >stdout xline= yline= dcdp= | ||
| 29 | |||
| 30 | |||
| 31 | |||
| 32 | Required parameters: | ||
| 33 | |||
| 34 | xline= array of X defining the CDP line | ||
| 35 | |||
| 36 | yline= array of Y defining the CDP line | ||
| 37 | |||
| 38 | dcdp= distance between bin centers | ||
| 39 | |||
| 40 | |||
| 41 | |||
| 42 | Optional parameters | ||
| 43 | |||
| 44 | verbose=0 <>0 output informations | ||
| 45 | |||
| 46 | cdpmin=1001 min cdp bin number | ||
| 47 | |||
| 48 | distmax=dcdp search radius | ||
| 49 | |||
| 50 | |||
| 51 | |||
| 52 | xline,yline defines the CDP line made of continuous straight lines. | ||
| 53 | |||
| 54 | If a smoother line is required, use unisam to interpolate. | ||
| 55 | |||
| 56 | Bin centers are located at dcdp constant interval on this line. | ||
| 57 | |||
| 58 | Each trace will be numbered with the number of the closest bin. If no | ||
| 59 | |||
| 60 | bin center is found within the search radius. cdp is set to 0 | ||
| 61 | |||
| 62 | |||
| 63 | |||
| 64 | |||
| 65 | |||
| 66 | Credits: | ||
| 67 | |||
| 68 | 2009 Dominique Rousset - Mohamed Hamza | ||
| 69 | |||
| 70 | Université de Pau et des Pays de l'Adour (France) | ||
| 71 | |||
| 72 | |||
| 73 | |||
| 74 | |||
| 75 | |||
| 76 | =head2 User's notes (Juan Lorenzo) | ||
| 77 | untested | ||
| 78 | |||
| 79 | =cut | ||
| 80 | |||
| 81 | |||
| 82 | =head2 CHANGES and their DATES | ||
| 83 | |||
| 84 | =cut | ||
| 85 | |||
| 86 | use Moose; | ||
| 87 | our $VERSION = '0.0.1'; | ||
| 88 | |||
| 89 | |||
| 90 | =head2 Import packages | ||
| 91 | |||
| 92 | =cut | ||
| 93 | |||
| 94 | use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants'; | ||
| 95 | |||
| 96 | use App::SeismicUnixGui::misc::SeismicUnix qw($go $in $off $on $out $ps $to $suffix_ascii $suffix_bin $suffix_ps $suffix_segy $suffix_su); | ||
| 97 | use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config'; | ||
| 98 | |||
| 99 | |||
| 100 | =head2 instantiation of packages | ||
| 101 | |||
| 102 | =cut | ||
| 103 | |||
| 104 | my $get = L_SU_global_constants->new(); | ||
| 105 | my $Project = Project_config->new(); | ||
| 106 | my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU(); | ||
| 107 | my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN(); | ||
| 108 | my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT(); | ||
| 109 | |||
| 110 | my $PS_SEISMIC = $Project->PS_SEISMIC(); | ||
| 111 | |||
| 112 | my $var = $get->var(); | ||
| 113 | my $on = $var->{_on}; | ||
| 114 | my $off = $var->{_off}; | ||
| 115 | my $true = $var->{_true}; | ||
| 116 | my $false = $var->{_false}; | ||
| 117 | my $empty_string = $var->{_empty_string}; | ||
| 118 | |||
| 119 | =head2 Encapsulated | ||
| 120 | hash of private variables | ||
| 121 | |||
| 122 | =cut | ||
| 123 | |||
| 124 | my $sucdpbin = { | ||
| 125 | _cdpmin => '', | ||
| 126 | _dcdp => '', | ||
| 127 | _distmax => '', | ||
| 128 | _verbose => '', | ||
| 129 | _xline => '', | ||
| 130 | _yline => '', | ||
| 131 | _Step => '', | ||
| 132 | _note => '', | ||
| 133 | |||
| 134 | }; | ||
| 135 | |||
| 136 | =head2 sub Step | ||
| 137 | |||
| 138 | collects switches and assembles bash instructions | ||
| 139 | by adding the program name | ||
| 140 | |||
| 141 | =cut | ||
| 142 | |||
| 143 | sub Step { | ||
| 144 | |||
| 145 | $sucdpbin->{_Step} = 'sucdpbin'.$sucdpbin->{_Step}; | ||
| 146 | return ( $sucdpbin->{_Step} ); | ||
| 147 | |||
| 148 | } | ||
| 149 | |||
| 150 | |||
| 151 | =head2 sub note | ||
| 152 | |||
| 153 | collects switches and assembles bash instructions | ||
| 154 | by adding the program name | ||
| 155 | |||
| 156 | =cut | ||
| 157 | |||
| 158 | sub note { | ||
| 159 | |||
| 160 | $sucdpbin->{_note} = 'sucdpbin'.$sucdpbin->{_note}; | ||
| 161 | return ( $sucdpbin->{_note} ); | ||
| 162 | |||
| 163 | } | ||
| 164 | |||
| 165 | |||
| 166 | |||
| 167 | =head2 sub clear | ||
| 168 | |||
| 169 | =cut | ||
| 170 | |||
| 171 | sub clear { | ||
| 172 | |||
| 173 | $sucdpbin->{_cdpmin} = ''; | ||
| 174 | $sucdpbin->{_dcdp} = ''; | ||
| 175 | $sucdpbin->{_distmax} = ''; | ||
| 176 | $sucdpbin->{_verbose} = ''; | ||
| 177 | $sucdpbin->{_xline} = ''; | ||
| 178 | $sucdpbin->{_yline} = ''; | ||
| 179 | $sucdpbin->{_Step} = ''; | ||
| 180 | $sucdpbin->{_note} = ''; | ||
| 181 | } | ||
| 182 | |||
| 183 | |||
| 184 | =head2 sub cdpmin | ||
| 185 | |||
| 186 | |||
| 187 | =cut | ||
| 188 | |||
| 189 | sub cdpmin { | ||
| 190 | |||
| 191 | my ( $self,$cdpmin ) = @_; | ||
| 192 | if ( $cdpmin ne $empty_string ) { | ||
| 193 | |||
| 194 | $sucdpbin->{_cdpmin} = $cdpmin; | ||
| 195 | $sucdpbin->{_note} = $sucdpbin->{_note}.' cdpmin='.$sucdpbin->{_cdpmin}; | ||
| 196 | $sucdpbin->{_Step} = $sucdpbin->{_Step}.' cdpmin='.$sucdpbin->{_cdpmin}; | ||
| 197 | |||
| 198 | } else { | ||
| 199 | print("sucdpbin, cdpmin, missing cdpmin,\n"); | ||
| 200 | } | ||
| 201 | } | ||
| 202 | |||
| 203 | |||
| 204 | =head2 sub dcdp | ||
| 205 | |||
| 206 | |||
| 207 | =cut | ||
| 208 | |||
| 209 | sub dcdp { | ||
| 210 | |||
| 211 | my ( $self,$dcdp ) = @_; | ||
| 212 | if ( $dcdp ne $empty_string ) { | ||
| 213 | |||
| 214 | $sucdpbin->{_dcdp} = $dcdp; | ||
| 215 | $sucdpbin->{_note} = $sucdpbin->{_note}.' dcdp='.$sucdpbin->{_dcdp}; | ||
| 216 | $sucdpbin->{_Step} = $sucdpbin->{_Step}.' dcdp='.$sucdpbin->{_dcdp}; | ||
| 217 | |||
| 218 | } else { | ||
| 219 | print("sucdpbin, dcdp, missing dcdp,\n"); | ||
| 220 | } | ||
| 221 | } | ||
| 222 | |||
| 223 | |||
| 224 | =head2 sub distmax | ||
| 225 | |||
| 226 | |||
| 227 | =cut | ||
| 228 | |||
| 229 | sub distmax { | ||
| 230 | |||
| 231 | my ( $self,$distmax ) = @_; | ||
| 232 | if ( $distmax ne $empty_string ) { | ||
| 233 | |||
| 234 | $sucdpbin->{_distmax} = $distmax; | ||
| 235 | $sucdpbin->{_note} = $sucdpbin->{_note}.' distmax='.$sucdpbin->{_distmax}; | ||
| 236 | $sucdpbin->{_Step} = $sucdpbin->{_Step}.' distmax='.$sucdpbin->{_distmax}; | ||
| 237 | |||
| 238 | } else { | ||
| 239 | print("sucdpbin, distmax, missing distmax,\n"); | ||
| 240 | } | ||
| 241 | } | ||
| 242 | |||
| 243 | |||
| 244 | =head2 sub verbose | ||
| 245 | |||
| 246 | |||
| 247 | =cut | ||
| 248 | |||
| 249 | sub verbose { | ||
| 250 | |||
| 251 | my ( $self,$verbose ) = @_; | ||
| 252 | if ( $verbose ne $empty_string ) { | ||
| 253 | |||
| 254 | $sucdpbin->{_verbose} = $verbose; | ||
| 255 | $sucdpbin->{_note} = $sucdpbin->{_note}.' verbose='.$sucdpbin->{_verbose}; | ||
| 256 | $sucdpbin->{_Step} = $sucdpbin->{_Step}.' verbose='.$sucdpbin->{_verbose}; | ||
| 257 | |||
| 258 | } else { | ||
| 259 | print("sucdpbin, verbose, missing verbose,\n"); | ||
| 260 | } | ||
| 261 | } | ||
| 262 | |||
| 263 | |||
| 264 | =head2 sub xline | ||
| 265 | |||
| 266 | |||
| 267 | =cut | ||
| 268 | |||
| 269 | sub xline { | ||
| 270 | |||
| 271 | my ( $self,$xline ) = @_; | ||
| 272 | if ( $xline ne $empty_string ) { | ||
| 273 | |||
| 274 | $sucdpbin->{_xline} = $xline; | ||
| 275 | $sucdpbin->{_note} = $sucdpbin->{_note}.' xline='.$sucdpbin->{_xline}; | ||
| 276 | $sucdpbin->{_Step} = $sucdpbin->{_Step}.' xline='.$sucdpbin->{_xline}; | ||
| 277 | |||
| 278 | } else { | ||
| 279 | print("sucdpbin, xline, missing xline,\n"); | ||
| 280 | } | ||
| 281 | } | ||
| 282 | |||
| 283 | |||
| 284 | =head2 sub yline | ||
| 285 | |||
| 286 | |||
| 287 | =cut | ||
| 288 | |||
| 289 | sub yline { | ||
| 290 | |||
| 291 | my ( $self,$yline ) = @_; | ||
| 292 | if ( $yline ne $empty_string ) { | ||
| 293 | |||
| 294 | $sucdpbin->{_yline} = $yline; | ||
| 295 | $sucdpbin->{_note} = $sucdpbin->{_note}.' yline='.$sucdpbin->{_yline}; | ||
| 296 | $sucdpbin->{_Step} = $sucdpbin->{_Step}.' yline='.$sucdpbin->{_yline}; | ||
| 297 | |||
| 298 | } else { | ||
| 299 | print("sucdpbin, yline, missing yline,\n"); | ||
| 300 | } | ||
| 301 | } | ||
| 302 | |||
| 303 | |||
| 304 | =head2 sub get_max_index | ||
| 305 | |||
| 306 | max index = number of input variables -1 | ||
| 307 | |||
| 308 | =cut | ||
| 309 | |||
| 310 | sub get_max_index { | ||
| 311 | my ($self) = @_; | ||
| 312 | my $max_index = 5; | ||
| 313 | |||
| 314 | return($max_index); | ||
| 315 | } | ||
| 316 | |||
| 317 | |||
| 318 | 1; |