« lib/App/SeismicUnixGui/big_streams/iApply_mute.pm
↑ Summary
lib/App/SeismicUnixGui/big_streams/iSave_top_mute_picks.pm »
| 1 | package App::SeismicUnixGui::big_streams::iSave_bottom_mute_picks; | ||
| 2 | |||
| 3 | use Moose; | ||
| 4 | our $VERSION = '0.0.1'; | ||
| 5 | use aliased 'App::SeismicUnixGui::misc::message'; | ||
| 6 | use aliased 'App::SeismicUnixGui::misc::flow'; | ||
| 7 | use aliased 'App::SeismicUnixGui::sunix::shell::cp'; | ||
| 8 | use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config'; | ||
| 9 | use App::SeismicUnixGui::misc::SeismicUnix qw($itemp_bot_mute_picks_sorted_par_ $ibot_mute_par_ | ||
| 10 | $ibottom_mute_file_list $suffix_txt ); | ||
| 11 | |||
| 12 | =head1 DOCUMENTATION | ||
| 13 | |||
| 14 | =head2 SYNOPSIS | ||
| 15 | |||
| 16 | PROGRAM NAME:iSave_bottom_mute_picks.pm | ||
| 17 | AUTHOR: Juan Lorenzo | ||
| 18 | DATE: Nue 12 2017 | ||
| 19 | Version: 3.0 | ||
| 20 | |||
| 21 | DESCRIPTION: Originally to Save final Top Mute of Data | ||
| 22 | |||
| 23 | =head2 USE | ||
| 24 | |||
| 25 | =head4 | ||
| 26 | |||
| 27 | Examples | ||
| 28 | |||
| 29 | =head2 SEISMIC UNIX NOTES | ||
| 30 | |||
| 31 | =head4 CHANGES and their DATES | ||
| 32 | |||
| 33 | V1 May 5 2009 | ||
| 34 | V2. change mute parameters to top mute parameters | ||
| 35 | Aug 12, 2011 | ||
| 36 | V3.0 September 2015 : | ||
| 37 | updated to oop | ||
| 38 | introduced Tk widgets | ||
| 39 | Made all event-driven | ||
| 40 | June 12 2017 adapted from iSave_top_mute_picks.pm | ||
| 41 | |||
| 42 | =head2 STEPS | ||
| 43 | |||
| 44 | use the local library of the user | ||
| 45 | bring is user variables from a local file | ||
| 46 | create instances of the needed subroutines | ||
| 47 | |||
| 48 | =cut | ||
| 49 | |||
| 50 | =head2 | ||
| 51 | |||
| 52 | instantiate classes | ||
| 53 | |||
| 54 | =cut | ||
| 55 | |||
| 56 | my $log = message->new(); | ||
| 57 | my $run = flow->new(); | ||
| 58 | my $cp = cp->new(); | ||
| 59 | my $Project = Project_config->new(); | ||
| 60 | |||
| 61 | =head2 | ||
| 62 | |||
| 63 | declare variables types | ||
| 64 | establish just the locally scoped variables | ||
| 65 | |||
| 66 | =cut | ||
| 67 | |||
| 68 | my ( @flow, @cp, @items ); | ||
| 69 | |||
| 70 | =head2 | ||
| 71 | |||
| 72 | create hash with important variables | ||
| 73 | |||
| 74 | =cut | ||
| 75 | |||
| 76 | my $iSave_bot_mute_picks = { | ||
| 77 | _gather_num => '', | ||
| 78 | _gather_type => '', | ||
| 79 | _gather_header => '', | ||
| 80 | _file_in => '', | ||
| 81 | _inbound => '', | ||
| 82 | _outbound => '' | ||
| 83 | }; | ||
| 84 | |||
| 85 | =head2 | ||
| 86 | |||
| 87 | Import directory definitions | ||
| 88 | |||
| 89 | =cut | ||
| 90 | |||
| 91 | my ($DATA_SEISMIC_TXT) = $Project->DATA_SEISMIC_TXT(); | ||
| 92 | |||
| 93 | =head2 subroutine clear | ||
| 94 | |||
| 95 | sets all variable strings to '' | ||
| 96 | |||
| 97 | =cut | ||
| 98 | |||
| 99 | sub clear { | ||
| 100 | $iSave_bot_mute_picks->{_gather_num} = ''; | ||
| 101 | $iSave_bot_mute_picks->{_gather_type} = ''; | ||
| 102 | $iSave_bot_mute_picks->{_gather_header} = ''; | ||
| 103 | $iSave_bot_mute_picks->{_inbound} = ''; | ||
| 104 | $iSave_bot_mute_picks->{_outbound} = ''; | ||
| 105 | } | ||
| 106 | |||
| 107 | =head2 subroutine file_in | ||
| 108 | |||
| 109 | Required file name | ||
| 110 | on which to pick bottom mute values | ||
| 111 | |||
| 112 | =cut | ||
| 113 | |||
| 114 | sub file_in { | ||
| 115 | my ( $variable, $file_in ) = @_; | ||
| 116 | $iSave_bot_mute_picks->{_file_in} = $file_in if defined($file_in); | ||
| 117 | |||
| 118 | #print("file name is $iSave_bot_mute_picks->{_file_in} \n\n"); | ||
| 119 | |||
| 120 | } | ||
| 121 | |||
| 122 | =head2 subroutine gather | ||
| 123 | |||
| 124 | sets gather number to consider | ||
| 125 | |||
| 126 | =cut | ||
| 127 | |||
| 128 | sub gather_num { | ||
| 129 | my ( $variable, $gather_num ) = @_; | ||
| 130 | $iSave_bot_mute_picks->{_gather_num} = $gather_num | ||
| 131 | if defined($gather_num); | ||
| 132 | } | ||
| 133 | |||
| 134 | =head2 subroutine gather_type | ||
| 135 | |||
| 136 | sets gather_type number to consider | ||
| 137 | |||
| 138 | =cut | ||
| 139 | |||
| 140 | sub gather_type { | ||
| 141 | my ( $variable, $gather_type ) = @_; | ||
| 142 | $iSave_bot_mute_picks->{_gather_type} = $gather_type | ||
| 143 | if defined($gather_type); | ||
| 144 | } | ||
| 145 | |||
| 146 | =head2 subroutine gather_header | ||
| 147 | |||
| 148 | sets gather_header number to consider | ||
| 149 | |||
| 150 | =cut | ||
| 151 | |||
| 152 | sub gather_header { | ||
| 153 | my ( $variable, $gather_header ) = @_; | ||
| 154 | $iSave_bot_mute_picks->{_gather_header} = $gather_header | ||
| 155 | if defined($gather_header); | ||
| 156 | } | ||
| 157 | |||
| 158 | =head2 sub calc | ||
| 159 | |||
| 160 | rewrite sorted picks into a permanent file | ||
| 161 | |||
| 162 | =cut | ||
| 163 | |||
| 164 | sub calc { # | ||
| 165 | my $suffix; | ||
| 166 | |||
| 167 | $suffix = '_' | ||
| 168 | . $iSave_bot_mute_picks->{_gather_header} | ||
| 169 | . $iSave_bot_mute_picks->{_gather_num}; | ||
| 170 | |||
| 171 | $iSave_bot_mute_picks->{_inbound} = | ||
| 172 | $DATA_SEISMIC_TXT . '/' | ||
| 173 | . $itemp_bot_mute_picks_sorted_par_ | ||
| 174 | . $iSave_bot_mute_picks->{_file_in}; | ||
| 175 | |||
| 176 | $iSave_bot_mute_picks->{_outbound} = | ||
| 177 | $DATA_SEISMIC_TXT . '/' | ||
| 178 | . $ibot_mute_par_ | ||
| 179 | . $iSave_bot_mute_picks->{_file_in} | ||
| 180 | . $suffix; | ||
| 181 | |||
| 182 | $cp->from( $iSave_bot_mute_picks->{_inbound} ); | ||
| 183 | $cp->to( $iSave_bot_mute_picks->{_outbound} ); | ||
| 184 | $cp[1] = $cp->Step(); | ||
| 185 | |||
| 186 | |||
| 187 | =head2 | ||
| 188 | |||
| 189 | append file name to an output list | ||
| 190 | ibottom_mute_file_list | ||
| 191 | |||
| 192 | =cut | ||
| 193 | |||
| 194 | my $append = ("echo $ibot_mute_par_$iSave_bot_mute_picks->{_file_in}$suffix >>\\ | ||
| 195 | $DATA_SEISMIC_TXT/$ibottom_mute_file_list$suffix_txt"); | ||
| 196 | |||
| 197 | system($append); | ||
| 198 | print("$append\n"); | ||
| 199 | |||
| 200 | =head2 | ||
| 201 | |||
| 202 | DEFINE FLOW(S) | ||
| 203 | |||
| 204 | =cut | ||
| 205 | |||
| 206 | @items = ( $cp[1] ); | ||
| 207 | $flow[1] = $run->modules( \@items ); | ||
| 208 | |||
| 209 | =head2 | ||
| 210 | |||
| 211 | RUN FLOW(S) | ||
| 212 | |||
| 213 | =cut | ||
| 214 | |||
| 215 | $run->flow( \$flow[1] ); | ||
| 216 | |||
| 217 | =head2 | ||
| 218 | |||
| 219 | LOG FLOW(S)TO SCREEN AND FILE | ||
| 220 | |||
| 221 | =cut | ||
| 222 | |||
| 223 | # print "$flow[1]\n"; | ||
| 224 | #$log->file($flow[1]); | ||
| 225 | |||
| 226 | } # end calc subroutine | ||
| 227 | 1; |