view release on metacpan or search on metacpan
lib/App/SeismicUnixGui/big_streams/immodpg.pm view on Meta::CPAN
use aliased 'App::SeismicUnixGui::configs::big_streams::immodpg_config';
use aliased 'App::SeismicUnixGui::big_streams::immodpg_global_constants';
use aliased 'App::SeismicUnixGui::sunix::header::header_values';
use aliased 'App::SeismicUnixGui::misc::manage_files_by2';
use App::SeismicUnixGui::misc::control '0.0.3';
use aliased 'App::SeismicUnixGui::misc::control';
use aliased 'App::SeismicUnixGui::messages::message_director';
use aliased 'App::SeismicUnixGui::specs::big_streams::immodpg_spec';
use aliased 'App::SeismicUnixGui::sunix::shell::xk';
use Scalar::Util qw(looks_like_number);
=pod
instantiate modules
=cut
my $Project = Project_config->new();
my $get_L_SU = L_SU_global_constants->new();
my $get_immodpg = immodpg_global_constants->new();
my $immodpg_config = immodpg_config->new();
lib/App/SeismicUnixGui/big_streams/immodpg.pm view on Meta::CPAN
#set defaults
#
#=cut
#
# sub _get_control_VbotNtop_factor {
#
# my ($self) = @_;
#
# my $result;
#
# if ( not( looks_like_number( $immodpg->{_control_VbotNtop_factor} ) ) ) {
#
# $immodpg->{_VbotNtop_factor_current} = $immodpg->{_VbotNtop_factor_default};
# $immodpg->{_VbotNtop_factor_prior} = $immodpg->{_VbotNtop_factor_default};
# $immodpg->{_VbotNtop_factorEntry}->delete( 0, 'end' );
# $immodpg->{_VbotNtop_factorEntry}->insert( 0, $immodpg->{_VbotNtop_factor_current} );
# $immodpg->{_isVbotNtop_factor_changed_in_gui} = $no,;
#
# } else {
# print("immodpg, _get_control_VbotNtop_factor, bad value\n");
# }
lib/App/SeismicUnixGui/big_streams/immodpg.pm view on Meta::CPAN
my ($self) = @_;
my @VPtop = @{ $immodpg->{_refVPtop} };
my @VPbot = @{ $immodpg->{_refVPbot} };
my @dz = @{ $immodpg->{_ref_dz} };
my $layer = $immodpg->{_model_layer_number};
# print("immodpg,_getVp_ref_dz_ref layer_number = $layer \n");
if ( looks_like_number($layer)
and scalar(@VPtop)
and scalar(@VPbot)
and scalar(@dz) )
{
return ( \@VPtop, \@VPbot, \@dz );
}
else {
print("immodpg,_getVp_ref_dz_ref , unexpected value\n");
lib/App/SeismicUnixGui/big_streams/immodpg.pm view on Meta::CPAN
values in the model for
layers and their velocities and
thicknesses
=cut
sub _getVp_ref_dz_scalar {
my ($self) = @_;
if ( looks_like_number( $immodpg->{_model_layer_number} ) ) {
my ( $_thickness_m_upper_layer, $Vbot_lower_layer );
my ( @V, @result );
my $layer = $immodpg->{_model_layer_number};
# print("immodpg,_getVp_ref_dz_scalar layer_number = $layer \n");
my @VPtop = @{ $immodpg->{_refVPtop} };
my @VPbot = @{ $immodpg->{_refVPbot} };
lib/App/SeismicUnixGui/big_streams/immodpg.pm view on Meta::CPAN
}
=head2 sub _get_initialVp_dz4gui
=cut
sub _get_initialVp_dz4gui {
my ($self) = @_;
if ( looks_like_number( $immodpg->{_model_layer_number} ) ) {
my ( $_thickness_m_upper_layer, $Vbot_lower_layer );
my ( @V, @result );
my $layer = $immodpg->{_model_layer_number};
my ( $refVPtop, $refVPbot, $ref_dz, $error_switch ) =
_get_initial_model4gui();
if ( length($refVPtop)
and length($refVPbot)
lib/App/SeismicUnixGui/big_streams/immodpg.pm view on Meta::CPAN
Then, delete the lock file
Avoids crash between asynchronous
reading (fortran) and
writing (Perl) of files
=cut
sub _setVbot {
my ($Vbot) = @_;
if ( looks_like_number($Vbot)
&& $immodpg->{_isVbot_changed_in_gui} eq $yes )
{
=head2 instantiate classes
=cut
my $files = manage_files_by2->new();
my $control = control->new();
lib/App/SeismicUnixGui/big_streams/immodpg.pm view on Meta::CPAN
Avoids crash between asynchronous
reading (fortran) and
writing (Perl) of files
_setVbotNtop_multiply
=cut
sub _setVbotNtop_multiply {
my ($self) = @_;
if ( looks_like_number( $immodpg->{_Vbot_multiplied} )
&& looks_like_number( $immodpg->{_Vtop_multiplied} )
&& looks_like_number( $immodpg->{_Vbot_current} )
&& looks_like_number( $immodpg->{_Vtop_current} ) )
{
=head2 instantiate classes
=cut
my $files = manage_files_by2->new();
my $control = control->new();
=head2 Define local
lib/App/SeismicUnixGui/big_streams/immodpg.pm view on Meta::CPAN
Avoids crash between asynchronous
reading (fortran) and
writing (Perl) of files
=cut
sub _setVtop {
my ($Vtop) = @_;
if ( looks_like_number($Vtop)
&& $immodpg->{_isVtop_changed_in_gui} eq $yes )
{
# print("immodpg,_setVtop,write out fortran value of Vtop\n");
=head2 instantiate classes
=cut
my $files = manage_files_by2->new();
lib/App/SeismicUnixGui/big_streams/immodpg.pm view on Meta::CPAN
Then, delete the lock file
Avoids crash between asynchronous
reading (fortran) and
writing (Perl) of files
=cut
sub _setVtop_lower_layer {
my ($Vtop_lower_layer) = @_;
if ( looks_like_number($Vtop_lower_layer)
&& $immodpg->{_isVtop_lower_layer_changed_in_gui} eq $yes )
{
=head2 instantiate classes
=cut
my $files = manage_files_by2->new();
my $control = control->new();
lib/App/SeismicUnixGui/big_streams/immodpg.pm view on Meta::CPAN
of the model properties
use App::SeismicUnixGui::misc::control '0.0.3' method to check for bad values;
=cut
sub _updateVbot {
my ($self) = @_;
if ( looks_like_number( $immodpg->{_Vbot_current} )
and looks_like_number( $immodpg->{_Vbot_prior} )
&& $immodpg->{_Vbot_current} != $immodpg->{_Vbot_prior} )
{
# CASE Vbot has changed
$immodpg->{_isVbot_changed_in_gui} = $yes;
$immodpg->{_Vbot_prior} = $immodpg->{_Vbot_current};
# print("immodpg, _updateVbot, has changed\n");
# print("1. immodpg,_updateVbot,Vbot_current=$immodpg->{_Vbot_current}\n");
# print("1. immodpg,_updateVbot,Vbot_prior=$immodpg->{_Vbot_prior}\n");
lib/App/SeismicUnixGui/big_streams/immodpg.pm view on Meta::CPAN
GUI
current layer must >0
=cut
sub _updateVbot_upper_layer {
my ($self) = @_;
# print("mmodpg, _updateVbot_upper_layer, Vbot_upper_layer_current=..$immodpg->{_Vbot_upper_layer_current}..\n");
if ( looks_like_number( $immodpg->{_Vbot_upper_layer_current} )
&& $immodpg->{_layer_current} > 0
&& $immodpg->{_Vbot_upper_layer_current} !=
$immodpg->{_Vbot_upper_layer_prior} )
{
# CASE Vbot_upper_layer changed
$immodpg->{_isVbot_upper_layer_changed_in_gui} = $yes;
$immodpg->{_Vbot_upper_layer_prior} =
$immodpg->{_Vbot_upper_layer_current};
lib/App/SeismicUnixGui/big_streams/immodpg.pm view on Meta::CPAN
# print("immodpg,_updateVbot_upper_layer,Vbot_upper_layer_prior=$immodpg->{_Vbot_upper_layer_prior}\n");
_set_control( 'Vbot_upper_layer',
$immodpg->{_Vbot_upper_layer_current} );
$immodpg->{_Vbot_upper_layer_current} =
_get_control('Vbot_upper_layer');
_setVp_dz( 'Vbot_upper_layer', $immodpg->{_Vbot_upper_layer_current} );
return ();
}
elsif ( looks_like_number( $immodpg->{_Vbot_upper_layer_current} )
&& $immodpg->{_Vbot_upper_layer_current} ==
$immodpg->{_Vbot_upper_layer_prior} )
{
# CASE Vbot_upper_layer is unchanged
# print("immodpg, _updateVbot_upper_layer, unchanged\n");
$immodpg->{_isVbot_upper_layer_changed_in_gui} = $no;
# print("immodpg,_updateVbot_upper_layer,Vbot_upper_layer_prior=$immodpg->{_Vbot_upper_layer_prior}\n");
return ();
}
elsif ( not( looks_like_number( $immodpg->{_Vbot_upper_layer_current} ) ) )
{
# CASE Vbot_upper_layer is unchanged
# print("immodpg, _updateVbot_upper_layer, no value in Vbot_upper_layer NADA\n");
# print("immodpg,_updateVbot_upper_layer,Vbot_upper_layer_prior=$immodpg->{_Vbot_upper_layer_prior}\n");
return ();
}
else {
print("immodpg, _updateVbot_upper_layer, unexpected\n");
lib/App/SeismicUnixGui/big_streams/immodpg.pm view on Meta::CPAN
keep tabs on Vincrement values
and changes in the values in the
GUI
=cut
sub _updateVincrement {
my ($self) = @_;
if ( looks_like_number( $immodpg->{_Vincrement_current} )
&& $immodpg->{_Vincrement_current} != $immodpg->{_Vincrement_prior} )
{
# CASE Vincrement changed
$immodpg->{_Vincrement_current} = $immodpg->{_Vincrement_current};
$immodpg->{_isVincrement_changed_in_gui} = $yes;
# print("immodpg, _updateVincrement, updated to $immodpg->{_Vincrement_current}\n");
# print("immodpg,_updateVincrement,Vincrement_current=$immodpg->{_Vincrement_current}\n");
lib/App/SeismicUnixGui/big_streams/immodpg.pm view on Meta::CPAN
GUI
Also updates an shared copy
of the model properties
=cut
sub _updateVtop {
my ($self) = @_;
if ( looks_like_number( $immodpg->{_Vtop_current} )
&& $immodpg->{_Vtop_current} != $immodpg->{_Vtop_prior} )
{
# CASE Vtop changed
$immodpg->{_isVtop_changed_in_gui} = $yes;
$immodpg->{_Vtop_prior} = $immodpg->{_Vtop_current};
# print("immodpg, _updateVtop, updated to $immodpg->{_Vtop_current}\n");
# print("immodpg,_updateVtop,Vtop_current=$immodpg->{_Vtop_current}\n");
# print("immodpg,_updateVtop,Vtop_prior=$immodpg->{_Vtop_prior}\n");
lib/App/SeismicUnixGui/big_streams/immodpg.pm view on Meta::CPAN
GUI
Also updates an shared copy
of the model properties
=cut
sub _updateVtop_lower_layer {
my ($self) = @_;
if ( looks_like_number( $immodpg->{_Vtop_lower_layer_current} )
&& $immodpg->{_Vtop_lower_layer_current} !=
$immodpg->{_Vtop_lower_layer_prior} )
{
# CASE Vtop changed
# print("immodpg, _updateVtop_lower_layer, Vcurrent=$immodpg->{_Vtop_lower_layer_current}\n");
$immodpg->{_isVtop_lower_layer_changed_in_gui} = $yes;
$immodpg->{_Vtop_lower_layer_prior} =
$immodpg->{_Vtop_lower_layer_current};
lib/App/SeismicUnixGui/big_streams/immodpg.pm view on Meta::CPAN
keep tabs on VbotNtop_factor values
and changes in the values in the
GUI
=cut
sub _updateVbotNtop_factor {
my ($self) = @_;
if ( looks_like_number( $immodpg->{_VbotNtop_factor_current} )
&& $immodpg->{_VbotNtop_factor_current} !=
$immodpg->{_VbotNtop_factor_prior} )
{
# CASE VbotNtop_factor changed
# $immodpg->{_VbotNtop_factor_current} = $immodpg->{_VbotNtop_factor_current};
_set_control( 'VbotNtop_factor', $immodpg->{_VbotNtop_factor_current} );
$immodpg->{_VbotNtop_factor_current} = _get_control('VbotNtop_factor');
$immodpg->{_isVbotNtop_factor_changed_in_gui} = $yes;
lib/App/SeismicUnixGui/big_streams/immodpg.pm view on Meta::CPAN
GUI
Also updates an shared copy
of the model properties
=cut
sub _updateVbotNtop_multiply {
my ($self) = @_;
if ( looks_like_number( $immodpg->{_Vbot_current} )
&& looks_like_number( $immodpg->{_Vtop_current} )
&& looks_like_number( $immodpg->{_Vbot_multiplied} )
&& looks_like_number( $immodpg->{_Vtop_multiplied} ) )
{
$immodpg->{_Vbot_prior} = $immodpg->{_Vbot_current};
$immodpg->{_Vbot_current} = $immodpg->{_Vbot_multiplied};
$immodpg->{_Vtop_prior} = $immodpg->{_Vtop_current};
$immodpg->{_Vtop_current} = $immodpg->{_Vtop_multiplied};
_set_control( 'Vbot', $immodpg->{_Vbot_current} );
$immodpg->{_Vbot_current} = _get_control('Vbot');
lib/App/SeismicUnixGui/big_streams/immodpg.pm view on Meta::CPAN
keep tabs on clip values
and changes in the values in the
GUI
=cut
sub _update_clip {
my ($self) = @_;
if ( looks_like_number( $immodpg->{_clip4plot_current} )
&& $immodpg->{_clip4plot_current} != $immodpg->{_clip4plot_prior} )
{
# CASE clip changed
$immodpg->{_clip4plot_current} = $immodpg->{_clip4plot_current};
$immodpg->{_is_clip_changed_in_gui} = $yes;
# print("immodpg, _update_clip, updated to $immodpg->{_clip4plot_current}\n");
# print("immodpg,_update_clip,clip4plot_current=$immodpg->{_clip4plot_current}\n");
# print("immodpg,_update_clip,clip4plot_prior=$immodpg->{_clip4plot_prior}\n");
lib/App/SeismicUnixGui/big_streams/immodpg.pm view on Meta::CPAN
GUI
Also updates an shared copy
of the model properties
=cut
sub _update_thickness_m {
my ($self) = @_;
if ( looks_like_number( $immodpg->{_thickness_m_current} )
&& $immodpg->{_thickness_m_current} != $immodpg->{_thickness_m_prior} )
{
# CASE _thickness_m changed
$immodpg->{_is_thickness_m_changed_in_gui} = $yes;
# print("immodpg, _update_thickness_m, updated to $immodpg->{_thickness_m_current}\n");
# print("immodpg,_update_thickness_m,_thickness_m_current=$immodpg->{_thickness_m_current}\n");
# print("immodpg,_update_thickness_m,_thickness_m_prior=$immodpg->{_thickness_m_prior}\n");
lib/App/SeismicUnixGui/big_streams/immodpg.pm view on Meta::CPAN
keep tabs on thickness_increment_m values
and changes in the values in the
GUI
=cut
sub _update_thickness_increment_m_in_gui {
my ($self) = @_;
if ( looks_like_number( $immodpg->{_thickness_increment_m_current} )
&& $immodpg->{_thickness_increment_m_current} !=
$immodpg->{_thickness_increment_m_prior} )
{
# CASE thickness changed
$immodpg->{_thickness_increment_m_prior} =
$immodpg->{_thickness_increment_m_current};
$immodpg->{_is_layer_changed_in_gui} = $yes;
# print("immodpg, _update_thickness_increment_m_in_gui, updated to $immodpg->{_thickness_increment_m_current}\n");
lib/App/SeismicUnixGui/big_streams/immodpg.pm view on Meta::CPAN
update prior in advance of _check_layer
=cut
sub _update_layer_in_gui {
my ($self) = @_;
if (
looks_like_number( $immodpg->{_layer_current} )
and length(
$immodpg->{_layer_prior} and length( $immodpg->{_layerEntry} )
)
and ( $immodpg->{_layer_current} != $immodpg->{_layer_prior} )
)
{
# CASE layer changed
$immodpg->{_is_layer_changed_in_gui} = $yes;
my $layer_current = $immodpg->{_layer_current};
lib/App/SeismicUnixGui/big_streams/immodpg.pm view on Meta::CPAN
$immodpg->{_layerEntry}->delete( 0, 'end' );
$immodpg->{_layerEntry}->insert( 0, $layer_current );
$immodpg->{_layer_prior} = $new_layer_prior;
# print("immodpg, _update_layer_in_gui, prior=$immodpg->{_layer_prior}current= $immodpg->{_layer_current}\n");
return ();
}
elsif ( looks_like_number( $immodpg->{_layer_current} )
and looks_like_number( $immodpg->{_layer_prior} )
and ( $immodpg->{_layer_current} == $immodpg->{_layer_prior} ) )
{
# CASE layer has not changed
# print("immodpg, _update_layer_in_gui, unchanged\n");
$immodpg->{_is_layer_changed_in_gui} = $no;
$immodpg->{_layerEntry}->delete( 0, 'end' );
$immodpg->{_layerEntry}->insert( 0, $immodpg->{_layer_current} );
lib/App/SeismicUnixGui/big_streams/immodpg.pm view on Meta::CPAN
}
=head2 sub get_initialVp_dz4gui
=cut
sub get_initialVp_dz4gui {
my ($self) = @_;
if ( looks_like_number( $immodpg->{_model_layer_number} ) ) {
my ( $_thickness_m_upper_layer, $Vbot_lower_layer );
my ( @V, @result );
my $layer = $immodpg->{_model_layer_number};
my ( $refVPtop, $refVPbot, $ref_dz, $error_switch ) =
_get_initial_model();
if ( length($refVPtop)
lib/App/SeismicUnixGui/big_streams/immodpg.pm view on Meta::CPAN
output option for immodpg.for
=cut
sub setVbot_minus {
my ($self) = @_;
if ( length( $immodpg->{_VbotEntry} )
and looks_like_number( $immodpg->{_Vincrement_current} ) )
{
my $Vbot = ( $immodpg->{_VbotEntry} )->get();
if ( looks_like_number($Vbot) ) {
my $Vincrement = ( $immodpg->{_VincrementEntry} )->get();
my $newVbot = $Vbot - $Vincrement;
_set_control( 'Vbot', $newVbot );
$newVbot = _get_control('Vbot');
$immodpg->{_Vbot_prior} = $immodpg->{_Vbot_current};
$immodpg->{_Vbot_current} = $newVbot;
$immodpg->{_VbotEntry}->delete( 0, 'end' );
lib/App/SeismicUnixGui/big_streams/immodpg.pm view on Meta::CPAN
update private value in this module
output option for immodpg.for
=cut
sub setVbot_plus {
my ($self) = @_;
if ( length( $immodpg->{_VbotEntry} )
&& looks_like_number( $immodpg->{_Vincrement_current} ) )
{
my $Vbot = ( $immodpg->{_VbotEntry} )->get();
if ( looks_like_number($Vbot) ) {
my $Vincrement = ( $immodpg->{_VincrementEntry} )->get();
my $newVbot = $Vbot + $Vincrement;
_set_control( 'Vbot', $newVbot );
$newVbot = _get_control('Vbot');
$immodpg->{_Vbot_prior} = $immodpg->{_Vbot_current};
$immodpg->{_Vbot_current} = $newVbot;
lib/App/SeismicUnixGui/big_streams/immodpg.pm view on Meta::CPAN
output option for immodpg.for
=cut
sub setVtop_minus {
my ($self) = @_;
if ( length( $immodpg->{_VtopEntry} )
&& looks_like_number( $immodpg->{_Vincrement_current} ) )
{
my $Vtop = ( $immodpg->{_VtopEntry} )->get();
if ( looks_like_number($Vtop) ) {
my $Vincrement = ( $immodpg->{_VincrementEntry} )->get();
my $newVtop = $Vtop - $Vincrement;
_set_control( 'Vtop', $newVtop );
$newVtop = _get_control('Vtop');
$immodpg->{_Vtop_prior} = $immodpg->{_Vtop_current};
$immodpg->{_Vtop_current} = $newVtop;
lib/App/SeismicUnixGui/big_streams/immodpg.pm view on Meta::CPAN
my ($self) = @_;
# print("0. immodpg, setVtop_plus, VtopEntry=$immodpg->{_VtopEntry}\n");
if ( length( $immodpg->{_VtopEntry} )
&& length( $immodpg->{_VincrementEntry} ) )
{
# print("1. immodpg, setVtop_plus, VtopEntry=$immodpg->{_VtopEntry}\n");
my $Vtop = ( $immodpg->{_VtopEntry} )->get();
if ( looks_like_number($Vtop) ) {
my $Vincrement = ( $immodpg->{_VincrementEntry} )->get();
my $newVtop = $Vtop + $Vincrement;
$immodpg->{_Vtop_prior} = $immodpg->{_Vtop_current};
$immodpg->{_Vtop_current} = $newVtop;
_set_control( 'Vtop', $immodpg->{_Vtop_current} );
$immodpg->{_Vtop_current} = _get_control('Vtop');
$newVtop = $immodpg->{_Vtop_current};
lib/App/SeismicUnixGui/big_streams/immodpg.pm view on Meta::CPAN
my $newVbot_upper_layer;
if ( length( $immodpg->{_Vbot_upper_layerEntry} ) ) {
$immodpg->{_Vbot_upper_layer_current} =
( $immodpg->{_Vbot_upper_layerEntry} )->get();
my $Vbot_upper_layer_current = $immodpg->{_Vbot_upper_layer_current};
# print("1. immodpg, setVbot_upper_layer, immodpg->{_Vbot_upper_layer_current}=$Vbot_upper_layer_current\n");
if ( length $Vbot_upper_layer_current
and looks_like_number($Vbot_upper_layer_current)
and $layer_current > 0 )
{
# print("immodpg, setVbot_upper_layer, immodpg->{_Vbot_upper_layer_current}=$immodpg->{_Vbot_upper_layer_current}\n");
_set_control( 'Vbot_upper_layer',
$immodpg->{_Vbot_upper_layer_current} );
$immodpg->{_Vbot_upper_layer_current} =
_get_control('Vbot_upper_layer');
$newVbot_upper_layer = $immodpg->{_Vbot_upper_layer_current};
lib/App/SeismicUnixGui/big_streams/immodpg.pm view on Meta::CPAN
update private value in this module
output option for immodpg.for
=cut
sub setVbotNVtop_lower_layer_minus {
my ($self) = @_;
if ( looks_like_number( $immodpg->{_Vincrement_current} )
&& length( $immodpg->{_Vtop_lower_layerEntry} )
&& length( $immodpg->{_VbotEntry} ) )
{
my $Vbot = ( $immodpg->{_VbotEntry} )->get();
my $Vtop_lower_layer = ( $immodpg->{_Vtop_lower_layerEntry} )->get();
my $Vincrement = ( $immodpg->{_VincrementEntry} )->get();
if ( looks_like_number($Vtop_lower_layer)
&& looks_like_number($Vbot) )
{
my $newVtop_lower_layer = $Vtop_lower_layer - $Vincrement;
my $newVbot = $Vbot - $Vincrement;
_set_control( 'Vtop', $newVtop_lower_layer );
$newVtop_lower_layer = _get_control('Vtop');
_set_control( 'Vbot', $newVbot );
$newVbot = _get_control('Vbot');
lib/App/SeismicUnixGui/big_streams/immodpg.pm view on Meta::CPAN
update private value in this module
output option for immodpg.for
=cut
sub setVbotNVtop_lower_layer_plus {
my ($self) = @_;
if ( looks_like_number( $immodpg->{_Vincrement_current} )
&& length( $immodpg->{_Vtop_lower_layerEntry} )
&& length( $immodpg->{_VbotEntry} ) )
{
my $Vbot = ( $immodpg->{_VbotEntry} )->get();
my $Vtop_lower_layer = ( $immodpg->{_Vtop_lower_layerEntry} )->get();
my $Vincrement = ( $immodpg->{_VincrementEntry} )->get();
if ( looks_like_number($Vtop_lower_layer)
&& looks_like_number($Vbot) )
{
my $newVtop_lower_layer = $Vtop_lower_layer + $Vincrement;
my $newVbot = $Vbot + $Vincrement;
_set_control( 'Vbot', $newVbot );
$newVbot = _get_control('Vbot');
_set_control( 'Vtop', $newVtop_lower_layer );
$newVtop_lower_layer = _get_control('Vtop');
lib/App/SeismicUnixGui/big_streams/immodpg.pm view on Meta::CPAN
output option for immodpg.for
=cut
sub setVtopNVbot_upper_layer_minus {
my ($self) = @_;
# print("layer_current = $immodpg->{_layer_current};\n");
if (
looks_like_number( $immodpg->{_Vincrement_current} )
&& length( $immodpg->{_Vbot_upper_layerEntry} )
&& length( $immodpg->{_VtopEntry} )
)
{
my $Vtop = ( $immodpg->{_VtopEntry} )->get();
my $Vbot_upper_layer = ( $immodpg->{_Vbot_upper_layerEntry} )->get();
my $Vincrement = ( $immodpg->{_VincrementEntry} )->get();
my $layer_current = $immodpg->{_layer_current};
if ( looks_like_number($Vbot_upper_layer) && looks_like_number($Vtop)
and $layer_current > 1 )
{
my $newVbot_upper_layer = $Vbot_upper_layer - $Vincrement;
my $newVtop = $Vtop - $Vincrement;
_set_control( 'Vbot', $newVbot_upper_layer );
$newVbot_upper_layer = _get_control('Vbot');
_set_control( 'Vtop', $newVtop );
lib/App/SeismicUnixGui/big_streams/immodpg.pm view on Meta::CPAN
output option for immodpg.for
=cut
sub setVtopNVbot_upper_layer_plus {
my ($self) = @_;
if (
looks_like_number( $immodpg->{_Vincrement_current} )
&& length( $immodpg->{_Vbot_upper_layerEntry} )
&& length( $immodpg->{_VtopEntry} )
)
{
my $Vtop = ( $immodpg->{_VtopEntry} )->get();
my $Vbot_upper_layer = ( $immodpg->{_Vbot_upper_layerEntry} )->get();
my $Vincrement = ( $immodpg->{_VincrementEntry} )->get();
my $layer_current = $immodpg->{_layer_current};
if ( looks_like_number($Vbot_upper_layer) && looks_like_number($Vtop)
and $layer_current > 1 )
{
my $newVbot_upper_layer = $Vbot_upper_layer + $Vincrement;
my $newVtop = $Vtop + $Vincrement;
_set_control( 'Vbot', $newVbot_upper_layer );
$newVbot_upper_layer = _get_control('Vbot');
_set_control( 'Vtop', $newVtop );
lib/App/SeismicUnixGui/big_streams/immodpg.pm view on Meta::CPAN
VbotEntry and VtopEntry
output option for immodpg.for
=cut
sub setVbotNtop_multiply {
my ($self) = @_;
if ( looks_like_number( $immodpg->{_VbotNtop_factor_current} )
&& length( $immodpg->{_VbotEntry}->get() )
&& length( $immodpg->{_VtopEntry}->get() ) )
{
my $factor = $immodpg->{_VbotNtop_factorEntry}->get();
my $Vbot = ( $immodpg->{_VbotEntry} )->get();
my $Vtop = ( $immodpg->{_VtopEntry} )->get();
my $Vbot_multiplied = $Vbot * $factor;
my $Vtop_multiplied = $Vtop * $factor;
$immodpg->{_Vbot_multiplied} = $Vbot_multiplied;
lib/App/SeismicUnixGui/big_streams/immodpg.pm view on Meta::CPAN
my ($self) = @_;
if ( length( $immodpg->{_VbotEntry} )
&& length( $immodpg->{_VtopEntry} ) )
{
my $Vbot = ( $immodpg->{_VbotEntry} )->get();
my $Vtop = ( $immodpg->{_VtopEntry} )->get();
my $Vincrement = $immodpg->{_VincrementEntry}->get();
if ( looks_like_number($Vbot)
&& looks_like_number($Vtop)
&& looks_like_number($Vincrement) )
{
my $newVbot = $Vbot - $Vincrement;
_set_control( 'Vbot', $newVbot );
$newVbot = _get_control('Vbot');
$immodpg->{_Vbot_prior} = $immodpg->{_Vbot_current};
$immodpg->{_Vbot_current} = $newVbot;
lib/App/SeismicUnixGui/big_streams/immodpg.pm view on Meta::CPAN
my ($self) = @_;
if ( length( $immodpg->{_VbotEntry} )
&& length( $immodpg->{_VtopEntry} ) )
{
my $Vbot = ( $immodpg->{_VbotEntry} )->get();
my $Vtop = ( $immodpg->{_VtopEntry} )->get();
my $Vincrement = $immodpg->{_VincrementEntry}->get();
if ( looks_like_number($Vbot)
&& looks_like_number($Vtop)
&& looks_like_number($Vincrement) )
{
my $newVbot = $Vbot + $Vincrement;
_set_control( 'Vbot', $newVbot );
$newVbot = _get_control('Vbot');
$immodpg->{_Vbot_prior} = $immodpg->{_Vbot_current};
$immodpg->{_Vbot_current} = $newVbot;
lib/App/SeismicUnixGui/big_streams/immodpg.pm view on Meta::CPAN
compared to former layer values
=cut
sub set_layer {
my ($self) = @_;
# print("immodpg, set_layer, $immodpg->{_layerEntry}\n");
if ( length( $immodpg->{_layerEntry} )
&& looks_like_number( $immodpg->{_layer_current} )
&& length $immodpg->{_VbotEntry}
&& length $immodpg->{_VtopEntry}
&& length $immodpg->{_Vbot_upper_layerEntry}
&& length $immodpg->{_Vtop_lower_layerEntry}
&& length( $immodpg->{_thickness_mEntry} )
&& looks_like_number( $immodpg->{_thickness_m_current} ) )
{
_check_layer();
_update_layer_in_gui();
_update_upper_layer_in_gui();
_update_lower_layer_in_gui();
# _write_config(); TODO
if ( $immodpg->{_is_layer_changed_in_gui} eq $yes ) {
lib/App/SeismicUnixGui/big_streams/immodpg.pm view on Meta::CPAN
output option for immodpg.for
=cut
sub set_thickness_m_minus {
my ($self) = @_;
if ( length( $immodpg->{_thickness_mEntry} )
&& looks_like_number( $immodpg->{_thickness_increment_m} ) )
{
my $thickness_m = ( $immodpg->{_thickness_mEntry} )->get();
if ( looks_like_number($thickness_m) ) {
my $thickness_increment_m =
( $immodpg->{_thickness_increment_mEntry} )->get();
my $new_thickness_m = $thickness_m - $thickness_increment_m;
_set_control( 'thickness_m', $new_thickness_m );
$new_thickness_m = _get_control('thickness_m');
$immodpg->{_thickness_m_prior} = $immodpg->{_thickness_m_current};
$immodpg->{_thickness_m_current} = $new_thickness_m;
lib/App/SeismicUnixGui/big_streams/immodpg.pm view on Meta::CPAN
output option for immodpg.for
=cut
sub set_thickness_m_plus {
my ($self) = @_;
if ( length( $immodpg->{_thickness_mEntry} )
&& looks_like_number( $immodpg->{_thickness_increment_m} ) )
{
my $thickness_m = ( $immodpg->{_thickness_mEntry} )->get();
if ( looks_like_number($thickness_m) ) {
my $thickness_increment_m =
( $immodpg->{_thickness_increment_mEntry} )->get();
my $new_thickness_m = $thickness_m + $thickness_increment_m;
_set_control( 'thickness_m', $new_thickness_m );
$new_thickness_m = _get_control('thickness_m');
$immodpg->{_thickness_m_prior} = $immodpg->{_thickness_m_current};
$immodpg->{_thickness_m_current} = $new_thickness_m;
lib/App/SeismicUnixGui/big_streams/immodpg.pm view on Meta::CPAN
Avoids crash between asynchronous
reading (fortran) and
writing (Perl) of files
=cut
sub set_option {
my ( $self, $option ) = @_;
if ( looks_like_number($option)
&& $immodpg->{_option_file} ne $empty_string )
{
=head2 instantiate classes
=cut
my $files = manage_files_by2->new();
my $control = control->new();
lib/App/SeismicUnixGui/big_streams/immodpg.pm view on Meta::CPAN
thickness_m value is updated in immodpg.for
through a message in file="thickness_m"
($_set_thickness_m)
=cut
sub set_thickness_m {
my ($self) = @_;
if ( looks_like_number( $immodpg->{_thickness_m_current} ) ) {
_set_control( 'thickness_m', $immodpg->{_thickness_m_current} );
$immodpg->{_thickness_m_current} = _get_control('thickness_m');
_check_thickness_m();
_update_thickness_m();
if ( length( $immodpg->{_is_thickness_m_changed_in_gui} )
&& $immodpg->{_is_thickness_m_changed_in_gui} eq $yes )
{
lib/App/SeismicUnixGui/developer/Stripped/par/mkparfile.par.main view on Meta::CPAN
MKPARFILE - convert ascii to par file format
mkparfile <stdin >stdout
Optional parameters:
string1="par1" first par string
string2="par2" second par string
This is a tool to convert values written line by line to parameter
vectors in the form expected by getpar. For example, if the input
file looks like:
t0 v0
t1 v1
...
then
mkparfile <input >output string1=tnmo string2=vnmo
yields:
tnmo=t0,t1,...
vnmo=v0,v1,...
lib/App/SeismicUnixGui/developer/Stripped/plot/pswigp.psplot.main view on Meta::CPAN
seismic (axis 1 vertical, axis 2 horizontal)
curve=curve1,curve2,... file(s) containing points to draw curve(s)
npair=n1,n2,n2,... number(s) of pairs in each file
curvecolor=black,.. color of curve(s)
curvewidth=axeswidth width (in points) of curve(s)
curvedash=0 solid curve(s), dash indices 1,...,11 produce
curve(s) with various dash styles
Note: linewidth=0.0 produces the thinest possible line on the output.
device. Thus the result is device-dependent, put generally looks the
best for seismic traces.
The curve file is an ascii file with the points specified as x1 x2 pairs,
one pair to a line. A "vector" of curve files and curve colors may
be specified as curvefile=file1,file2,etc. and similarly
curvecolor=color1,color2,etc, and the number of pairs of values
in each file as npair=npair1,npair2,... .
All color specifications may also be made in X Window style Hex format
example: axescolor=#255
lib/App/SeismicUnixGui/developer/Stripped/shapeNcut/susorty.su.main.windowing_sorting_muting view on Meta::CPAN
Notes:
Creates a common shot su data file for sort visualization
time samples quantity
---------------- ----------
first 25% shot coord
second 25% rec coord
third 25% offset
fourth 25% cmp coord
1. default is shot ordered (hsv2 cmap looks best to me)
susorty | suximage legend=1 units=meters cmap=hsv2
2. sort on cmp (note random order within a cmp)
susorty | susort cdp > junk.su
suximage < junk.su legend=1 units=meters cmap=hsv2
3. sort to cmp and subsort on offset
susorty | susort cdp offset > junk.su
suximage < junk.su legend=1 units=meters cmap=hsv2
lib/App/SeismicUnixGui/misc/big_streams_param.pm view on Meta::CPAN
=cut
=head2 USE
=head3 NOTES
=head4 Examples
=head2 CHANGES and their DATES
May 5 2018 looks for configurations
first in the local directory
then in the default configuration
directory /usr/local/pl/big_streams/config
V 0.0.3 June 2022 reference to L_SU_local_user_constants
removed
L_SU_local_user_constants may create cirularity
=cut
lib/App/SeismicUnixGui/misc/control.pm view on Meta::CPAN
my ($entry_value) = @_;
my $program;
if ( length $entry_value ) {
# print(
# "1. control, _get_string_or_number, entering value to test = $entry_value\n"
# );
use Scalar::Util qw(looks_like_number);
# remove any exisitng quotes
my $clean_value = _get_no_quotes($entry_value);
if ( length( $control->{_prog_names_aref} )
&& ( length $control->{_flow_index} ) )
{
# CASE 1 Flow is previously saved to disk
# or to RAM, (e.g., either via "param_flows")
lib/App/SeismicUnixGui/misc/control.pm view on Meta::CPAN
my $exit_value_as_string = '\'' . $clean_value . '\'';
# print("CASE 1A.1 control, _get_string_or_number, value into a string: $exit_value_as_string\n");
return ($exit_value_as_string);
}
else { # remaining parameters for data_in and data_out
# determine whether we have a string or a number
my $fmt = 0;
$fmt = looks_like_number($clean_value);
# print("2. control, _get_string_or_number, entry_value = $clean_value\n");
if ($fmt) {
# keep numbers as they are
# print(
# "CASE 1A.2, numbers, control, _get_string_or_number,$clean_value looks like a number\n"
# );
my $exit_value_as_number = $clean_value;
return ($exit_value_as_number);
}
else {
# print("CASE 1A.3 control, strings, _get_string_or_number, exit_value looks like string\n");
my $exit_value_as_string =
'\'' . $clean_value . '\'';
# print("control, get_string_or_number, value into a string: $exit_value_as_string\n");
return ($exit_value_as_string);
}
}
}
else {
print("control, _get_string_or_number, missing index \n");
lib/App/SeismicUnixGui/misc/control.pm view on Meta::CPAN
# print(
#"CASE 1D control,_get_string_or_number, flow is already saved on disk or in RAM, \n
# (e.g., in param_flow_color_pkg') -- for most programs\n"
# );
# first remove any exisitng quotes
my $clean_value = _get_no_quotes($entry_value);
my $fmt = 0;
$fmt = looks_like_number($clean_value);
# print("control, _get_string_or_number, CASE 1C entry_value = $entry_value\n");
if ($fmt) {
# print(
#"CASE 1D.1, number, control, _get_string_or_number,$entry_value looks like a number\n"
# );
my $exit_value_as_number = $clean_value;
return ($exit_value_as_number);
}
else {
# print(
#"control, _get_string_or_number, exit_value does not look like a number \n"
# );
lib/App/SeismicUnixGui/misc/control.pm view on Meta::CPAN
# General, CASE 2 when flow is not yet saved
# to disk or RAM, (e.g., either via "param_flows")
# or disk
# print(
# "CASE 2 control,_get_string_or_number, flow not yet saved, without need for knowledge of program name or flow index \n"
# );
# determine whether we have a string or a number
my $fmt = 0;
$fmt = looks_like_number($clean_value);
if ($fmt) {
# print("CASE 2.1 control, _get_string_or_number,$clean_value looks like a number\n");
my $exit_value_as_number = $clean_value;
# print("561. control, _get_string_or_number, entry_value = $clean_value\n");
return ($exit_value_as_number);
}
else {
# print("control, _get_string_or_number, exit_value like a string\n");
my $exit_value_as_string = '\'' . $clean_value . '\'';
lib/App/SeismicUnixGui/misc/control.pm view on Meta::CPAN
=cut
sub get_string_or_number {
my ( $self, $entry_value ) = @_;
if ( defined($entry_value) ) {
if ( $entry_value ne $empty_string ) {
use Scalar::Util qw(looks_like_number);
# print ("control, get_string_or_number, entry_value: $entry_value\n");
# determine whether we have a string or a number
my $fmt = 0;
$fmt = looks_like_number($entry_value);
if ($fmt) {
# print("control, get_string_or_number,$entry_value looks like a number \n");
# do nothing
my $exit_value_as_number = $entry_value;
return ($exit_value_as_number);
}
else {
# print("control, get_string_or_number, exit_value does not look like a number \n");
my $exit_value_as_string = '\'' . $entry_value . '\'';
lib/App/SeismicUnixGui/misc/mkparfile.pm view on Meta::CPAN
MKPARFILE - convert ascii to par file format
mkparfile <stdin >stdout
Optional parameters:
string1="par1" first par string
string2="par2" second par string
This is a tool to convert values written line by line to parameter
vectors in the form expected by getpar. For example, if the input
file looks like:
t0 v0
t1 v1
...
then
mkparfile <input >output string1=tnmo string2=vnmo
yields:
tnmo=t0,t1,...
vnmo=v0,v1,...
lib/App/SeismicUnixGui/misc/param_widgets.pm view on Meta::CPAN
);
}
return ();
}
=head2 sub redisplay_values
display parameter values without quotes
although internally we always have quotes for strings
and no quotes if the value looks like a number
i/p: 2 array references
o/p: array reference
N.B. This is an ENTRY widget
textvariables must be a reference in order
for -validatecommand to work. BEWARE!
For the Entry widget do not alter the
textvariable directly while using
lib/App/SeismicUnixGui/misc/param_widgets4pre_built_streams.pm view on Meta::CPAN
else {
print( "param_widgets4pre_built_streams,redisplay labels, Warning parameters or labels_w_aref missing \n" );
}
return ();
}
=head2 sub redisplay_values
display parameter values without quotes
although internally we always have quotes for strings
and no quotes if the value looks like a number
i/p: 2 array references
o/p: array reference
N.B. This is an ENTRY widget
textvariables must be a reference in order
for -validatecommand to work. BEWARE!
9.27.23
Clear the GUI first and then redisplay values
lib/App/SeismicUnixGui/misc/param_widgets_blue.pm view on Meta::CPAN
"param_widgets_color,redisplay labels, Warning parameters or labels_w_aref missing \n"
);
}
return ();
}
=head2 sub redisplay_values
display parameter values without quotes
although internally we always have quotes for strings
and no quotes if the value looks like a number
i/p: 2 array references
o/p: array reference
N.B. This is an ENTRY widget
textvariables must be a reference in order
for -validatecommand to work. BEWARE!
For the Entry widget do not alter the
textvariable directly while using
lib/App/SeismicUnixGui/misc/param_widgets_green.pm view on Meta::CPAN
"param_widgets_color,redisplay labels, Warning parameters or labels_w_aref missing \n"
);
}
return ();
}
=head2 sub redisplay_values
display parameter values without quotes
although internally we always have quotes for strings
and no quotes if the value looks like a number
i/p: 2 array references
o/p: array reference
N.B. This is an ENTRY widget
textvariables must be a reference in order
for -validatecommand to work. BEWARE!
For the Entry widget do not alter the
textvariable directly while using
lib/App/SeismicUnixGui/misc/param_widgets_grey.pm view on Meta::CPAN
"param_widgets_color,redisplay labels, Warning parameters or labels_w_aref missing \n"
);
}
return ();
}
=head2 sub redisplay_values
display parameter values without quotes
although internally we always have quotes for strings
and no quotes if the value looks like a number
i/p: 2 array references
o/p: array reference
N.B. This is an ENTRY widget
textvariables must be a reference in order
for -validatecommand to work. BEWARE!
For the Entry widget do not alter the
textvariable directly while using
lib/App/SeismicUnixGui/misc/param_widgets_neutral.pm view on Meta::CPAN
else {
print("param_widgets_neutral,redisplay labels, Warning parameters or labels_w_aref missing \n");
}
return ();
}
=head2 sub redisplay_values
display parameter values without quotes
although internally we always have quotes for strings
and no quotes if the value looks like a number
i/p: 2 array references
o/p: array reference
N.B. This is an ENTRY widget
textvariables must be a reference in order
for -validatecommand to work. BEWARE!
DB
lib/App/SeismicUnixGui/misc/param_widgets_pink.pm view on Meta::CPAN
"param_widgets_color,redisplay labels, Warning parameters or labels_w_aref missing \n"
);
}
return ();
}
=head2 sub redisplay_values
display parameter values without quotes
although internally we always have quotes for strings
and no quotes if the value looks like a number
i/p: 2 array references
o/p: array reference
N.B. This is an ENTRY widget
textvariables must be a reference in order
for -validatecommand to work. BEWARE!
For the Entry widget do not alter the
textvariable directly while using
lib/App/SeismicUnixGui/misc/readfiles.pm view on Meta::CPAN
$x =~ tr/"//d;
# 2. remove extra single quotes if they exist at the start of the string
$x =~ s/^'//;
# 3. remove extra single quotes if they exist at the end of the string
$x =~ s/'$//;
# print("after removing only a last single quote: $x\n ");
# 4. determine whether we have a string or a number
my $fmt = 0;
$fmt = looks_like_number($x);
if ($fmt) {
# printf("$x looks like a number \n");
# do nothing
} else {
# printf("$x does not look like a number \n");
my $x_as_string = '\''.$x.'\'';
print (" Made $x into a string: $x_as_string\n");
$x = $x_as_string;
}
=cut
lib/App/SeismicUnixGui/misc/su_param.pm view on Meta::CPAN
=cut
=head2 USE
=head3 NOTES
=head4 Examples
=head2 CHANGES and their DATES
May 5 2018 looks for configurations
first in the local directory
then in the default configuration
directory /usr/local/pl/big_streams/config
V 0.0.3 June 2022 reference to L_SU_local_user_constants
removed
L_SU_local_user_constants may create cirularity
=cut
lib/App/SeismicUnixGui/sunix/par/mkparfile.pm view on Meta::CPAN
MKPARFILE - convert ascii to par file format
mkparfile <stdin >stdout
Optional parameters:
string1="par1" first par string
string2="par2" second par string
This is a tool to convert values written line by line to parameter
vectors in the form expected by getpar. For example, if the input
file looks like:
t0 v0
t1 v1
...
then
mkparfile <input >output string1=tnmo string2=vnmo
yields:
tnmo=t0,t1,...
vnmo=v0,v1,...
=head2 CHANGES and their DATES
lib/App/SeismicUnixGui/sunix/plot/pswigp.pm view on Meta::CPAN
curvewidth=axeswidth width (in points) of curve(s)
curvedash=0 solid curve(s), dash indices 1,...,11 produce
curve(s) with various dash styles
Note: linewidth=0.0 produces the thinest possible line on the output.
device. Thus the result is device-dependent, put generally looks the
best for seismic traces.
The curve file is an ascii file with the points specified as x1 x2 pairs,
one pair to a line. A "vector" of curve files and curve colors may
be specified as curvefile=file1,file2,etc. and similarly
lib/App/SeismicUnixGui/sunix/plot/supswigp.pm view on Meta::CPAN
seismic (axis 1 vertical, axis 2 horizontal)
curve=curve1,curve2,... file(s) containing points to draw curve(s)
npair=n1,n2,n2,... number(s) of pairs in each file
curvecolor=black,.. color of curve(s)
curvewidth=axeswidth width (in points) of curve(s)
curvedash=0 solid curve(s), dash indices 1,...,11 produce
curve(s) with various dash styles
Note: linewidth=0.0 produces the thinest possible line on the output.
device. Thus the result is device-dependent, put generally looks the
best for seismic traces.
The curve file is an ascii file with the points specified as x1 x2 pairs,
one pair to a line. A "vector" of curve files and curve colors may
be specified as curvefile=file1,file2,etc. and similarly
curvecolor=color1,color2,etc, and the number | ...of pairs of values
in each file as npair=npair1,npair2,... .
All color specifications may also be made in X Window style Hex format
example: axescolor=#255
lib/App/SeismicUnixGui/sunix/shapeNcut/sumute.pm view on Meta::CPAN
We now have added the following options
to sumute:
gather_type = ep (shotpoint),cdp (cdp gathers),fldr(field data gathers)
multi_gather_par_file = a concatenated file of the individual parfiles
multi_gather_su_file = the su file which was muted interactively to
create each of the parfiles, while using the Tool: iTop_Mute
A multi-parameter-file looks as follows:
cdp=1,2
tmute=0.141777,0.251418
xmute=73,96
tmute=0.131777,0.241418
xmute=85,96
lib/App/SeismicUnixGui/sunix/statsMath/sumax.pm view on Meta::CPAN
=cut
sub outpar {
my ( $self, $outpar ) = @_;
if ( defined $outpar
&& $outpar ne $empty_string )
{
use Scalar::Util qw(looks_like_number);
my $control = App::SeismicUnixGui::misc::control->new();
# we should have a string and not a number
my $fmt = 0;
$fmt = looks_like_number($outpar);
if ($fmt) {
# print("sumax,outpar, outpar_value looks like a number BUT should be a string\n");
}
else {
# print("sumax,outpar, looks like a string: $outpar\n");
$control->set_back_slashBgone($outpar);
$outpar = $control->get_back_slashBgone();
# print("sumax,outpar without back_slashes looks like $outpar \n");
}
$sumax->{_outpar} = $outpar;
# print("sumax,outpar, $outpar\n");
if ( defined $sumax->{_output}
&& $sumax->{_output} ne $empty_string
&& $sumax->{_outpar} ne '/dev/tty' )
{