« lib/App/SeismicUnixGui/configs/big_streams/iSpectralAnalysis_config.pm
↑ Summary
lib/App/SeismicUnixGui/configs/big_streams/iVA_config.pm »
| 1 | package App::SeismicUnixGui::configs::big_streams::iTopMute_config; | ||
| 2 | |||
| 3 | =head1 DOCUMENTATION | ||
| 4 | |||
| 5 | =head2 SYNOPSIS | ||
| 6 | |||
| 7 | PERL PERL PROGRAM NAME: iTop_Mute_config.pm | ||
| 8 | AUTHOR: Juan Lorenzo | ||
| 9 | DATE: July 27 2016 | ||
| 10 | DESCRIPTION Combines configuration variables | ||
| 11 | both from a simple text file and from | ||
| 12 | from additional packages. | ||
| 13 | |||
| 14 | USED FOR | ||
| 15 | Upper-level variable | ||
| 16 | definitions in iTop_Mute3 | ||
| 17 | Seismic data is assumed currently to be in | ||
| 18 | su format. | ||
| 19 | |||
| 20 | BASED ON: | ||
| 21 | Version 1 Based on linux command "cat" | ||
| 22 | Version 2 based on Sucat.pm June 29 2016 | ||
| 23 | Added a simple configuration file readable | ||
| 24 | and writable using Config::Simple (CPAN) | ||
| 25 | |||
| 26 | |||
| 27 | Needs: Simple (ASCII) local configuration | ||
| 28 | file is iTop_Mute3.config | ||
| 29 | |||
| 30 | Package control: | ||
| 31 | filename is file, without a suffix! | ||
| 32 | In some cases, numbers must be | ||
| 33 | separated by commasi-- needed by | ||
| 34 | Seismic Unix | ||
| 35 | |||
| 36 | =cut | ||
| 37 | |||
| 38 | =head2 text file | ||
| 39 | contains all the configuration variables in | ||
| 40 | perl script | ||
| 41 | |||
| 42 | base_file_name = 30Hz_All_geom_geom; | ||
| 43 | gather_header = fldr; | ||
| 44 | offset_type = tracl; | ||
| 45 | first_gather = 1; | ||
| 46 | gather_inc = 1; | ||
| 47 | last_gather = 100; | ||
| 48 | freq = '0,3,100,200; | ||
| 49 | gather_type = fldr; | ||
| 50 | min_amplitude = .0; | ||
| 51 | max_amplitude = .75; | ||
| 52 | |||
| 53 | =cut | ||
| 54 | |||
| 55 | use Moose; | ||
| 56 | our $VERSION = '1.0.3'; | ||
| 57 | use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config'; | ||
| 58 | use App::SeismicUnixGui::misc::control '0.0.3'; | ||
| 59 | use aliased 'App::SeismicUnixGui::misc::control'; | ||
| 60 | use aliased 'App::SeismicUnixGui::misc::config_superflows'; | ||
| 61 | use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants'; | ||
| 62 | use App::SeismicUnixGui::misc::SeismicUnix qw($in $out $on $go $to $suffix_ascii $off $suffix_su); | ||
| 63 | |||
| 64 | my $Project = Project_config->new(); | ||
| 65 | my $control = control->new(); | ||
| 66 | my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU(); | ||
| 67 | my $config_superflows = config_superflows->new(); | ||
| 68 | my $get = L_SU_global_constants->new(); | ||
| 69 | my $superflow_config_names = $get->superflow_config_names_aref(); | ||
| 70 | |||
| 71 | # WARNING---- watch out for missing underscore!! | ||
| 72 | |||
| 73 | =head2 private hash | ||
| 74 | |||
| 75 | =cut | ||
| 76 | |||
| 77 | my $iTopMute_config = { | ||
| 78 | _prog_name => '', | ||
| 79 | _values_aref => '', | ||
| 80 | }; | ||
| 81 | |||
| 82 | # set the superflow name: 5 is for TopMute-to-TopMute | ||
| 83 | sub get_values { | ||
| 84 | |||
| 85 | my ($self) = @_; | ||
| 86 | |||
| 87 | # Warning: set using a scalar reference | ||
| 88 | $iTopMute_config->{_prog_name} = \@{$superflow_config_names}[5]; | ||
| 89 | |||
| 90 | # print("iBBottomMute_config_config, prog_name : @{$superflow_config_names}[5]\n"); | ||
| 91 | |||
| 92 | $config_superflows->set_program_name( $iTopMute_config->{_prog_name} ); | ||
| 93 | |||
| 94 | # parameter values from superflow configuration file | ||
| 95 | $iTopMute_config->{_values_aref} = $config_superflows->get_values(); | ||
| 96 | |||
| 97 | # print("iTopMute_config_config,values=@{$iTopMute_config->{_values_aref}}\n"); | ||
| 98 | |||
| 99 | my $base_file_name = @{ $iTopMute_config->{_values_aref} }[0]; | ||
| 100 | my $gather_header = @{ $iTopMute_config->{_values_aref} }[1]; | ||
| 101 | my $offset_type = @{ $iTopMute_config->{_values_aref} }[2]; | ||
| 102 | my $first_gather = @{ $iTopMute_config->{_values_aref} }[3]; | ||
| 103 | my $gather_inc = @{ $iTopMute_config->{_values_aref} }[4]; | ||
| 104 | my $last_gather = @{ $iTopMute_config->{_values_aref} }[5]; | ||
| 105 | my $freq = @{ $iTopMute_config->{_values_aref} }[6]; | ||
| 106 | my $gather_type = @{ $iTopMute_config->{_values_aref} }[7]; | ||
| 107 | my $min_amplitude = @{ $iTopMute_config->{_values_aref} }[8]; | ||
| 108 | my $max_amplitude = @{ $iTopMute_config->{_values_aref} }[9]; | ||
| 109 | |||
| 110 | $base_file_name = $control->su_data_name( \$base_file_name ); | ||
| 111 | |||
| 112 | =head2 Example LOCAL VARIABLES FOR THIS PROJECT | ||
| 113 | |||
| 114 | =cut | ||
| 115 | |||
| 116 | my $CFG = { | ||
| 117 | sumute => { | ||
| 118 | 1 => { | ||
| 119 | gather_header => $gather_header, | ||
| 120 | offset_type => $offset_type, | ||
| 121 | first_gather => $first_gather, | ||
| 122 | gather_inc => $gather_inc, | ||
| 123 | last_gather => $last_gather, | ||
| 124 | freq => $freq, | ||
| 125 | gather_type => $gather_type, | ||
| 126 | min_amplitude => $min_amplitude, | ||
| 127 | max_amplitude => $max_amplitude, | ||
| 128 | }, | ||
| 129 | }, | ||
| 130 | sugain => { 1 => { freq => $freq }, }, | ||
| 131 | base_file_name => $base_file_name, | ||
| 132 | }; # end of CFG hash | ||
| 133 | |||
| 134 | return ( $CFG, $iTopMute_config->{_values_aref} ) | ||
| 135 | ; # hash and arrary reference | ||
| 136 | }; # end of sub get_values | ||
| 137 | |||
| 138 | =head2 sub get_max_index | ||
| 139 | |||
| 140 | max index = number of input variables -1 | ||
| 141 | |||
| 142 | =cut | ||
| 143 | |||
| 144 | sub get_max_index { | ||
| 145 | my ($self) = @_; | ||
| 146 | |||
| 147 | # only file_name : index=9 | ||
| 148 | my $max_index = 9; | ||
| 149 | |||
| 150 | return ($max_index); | ||
| 151 | } | ||
| 152 | |||
| 153 | 1; |