App-SeismicUnixGui

 view release on metacpan or  search on metacpan

lib/App/SeismicUnixGui/sunix/plot/suximage.pm  view on Meta::CPAN

	over the value in the trace header.

	When we must compute ntr, we don't allocate a 2-d array,
	but just content ourselves with copying trace by trace from
	the data "file" to the pipe into the plotting program.
	Although we could use tr.data, we allocate a trace buffer
	for code clarity.
	

 The parameters of the following seismic unix programs
 also applies to the current package suximage

XIMAGE - X IMAGE plot of a uniformly-sampled function f(x1,x2)     	
									
 ximage n1= [optional parameters] <binaryfile			        
									
 X Functionality:							
 Button 1	Zoom with rubberband box				
 Button 2	Show mouse (x1,x2) coordinates while pressed		
 q or Q key	Quit							
 s key		Save current mouse (x1,x2) location to file		
 p or P key	Plot current window with pswigb (only from disk files)	
 a or page up keys		enhance clipping by 10%			
 c or page down keys		reduce clipping by 10%			
 up,down,left,right keys	move zoom window by half width/height	
 i or +(keypad) 		zoom in by factor 2 			
 o or -(keypad) 		zoom out by factor 2 			
									
 ... change colormap interactively					
 r	     install next RGB - colormap				
 R	     install previous RGB - colormap				
 h	     install next HSV - colormap				
 H	     install previous HSV - colormap				
 H	     install previous HSV - colormap				
 (Move mouse cursor out and back into window for r,R,h,H to take effect)
 									
 Required Parameters:			#				
 n1			 number of samples in 1st (fast) dimension	
									
 Optional Parameters:							
 d1=1.0		 sampling interval in 1st dimension		
 f1=0.0		 first sample in 1st dimension			
 n2=all		 number of samples in 2nd (slow) dimension	
 d2=1.0		 sampling interval in 2nd dimension		
 f2=0.0		 first sample in 2nd dimension			
 mpicks=/dev/tty	 file to save mouse picks in			
 perc=100.0		 percentile used to determine clip		
 clip=(perc percentile) clip used to determine bclip and wclip		
 bperc=perc		 percentile for determining black clip value	
 wperc=100.0-perc	 percentile for determining white clip value	
 bclip=clip		 data values outside of [bclip,wclip] are clipped
 wclip=-clip		 data values outside of [bclip,wclip] are clipped
 balance=0		 bclip & wclip individually			
			 =1 set them to the same abs value		
			   if specified via perc (avoids colorbar skew)	
 cmap=hsv'n' or rgb'm'	'n' is a number from 0 to 13		
				'm' is a number from 0 to 11		
				cmap=rgb0 is equal to cmap=gray		
				cmap=hsv1 is equal to cmap=hue		
				(compatibility to older versions)	
 legend=0	        =1 display the color scale			
 units=		unit label for legend				
 legendfont=times_roman10    font name for title			
 verbose=1		=1 for info printed on stderr (0 for no info)	
 xbox=50		x in pixels of upper left corner of window	
 ybox=50		y in pixels of upper left corner of window	
 wbox=550		width in pixels of window			
 hbox=700		height in pixels of window			
 lwidth=16		colorscale (legend) width in pixels		
 lheight=hbox/3	colorscale (legend) height in pixels		
 lx=3			colorscale (legend) x-position in pixels	
 ly=(hbox-lheight)/3   colorscale (legend) y-position in pixels	
 x1beg=x1min		value at which axis 1 begins			
 x1end=x1max		value at which axis 1 ends			
 d1num=0.0		numbered tic interval on axis 1 (0.0 for automatic)
 f1num=x1min		first numbered tic on axis 1 (used if d1num not 0.0)
 n1tic=1		number of tics per numbered tic on axis 1	
 grid1=none		grid lines on axis 1 - none, dot, dash, or solid
 label1=		label on axis 1					
 x2beg=x2min		value at which axis 2 begins			
 x2end=x2max		value at which axis 2 ends			
 d2num=0.0		numbered tic interval on axis 2 (0.0 for automatic)
 f2num=x2min		first numbered tic on axis 2 (used if d2num not 0.0)
 n2tic=1		number of tics per numbered tic on axis 2	
 grid2=none		grid lines on axis 2 - none, dot, dash, or solid
 label2=		label on axis 2					
 labelfont=Erg14	font name for axes labels			
 title=		title of plot					
 titlefont=Rom22	font name for title				
 windowtitle=ximage	title on window					
 labelcolor=blue	color for axes labels				
 titlecolor=red	color for title					
 gridcolor=blue	color for grid lines				
 style=seismic	$        normal (axis 1 horizontal, axis 2 vertical) or  
			seismic (axis 1 vertical, axis 2 horizontal)	
 blank=0		This indicates what portion of the lower range  
			to blank out (make the background color).  The  
			value should range from 0 to 1.			
 plotfile=plotfile.ps  filename for interactive ploting (P)  		
 curve=curve1,curve2,...  file(s) containing points to draw curve(s)   
 npair=n1,n2,n2,...            number(s) of pairs in each file         
 curvecolor=color1,color2,...  color(s) for curve(s)                   
 blockinterp=0       whether to use block interpolation (0=no, 1=yes)
 curvewidth

 NOTES:								
 The curve file is an ascii file with the points  specified as x1 x2	
 pairs separated by a space, one pair to a line.  A "vector" of curve
 files and curv$e colors may be specified as curvefile=file1,file2,etc. 
 and curvecolor=color1,color2,etc, and the number of pairs of values   
 in each file as npair=npair1,npair2,... .
 
 JML:9-1-19                     curvefile=file1,file2,file3 fails
Perl wrapper automatically substitutes with: curve=file1,file2,file3


SUXIMAGE - X-windows IMAGE plot of a segy data set	                
									
 suximage infile= [optional parameters] | ...  (direct I/O)            
  or					                		
 suximage <stdin [optional parameters] | ...	(sequential I/O)        
									
 Optional parameters:						 	
									
 infile=NULL SU data to be ploted, default stdin with sequential access
             if 'infile' provided, su data read by (fast) direct access
									
	      with ftr,dtr and n2 suximage will pass a subset of data   
	      to the plotting program-ximage:                           
 ftr=1       First trace to be plotted                                 
 dtr=1       Trace increment to be plotted                             
 n2=tr.ntr   (Max) number of traces to be plotted (ntr is an alias for n2)

lib/App/SeismicUnixGui/sunix/plot/suximage.pm  view on Meta::CPAN

									
 tmpdir=	 	if non-empty, use the value as a directory path	
		 	prefix for storing temporary files; else if the	
	         	the CWP_TMPDIR environment variable is set use	
	         	its value for the path; else use tmpfile()	
 									
 Note that for seismic time domain data, the "fast dimension" is	
 time and the "slow dimension" is usually trace number or range.	
 Also note that "foreign" data tapes may have something unexpected	
 in the d2,f2 fields, use segyclean to clear these if you can afford	
 the processing time or use d2= f2= to override the header values if
 not.									
									
 See the ximage selfdoc for the remaining parameters.

=head2 CHANGES and their DATES

=cut

use Moose;
our $VERSION = '0.0.1';

use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';

my $get = L_SU_global_constants->new();

my $var          = $get->var();
my $empty_string = $var->{_empty_string};

my $suximage = {
    _balance     => '',
    _bclip       => '',
    _blank       => '',
    _blockinterp => '',
    _bperc       => '',
    _clip        => '',
    _cmap        => '',
    _curve       => '',
    _curvecolor  => '',
    _curvefile   => '',
    _curvewidth	 => '',
    _d1          => '',
    _d1num       => '',
    _d2          => '',
    _d2num       => '',
    _dtr         => '',
    _f1          => '',
    _f1num       => '',
    _f2          => '',
    _f2num       => '',
    _grid1       => '',
    _grid2       => '',
    _gridcolor   => '',
    _hbox        => '',
    _infile      => '',
    _key         => '',
    _label1      => '',
    _label2      => '',
    _labelcolor  => '',
    _labelfont   => '',
    _legend      => '',
    _legendfont  => '',
    _lheight     => '',
    _lwidth      => '',
    _lx          => '',
    _ly          => '',
    _mpicks      => '',
    _n1          => '',
    _n1tic       => '',
    _n2          => '',
    _n2tic       => '',
    _npair       => '',
    _perc        => '',
    _plotfile    => '',
    _style       => '',
    _title       => '',
    _titlecolor  => '',
    _titlefont   => '',
    _tmpdir      => '',
    _units       => '',
    _verbose     => '',
    _wbox        => '',
    _wclip       => '',
    _windowtitle => '',
    _wperc       => '',
    _x1beg       => '',
    _x1end       => '',
    _x2beg       => '',
    _x2end       => '',
    _xbox        => '',
    _ybox        => '',
    _Step        => '',
    _note        => '',
};

=head2 sub Step

collects switches and assembles bash instructions
by adding the program name

=cut

sub Step {

    $suximage->{_Step} = 'suximage' . $suximage->{_Step};
    return ( $suximage->{_Step} );

}

=head2 sub note

collects switches and assembles bash instructions
by adding the program name

=cut

sub note {

    $suximage->{_note} = 'suximage' . $suximage->{_note};
    return ( $suximage->{_note} );

}

=head2 sub clear

 56 +2 items
 
=cut

sub clear {

    $suximage->{_balance}     = '';
    $suximage->{_bclip}       = '';
    $suximage->{_blank}       = '';
    $suximage->{_blockinterp} = '';
    $suximage->{_bperc}       = '';
    $suximage->{_clip}        = '';
    $suximage->{_cmap}        = '';
    $suximage->{_curve}       = '';
    $suximage->{_curvecolor}  = '';
    $suximage->{_curvefile}   = '';
    $suximage->{_curvewidth}  = '';    
    $suximage->{_d1}          = '';
    $suximage->{_d1num}       = '';
    $suximage->{_d2}          = '';
    $suximage->{_d2num}       = '';
    $suximage->{_dtr}         = '';
    $suximage->{_f1}          = '';
    $suximage->{_f1num}       = '';
    $suximage->{_f2}          = '';
    $suximage->{_f2num}       = '';
    $suximage->{_ftr}         = '';
    $suximage->{_grid1}       = '';
    $suximage->{_grid2}       = '';
    $suximage->{_gridcolor}   = '';
    $suximage->{_hbox}        = '';
    $suximage->{_infile}      = '';
    $suximage->{_key}         = '';
    $suximage->{_label1}      = '';
    $suximage->{_label2}      = '';
    $suximage->{_labelcolor}  = '';
    $suximage->{_labelfont}   = '';
    $suximage->{_legend}      = '';
    $suximage->{_legendfont}  = '';
    $suximage->{_lheight}     = '';
    $suximage->{_lwidth}      = '';
    $suximage->{_lx}          = '';
    $suximage->{_ly}          = '';
    $suximage->{_mpicks}      = '';
    $suximage->{_n1}          = '';
    $suximage->{_n1tic}       = '';
    $suximage->{_n2}          = '';
    $suximage->{_n2tic}       = '';
    $suximage->{_npair}       = '';
    $suximage->{_perc}        = '';
    $suximage->{_plotfile}    = '';
    $suximage->{_style}       = '';
    $suximage->{_title}       = '';
    $suximage->{_titlecolor}  = '';
    $suximage->{_titlefont}   = '';
    $suximage->{_tmpdir}      = '';
    $suximage->{_units}       = '';
    $suximage->{_verbose}     = '';
    $suximage->{_wbox}        = '';
    $suximage->{_wclip}       = '';
    $suximage->{_windowtitle} = '';
    $suximage->{_wperc}       = '';
    $suximage->{_x1beg}       = '';
    $suximage->{_x1end}       = '';
    $suximage->{_x2beg}       = '';
    $suximage->{_x2end}       = '';
    $suximage->{_xbox}        = '';
    $suximage->{_ybox}        = '';
    $suximage->{_Step}        = '';
    $suximage->{_note}        = '';
}

=head2 sub dtr 


=cut

sub dtr {

    my ( $self, $dtr ) = @_;
    if ( $dtr ne $empty_string ) {

        $suximage->{_dtr}  = $dtr;
        $suximage->{_note} = $suximage->{_note} . ' dtr=' . $suximage->{_dtr};
        $suximage->{_Step} = $suximage->{_Step} . ' dtr=' . $suximage->{_dtr};

    }
    else {
        print("suximage, dtr, missing dtr,\n");
    }
}

=head2 sub ftr 


=cut

sub ftr {

lib/App/SeismicUnixGui/sunix/plot/suximage.pm  view on Meta::CPAN


    my ( $self, $label2 ) = @_;
    if ( $label2 ne $empty_string ) {

        $suximage->{_label2} = $label2;
        $suximage->{_note} =
          $suximage->{_note} . ' label2=' . $suximage->{_label2};
        $suximage->{_Step} =
          $suximage->{_Step} . ' label2=' . $suximage->{_label2};

    }
    else {
        print("suximage, label2, missing label2,\n");
    }
}

=head2 sub labelcolor 


=cut

sub labelcolor {

    my ( $self, $labelcolor ) = @_;
    if ( $labelcolor ne $empty_string ) {

        $suximage->{_labelcolor} = $labelcolor;
        $suximage->{_note} =
          $suximage->{_note} . ' labelcolor=' . $suximage->{_labelcolor};
        $suximage->{_Step} =
          $suximage->{_Step} . ' labelcolor=' . $suximage->{_labelcolor};

    }
    else {
        print("suximage, labelcolor, missing labelcolor,\n");
    }
}

=head2 sub labelfont 


=cut

sub labelfont {

    my ( $self, $labelfont ) = @_;
    if ( $labelfont ne $empty_string ) {

        $suximage->{_labelfont} = $labelfont;
        $suximage->{_note} =
          $suximage->{_note} . ' labelfont=' . $suximage->{_labelfont};
        $suximage->{_Step} =
          $suximage->{_Step} . ' labelfont=' . $suximage->{_labelfont};

    }
    else {
        print("suximage, labelfont, missing labelfont,\n");
    }
}

=head2 sub legend 


=cut

sub legend {

    my ( $self, $legend ) = @_;
    if ( $legend ne $empty_string ) {

        $suximage->{_legend} = $legend;
        $suximage->{_note} =
          $suximage->{_note} . ' legend=' . $suximage->{_legend};
        $suximage->{_Step} =
          $suximage->{_Step} . ' legend=' . $suximage->{_legend};

    }
    else {
        print("suximage, legend, missing legend,\n");
    }
}

=head2 sub legendfont 


=cut

sub legendfont {

    my ( $self, $legendfont ) = @_;
    if ( $legendfont ne $empty_string ) {

        $suximage->{_legendfont} = $legendfont;
        $suximage->{_note} =
          $suximage->{_note} . ' legendfont=' . $suximage->{_legendfont};
        $suximage->{_Step} =
          $suximage->{_Step} . ' legendfont=' . $suximage->{_legendfont};

    }
    else {
        print("suximage, legendfont, missing legendfont,\n");
    }
}

=head2 sub lheight 


=cut

sub lheight {

    my ( $self, $lheight ) = @_;
    if ( $lheight ne $empty_string ) {

        $suximage->{_lheight} = $lheight;
        $suximage->{_note} =
          $suximage->{_note} . ' lheight=' . $suximage->{_lheight};
        $suximage->{_Step} =
          $suximage->{_Step} . ' lheight=' . $suximage->{_lheight};

    }
    else {
        print("suximage, lheight, missing lheight,\n");
    }
}

=head2 sub loclip 

	subs loclip bclip

=cut

sub loclip {

    my ( $self, $bclip ) = @_;

    # print("suximage, loclip, $bclip,\n");

    # $wclip >= 0  &&
    if ( $bclip ne $empty_string ) {

        $suximage->{_bclip} = $bclip;
        $suximage->{_note} =
          $suximage->{_note} . ' bclip=' . $suximage->{_bclip};
        $suximage->{_Step} =
          $suximage->{_Step} . ' bclip=' . $suximage->{_bclip};
    }
    else {
        print("suximage, loclip, missing loclip,\n");
    }
}

=head2 sub lwidth 


=cut

sub lwidth {

    my ( $self, $lwidth ) = @_;
    if ( $lwidth ne $empty_string ) {



( run in 0.518 second using v1.01-cache-2.11-cpan-d8267643d1d )