lib/App/SeismicUnixGui/big_streams/iShowNselect_picks.pm untested

filter: Statementstmt 0.0% 0 / 244 Branchbran 0.0% 0 / 46 Conditioncond 0.0% 0 / 33 MC/DCmcdc 0.0% 0 / 20 Subroutinesub 0.0% 0 / 30 Podpod 0.0% 0 / 14 totaltotal 0.0% 0 / 387 CC 24 SCAR 34.4
CC
24
Cov
0%
calcNdisplay
132.0
set_purpose
12.0
_inbound_curve_file
6.0
CRAP 31.2
1 package App::SeismicUnixGui::big_streams::iShowNselect_picks;
2  
3 =head1 DOCUMENTATION
4  
5 =head2 SYNOPSIS
6  
7 PERL PROGRAM NAME: iShowNselect_picks
8 AUTHOR: Juan Lorenzo
9  
10 DESCRIPTION:
11 Purpose: display selected picks ontop of data
12  
13 =head2 USE
14  
15 =head2 NOTES
16  
17  
18 =cut
19  
20 # $iPick->{_min_amplitude} = $min_amplitude;
21  
22 =head2
23  
24 needed packages
25  
26 =cut
27  
28 use Moose;
29 our $VERSION = '0.0.1';
30  
31 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
32  
33 use App::SeismicUnixGui::misc::control '0.0.3';
34 use aliased 'App::SeismicUnixGui::misc::control';
35  
36 use aliased 'App::SeismicUnixGui::misc::message';
37 use aliased 'App::SeismicUnixGui::misc::manage_files_by';
38 use aliased 'App::SeismicUnixGui::misc::flow';
39 use aliased 'App::SeismicUnixGui::sunix::filter::sufilter';
40 use aliased 'App::SeismicUnixGui::sunix::shapeNcut::sugain';
41 use aliased 'App::SeismicUnixGui::sunix::shapeNcut::suwind';
42 use aliased 'App::SeismicUnixGui::sunix::plot::suxwigb';
43 use aliased 'App::SeismicUnixGui::sunix::plot::suximage';
44 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
45 use aliased 'App::SeismicUnixGui::messages::SuMessages';
46 use aliased 'App::SeismicUnixGui::specs::big_streams::iPick_specC';
47  
48 use App::SeismicUnixGui::misc::SeismicUnix
49 qw($false $true $go $in $on $off $ipicks $itemp_picks_ $itemp_num_points
50 $itemp_picks_sorted_ $suffix_su $suffix_hyphen $to);
51  
52 my $iPick_specC = iPick_specC->new();
53  
54 my $get = L_SU_global_constants->new();
55 my $control = control->new();
56 my $manage_files_by = manage_files_by->new();
57 my $variables = $iPick_specC->variables();
58 my $DATA_DIR_IN = $variables->{_DATA_DIR_IN};
59 my $DATA_DIR_OUT = $variables->{_DATA_DIR_OUT};
60 my $data_suffix_in = $variables->{_data_suffix_in};
61 my $data_suffix_out = $variables->{_data_suffix_out};
62 my $var = $get->var();
63 my $empty_string = $var->{_empty_string};
64 my $purpose = $get->purpose();
65  
66 =head2
67  
68 inherit other packages
69 1. Instantiate classes
70 Create a new version of the package
71 Personalize to give it a new name if you wish
72 Use the following classes:
73  
74 =cut
75  
76 my $log = message->new();
77 my $run = flow->new();
78 my $sufilter = sufilter->new();
79 my $sugain = sugain->new();
80 my $suwind = suwind->new();
81 my $suxwigb = suxwigb->new();
82 my $suximage = suximage->new();
83 my $Project = Project_config->new();
84 my $SuMessages = SuMessages->new();
85  
86 =head2
87  
88 Import file-name and directory definitions
89  
90 =cut
91  
92 my ($PL_SEISMIC) = $Project->PL_SEISMIC();
93 my ($DATA_SEISMIC_SU) = $Project->DATA_SEISMIC_SU();
94 my ($DATA_SEISMIC_TXT) = $Project->DATA_SEISMIC_TXT();
95  
96 =head2
97
98 establish just the locally scoped variables
99  
100 =cut
101  
102 my ( @items, @flow, @sugain, @sufilter, @suwind );
103 my ( @suximage, @suxwigb );
104 my @windowtitle;
105 my @base_caption;
106  
107 =head2
108  
109 hash array of important variables used within
110 this package
111 Assume that the parameter file already exists
112 Assume that the name of this parameter file is:
113 $itemp_picks_sorted_par_.$iShowNselect_picks->{_file_in}
114  
115 =cut
116  
117 my $iShowNselect_picks = {
118 _gather_header => '',
119 _error_freq => $false,
120 _offset_type => '',
121 _file_in => '',
122 _freq => '',
123 _gather_num => '',
124 _inbound => '',
125 _inbound_curve_file => '',
126 _message_type => '',
127 _max_amplitude => '',
128 _max_x1 => '',
129 _min_amplitude => '',
130 _min_x1 => '',
131 _ntaper => '',
132 _number_of_tries => '',
133 _offset_type => '',
134 _parfile_in => '',
135 _purpose => '',
136 _textfile_in => '',
137 };
138  
139 =head2
140  
141 subroutine clear
142 to blank out hash array values
143  
144 =cut
145  
146 sub clear {
147 $iShowNselect_picks->{_gather_header} = '';
148 $iShowNselect_picks->{_error_freq} = $false;
149 $iShowNselect_picks->{_file_in} = '';
150 $iShowNselect_picks->{_freq} = '';
151 $iShowNselect_picks->{_gather_num} = '';
152 $iShowNselect_picks->{_inbound} = '';
153 $iShowNselect_picks->{_inbound_curve_file} = '',
154 $iShowNselect_picks->{_message_type} = '';
155 $iShowNselect_picks->{_max_amplitude} = '';
156 $iShowNselect_picks->{_max_x1} = '';
157 $iShowNselect_picks->{_min_amplitude} = '';
158 $iShowNselect_picks->{_min_x1} = '';
159 $iShowNselect_picks->{_ntaper} = '';
160 $iShowNselect_picks->{_number_of_tries} = '';
161 $iShowNselect_picks->{_offset_type} = '';
162 $iShowNselect_picks->{_purpose} = '';
163 $iShowNselect_picks->{_textfile_in} = '';
164 }
165  
166 =head2 sub _inbound_curve_file
167  
168 Required text file with x,t pairs
169
170 =cut
171  
172 sub _inbound_curve_file {
173  
174 my ($self) = @_;
175  
176 if ( defined $iShowNselect_picks->{_file_in} ) {
177  
178 my $file_in = $iShowNselect_picks->{_file_in};
179  
180 $iShowNselect_picks->{_inbound_curve_file} =
181 $DATA_DIR_OUT . '/' . $itemp_picks_sorted_ . $file_in;
182  
183 # print("iShowNselect_picks, _inbound_curve_file: $iShowNselect_picks->{_inbound_curve_file} \n\n");
184  
185 }
186 else {
187 print("iShowNselect_picks, file_in: unexpected file_in \n\n");
188 }
189 }
190  
191 =head2 subroutine gather_header
192  
193 define the header for the x values
194 binheader type value helps define the x values
195 e.g. if gather_header = 'gather'
196 the x values are 'offset'
197  
198 =cut
199  
200 sub gather_header {
201 my ( $self, $gather_header ) = @_;
202 $iShowNselect_picks->{_gather_header} = $gather_header
203 if defined($gather_header);
204  
205 print(" header type is $iShowNselect_picks->{_gather_header}\n\n");
206 }
207  
208 =head2 subroutine calcNdisplay
209  
210 main processing flow
211 display picks on top of results
212  
213 =cut
214  
215 sub calcNdisplay {
216  
217  
218 =head2
219  
220 WINDOW DATA
221  
222 =cut
223  
224 $suwind->clear();
225 $suwind->setheaderword( $iShowNselect_picks->{_gather_header} );
226 $suwind->min( $iShowNselect_picks->{_gather_num} );
227 $suwind->max( $iShowNselect_picks->{_gather_num} );
228  
229 # print("gather num is $iShowNselect_picks->{_gather_num}\n\n");
230 $suwind[1] = $suwind->Step();
231  
232 $suwind->clear();
233 $suwind->tmin( $iShowNselect_picks->{_min_x1} );
234 $suwind->tmax( $iShowNselect_picks->{_max_x1} );
235 $suwind[2] = $suwind->Step();
236  
237 =head2 Filter parameters
238  
239
240 =cut
241  
242 if ( defined $iShowNselect_picks->{_freq}
243 && $iShowNselect_picks->{_freq} ne $empty_string )
244 {
245  
246 # print(
247 # "iShowNselect_picks, sufilter frequencies: $iShowNselect_picks->{_freq}\n"
248 # );
249 print("L249 iShowNselect_picks, error_freq: $iShowNselect_picks->{_error_freq}\n");
250
251 $sufilter->clear();
252 $sufilter->freq( $iShowNselect_picks->{_freq} );
253 $sufilter[1] = $sufilter->Step();
254  
255 }
256 elsif ( not defined $iShowNselect_picks->{_freq}
257 or $iShowNselect_picks->{_freq} eq $empty_string )
258 {
259  
260 $iShowNselect_picks->{_error_freq} = $true;
261  
262 # print("iShowNselect_picks, missing frequencies-- error NADA\n");
263  
264 }
265 else {
266  
267 print("iShowNselect_picks, missing frequencies NADA \n");
268 }
269  
270 =head2
271  
272 GAIN DATA
273  
274 =cut
275  
276 $sugain->clear();
277 $sugain->pbal($on);
278 $sugain[1] = $sugain->Step();
279  
280 $sugain->clear();
281 $sugain->agc($on);
282  
283 # nominal agc width
284 my $wagc =
285 ( $iShowNselect_picks->{_max_x1} - $iShowNselect_picks->{_min_x1} ) / 10;
286  
287 # print("iShowNselect_picks,calcNdisplay,wagc=$wagc\n");
288 $sugain->width($wagc);
289 $sugain[2] = $sugain->Step();
290  
291 $sugain->clear();
292 $sugain->tpower(1.8);
293 $sugain[3] = $sugain->Step();
294  
295 =head2
296  
297 DISPLAY DATA (SUXIMAGE)
298  
299 =cut
300  
301 $base_caption[1] =
302 $iShowNselect_picks->{_file_in}
303 . quotemeta(' ')
304 . quotemeta(' f=')
305 . $iShowNselect_picks->{_freq};
306 $windowtitle[1] =
307 $iShowNselect_picks->{_gather_header}
308 . quotemeta(' = ')
309 . $iShowNselect_picks->{_gather_num};
310  
311 $suximage->clear();
312 $suximage->box_width(400);
313 $suximage->box_height(600);
314 $suximage->box_X0(200);
315 $suximage->box_Y0(150);
316 $suximage->title( $base_caption[1] );
317 $suximage->windowtitle( $windowtitle[1] );
318 $suximage->ylabel( quotemeta('TWTTs') );
319 $suximage->xlabel( $iShowNselect_picks->{_offset_type} );
320 $suximage->legend($on);
321 $suximage->cmap('rgb0');
322 $suximage->loclip( $iShowNselect_picks->{_min_amplitude} );
323 $suximage->hiclip( $iShowNselect_picks->{_max_amplitude} );
324  
325 # geopsy plot preference for JML
326 if ( length $iShowNselect_picks->{_purpose}
327 and $iShowNselect_picks->{_purpose} eq $purpose->{_geopsy}
328 and $iShowNselect_picks->{_max_x1} > $iShowNselect_picks->{_min_x1} )
329 {
330  
331 # frequency is hzntl and velocity is vertical in geopsy,
332 # so the x axis is reversed compared to a normal seismic plot.
333 $suximage->orientation('normal');
334 $suximage->cmap('hsv2');
335 $suximage->box_width(800);
336 $suximage->box_height(400);
337 # print("iShowNselect_picks, suximage with \'geopsy\' purpose\n");
338  
339 }
340 else {
341 $suximage->x1beg( $iShowNselect_picks->{_min_x1} );
342 $suximage->x1end( $iShowNselect_picks->{_max_x1} );
343 }
344  
345 $suximage->verbose($off);
346  
347 &_inbound_curve_file();
348  
349 # print("iShowNselect_picks,calc, using a curve file:\n");
350 print("\t$iShowNselect_picks->{_inbound_curve_file}\n\n");
351  
352 $suximage->curve( quotemeta( $iShowNselect_picks->{_inbound_curve_file} ) );
353 my ( $ref_T, $ref_X, $num_tx_pairs ) = $manage_files_by->read_2cols(
354 \$iShowNselect_picks->{_inbound_curve_file} );
355 $suximage->npair( quotemeta($num_tx_pairs) );
356 $suximage->curvecolor( quotemeta(2) );
357  
358 =item choose to save picks
359
360 =cut
361  
362 if ( $iShowNselect_picks->{_number_of_tries} >= 2 ) {
363  
364 $iShowNselect_picks->{_TX_outbound} =
365 $itemp_picks_ . $iShowNselect_picks->{_file_in};
366 $suximage->picks(
367 $DATA_DIR_OUT . '/' . $iShowNselect_picks->{_TX_outbound} );
368  
369 # print("iShowNselect_picks, suximage, writing picks to $itemp_picks_$iShowNselect_picks->{_file_in} \n");
370 # print("iShowNselect_picks, suximage, PATH: $DATA_DIR_OUT \n\n");
371 # print("number of tries is $iShowNselect_picks->{_number_of_tries} \n\n");
372 }
373  
374 $suximage[1] = $suximage->Step();
375  
376 =head2
377  
378 DISPLAY DATA (SUXWIGB)
379  
380 =cut
381  
382 $base_caption[2] =
383 $iShowNselect_picks->{_file_in}
384 . quotemeta(' f=')
385 . $iShowNselect_picks->{_freq};
386 $windowtitle[2] =
387 $iShowNselect_picks->{_gather_header}
388 . quotemeta(' = ')
389 . $iShowNselect_picks->{_gather_num};
390  
391 $suxwigb->clear();
392 $suxwigb->box_width(400);
393 $suxwigb->box_height(600);
394 $suxwigb->box_X0(750);
395 $suxwigb->box_Y0(150);
396 $suxwigb->title( $base_caption[2] );
397 $suxwigb->windowtitle( $windowtitle[2] );
398 $suxwigb->ylabel( quotemeta('TWTTs') );
399 $suxwigb->xlabel( $iShowNselect_picks->{_offset_type} );
400 $suxwigb->loclip( $iShowNselect_picks->{_min_amplitude} );
401 $suxwigb->hiclip( $iShowNselect_picks->{_max_amplitude} );
402  
403 # geopsy plot preference for JML
404 if ( length $iShowNselect_picks->{_purpose}
405 and $iShowNselect_picks->{_purpose} eq $purpose->{_geopsy}
406 and $iShowNselect_picks->{_max_x1} > $iShowNselect_picks->{_min_x1} )
407 {
408  
409 # frequency is hzntl and velocity is vertical in geopsy,
410 # so the x axis is reversed compared to a normal seismic plot.
411 $suxwigb->orientation('normal');
412 # print("iShowNselect_picks, suxwigb with \'geopsy\' purpose\n");
413  
414 }
415 else {
416 $suxwigb->x1beg( $iShowNselect_picks->{_min_x1} );
417 $suxwigb->x1end( $iShowNselect_picks->{_max_x1} );
418 }
419  
420 $suxwigb->verbose($off);
421  
422 =head2 conditions
423
424 when number_of_tries is >=2
425 there should be a pre-exisiting digitized
426 overlay curve to plot as well
427  
428 =cut
429  
430 _inbound_curve_file();
431  
432 # print("iShowNselect_picks,calc, using a curve file:\n");
433 # print("\t$iShowNselect_picks->{_inbound_curve_file}\n\n");
434  
435 $suxwigb->curve( quotemeta( $iShowNselect_picks->{_inbound_curve_file} ) );
436 ( $ref_T, $ref_X, $num_tx_pairs ) = $manage_files_by->read_2cols(
437 \$iShowNselect_picks->{_inbound_curve_file} );
438 $suxwigb->npair( quotemeta($num_tx_pairs) );
439 $suxwigb->curvecolor( quotemeta(2) );
440  
441 =item choose to save picks
442
443 =cut
444  
445 if ( $iShowNselect_picks->{_number_of_tries} > 0 ) {
446  
447 $iShowNselect_picks->{_TX_outbound} =
448 $itemp_picks_ . $iShowNselect_picks->{_file_in};
449 $suxwigb->picks(
450 $DATA_DIR_OUT . '/' . $iShowNselect_picks->{_TX_outbound} );
451  
452 # print("iShowNselect_picks, suxwigb, writing picks to $itemp_picks_$iShowNselect_picks->{_file_in} \n");
453 # print("iShowNselect_picks, suxwigb, PATH: $DATA_DIR_OUT \n\n");
454 # print("number of tries is $iShowNselect_picks->{_number_of_tries} \n\n");
455 }
456  
457 $suxwigb[1] = $suxwigb->Step();
458  
459 =head2
460
461 DEFINE FLOW(S) - for both suximage AND suxwigb
462 remove gain $to, $sugain[1],
463 =cut
464  
465 # CASES 1 and 2 With GEOPSY as the purpose
466 if ( defined $iShowNselect_picks->{_purpose}
467 and $iShowNselect_picks->{_purpose} ne $empty_string )
468 {
469  
470 if ( $iShowNselect_picks->{_purpose} eq $purpose->{_geopsy})
471 {
472 # CASE 1: frequencies may or may not be input by the user
473 @items = (
474 $suwind[1], $in, $iShowNselect_picks->{_inbound},
475 $to, $suwind[2],
476 $to, $suxwigb[1],
477 $go
478 );
479 $flow[1] = $run->modules( \@items );
480  
481 print ("iShowNselect_picks, CASE1: $flow[1]\n");
482 @items = (
483 $suwind[1], $in, $iShowNselect_picks->{_inbound},
484 $to, $suwind[2], $to, $suximage[1], $go
485 );
486 $flow[2] = $run->modules( \@items );
487  
488 }
489 # else {
490 #
491 #print("1. iShowNselect_picks, purpose:$iShowNselect_picks->{_purpose}\n");
492 #print("1. iShowNselect_picks, error_freq: $iShowNselect_picks->{_error_freq}\n");
493 #print("1. iShowNselect_picks, unconstrained purpose\n");
494 # print ( "L490 $flow[1]\n");
495 # }
496  
497 # CASE 2 No purpose
498 # BUT frequencies ARE present
499 # TODO No purpose BUT frequencies are absent
500 }
501 elsif (
502 (
503 not( defined $iShowNselect_picks->{_purpose} )
504 || $iShowNselect_picks->{_purpose} eq $empty_string
505 )
506 && $iShowNselect_picks->{_error_freq} eq $false
507 )
508 {
509  
510 @items = (
511 $suwind[1], $in, $iShowNselect_picks->{_inbound},
512 $to, $suwind[2], $to, $sufilter[1], $to, $suxwigb[1], $go
513 );
514 $flow[1] = $run->modules( \@items );
515  
516 print ("iShowNselect_picks, CASE2: $flow[1]\n");
517  
518 @items = (
519 $suwind[1], $in, $iShowNselect_picks->{_inbound},
520 $to, $suwind[2], $to, $sufilter[1], $to, $suximage[1], $go
521 );
522 $flow[2] = $run->modules( \@items );
523  
524 }
525 else {
526
527  
528 # print("2. iShowNselect_picks, purpose:---$iShowNselect_picks->{_purpose}---\n");
529 print("2. iShowNselect_picks, error_freq:---$iShowNselect_picks->{_error_freq}---\n");
530 # print("2. iShowNselect_picks, unexpected purpose\n");
531 }
532  
533 =head2
534  
535 RUN FLOW(S)
536
537 output copy of picked data points
538 only occurs after the number of tries
539 is updated
540  
541 =cut
542  
543 if ( defined $iShowNselect_picks->{_purpose}
544 and $iShowNselect_picks->{_purpose} eq $purpose->{_geopsy} )
545 {
546 # for suximage
547 $run->flow( \$flow[2] );
548  
549 } else {
550 # for suxwigb
551 $run->flow( \$flow[1] );
552  
553 # for suximage
554 $run->flow( \$flow[2] );
555 }
556  
557 =head2
558  
559 LOG FLOW(S)TO SCREEN AND FILE
560  
561 =cut
562  
563 # for suxwigb
564 #$log->file($flow[1]);
565  
566 #for suximage
567 # print "$flow[2]\n";
568  
569 } # end calcNdisplay subroutine
570  
571 =head2 sub file_in
572  
573 Required sunix file name
574 on which to pick mute values
575 print("$iShowNselect_picks->{_inbound}\n\n");
576
577 =cut
578  
579 sub file_in {
580  
581 my ( $self, $file_in ) = @_;
582  
583 if ( defined $file_in ) {
584  
585 # e.g. 'sp1' becomes sp1
586 $control->set_infection($file_in);
587 $file_in = control->get_ticksBgone();
588 $iShowNselect_picks->{_file_in} = $file_in;
589 $iShowNselect_picks->{_inbound} =
590 $DATA_DIR_IN . '/' . $file_in . $data_suffix_in;
591  
592 # print("iShowNselect_picks, file_in: $iShowNselect_picks->{_file_in} \n\n");
593 }
594 else {
595 print("iShowNselect_picks, file_in: unexpected file_in \n\n");
596 }
597 }
598  
599 =head2
600  
601 subroutine freq
602 creates the bandpass frequencies to filter data
603 e.g., "3,6,40,50"
604
605 =cut
606  
607 sub freq {
608 my ( $self, $freq ) = @_;
609 $iShowNselect_picks->{_freq} = $freq if defined($freq);
610  
611 # print("freq is $iShowNselect_picks->{_freq}\n\n");
612 }
613  
614 =head2 subroutine gather
615  
616 sets gather number to consider
617  
618 =cut
619  
620 sub gather_num {
621 my ( $self, $gather_num ) = @_;
622 $iShowNselect_picks->{_gather_num} = $gather_num if defined($gather_num);
623 }
624  
625 =head2
626  
627 subroutine maximum amplitude to plot
628  
629 =cut
630  
631 sub max_amplitude {
632 my ( $self, $max_amplitude ) = @_;
633 $iShowNselect_picks->{_max_amplitude} = $max_amplitude
634 if defined($max_amplitude);
635  
636 # print("max_amplitude is $iShowNselect_picks->{_max_amplitude}\n\n");
637 }
638  
639 =head2
640  
641 subroutine minumum amplitude to plot
642  
643 =cut
644  
645 sub min_amplitude {
646 my ( $self, $min_amplitude ) = @_;
647 $iShowNselect_picks->{_min_amplitude} = $min_amplitude
648 if defined($min_amplitude);
649  
650 # print("min_amplitude is $iShowNselect_picks->{_min_amplitude}\n\n");
651  
652 }
653  
654 =head2 sub max_x1
655  
656 maximum time/Hz to plot
657  
658 =cut
659  
660 sub max_x1 {
661 my ( $self, $max_x1 ) = @_;
662  
663 if ( length $max_x1 ) {
664  
665 $iShowNselect_picks->{_max_x1} = $max_x1;
666  
667 # print("max_x1 is $iShowNselect_picks->{_max_x1}\n\n");
668  
669 }
670 else {
671 print("iShowNselect_picks, max_x1, value missing\n");
672 }
673 return ();
674 }
675  
676 =head3 sub min_x1
677  
678 minumum time/Hz to plot
679  
680 =cut
681  
682 sub min_x1 {
683 my ( $self, $min_x1 ) = @_;
684  
685 if ( length $min_x1 ) {
686  
687 $iShowNselect_picks->{_min_x1} = $min_x1;
688  
689 # print("min_x1 is $iShowNselect_picks->{_min_x1}\n\n");
690  
691 }
692 else {
693 print("iShowNselect_picks,min_x1, unexpected min time-s\n");
694 }
695 }
696  
697 =head2 sub number_of_tries
698  
699 keep track of the number of attempts
700 at picking top mute
701  
702 =cut
703  
704 sub number_of_tries {
705 my ( $self, $number_of_tries ) = @_;
706 $iShowNselect_picks->{_number_of_tries} = $number_of_tries
707 if defined($number_of_tries);
708  
709 # print("num of tries is $iShowNselect_picks->{_number_of_tries}\n\n");
710 }
711  
712 =head2 subroutine offset_type
713  
714 define the header for the x values
715 offset type value helps define the x values
716 e.g. if offset_type = 'gather'
717 the x values are 'offset'
718  
719 =cut
720  
721 sub offset_type {
722 my ( $self, $offset_type ) = @_;
723  
724 $iShowNselect_picks->{_offset_type} = $offset_type
725 if defined($offset_type);
726  
727 print(" offset type is $iShowNselect_picks->{_offset_type}\n\n");
728 }
729  
730 =head2 sub set_purpose
731  
732 define where the data will need to go
733 define the type of behavior
734
735 =cut
736  
737 sub set_purpose {
738  
739 my ( $self, $type ) = @_;
740  
741 if ( defined $type
742 && $type ne $empty_string )
743 {
744  
745 my $control = control->new();
746 $control->set_infection($type);
747 $type = control->get_ticksBgone();
748  
749 # print("iShowNselect_picks,set_purpose: $type\n");
750 print("iShowNselect_picks,set_purpose: $purpose->{_geopsy}\n");
751  
752 if ( $type eq $purpose->{_geopsy} ) {
753  
754 $iShowNselect_picks->{_purpose} = $type;
755  
756 # print("iShowNselect,set_purpose: $iShowNselect_picks->{_purpose}\n");
757  
758 }
759 else {
760  
761 # print("iShowNselect_picks,set_purpose is unavailable, NADA\n");
762 }
763  
764 }
765 else {
766  
767 # print("iShowNselect_picks,set_purpose value is empty NADA\n");
768 }
769 }
770  
771 1;