« lib/App/SeismicUnixGui/sunix/header/sukeycount.pm
↑ Summary
lib/App/SeismicUnixGui/sunix/model/suimpedance.pm »
| 1 | package App::SeismicUnixGui::sunix::header::sutrcount; | ||
| 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 | SUTRCOUNT - SU program to count the TRaces in infile | ||
| 25 | |||
| 26 | |||
| 27 | |||
| 28 | sutrcount < infile | ||
| 29 | |||
| 30 | Required parameters: | ||
| 31 | |||
| 32 | none | ||
| 33 | |||
| 34 | Optional parameter: | ||
| 35 | |||
| 36 | outpar=stdout | ||
| 37 | |||
| 38 | Notes: | ||
| 39 | |||
| 40 | Once you have the value of ntr, you may set the ntr header field | ||
| 41 | |||
| 42 | via: | ||
| 43 | |||
| 44 | sushw key=ntr a=NTR < datain.su > dataout.su | ||
| 45 | |||
| 46 | Where NTR is the value of the count obtained with sutrcount | ||
| 47 | |||
| 48 | |||
| 49 | |||
| 50 | |||
| 51 | |||
| 52 | Credits: B.Nemeth, Potash Corporation, Saskatchewan | ||
| 53 | |||
| 54 | given to CWP in 2008 with permission of Potash Corporation | ||
| 55 | |||
| 56 | |||
| 57 | |||
| 58 | |||
| 59 | |||
| 60 | =head2 User's notes (Juan Lorenzo) | ||
| 61 | untested | ||
| 62 | |||
| 63 | =cut | ||
| 64 | |||
| 65 | |||
| 66 | =head2 CHANGES and their DATES | ||
| 67 | |||
| 68 | =cut | ||
| 69 | |||
| 70 | use Moose; | ||
| 71 | our $VERSION = '0.0.1'; | ||
| 72 | |||
| 73 | |||
| 74 | =head2 Import packages | ||
| 75 | |||
| 76 | =cut | ||
| 77 | |||
| 78 | use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants'; | ||
| 79 | |||
| 80 | use App::SeismicUnixGui::misc::SeismicUnix qw($go $in $off $on $out $ps $to $suffix_ascii $suffix_bin $suffix_ps $suffix_segy $suffix_su); | ||
| 81 | use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config'; | ||
| 82 | |||
| 83 | |||
| 84 | =head2 instantiation of packages | ||
| 85 | |||
| 86 | =cut | ||
| 87 | |||
| 88 | my $get = L_SU_global_constants->new(); | ||
| 89 | my $Project = Project_config->new(); | ||
| 90 | my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU(); | ||
| 91 | my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN(); | ||
| 92 | my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT(); | ||
| 93 | |||
| 94 | my $PS_SEISMIC = $Project->PS_SEISMIC(); | ||
| 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 $sutrcount = { | ||
| 109 | _key => '', | ||
| 110 | _outpar => '', | ||
| 111 | _Step => '', | ||
| 112 | _note => '', | ||
| 113 | |||
| 114 | }; | ||
| 115 | |||
| 116 | =head2 sub Step | ||
| 117 | |||
| 118 | collects switches and assembles bash instructions | ||
| 119 | by adding the program name | ||
| 120 | |||
| 121 | =cut | ||
| 122 | |||
| 123 | sub Step { | ||
| 124 | |||
| 125 | $sutrcount->{_Step} = 'sutrcount'.$sutrcount->{_Step}; | ||
| 126 | return ( $sutrcount->{_Step} ); | ||
| 127 | |||
| 128 | } | ||
| 129 | |||
| 130 | |||
| 131 | =head2 sub note | ||
| 132 | |||
| 133 | collects switches and assembles bash instructions | ||
| 134 | by adding the program name | ||
| 135 | |||
| 136 | =cut | ||
| 137 | |||
| 138 | sub note { | ||
| 139 | |||
| 140 | $sutrcount->{_note} = 'sutrcount'.$sutrcount->{_note}; | ||
| 141 | return ( $sutrcount->{_note} ); | ||
| 142 | |||
| 143 | } | ||
| 144 | |||
| 145 | |||
| 146 | |||
| 147 | =head2 sub clear | ||
| 148 | |||
| 149 | =cut | ||
| 150 | |||
| 151 | sub clear { | ||
| 152 | |||
| 153 | $sutrcount->{_key} = ''; | ||
| 154 | $sutrcount->{_outpar} = ''; | ||
| 155 | $sutrcount->{_Step} = ''; | ||
| 156 | $sutrcount->{_note} = ''; | ||
| 157 | } | ||
| 158 | |||
| 159 | |||
| 160 | =head2 sub key | ||
| 161 | |||
| 162 | |||
| 163 | =cut | ||
| 164 | |||
| 165 | sub key { | ||
| 166 | |||
| 167 | my ( $self,$key ) = @_; | ||
| 168 | if ( $key ne $empty_string ) { | ||
| 169 | |||
| 170 | $sutrcount->{_key} = $key; | ||
| 171 | $sutrcount->{_note} = $sutrcount->{_note}.' key='.$sutrcount->{_key}; | ||
| 172 | $sutrcount->{_Step} = $sutrcount->{_Step}.' key='.$sutrcount->{_key}; | ||
| 173 | |||
| 174 | } else { | ||
| 175 | print("sutrcount, key, missing key,\n"); | ||
| 176 | } | ||
| 177 | } | ||
| 178 | |||
| 179 | |||
| 180 | =head2 sub outpar | ||
| 181 | |||
| 182 | |||
| 183 | =cut | ||
| 184 | |||
| 185 | sub outpar { | ||
| 186 | |||
| 187 | my ( $self,$outpar ) = @_; | ||
| 188 | if ( $outpar ne $empty_string ) { | ||
| 189 | |||
| 190 | $sutrcount->{_outpar} = $outpar; | ||
| 191 | $sutrcount->{_note} = $sutrcount->{_note}.' outpar='.$sutrcount->{_outpar}; | ||
| 192 | $sutrcount->{_Step} = $sutrcount->{_Step}.' outpar='.$sutrcount->{_outpar}; | ||
| 193 | |||
| 194 | } else { | ||
| 195 | print("sutrcount, outpar, missing outpar,\n"); | ||
| 196 | } | ||
| 197 | } | ||
| 198 | |||
| 199 | |||
| 200 | =head2 sub get_max_index | ||
| 201 | |||
| 202 | max index = number of input variables -1 | ||
| 203 | |||
| 204 | =cut | ||
| 205 | |||
| 206 | sub get_max_index { | ||
| 207 | my ($self) = @_; | ||
| 208 | my $max_index = 1; | ||
| 209 | |||
| 210 | return($max_index); | ||
| 211 | } | ||
| 212 | |||
| 213 | |||
| 214 | 1; |