« lib/App/SeismicUnixGui/sunix/data/suoldtonew.pm
↑ Summary
lib/App/SeismicUnixGui/sunix/data/wpc1uncomp2.pm »
| 1 | package App::SeismicUnixGui::sunix::data::suunpack1; | ||
| 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 | SUUNPACK1 - unpack segy trace data from chars to floats | ||
| 25 | |||
| 26 | |||
| 27 | |||
| 28 | suunpack1 <packed_file >unpacked_file | ||
| 29 | |||
| 30 | |||
| 31 | |||
| 32 | suunpack1 is the approximate inverse of supack1 | ||
| 33 | |||
| 34 | opt=null | ||
| 35 | |||
| 36 | |||
| 37 | |||
| 38 | |||
| 39 | Credits: | ||
| 40 | |||
| 41 | CWP: Jack K. Cohen, Shuki Ronen, Brian Sumner | ||
| 42 | |||
| 43 | |||
| 44 | |||
| 45 | Caveats: | ||
| 46 | |||
| 47 | This program is for single site use with supack1. See the | ||
| 48 | |||
| 49 | supack1 header comments. | ||
| 50 | |||
| 51 | |||
| 52 | |||
| 53 | Notes: | ||
| 54 | |||
| 55 | ungpow and unscale are defined in segy.h | ||
| 56 | |||
| 57 | opt = CHARPACK is defined in su.h and segy.h | ||
| 58 | |||
| 59 | |||
| 60 | |||
| 61 | |||
| 62 | |||
| 63 | Trace header fields accessed: ns, opt, ungpow, unscale | ||
| 64 | |||
| 65 | Trace header fields modified: opt, ungpow, unscale | ||
| 66 | |||
| 67 | |||
| 68 | |||
| 69 | =head2 User's notes (Juan Lorenzo) | ||
| 70 | untested | ||
| 71 | |||
| 72 | =cut | ||
| 73 | |||
| 74 | |||
| 75 | =head2 CHANGES and their DATES | ||
| 76 | |||
| 77 | =cut | ||
| 78 | |||
| 79 | use Moose; | ||
| 80 | our $VERSION = '0.0.1'; | ||
| 81 | |||
| 82 | |||
| 83 | =head2 Import packages | ||
| 84 | |||
| 85 | =cut | ||
| 86 | |||
| 87 | use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants'; | ||
| 88 | |||
| 89 | use App::SeismicUnixGui::misc::SeismicUnix qw($in $out $on $go $to $suffix_ascii $off $suffix_su $suffix_bin); | ||
| 90 | use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config'; | ||
| 91 | |||
| 92 | |||
| 93 | =head2 instantiation of packages | ||
| 94 | |||
| 95 | =cut | ||
| 96 | |||
| 97 | my $get = L_SU_global_constants->new(); | ||
| 98 | my $Project = Project_config->new(); | ||
| 99 | my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU(); | ||
| 100 | my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN(); | ||
| 101 | my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT(); | ||
| 102 | |||
| 103 | my $var = $get->var(); | ||
| 104 | my $on = $var->{_on}; | ||
| 105 | my $off = $var->{_off}; | ||
| 106 | my $true = $var->{_true}; | ||
| 107 | my $false = $var->{_false}; | ||
| 108 | my $empty_string = $var->{_empty_string}; | ||
| 109 | |||
| 110 | =head2 Encapsulated | ||
| 111 | hash of private variables | ||
| 112 | |||
| 113 | =cut | ||
| 114 | |||
| 115 | my $suunpack1 = { | ||
| 116 | _opt => '', | ||
| 117 | _Step => '', | ||
| 118 | _note => '', | ||
| 119 | |||
| 120 | }; | ||
| 121 | |||
| 122 | =head2 sub Step | ||
| 123 | |||
| 124 | collects switches and assembles bash instructions | ||
| 125 | by adding the program name | ||
| 126 | |||
| 127 | =cut | ||
| 128 | |||
| 129 | sub Step { | ||
| 130 | |||
| 131 | $suunpack1->{_Step} = 'suunpack1'.$suunpack1->{_Step}; | ||
| 132 | return ( $suunpack1->{_Step} ); | ||
| 133 | |||
| 134 | } | ||
| 135 | |||
| 136 | |||
| 137 | =head2 sub note | ||
| 138 | |||
| 139 | collects switches and assembles bash instructions | ||
| 140 | by adding the program name | ||
| 141 | |||
| 142 | =cut | ||
| 143 | |||
| 144 | sub note { | ||
| 145 | |||
| 146 | $suunpack1->{_note} = 'suunpack1'.$suunpack1->{_note}; | ||
| 147 | return ( $suunpack1->{_note} ); | ||
| 148 | |||
| 149 | } | ||
| 150 | |||
| 151 | |||
| 152 | |||
| 153 | =head2 sub clear | ||
| 154 | |||
| 155 | =cut | ||
| 156 | |||
| 157 | sub clear { | ||
| 158 | |||
| 159 | $suunpack1->{_opt} = ''; | ||
| 160 | $suunpack1->{_Step} = ''; | ||
| 161 | $suunpack1->{_note} = ''; | ||
| 162 | } | ||
| 163 | |||
| 164 | |||
| 165 | =head2 sub opt | ||
| 166 | |||
| 167 | |||
| 168 | =cut | ||
| 169 | |||
| 170 | sub opt { | ||
| 171 | |||
| 172 | my ( $self,$opt ) = @_; | ||
| 173 | # if ( $opt ne $empty_string | ||
| 174 | # or $opt eq $empty_string ) { | ||
| 175 | # | ||
| 176 | # $suunpack1->{_opt} = $opt; | ||
| 177 | # $suunpack1->{_note} = $suunpack1->{_note}.' opt='.$suunpack1->{_opt}; | ||
| 178 | # $suunpack1->{_Step} = $suunpack1->{_Step}.' opt='.$suunpack1->{_opt}; | ||
| 179 | # | ||
| 180 | # } else { | ||
| 181 | # print("suunpack1, opt, missing opt,\n"); | ||
| 182 | # } | ||
| 183 | } | ||
| 184 | |||
| 185 | |||
| 186 | =head2 sub get_max_index | ||
| 187 | |||
| 188 | max index = number of input variables -1 | ||
| 189 | |||
| 190 | =cut | ||
| 191 | |||
| 192 | sub get_max_index { | ||
| 193 | my ($self) = @_; | ||
| 194 | my $max_index = 0; | ||
| 195 | |||
| 196 | return($max_index); | ||
| 197 | } | ||
| 198 | |||
| 199 | |||
| 200 | 1; |