« lib/App/SeismicUnixGui/configs/big_streams/Sudipfilt_config.pm
↑ Summary
lib/App/SeismicUnixGui/configs/big_streams/iBottomMute_config.pm »
| 1 | package App::SeismicUnixGui::configs::big_streams::Synseis_config; | ||
| 2 | |||
| 3 | =head1 DOCUMENTATION | ||
| 4 | |||
| 5 | =head2 SYNOPSIS | ||
| 6 | |||
| 7 | PERL PROGRAM NAME: Synseis_config.pm | ||
| 8 | AUTHOR: Juan Lorenzo | ||
| 9 | DATE: | ||
| 10 | Jan 31 2018 | ||
| 11 | |||
| 12 | DESCRIPTION Combines configuration variables | ||
| 13 | both from a simple text file and from | ||
| 14 | from additional packages. | ||
| 15 | |||
| 16 | derives from Synseis_config.pm | ||
| 17 | |||
| 18 | |||
| 19 | =cut | ||
| 20 | |||
| 21 | =head2 LOCAL VARIABLES FOR THIS PROJECT | ||
| 22 | |||
| 23 | Values taken from the simple,local | ||
| 24 | file: Synseis.config | ||
| 25 | LOCAL VARIABLES FOR THIS PROJECT | ||
| 26 | |||
| 27 | base_file_name = 'zrhov' | ||
| 28 | time_sampling_interval_s = 0.001 | ||
| 29 | depth_sampling_interval_m = .2; # meters | ||
| 30 | water_depth_m = 0; | ||
| 31 | Ricker_endtime = 0.15 | ||
| 32 | Ricker_frequency = 20 | ||
| 33 | plot_density_max = 2 | ||
| 34 | plot_density_min = 1 | ||
| 35 | plot_depth_min_m = 0 | ||
| 36 | plot_depth_max_m = 200 | ||
| 37 | plot_time_min_s = 0 | ||
| 38 | plot_time_max_s = 2 | ||
| 39 | plot_velocity_min = 1500 | ||
| 40 | plot_velocity_max = 2500 | ||
| 41 | plot_reflection_coefficient_min = -.1 | ||
| 42 | plot_reflection_coefficient_max = 0.1 | ||
| 43 | plot_ss_amplitude_max = .3 | ||
| 44 | plot_ss_amplitude_min = -.3 | ||
| 45 | =cut | ||
| 46 | |||
| 47 | use Moose; | ||
| 48 | our $VERSION = '1.0.0'; | ||
| 49 | use aliased 'App::SeismicUnixGui::misc::config_superflows'; | ||
| 50 | use App::SeismicUnixGui::misc::control '0.0.3'; | ||
| 51 | use aliased 'App::SeismicUnixGui::misc::control'; | ||
| 52 | use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants'; | ||
| 53 | |||
| 54 | my $L_SU_global_constants = L_SU_global_constants->new(); | ||
| 55 | my $control = control->new(); | ||
| 56 | my $config_superflows = config_superflows->new(); | ||
| 57 | my $superflow_config_names = $L_SU_global_constants->superflow_config_names_aref(); | ||
| 58 | |||
| 59 | #WARNING---- watch out for missing underscore!! | ||
| 60 | # set the correct index manually for this superflow | ||
| 61 | # print("1. Synseis_config, alias_superflow_config_name : $$alias_superflow_config_name[4].config\n"); | ||
| 62 | |||
| 63 | =head2 Synseis hash | ||
| 64 | |||
| 65 | |||
| 66 | =cut | ||
| 67 | |||
| 68 | my $Synseis = { | ||
| 69 | _prog_name => '', | ||
| 70 | _names_aref => '', | ||
| 71 | _values_aref => '', | ||
| 72 | _superflows_first_idx => '', | ||
| 73 | _superflows_length => '', | ||
| 74 | }; | ||
| 75 | |||
| 76 | # set the superflow name: 8 is for Synseis | ||
| 77 | # print("Synseis_config, prog_name : @{$superflow_config_names}[8]\n"); | ||
| 78 | # Warning: set using a scalar reference | ||
| 79 | |||
| 80 | sub get_values { | ||
| 81 | |||
| 82 | my ($self) = @_; | ||
| 83 | |||
| 84 | $Synseis->{_prog_name} = \@{$superflow_config_names}[8]; | ||
| 85 | |||
| 86 | $config_superflows->set_program_name( $Synseis->{_prog_name} ); | ||
| 87 | |||
| 88 | # parameter names from superflow configuration file | ||
| 89 | # $Synseis->{_names_aref} = $config_superflows->get_names(); | ||
| 90 | # print("Synseis_config,prog=@{$Synseis->{_names_aref}}\n"); | ||
| 91 | |||
| 92 | # parameter values from superflow configuration file | ||
| 93 | $Synseis->{_values_aref} = $config_superflows->get_values(); | ||
| 94 | |||
| 95 | # print("Synseis_config,values=@{$Synseis->{_values_aref}}\n"); | ||
| 96 | |||
| 97 | # $Synseis->{_check_buttons_settings_aref} = $config_superflows->get_check_buttons_settings(); | ||
| 98 | # print("Synseis_config,chkb=@{$Synseis->{_check_buttons_settings_aref}}\n"); | ||
| 99 | |||
| 100 | $Synseis->{_superflows_first_idx} = $config_superflows->first_idx(); | ||
| 101 | $Synseis->{_superflows_length} = $config_superflows->length(); | ||
| 102 | |||
| 103 | my $base_file_name = @{ $Synseis->{_values_aref} }[0]; | ||
| 104 | my $time_sampling_interval_s = @{ $Synseis->{_values_aref} }[1]; | ||
| 105 | my $depth_sampling_interval_m = @{ $Synseis->{_values_aref} }[2]; | ||
| 106 | my $water_depth_m = @{ $Synseis->{_values_aref} }[3]; | ||
| 107 | my $Ricker_endtime = @{ $Synseis->{_values_aref} }[4]; | ||
| 108 | my $Ricker_frequency = @{ $Synseis->{_values_aref} }[5]; | ||
| 109 | my $plot_density_min = @{ $Synseis->{_values_aref} }[6]; | ||
| 110 | my $plot_density_max = @{ $Synseis->{_values_aref} }[7]; | ||
| 111 | my $plot_depth_min_m = @{ $Synseis->{_values_aref} }[8]; | ||
| 112 | my $plot_depth_max_m = @{ $Synseis->{_values_aref} }[9]; | ||
| 113 | my $plot_time_min_s = @{ $Synseis->{_values_aref} }[10]; | ||
| 114 | my $plot_time_max_s = @{ $Synseis->{_values_aref} }[11]; | ||
| 115 | my $plot_velocity_min = @{ $Synseis->{_values_aref} }[12]; | ||
| 116 | my $plot_velocity_max = @{ $Synseis->{_values_aref} }[13]; | ||
| 117 | my $plot_reflection_coefficient_min = @{ $Synseis->{_values_aref} }[14]; | ||
| 118 | my $plot_reflection_coefficient_max = @{ $Synseis->{_values_aref} }[15]; | ||
| 119 | my $plot_ss_amplitude_min = @{ $Synseis->{_values_aref} }[16]; | ||
| 120 | my $plot_ss_amplitude_max = @{ $Synseis->{_values_aref} }[17]; | ||
| 121 | |||
| 122 | # print(" 1. Synseis_config, get_values, base_file_name is $base_file_name\n\n"); | ||
| 123 | $base_file_name = $control->su_data_name( \$base_file_name ); | ||
| 124 | |||
| 125 | # private hash variable | ||
| 126 | my $CFG_h = { | ||
| 127 | Synseis => { | ||
| 128 | 1 => { | ||
| 129 | base_file_name => $base_file_name, | ||
| 130 | time_sampling_interval_s => $time_sampling_interval_s, | ||
| 131 | depth_sampling_interval_m => $depth_sampling_interval_m, | ||
| 132 | water_depth_m => $water_depth_m, | ||
| 133 | Ricker_endtime => $Ricker_endtime, | ||
| 134 | Ricker_frequency => $Ricker_frequency, | ||
| 135 | plot_density_min => $plot_density_min, | ||
| 136 | plot_density_max => $plot_density_max, | ||
| 137 | plot_depth_min_m => $plot_depth_min_m, | ||
| 138 | plot_depth_max_m => $plot_depth_max_m, | ||
| 139 | plot_time_min_s => $plot_time_min_s, | ||
| 140 | plot_time_max_s => $plot_time_max_s, | ||
| 141 | plot_velocity_min => $plot_velocity_min, | ||
| 142 | plot_velocity_max => $plot_velocity_max, | ||
| 143 | plot_reflection_coefficient_min => | ||
| 144 | $plot_reflection_coefficient_min, | ||
| 145 | plot_reflection_coefficient_max => | ||
| 146 | $plot_reflection_coefficient_max, | ||
| 147 | plot_ss_amplitude_min => $plot_ss_amplitude_min, | ||
| 148 | plot_ss_amplitude_max => $plot_ss_amplitude_max, | ||
| 149 | }, | ||
| 150 | }, | ||
| 151 | }; | ||
| 152 | |||
| 153 | return ( $CFG_h, $Synseis->{_values_aref} ); # hash and arrary referenc | ||
| 154 | } # end of sub get_values | ||
| 155 | |||
| 156 | =head2 sub get_max_index | ||
| 157 | |||
| 158 | max index = number of input variables -1 | ||
| 159 | |||
| 160 | =cut | ||
| 161 | |||
| 162 | sub get_max_index { | ||
| 163 | my ($self) = @_; | ||
| 164 | |||
| 165 | # index=17 | ||
| 166 | my $max_index = 17; | ||
| 167 | |||
| 168 | return ($max_index); | ||
| 169 | } | ||
| 170 | |||
| 171 | 1; | ||
| 172 |