« lib/App/SeismicUnixGui/sunix/data/wtuncomp.pm
↑ Summary
lib/App/SeismicUnixGui/sunix/par/ftnstrip.pm »
| 1 | package App::SeismicUnixGui::sunix::header::swapbhed; | ||
| 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 | SWAPBHED - SWAP the BYTES in a SEGY Binary tape HEaDer file | ||
| 25 | |||
| 26 | opt=null | ||
| 27 | |||
| 28 | swapbhed < binary_in > binary out | ||
| 29 | |||
| 30 | |||
| 31 | |||
| 32 | |||
| 33 | |||
| 34 | |||
| 35 | |||
| 36 | Required parameter: | ||
| 37 | |||
| 38 | none | ||
| 39 | |||
| 40 | Optional parameters: | ||
| 41 | |||
| 42 | none | ||
| 43 | |||
| 44 | |||
| 45 | |||
| 46 | |||
| 47 | |||
| 48 | Credits: | ||
| 49 | |||
| 50 | |||
| 51 | |||
| 52 | CWP: John Stockwell 13 May 2011 | ||
| 53 | |||
| 54 | |||
| 55 | |||
| 56 | =head2 User's notes (Juan Lorenzo) | ||
| 57 | untested | ||
| 58 | |||
| 59 | =cut | ||
| 60 | |||
| 61 | |||
| 62 | =head2 CHANGES and their DATES | ||
| 63 | |||
| 64 | =cut | ||
| 65 | |||
| 66 | use Moose; | ||
| 67 | our $VERSION = '0.0.1'; | ||
| 68 | |||
| 69 | |||
| 70 | =head2 Import packages | ||
| 71 | |||
| 72 | =cut | ||
| 73 | |||
| 74 | use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants'; | ||
| 75 | |||
| 76 | use App::SeismicUnixGui::misc::SeismicUnix qw($go $in $off $on $out $ps $to $suffix_ascii $suffix_bin $suffix_ps $suffix_segy $suffix_su); | ||
| 77 | use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config'; | ||
| 78 | |||
| 79 | |||
| 80 | =head2 instantiation of packages | ||
| 81 | |||
| 82 | =cut | ||
| 83 | |||
| 84 | my $get = L_SU_global_constants->new(); | ||
| 85 | my $Project = Project_config->new(); | ||
| 86 | my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU(); | ||
| 87 | my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN(); | ||
| 88 | my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT(); | ||
| 89 | |||
| 90 | my $PS_SEISMIC = $Project->PS_SEISMIC(); | ||
| 91 | |||
| 92 | my $var = $get->var(); | ||
| 93 | my $on = $var->{_on}; | ||
| 94 | my $off = $var->{_off}; | ||
| 95 | my $true = $var->{_true}; | ||
| 96 | my $false = $var->{_false}; | ||
| 97 | my $empty_string = $var->{_empty_string}; | ||
| 98 | |||
| 99 | =head2 Encapsulated | ||
| 100 | hash of private variables | ||
| 101 | |||
| 102 | =cut | ||
| 103 | |||
| 104 | my $swapbhed = { | ||
| 105 | _opt => '', | ||
| 106 | _Step => '', | ||
| 107 | _note => '', | ||
| 108 | |||
| 109 | }; | ||
| 110 | |||
| 111 | =head2 sub Step | ||
| 112 | |||
| 113 | collects switches and assembles bash instructions | ||
| 114 | by adding the program name | ||
| 115 | |||
| 116 | =cut | ||
| 117 | |||
| 118 | sub Step { | ||
| 119 | |||
| 120 | $swapbhed->{_Step} = 'swapbhed'.$swapbhed->{_Step}; | ||
| 121 | return ( $swapbhed->{_Step} ); | ||
| 122 | |||
| 123 | } | ||
| 124 | |||
| 125 | |||
| 126 | =head2 sub note | ||
| 127 | |||
| 128 | collects switches and assembles bash instructions | ||
| 129 | by adding the program name | ||
| 130 | |||
| 131 | =cut | ||
| 132 | |||
| 133 | sub note { | ||
| 134 | |||
| 135 | $swapbhed->{_note} = 'swapbhed'.$swapbhed->{_note}; | ||
| 136 | return ( $swapbhed->{_note} ); | ||
| 137 | |||
| 138 | } | ||
| 139 | |||
| 140 | |||
| 141 | |||
| 142 | =head2 sub clear | ||
| 143 | |||
| 144 | =cut | ||
| 145 | |||
| 146 | sub clear { | ||
| 147 | |||
| 148 | $swapbhed->{_opt} = ''; | ||
| 149 | $swapbhed->{_Step} = ''; | ||
| 150 | $swapbhed->{_note} = ''; | ||
| 151 | } | ||
| 152 | |||
| 153 | |||
| 154 | =head2 sub opt | ||
| 155 | |||
| 156 | |||
| 157 | =cut | ||
| 158 | |||
| 159 | sub opt { | ||
| 160 | |||
| 161 | my ( $self,$opt ) = @_; | ||
| 162 | # if ( $opt ne $empty_string ) { | ||
| 163 | # | ||
| 164 | # $swapbhed->{_opt} = $opt; | ||
| 165 | # $swapbhed->{_note} = $swapbhed->{_note}.' opt='.$swapbhed->{_opt}; | ||
| 166 | # $swapbhed->{_Step} = $swapbhed->{_Step}.' opt='.$swapbhed->{_opt}; | ||
| 167 | # | ||
| 168 | # } else { | ||
| 169 | # print("swapbhed, opt, missing opt,\n"); | ||
| 170 | # } | ||
| 171 | } | ||
| 172 | |||
| 173 | |||
| 174 | =head2 sub get_max_index | ||
| 175 | |||
| 176 | max index = number of input variables -1 | ||
| 177 | |||
| 178 | =cut | ||
| 179 | |||
| 180 | sub get_max_index { | ||
| 181 | my ($self) = @_; | ||
| 182 | my $max_index = 0; | ||
| 183 | |||
| 184 | return($max_index); | ||
| 185 | } | ||
| 186 | |||
| 187 | |||
| 188 | 1; |