| 1 | package App::SeismicUnixGui::sunix::data::supack1; | ||
| 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 | SUPACK1 - pack segy trace data into chars | ||
| 25 | |||
| 26 | |||
| 27 | |||
| 28 | supack1 <segy_file >packed_file gpow=0.5 | ||
| 29 | |||
| 30 | |||
| 31 | |||
| 32 | Required parameters: | ||
| 33 | |||
| 34 | none | ||
| 35 | |||
| 36 | |||
| 37 | |||
| 38 | Optional parameter: | ||
| 39 | |||
| 40 | gpow=0.5 exponent used to compress the dynamic | ||
| 41 | |||
| 42 | range of the traces | ||
| 43 | |||
| 44 | |||
| 45 | |||
| 46 | |||
| 47 | |||
| 48 | Credits: | ||
| 49 | |||
| 50 | CWP: Jack K. Cohen, Shuki Ronen, Brian Sumner | ||
| 51 | |||
| 52 | |||
| 53 | |||
| 54 | Caveats: | ||
| 55 | |||
| 56 | This program is for single site use. Use segywrite to make | ||
| 57 | |||
| 58 | a portable tape. | ||
| 59 | |||
| 60 | |||
| 61 | |||
| 62 | We are storing the local header words, ungpow and unscale, | ||
| 63 | |||
| 64 | required by suunpack1 as floats. Although not essential | ||
| 65 | |||
| 66 | (compare the handling of such fields as dt), it allows us | ||
| 67 | |||
| 68 | to demonstrate the convenience of using the natural data type. | ||
| 69 | |||
| 70 | In any case, the data itself is non-portable floats in general, | ||
| 71 | |||
| 72 | so we aren't giving up any intrinsic portability. | ||
| 73 | |||
| 74 | |||
| 75 | |||
| 76 | Notes: | ||
| 77 | |||
| 78 | ungpow and unscale are defined in segy.h | ||
| 79 | |||
| 80 | trid = CHARPACK is defined in su.h and segy.h | ||
| 81 | |||
| 82 | |||
| 83 | |||
| 84 | Trace header fields accessed: ns | ||
| 85 | |||
| 86 | Trace header fields modified: ungpow, unscale, trid | ||
| 87 | |||
| 88 | |||
| 89 | |||
| 90 | =head2 User's notes (Juan Lorenzo) | ||
| 91 | untested | ||
| 92 | |||
| 93 | =cut | ||
| 94 | |||
| 95 | |||
| 96 | =head2 CHANGES and their DATES | ||
| 97 | |||
| 98 | =cut | ||
| 99 | |||
| 100 | use Moose; | ||
| 101 | our $VERSION = '0.0.1'; | ||
| 102 | |||
| 103 | |||
| 104 | =head2 Import packages | ||
| 105 | |||
| 106 | =cut | ||
| 107 | |||
| 108 | use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants'; | ||
| 109 | |||
| 110 | use App::SeismicUnixGui::misc::SeismicUnix qw($in $out $on $go $to $suffix_ascii $off $suffix_su $suffix_bin); | ||
| 111 | use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config'; | ||
| 112 | |||
| 113 | |||
| 114 | =head2 instantiation of packages | ||
| 115 | |||
| 116 | =cut | ||
| 117 | |||
| 118 | my $get = L_SU_global_constants->new(); | ||
| 119 | my $Project = Project_config->new(); | ||
| 120 | my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU(); | ||
| 121 | my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN(); | ||
| 122 | my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT(); | ||
| 123 | |||
| 124 | my $var = $get->var(); | ||
| 125 | my $on = $var->{_on}; | ||
| 126 | my $off = $var->{_off}; | ||
| 127 | my $true = $var->{_true}; | ||
| 128 | my $false = $var->{_false}; | ||
| 129 | my $empty_string = $var->{_empty_string}; | ||
| 130 | |||
| 131 | =head2 Encapsulated | ||
| 132 | hash of private variables | ||
| 133 | |||
| 134 | =cut | ||
| 135 | |||
| 136 | my $supack1 = { | ||
| 137 | _gpow => '', | ||
| 138 | _trid => '', | ||
| 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 | $supack1->{_Step} = 'supack1'.$supack1->{_Step}; | ||
| 154 | return ( $supack1->{_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 | $supack1->{_note} = 'supack1'.$supack1->{_note}; | ||
| 169 | return ( $supack1->{_note} ); | ||
| 170 | |||
| 171 | } | ||
| 172 | |||
| 173 | |||
| 174 | |||
| 175 | =head2 sub clear | ||
| 176 | |||
| 177 | =cut | ||
| 178 | |||
| 179 | sub clear { | ||
| 180 | |||
| 181 | $supack1->{_gpow} = ''; | ||
| 182 | $supack1->{_trid} = ''; | ||
| 183 | $supack1->{_Step} = ''; | ||
| 184 | $supack1->{_note} = ''; | ||
| 185 | } | ||
| 186 | |||
| 187 | |||
| 188 | =head2 sub gpow | ||
| 189 | |||
| 190 | |||
| 191 | =cut | ||
| 192 | |||
| 193 | sub gpow { | ||
| 194 | |||
| 195 | my ( $self,$gpow ) = @_; | ||
| 196 | if ( $gpow ne $empty_string ) { | ||
| 197 | |||
| 198 | $supack1->{_gpow} = $gpow; | ||
| 199 | $supack1->{_note} = $supack1->{_note}.' gpow='.$supack1->{_gpow}; | ||
| 200 | $supack1->{_Step} = $supack1->{_Step}.' gpow='.$supack1->{_gpow}; | ||
| 201 | |||
| 202 | } else { | ||
| 203 | print("supack1, gpow, missing gpow,\n"); | ||
| 204 | } | ||
| 205 | } | ||
| 206 | |||
| 207 | |||
| 208 | =head2 sub trid | ||
| 209 | |||
| 210 | |||
| 211 | =cut | ||
| 212 | |||
| 213 | sub trid { | ||
| 214 | |||
| 215 | my ( $self,$trid ) = @_; | ||
| 216 | if ( $trid ne $empty_string ) { | ||
| 217 | |||
| 218 | $supack1->{_trid} = $trid; | ||
| 219 | $supack1->{_note} = $supack1->{_note}.' trid='.$supack1->{_trid}; | ||
| 220 | $supack1->{_Step} = $supack1->{_Step}.' trid='.$supack1->{_trid}; | ||
| 221 | |||
| 222 | } else { | ||
| 223 | print("supack1, trid, missing trid,\n"); | ||
| 224 | } | ||
| 225 | } | ||
| 226 | |||
| 227 | |||
| 228 | =head2 sub get_max_index | ||
| 229 | |||
| 230 | max index = number of input variables -1 | ||
| 231 | |||
| 232 | =cut | ||
| 233 | |||
| 234 | sub get_max_index { | ||
| 235 | my ($self) = @_; | ||
| 236 | my $max_index = 0; | ||
| 237 | |||
| 238 | return($max_index); | ||
| 239 | } | ||
| 240 | |||
| 241 | |||
| 242 | 1; |