« lib/App/SeismicUnixGui/configs/big_streams/iPick_config.pm
↑ Summary
lib/App/SeismicUnixGui/configs/big_streams/iTopMute_config.pm »
| 1 | package App::SeismicUnixGui::configs::big_streams::iSpectralAnalysis_config; | ||
| 2 | |||
| 3 | =head1 DOCUMENTATION | ||
| 4 | |||
| 5 | =head2 SYNOPSIS | ||
| 6 | |||
| 7 | PERL PROGRAM NAME: iSpectralAnalysis_config.pm | ||
| 8 | AUTHOR: Juan Lorenzo | ||
| 9 | DATE: August 1 2016 | ||
| 10 | DESCRIPTION Combines configuration variables | ||
| 11 | both from a simple text file and from | ||
| 12 | from additional packages. | ||
| 13 | |||
| 14 | =head2 CHANGES | ||
| 15 | DATE: Jan 11, 2018 | ||
| 16 | remove dependency on Config::Simple | ||
| 17 | |||
| 18 | =head2 PURPOSE | ||
| 19 | |||
| 20 | Upper-level variable | ||
| 21 | definitions in iSpectralAnalysis | ||
| 22 | Seismic data is assumed currently to be in | ||
| 23 | su format. | ||
| 24 | |||
| 25 | BASED ON: | ||
| 26 | |||
| 27 | |||
| 28 | Needs: Simple (ASCII) local configuration | ||
| 29 | file is iSpectralAnalysis.config | ||
| 30 | |||
| 31 | =cut | ||
| 32 | |||
| 33 | =head2 Notes | ||
| 34 | anonymous array reference $CFG | ||
| 35 | |||
| 36 | contains all the configuration variables in | ||
| 37 | text script | ||
| 38 | |||
| 39 | base_file_name = '1072_clean'; | ||
| 40 | |||
| 41 | sufilter_1_freq = '0,1,20,40' | ||
| 42 | |||
| 43 | sugain_1_agc_gain_width = 2.6; | ||
| 44 | |||
| 45 | suxwigb_1_absclip = 100000; | ||
| 46 | |||
| 47 | suxwigb_2_absclip_phase = 100; | ||
| 48 | |||
| 49 | suxwigb_3_absclip_freq = 100; | ||
| 50 | |||
| 51 | |||
| 52 | =cut | ||
| 53 | |||
| 54 | use Moose; | ||
| 55 | our $VERSION = '1.0.0'; | ||
| 56 | use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config'; | ||
| 57 | use aliased 'App::SeismicUnixGui::misc::config_superflows'; | ||
| 58 | use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants'; | ||
| 59 | use App::SeismicUnixGui::misc::SeismicUnix qw($in $out $on $go $to $suffix_ascii $off $suffix_su); | ||
| 60 | |||
| 61 | my $Project = Project_config->new(); | ||
| 62 | my $config_superflows = config_superflows->new(); | ||
| 63 | my $L_SU_global_constants = L_SU_global_constants->new(); | ||
| 64 | my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU(); | ||
| 65 | my $superflow_config_names = $L_SU_global_constants->superflow_config_names_aref(); | ||
| 66 | |||
| 67 | # WARNING---- watch out for missing underscore!! | ||
| 68 | |||
| 69 | =head2 private hash | ||
| 70 | |||
| 71 | =cut | ||
| 72 | |||
| 73 | my $iSpectralAnalysis_config = { | ||
| 74 | _prog_name => '', | ||
| 75 | _values_aref => '', | ||
| 76 | }; | ||
| 77 | |||
| 78 | # set the superflow name: 3 is for fk-to-Sudipfilt | ||
| 79 | sub get_values { | ||
| 80 | |||
| 81 | my ($self) = @_; | ||
| 82 | |||
| 83 | # Warning: set using a scalar reference | ||
| 84 | $iSpectralAnalysis_config->{_prog_name} = \@{$superflow_config_names}[3]; | ||
| 85 | |||
| 86 | # print("iSpectralAnalysis_config_config, prog_name : @{$superflow_config_names}[3]\n"); | ||
| 87 | |||
| 88 | $config_superflows->set_program_name( | ||
| 89 | $iSpectralAnalysis_config->{_prog_name} ); | ||
| 90 | |||
| 91 | # parameter values from superflow configuration file | ||
| 92 | $iSpectralAnalysis_config->{_values_aref} = | ||
| 93 | $config_superflows->get_values(); | ||
| 94 | |||
| 95 | # print("iSpectralAnalysis_config ,values=@{$iSpectralAnalysis_config->{_values_aref}}\n"); | ||
| 96 | |||
| 97 | my $base_file_name = @{ $iSpectralAnalysis_config->{_values_aref} }[0]; | ||
| 98 | my $sufilter_1_freq = @{ $iSpectralAnalysis_config->{_values_aref} }[1]; | ||
| 99 | my $sugain_1_agc_gain_width = | ||
| 100 | @{ $iSpectralAnalysis_config->{_values_aref} }[2]; | ||
| 101 | my $suxwigb_1_absclip = @{ $iSpectralAnalysis_config->{_values_aref} }[3]; | ||
| 102 | my $suxwigb_1_headerWord = | ||
| 103 | @{ $iSpectralAnalysis_config->{_values_aref} }[4]; | ||
| 104 | my $suxwigb_2_absclip_phase = | ||
| 105 | @{ $iSpectralAnalysis_config->{_values_aref} }[5]; | ||
| 106 | my $suxwigb_3_absclip_freq = | ||
| 107 | @{ $iSpectralAnalysis_config->{_values_aref} }[6]; | ||
| 108 | |||
| 109 | # print("file name is $base_file_name\n\n"); | ||
| 110 | |||
| 111 | =head2 Example LOCAL VARIABLES FOR THIS PROJECT | ||
| 112 | |||
| 113 | =cut | ||
| 114 | |||
| 115 | my $CFG = { | ||
| 116 | sufilter => { 1 => { freq => $sufilter_1_freq, }, }, | ||
| 117 | sugain => { 1 => { agc_gain_width => $sugain_1_agc_gain_width, }, }, | ||
| 118 | suxwigb => { | ||
| 119 | 1 => { | ||
| 120 | absclip => $suxwigb_1_absclip, | ||
| 121 | headerWord => $suxwigb_1_headerWord, | ||
| 122 | }, | ||
| 123 | 2 => { absclip_phase => $suxwigb_2_absclip_phase, }, | ||
| 124 | 3 => { absclip_freq => $suxwigb_3_absclip_freq, } | ||
| 125 | }, | ||
| 126 | base_file_name => $base_file_name, | ||
| 127 | }; # end of CFG hash | ||
| 128 | |||
| 129 | return ( $CFG, $iSpectralAnalysis_config->{_values_aref} ) | ||
| 130 | ; # hash and arrary reference | ||
| 131 | |||
| 132 | }; # end of sub get_values | ||
| 133 | |||
| 134 | =head2 sub get_max_index | ||
| 135 | |||
| 136 | |||
| 137 | max index = number of input variables -1 | ||
| 138 | |||
| 139 | =cut | ||
| 140 | |||
| 141 | sub get_max_index { | ||
| 142 | my ($self) = @_; | ||
| 143 | my $max_index = 6; | ||
| 144 | |||
| 145 | return ($max_index); | ||
| 146 | } | ||
| 147 | 1; |