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