« lib/App/SeismicUnixGui/sunix/data/ctrlstrip.pm
↑ Summary
lib/App/SeismicUnixGui/sunix/data/suoldtonew.pm »
| 1 | package App::SeismicUnixGui::sunix::data::segyscan; | ||
| 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 | SEGYSCAN -- SCANs SEGY file trace headers for min-max in several | ||
| 25 | |||
| 26 | possible formats. | ||
| 27 | |||
| 28 | |||
| 29 | |||
| 30 | segyscan < segyfile | ||
| 31 | |||
| 32 | |||
| 33 | |||
| 34 | opt=null | ||
| 35 | |||
| 36 | |||
| 37 | |||
| 38 | Notes: | ||
| 39 | |||
| 40 | The SEGY file trace headers are scanned assuming short, ushort, int, | ||
| 41 | |||
| 42 | uint, float, and double and the results are printed as tables. | ||
| 43 | |||
| 44 | |||
| 45 | |||
| 46 | |||
| 47 | |||
| 48 | |||
| 49 | |||
| 50 | Credits: Stew Levin, June 2013 | ||
| 51 | |||
| 52 | |||
| 53 | |||
| 54 | =head2 User's notes (Juan Lorenzo) | ||
| 55 | |||
| 56 | Remember to use sgy on the second line of the "data_in" module | ||
| 57 | No "data_out" module required | ||
| 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($in $out $on $go $to $suffix_ascii $off $suffix_su $suffix_bin); | ||
| 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 $var = $get->var(); | ||
| 91 | my $on = $var->{_on}; | ||
| 92 | my $off = $var->{_off}; | ||
| 93 | my $true = $var->{_true}; | ||
| 94 | my $false = $var->{_false}; | ||
| 95 | my $empty_string = $var->{_empty_string}; | ||
| 96 | |||
| 97 | =head2 Encapsulated | ||
| 98 | hash of private variables | ||
| 99 | |||
| 100 | =cut | ||
| 101 | |||
| 102 | my $segyscan = { | ||
| 103 | _opt => '', | ||
| 104 | _Step => '', | ||
| 105 | _note => '', | ||
| 106 | |||
| 107 | }; | ||
| 108 | |||
| 109 | =head2 sub Step | ||
| 110 | |||
| 111 | collects switches and assembles bash instructions | ||
| 112 | by adding the program name | ||
| 113 | |||
| 114 | =cut | ||
| 115 | |||
| 116 | sub Step { | ||
| 117 | |||
| 118 | $segyscan->{_Step} = 'segyscan'.$segyscan->{_Step}; | ||
| 119 | return ( $segyscan->{_Step} ); | ||
| 120 | |||
| 121 | } | ||
| 122 | |||
| 123 | |||
| 124 | =head2 sub note | ||
| 125 | |||
| 126 | collects switches and assembles bash instructions | ||
| 127 | by adding the program name | ||
| 128 | |||
| 129 | =cut | ||
| 130 | |||
| 131 | sub note { | ||
| 132 | |||
| 133 | $segyscan->{_note} = 'segyscan'.$segyscan->{_note}; | ||
| 134 | return ( $segyscan->{_note} ); | ||
| 135 | |||
| 136 | } | ||
| 137 | |||
| 138 | |||
| 139 | |||
| 140 | =head2 sub clear | ||
| 141 | |||
| 142 | =cut | ||
| 143 | |||
| 144 | sub clear { | ||
| 145 | |||
| 146 | $segyscan->{_opt} = ''; | ||
| 147 | $segyscan->{_Step} = ''; | ||
| 148 | $segyscan->{_note} = ''; | ||
| 149 | } | ||
| 150 | |||
| 151 | |||
| 152 | =head2 sub opt | ||
| 153 | |||
| 154 | does nothing | ||
| 155 | |||
| 156 | =cut | ||
| 157 | |||
| 158 | sub opt { | ||
| 159 | |||
| 160 | my ( $self, $opt ) = @_; | ||
| 161 | # if ( $opt ne $empty_string ) { | ||
| 162 | # | ||
| 163 | # $segyscan->{_opt} = $opt; | ||
| 164 | # $segyscan->{_note} = $segyscan->{_note}.' opt='.$segyscan->{_opt}; | ||
| 165 | # $segyscan->{_Step} = $segyscan->{_Step}.' opt='.$segyscan->{_opt}; | ||
| 166 | # | ||
| 167 | # } else { | ||
| 168 | # print("segyscan, opt, missing opt,\n"); | ||
| 169 | # } | ||
| 170 | } | ||
| 171 | |||
| 172 | |||
| 173 | =head2 sub get_max_index | ||
| 174 | |||
| 175 | max index = number of input variables -1 | ||
| 176 | |||
| 177 | =cut | ||
| 178 | |||
| 179 | sub get_max_index { | ||
| 180 | my ($self) = @_; | ||
| 181 | my $max_index = 0; | ||
| 182 | |||
| 183 | return($max_index); | ||
| 184 | } | ||
| 185 | |||
| 186 | |||
| 187 | 1; |