lib/App/SeismicUnixGui/sunix/filter/sulfaf.pm untested

filter: Statementstmt 0.0% 0 / 315 Branchbran 0.0% 0 / 80 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 48 Podpod 0.0% 0 / 44 totaltotal 0.0% 0 / 487 CC 41 SCAR 17.3
CC
41
Cov
0%
adb
6.0
ct
6.0
d1
6.0
CRAP 5.6
1 package App::SeismicUnixGui::sunix::filter::sulfaf;
2  
3 =head2 SYNOPSIS
4  
5 PERL PROGRAM NAME:
6  
7 AUTHOR: Juan Lorenzo (Perl module only)
8  
9 DATE:
10  
11 DESCRIPTION:
12  
13 Version:
14  
15 =head2 USE
16  
17 =head3 NOTES
18  
19 =head4 Examples
20  
21 =head2 SYNOPSIS
22  
23 =head3 SEISMIC UNIX NOTES
24 SULFAF - Low frequency array forming ",
25  
26  
27  
28 sulfaf < stdin > stdout [optional parameters]
29  
30  
31  
32 Optional Parameters:
33  
34 key=ep header keyword describing the gathers
35  
36 f1=3 lower frequency cutof
37  
38 f2=20 high frequency cutof
39  
40 fr=5 frequency ramp
41  
42  
43  
44 vel=1000 surface wave velocity
45  
46 dx=10 trace spacing
47  
48 maxmix=tr.ntr default is the entire gather
49  
50 adb=1.0 add back ratio 1.0=pure filtered 0.0=origibal
51  
52  
53  
54 tri=0 1 Triangular weight in mixing window
55  
56  
57  
58 Notes:
59  
60 The traces transformed into the freqiency domain
61  
62 where a trace mix is performed in the specifed frequency range
63  
64 as Mix=vel/(freq*dx)
65  
66  
67  
68 This program uses "get_gather" and "put_gather" so requires that
69  
70 the data be sorted into ensembles designated by "key", with the ntr
71  
72 field set to the number of traces in each respective ensemble.
73  
74  
75  
76 Example:
77  
78 susort ep offset < data.su > datasorted.su
79  
80 suputgthr dir=Data verbose=1 < datasorted.su
81  
82 sugetgthr dir=Data verbose=1 > dataupdated.su
83  
84 sulfaf < dataupdated.su > ccfiltdata.su
85  
86  
87  
88 (Work in progress, editing required)
89  
90  
91  
92 define LOOKFAC 1 /* Look ahead factor for npfaro
93  
94 define PFA_MAX 720720 /* Largest allowed nfft */
95  
96 define PIP2 PI/2.0 /* IP/2 */
97  
98  
99  
100 int
101  
102 main( int argc, char *argv[] )
103  
104 {
105  
106 cwp_String key; /* header key word from segy.h */
107  
108 cwp_String type; /* ... its type */
109  
110 Value val; /* ... its value */
111  
112 segy **rec_o; /* trace header+data matrix */
113  
114 int first=0; /* true when we passed the first gather
115  
116 int ng=0;
117  
118 float dt; /* time sampling interval */
119  
120 int nt; /* num time samples per trace */
121  
122 int ntr; /* num of traces per ensemble */
123  
124
125  
126 int nfft=0; /* lenghth of padded array */
127  
128 float snfft; /* scale factor for inverse fft
129  
130 int nf=0; /* number of frequencies */
131  
132 float d1; /* frequency sampling interval. */
133  
134 float *rt=NULL; /* real trace */
135  
136 complex *ct=NULL; /* complex trace */
137  
138 float **ffdr=NULL; /* frequency domain data */
139  
140 float **ffdi=NULL; /* frequency domain data */
141  
142 float **ffdrm=NULL; /* frequency domain mixed data */
143  
144 float **ffdim=NULL; /* frequency domain mixed data */
145  
146
147  
148 int verbose; /* flag: =0 silent; =1 chatty */
149  
150
151  
152
153  
154 float f1; /* minimum frequency */
155  
156 int if1; /* ... ... integerized */
157  
158 float f2; /* maximum frequency */
159  
160 int if2; /* ... ... integerized */
161  
162 float fr; /* slope of frequency ramp */
163  
164 int ifr; /* ... ... integerized */
165  
166 float vel; /* velocity of guided waves */
167  
168 float dx; /* spatial sampling intervall */
169  
170 int maxmix; /* size of mix */
171  
172 int tri; /* flag: =1 trianglular window */
173  
174 float adb; /* add back ratio */
175  
176
177  
178 /* Initialize
179  
180 initargs(argc, argv);
181  
182 requestdoc(1);
183  
184
185  
186 if (!getparstring("key", &key)) key = "ep";
187  
188 if (!getparfloat("f1", &f1)) f1 = 3.0;
189  
190 if (!getparfloat("f2", &f2)) f2 = 20.0;
191  
192 if (!getparfloat("dx", &dx)) dx = 10;
193  
194 if (!getparfloat("vel", &vel)) vel = 1000;
195  
196 if (!getparfloat("fr", &fr)) fr = 5;
197  
198 if (!getparint("maxmix", &maxmix)) maxmix = -1;
199  
200 if (!getparint("tri", &tri)) tri = 0;
201  
202 if (!getparfloat("adb", &adb)) adb = 1.0;
203  
204
205  
206 if (!getparint("verbose", &verbose)) verbose = 0;
207  
208  
209  
210 /* get the first record
211  
212 rec_o = get_gather(&key,&type,&val,&nt,&ntr,&dt,&first);
213  
214 if(ntr==0) err("Can't get first record\n");
215  
216
217  
218 /* set up the fft
219  
220 nfft = npfaro(nt, LOOKFAC * nt);
221  
222 if (nfft >= SU_NFLTS || nfft >= PFA_MAX)
223  
224 err("Padded nt=0--too big", nfft);
225  
226 nf = nfft/2 + 1;
227  
228 snfft=1.0/nfft;
229  
230 d1=1.0/(nfft*dt);
231  
232
233  
234 ct=ealloc1complex(nf);
235  
236 rt=ealloc1float(nfft);
237  
238
239  
240 if1=NINT(f1/d1);
241  
242 if2=NINT(f2/d1);
243  
244 ifr=NINT(fr/d1);
245  
246
247  
248 do {
249  
250 if(maxmix==-1) maxmix=ntr;
251  
252 ng++;
253  
254
255  
256 /* Allocate arrays for fft
257  
258 ffdr = ealloc2float(nf,ntr);
259  
260 ffdi = ealloc2float(nf,ntr);
261  
262 ffdrm = ealloc2float(if2+ifr,ntr);
263  
264 ffdim = ealloc2float(if2+ifr,ntr);
265  
266 { int itr,iw;
267  
268 for(itr=0;itr<ntr;itr++) {
269  
270
271  
272 memcpy( (void *) rt, (const void *) (*rec_o[itr]).data, nt*FSIZE);
273  
274  
275  
276 memset( (void *) &rt[nt], 0,(nfft-nt)*FSIZE);
277  
278
279  
280 pfarc(1,nfft,rt,ct);
281  
282
283  
284 for(iw=0;iw<nf;iw++) {
285  
286 ffdr[itr][iw] = ct[iw].r;
287  
288 ffdi[itr][iw] = ct[iw].i;
289  
290 }
291  
292 }
293  
294 }
295  
296
297  
298 /* Mixing
299  
300 { int mix,iw,nmix;
301  
302 int ims,ime;
303  
304 int itr,itrm,iww,ws;
305  
306 float tmpr,tmpi,wh;
307  
308
309  
310 for(iw=if1;iw<if2+ifr;iw++) {
311  
312
313  
314 mix=MIN(NINT(vel/iw*d1*dx),maxmix);
315  
316 if(!ISODD(mix)) mix -=1;
317  
318 if (verbose) warn(" 0.000000 0",iw*d1,mix);
319  
320
321  
322 for(itr=0;itr<ntr;itr++) {
323  
324
325  
326 ims=MAX(itr-mix/2,0);
327  
328 ime=MIN(ims+mix,ntr-1);
329  
330  
331  
332 tmpr=0.0; tmpi=0.0;
333  
334 wh=1.0; ws=mix/2;
335  
336 nmix=0;
337  
338 for(itrm=ims,iww=-mix/2;itrm<ime;++itrm,++iww) {
339  
340 ++nmix;
341  
342 if(tri) wh = (float)(ws-abs(iww));
343  
344 tmpr+=ffdr[itrm][iw]*wh;
345  
346 tmpi+=ffdi[itrm][iw]*wh;
347  
348 }
349  
350 ffdrm[itr][iw]=tmpr/nmix;
351  
352 ffdim[itr][iw]=tmpi/nmix;
353  
354 }
355  
356 }
357  
358
359  
360 for(iw=if1;iw<if2;iw++) {
361  
362 for(itr=0;itr<ntr;itr++) {
363  
364 ffdr[itr][iw]=ffdrm[itr][iw]*adb+ffdr[itr][iw]*(1.0-adb);
365  
366 ffdi[itr][iw]=ffdim[itr][iw]*adb+ffdi[itr][iw]*(1.0-adb);
367  
368 }
369  
370 }
371  
372
373  
374 for(iw=if2,iww=0;iw<if2+ifr;iw++,iww++) {
375  
376
377  
378 wh=(float)(1.0-(float)iww/(float)ifr);
379  
380
381  
382 for(itr=0;itr<ntr;itr++) {
383  
384 ffdr[itr][iw] = (wh*ffdrm[itr][iw]+ffdr[itr][iw]*(1.0-wh))*adb+ffdr[itr][iw]*(1.0-adb);
385  
386 ffdi[itr][iw] = (wh*ffdim[itr][iw]+ffdi[itr][iw]*(1.0-wh))*adb+ffdi[itr][iw]*(1.0-adb);
387  
388 }
389  
390 }
391  
392
393  
394 }
395  
396
397  
398
399  
400 { int itr,iw;
401  
402 for(itr=0;itr<ntr;itr++) {
403  
404
405  
406 for(iw=0;iw<nf;iw++) {
407  
408 ct[iw].r = ffdr[itr][iw]*snfft;
409  
410 ct[iw].i = ffdi[itr][iw]*snfft;
411  
412 }
413  
414
415  
416 pfacr(-1,nfft,ct,rt);
417  
418 memcpy( (void *) (*rec_o[itr]).data, (const void *) rt, nt*FSIZE);
419  
420
421  
422 }
423  
424 }
425  
426
427  
428 rec_o = put_gather(rec_o,&nt,&ntr);
429  
430  
431  
432 free2float(ffdr);
433  
434 free2float(ffdi);
435  
436 free2float(ffdrm);
437  
438 free2float(ffdim);
439  
440 rec_o = get_gather(&key,&type,&val,&nt,&ntr,&dt,&first);
441  
442
443  
444 } while(ntr);
445  
446  
447  
448 warn("Number of gathers 0\n",ng);
449  
450
451  
452 return EXIT_SUCCESS;
453  
454 }
455  
456  
457  
458 =head2 User's notes (Juan Lorenzo)
459 untested
460  
461 =cut
462  
463  
464 =head2 CHANGES and their DATES
465  
466 =cut
467  
468 use Moose;
469 our $VERSION = '0.0.1';
470  
471  
472 =head2 Import packages
473  
474 =cut
475  
476 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
477  
478 use App::SeismicUnixGui::misc::SeismicUnix qw($go $in $off $on $out $ps $to $suffix_ascii $suffix_bin $suffix_ps $suffix_segy $suffix_su);
479 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
480  
481  
482 =head2 instantiation of packages
483  
484 =cut
485  
486 my $get = L_SU_global_constants->new();
487 my $Project = Project_config->new();
488 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
489 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
490 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
491  
492 my $PS_SEISMIC = $Project->PS_SEISMIC();
493  
494 my $var = $get->var();
495 my $on = $var->{_on};
496 my $off = $var->{_off};
497 my $true = $var->{_true};
498 my $false = $var->{_false};
499 my $empty_string = $var->{_empty_string};
500  
501 =head2 Encapsulated
502 hash of private variables
503  
504 =cut
505  
506 my $sulfaf = {
507 _adb => '',
508 _ct => '',
509 _d1 => '',
510 _dir => '',
511 _dx => '',
512 _f1 => '',
513 _f2 => '',
514 _ffdi => '',
515 _ffdim => '',
516 _ffdr => '',
517 _ffdrm => '',
518 _first => '',
519 _fr => '',
520 _i => '',
521 _if1 => '',
522 _if2 => '',
523 _ifr => '',
524 _ime => '',
525 _ims => '',
526 _itr => '',
527 _itrm => '',
528 _iw => '',
529 _key => '',
530 _maxmix => '',
531 _mix => '',
532 _nf => '',
533 _nfft => '',
534 _ng => '',
535 _nmix => '',
536 _nt => '',
537 _ntr => '',
538 _r => '',
539 _rec_o => '',
540 _rt => '',
541 _snfft => '',
542 _tmpr => '',
543 _tri => '',
544 _vel => '',
545 _verbose => '',
546 _wh => '',
547 _Step => '',
548 _note => '',
549  
550 };
551  
552 =head2 sub Step
553  
554 collects switches and assembles bash instructions
555 by adding the program name
556  
557 =cut
558  
559 sub Step {
560  
561 $sulfaf->{_Step} = 'sulfaf'.$sulfaf->{_Step};
562 return ( $sulfaf->{_Step} );
563  
564 }
565  
566  
567 =head2 sub note
568  
569 collects switches and assembles bash instructions
570 by adding the program name
571  
572 =cut
573  
574 sub note {
575  
576 $sulfaf->{_note} = 'sulfaf'.$sulfaf->{_note};
577 return ( $sulfaf->{_note} );
578  
579 }
580  
581  
582  
583 =head2 sub clear
584  
585 =cut
586  
587 sub clear {
588  
589 $sulfaf->{_adb} = '';
590 $sulfaf->{_ct} = '';
591 $sulfaf->{_d1} = '';
592 $sulfaf->{_dir} = '';
593 $sulfaf->{_dx} = '';
594 $sulfaf->{_f1} = '';
595 $sulfaf->{_f2} = '';
596 $sulfaf->{_ffdi} = '';
597 $sulfaf->{_ffdim} = '';
598 $sulfaf->{_ffdr} = '';
599 $sulfaf->{_ffdrm} = '';
600 $sulfaf->{_first} = '';
601 $sulfaf->{_fr} = '';
602 $sulfaf->{_i} = '';
603 $sulfaf->{_if1} = '';
604 $sulfaf->{_if2} = '';
605 $sulfaf->{_ifr} = '';
606 $sulfaf->{_ime} = '';
607 $sulfaf->{_ims} = '';
608 $sulfaf->{_itr} = '';
609 $sulfaf->{_itrm} = '';
610 $sulfaf->{_iw} = '';
611 $sulfaf->{_key} = '';
612 $sulfaf->{_maxmix} = '';
613 $sulfaf->{_mix} = '';
614 $sulfaf->{_nf} = '';
615 $sulfaf->{_nfft} = '';
616 $sulfaf->{_ng} = '';
617 $sulfaf->{_nmix} = '';
618 $sulfaf->{_nt} = '';
619 $sulfaf->{_ntr} = '';
620 $sulfaf->{_r} = '';
621 $sulfaf->{_rec_o} = '';
622 $sulfaf->{_rt} = '';
623 $sulfaf->{_snfft} = '';
624 $sulfaf->{_tmpr} = '';
625 $sulfaf->{_tri} = '';
626 $sulfaf->{_vel} = '';
627 $sulfaf->{_verbose} = '';
628 $sulfaf->{_wh} = '';
629 $sulfaf->{_Step} = '';
630 $sulfaf->{_note} = '';
631 }
632  
633  
634  
635 =head2 sub adb
636  
637  
638 =cut
639  
640 sub adb {
641  
642 my ( $self,$adb ) = @_;
643 if ( $adb ne $empty_string ) {
644  
645 $sulfaf->{_adb} = $adb;
646 $sulfaf->{_note} = $sulfaf->{_note}.' adb='.$sulfaf->{_adb};
647 $sulfaf->{_Step} = $sulfaf->{_Step}.' adb='.$sulfaf->{_adb};
648  
649 } else {
650 print("sulfaf, adb, missing adb,\n");
651 }
652 }
653  
654  
655 =head2 sub ct
656  
657  
658 =cut
659  
660 sub ct {
661  
662 my ( $self,$ct ) = @_;
663 if ( $ct ne $empty_string ) {
664  
665 $sulfaf->{_ct} = $ct;
666 $sulfaf->{_note} = $sulfaf->{_note}.' ct='.$sulfaf->{_ct};
667 $sulfaf->{_Step} = $sulfaf->{_Step}.' ct='.$sulfaf->{_ct};
668  
669 } else {
670 print("sulfaf, ct, missing ct,\n");
671 }
672 }
673  
674  
675 =head2 sub d1
676  
677  
678 =cut
679  
680 sub d1 {
681  
682 my ( $self,$d1 ) = @_;
683 if ( $d1 ne $empty_string ) {
684  
685 $sulfaf->{_d1} = $d1;
686 $sulfaf->{_note} = $sulfaf->{_note}.' d1='.$sulfaf->{_d1};
687 $sulfaf->{_Step} = $sulfaf->{_Step}.' d1='.$sulfaf->{_d1};
688  
689 } else {
690 print("sulfaf, d1, missing d1,\n");
691 }
692 }
693  
694  
695 =head2 sub dir
696  
697  
698 =cut
699  
700 sub dir {
701  
702 my ( $self,$dir ) = @_;
703 if ( $dir ne $empty_string ) {
704  
705 $sulfaf->{_dir} = $dir;
706 $sulfaf->{_note} = $sulfaf->{_note}.' dir='.$sulfaf->{_dir};
707 $sulfaf->{_Step} = $sulfaf->{_Step}.' dir='.$sulfaf->{_dir};
708  
709 } else {
710 print("sulfaf, dir, missing dir,\n");
711 }
712 }
713  
714  
715 =head2 sub dx
716  
717  
718 =cut
719  
720 sub dx {
721  
722 my ( $self,$dx ) = @_;
723 if ( $dx ne $empty_string ) {
724  
725 $sulfaf->{_dx} = $dx;
726 $sulfaf->{_note} = $sulfaf->{_note}.' dx='.$sulfaf->{_dx};
727 $sulfaf->{_Step} = $sulfaf->{_Step}.' dx='.$sulfaf->{_dx};
728  
729 } else {
730 print("sulfaf, dx, missing dx,\n");
731 }
732 }
733  
734  
735 =head2 sub f1
736  
737  
738 =cut
739  
740 sub f1 {
741  
742 my ( $self,$f1 ) = @_;
743 if ( $f1 ne $empty_string ) {
744  
745 $sulfaf->{_f1} = $f1;
746 $sulfaf->{_note} = $sulfaf->{_note}.' f1='.$sulfaf->{_f1};
747 $sulfaf->{_Step} = $sulfaf->{_Step}.' f1='.$sulfaf->{_f1};
748  
749 } else {
750 print("sulfaf, f1, missing f1,\n");
751 }
752 }
753  
754  
755 =head2 sub f2
756  
757  
758 =cut
759  
760 sub f2 {
761  
762 my ( $self,$f2 ) = @_;
763 if ( $f2 ne $empty_string ) {
764  
765 $sulfaf->{_f2} = $f2;
766 $sulfaf->{_note} = $sulfaf->{_note}.' f2='.$sulfaf->{_f2};
767 $sulfaf->{_Step} = $sulfaf->{_Step}.' f2='.$sulfaf->{_f2};
768  
769 } else {
770 print("sulfaf, f2, missing f2,\n");
771 }
772 }
773  
774  
775 =head2 sub ffdi
776  
777  
778 =cut
779  
780 sub ffdi {
781  
782 my ( $self,$ffdi ) = @_;
783 if ( $ffdi ne $empty_string ) {
784  
785 $sulfaf->{_ffdi} = $ffdi;
786 $sulfaf->{_note} = $sulfaf->{_note}.' ffdi='.$sulfaf->{_ffdi};
787 $sulfaf->{_Step} = $sulfaf->{_Step}.' ffdi='.$sulfaf->{_ffdi};
788  
789 } else {
790 print("sulfaf, ffdi, missing ffdi,\n");
791 }
792 }
793  
794  
795 =head2 sub ffdim
796  
797  
798 =cut
799  
800 sub ffdim {
801  
802 my ( $self,$ffdim ) = @_;
803 if ( $ffdim ne $empty_string ) {
804  
805 $sulfaf->{_ffdim} = $ffdim;
806 $sulfaf->{_note} = $sulfaf->{_note}.' ffdim='.$sulfaf->{_ffdim};
807 $sulfaf->{_Step} = $sulfaf->{_Step}.' ffdim='.$sulfaf->{_ffdim};
808  
809 } else {
810 print("sulfaf, ffdim, missing ffdim,\n");
811 }
812 }
813  
814  
815 =head2 sub ffdr
816  
817  
818 =cut
819  
820 sub ffdr {
821  
822 my ( $self,$ffdr ) = @_;
823 if ( $ffdr ne $empty_string ) {
824  
825 $sulfaf->{_ffdr} = $ffdr;
826 $sulfaf->{_note} = $sulfaf->{_note}.' ffdr='.$sulfaf->{_ffdr};
827 $sulfaf->{_Step} = $sulfaf->{_Step}.' ffdr='.$sulfaf->{_ffdr};
828  
829 } else {
830 print("sulfaf, ffdr, missing ffdr,\n");
831 }
832 }
833  
834  
835 =head2 sub ffdrm
836  
837  
838 =cut
839  
840 sub ffdrm {
841  
842 my ( $self,$ffdrm ) = @_;
843 if ( $ffdrm ne $empty_string ) {
844  
845 $sulfaf->{_ffdrm} = $ffdrm;
846 $sulfaf->{_note} = $sulfaf->{_note}.' ffdrm='.$sulfaf->{_ffdrm};
847 $sulfaf->{_Step} = $sulfaf->{_Step}.' ffdrm='.$sulfaf->{_ffdrm};
848  
849 } else {
850 print("sulfaf, ffdrm, missing ffdrm,\n");
851 }
852 }
853  
854  
855 =head2 sub first
856  
857  
858 =cut
859  
860 sub first {
861  
862 my ( $self,$first ) = @_;
863 if ( $first ne $empty_string ) {
864  
865 $sulfaf->{_first} = $first;
866 $sulfaf->{_note} = $sulfaf->{_note}.' first='.$sulfaf->{_first};
867 $sulfaf->{_Step} = $sulfaf->{_Step}.' first='.$sulfaf->{_first};
868  
869 } else {
870 print("sulfaf, first, missing first,\n");
871 }
872 }
873  
874  
875 =head2 sub fr
876  
877  
878 =cut
879  
880 sub fr {
881  
882 my ( $self,$fr ) = @_;
883 if ( $fr ne $empty_string ) {
884  
885 $sulfaf->{_fr} = $fr;
886 $sulfaf->{_note} = $sulfaf->{_note}.' fr='.$sulfaf->{_fr};
887 $sulfaf->{_Step} = $sulfaf->{_Step}.' fr='.$sulfaf->{_fr};
888  
889 } else {
890 print("sulfaf, fr, missing fr,\n");
891 }
892 }
893  
894  
895 =head2 sub i
896  
897  
898 =cut
899  
900 sub i {
901  
902 my ( $self,$i ) = @_;
903 if ( $i ne $empty_string ) {
904  
905 $sulfaf->{_i} = $i;
906 $sulfaf->{_note} = $sulfaf->{_note}.' i='.$sulfaf->{_i};
907 $sulfaf->{_Step} = $sulfaf->{_Step}.' i='.$sulfaf->{_i};
908  
909 } else {
910 print("sulfaf, i, missing i,\n");
911 }
912 }
913  
914  
915 =head2 sub if1
916  
917  
918 =cut
919  
920 sub if1 {
921  
922 my ( $self,$if1 ) = @_;
923 if ( $if1 ne $empty_string ) {
924  
925 $sulfaf->{_if1} = $if1;
926 $sulfaf->{_note} = $sulfaf->{_note}.' if1='.$sulfaf->{_if1};
927 $sulfaf->{_Step} = $sulfaf->{_Step}.' if1='.$sulfaf->{_if1};
928  
929 } else {
930 print("sulfaf, if1, missing if1,\n");
931 }
932 }
933  
934  
935 =head2 sub if2
936  
937  
938 =cut
939  
940 sub if2 {
941  
942 my ( $self,$if2 ) = @_;
943 if ( $if2 ne $empty_string ) {
944  
945 $sulfaf->{_if2} = $if2;
946 $sulfaf->{_note} = $sulfaf->{_note}.' if2='.$sulfaf->{_if2};
947 $sulfaf->{_Step} = $sulfaf->{_Step}.' if2='.$sulfaf->{_if2};
948  
949 } else {
950 print("sulfaf, if2, missing if2,\n");
951 }
952 }
953  
954  
955 =head2 sub ifr
956  
957  
958 =cut
959  
960 sub ifr {
961  
962 my ( $self,$ifr ) = @_;
963 if ( $ifr ne $empty_string ) {
964  
965 $sulfaf->{_ifr} = $ifr;
966 $sulfaf->{_note} = $sulfaf->{_note}.' ifr='.$sulfaf->{_ifr};
967 $sulfaf->{_Step} = $sulfaf->{_Step}.' ifr='.$sulfaf->{_ifr};
968  
969 } else {
970 print("sulfaf, ifr, missing ifr,\n");
971 }
972 }
973  
974  
975 =head2 sub ime
976  
977  
978 =cut
979  
980 sub ime {
981  
982 my ( $self,$ime ) = @_;
983 if ( $ime ne $empty_string ) {
984  
985 $sulfaf->{_ime} = $ime;
986 $sulfaf->{_note} = $sulfaf->{_note}.' ime='.$sulfaf->{_ime};
987 $sulfaf->{_Step} = $sulfaf->{_Step}.' ime='.$sulfaf->{_ime};
988  
989 } else {
990 print("sulfaf, ime, missing ime,\n");
991 }
992 }
993  
994  
995 =head2 sub ims
996  
997  
998 =cut
999  
1000 sub ims {
1001  
1002 my ( $self,$ims ) = @_;
1003 if ( $ims ne $empty_string ) {
1004  
1005 $sulfaf->{_ims} = $ims;
1006 $sulfaf->{_note} = $sulfaf->{_note}.' ims='.$sulfaf->{_ims};
1007 $sulfaf->{_Step} = $sulfaf->{_Step}.' ims='.$sulfaf->{_ims};
1008  
1009 } else {
1010 print("sulfaf, ims, missing ims,\n");
1011 }
1012 }
1013  
1014  
1015 =head2 sub itr
1016  
1017  
1018 =cut
1019  
1020 sub itr {
1021  
1022 my ( $self,$itr ) = @_;
1023 if ( $itr ne $empty_string ) {
1024  
1025 $sulfaf->{_itr} = $itr;
1026 $sulfaf->{_note} = $sulfaf->{_note}.' itr='.$sulfaf->{_itr};
1027 $sulfaf->{_Step} = $sulfaf->{_Step}.' itr='.$sulfaf->{_itr};
1028  
1029 } else {
1030 print("sulfaf, itr, missing itr,\n");
1031 }
1032 }
1033  
1034  
1035 =head2 sub itrm
1036  
1037  
1038 =cut
1039  
1040 sub itrm {
1041  
1042 my ( $self,$itrm ) = @_;
1043 if ( $itrm ne $empty_string ) {
1044  
1045 $sulfaf->{_itrm} = $itrm;
1046 $sulfaf->{_note} = $sulfaf->{_note}.' itrm='.$sulfaf->{_itrm};
1047 $sulfaf->{_Step} = $sulfaf->{_Step}.' itrm='.$sulfaf->{_itrm};
1048  
1049 } else {
1050 print("sulfaf, itrm, missing itrm,\n");
1051 }
1052 }
1053  
1054  
1055 =head2 sub iw
1056  
1057  
1058 =cut
1059  
1060 sub iw {
1061  
1062 my ( $self,$iw ) = @_;
1063 if ( $iw ne $empty_string ) {
1064  
1065 $sulfaf->{_iw} = $iw;
1066 $sulfaf->{_note} = $sulfaf->{_note}.' iw='.$sulfaf->{_iw};
1067 $sulfaf->{_Step} = $sulfaf->{_Step}.' iw='.$sulfaf->{_iw};
1068  
1069 } else {
1070 print("sulfaf, iw, missing iw,\n");
1071 }
1072 }
1073  
1074  
1075 =head2 sub key
1076  
1077  
1078 =cut
1079  
1080 sub key {
1081  
1082 my ( $self,$key ) = @_;
1083 if ( $key ne $empty_string ) {
1084  
1085 $sulfaf->{_key} = $key;
1086 $sulfaf->{_note} = $sulfaf->{_note}.' key='.$sulfaf->{_key};
1087 $sulfaf->{_Step} = $sulfaf->{_Step}.' key='.$sulfaf->{_key};
1088  
1089 } else {
1090 print("sulfaf, key, missing key,\n");
1091 }
1092 }
1093  
1094  
1095 =head2 sub maxmix
1096  
1097  
1098 =cut
1099  
1100 sub maxmix {
1101  
1102 my ( $self,$maxmix ) = @_;
1103 if ( $maxmix ne $empty_string ) {
1104  
1105 $sulfaf->{_maxmix} = $maxmix;
1106 $sulfaf->{_note} = $sulfaf->{_note}.' maxmix='.$sulfaf->{_maxmix};
1107 $sulfaf->{_Step} = $sulfaf->{_Step}.' maxmix='.$sulfaf->{_maxmix};
1108  
1109 } else {
1110 print("sulfaf, maxmix, missing maxmix,\n");
1111 }
1112 }
1113  
1114  
1115 =head2 sub mix
1116  
1117  
1118 =cut
1119  
1120 sub mix {
1121  
1122 my ( $self,$mix ) = @_;
1123 if ( $mix ne $empty_string ) {
1124  
1125 $sulfaf->{_mix} = $mix;
1126 $sulfaf->{_note} = $sulfaf->{_note}.' mix='.$sulfaf->{_mix};
1127 $sulfaf->{_Step} = $sulfaf->{_Step}.' mix='.$sulfaf->{_mix};
1128  
1129 } else {
1130 print("sulfaf, mix, missing mix,\n");
1131 }
1132 }
1133  
1134  
1135 =head2 sub nf
1136  
1137  
1138 =cut
1139  
1140 sub nf {
1141  
1142 my ( $self,$nf ) = @_;
1143 if ( $nf ne $empty_string ) {
1144  
1145 $sulfaf->{_nf} = $nf;
1146 $sulfaf->{_note} = $sulfaf->{_note}.' nf='.$sulfaf->{_nf};
1147 $sulfaf->{_Step} = $sulfaf->{_Step}.' nf='.$sulfaf->{_nf};
1148  
1149 } else {
1150 print("sulfaf, nf, missing nf,\n");
1151 }
1152 }
1153  
1154  
1155 =head2 sub nfft
1156  
1157  
1158 =cut
1159  
1160 sub nfft {
1161  
1162 my ( $self,$nfft ) = @_;
1163 if ( $nfft ne $empty_string ) {
1164  
1165 $sulfaf->{_nfft} = $nfft;
1166 $sulfaf->{_note} = $sulfaf->{_note}.' nfft='.$sulfaf->{_nfft};
1167 $sulfaf->{_Step} = $sulfaf->{_Step}.' nfft='.$sulfaf->{_nfft};
1168  
1169 } else {
1170 print("sulfaf, nfft, missing nfft,\n");
1171 }
1172 }
1173  
1174  
1175 =head2 sub ng
1176  
1177  
1178 =cut
1179  
1180 sub ng {
1181  
1182 my ( $self,$ng ) = @_;
1183 if ( $ng ne $empty_string ) {
1184  
1185 $sulfaf->{_ng} = $ng;
1186 $sulfaf->{_note} = $sulfaf->{_note}.' ng='.$sulfaf->{_ng};
1187 $sulfaf->{_Step} = $sulfaf->{_Step}.' ng='.$sulfaf->{_ng};
1188  
1189 } else {
1190 print("sulfaf, ng, missing ng,\n");
1191 }
1192 }
1193  
1194  
1195 =head2 sub nmix
1196  
1197  
1198 =cut
1199  
1200 sub nmix {
1201  
1202 my ( $self,$nmix ) = @_;
1203 if ( $nmix ne $empty_string ) {
1204  
1205 $sulfaf->{_nmix} = $nmix;
1206 $sulfaf->{_note} = $sulfaf->{_note}.' nmix='.$sulfaf->{_nmix};
1207 $sulfaf->{_Step} = $sulfaf->{_Step}.' nmix='.$sulfaf->{_nmix};
1208  
1209 } else {
1210 print("sulfaf, nmix, missing nmix,\n");
1211 }
1212 }
1213  
1214  
1215 =head2 sub nt
1216  
1217  
1218 =cut
1219  
1220 sub nt {
1221  
1222 my ( $self,$nt ) = @_;
1223 if ( $nt ne $empty_string ) {
1224  
1225 $sulfaf->{_nt} = $nt;
1226 $sulfaf->{_note} = $sulfaf->{_note}.' nt='.$sulfaf->{_nt};
1227 $sulfaf->{_Step} = $sulfaf->{_Step}.' nt='.$sulfaf->{_nt};
1228  
1229 } else {
1230 print("sulfaf, nt, missing nt,\n");
1231 }
1232 }
1233  
1234  
1235 =head2 sub ntr
1236  
1237  
1238 =cut
1239  
1240 sub ntr {
1241  
1242 my ( $self,$ntr ) = @_;
1243 if ( $ntr ne $empty_string ) {
1244  
1245 $sulfaf->{_ntr} = $ntr;
1246 $sulfaf->{_note} = $sulfaf->{_note}.' ntr='.$sulfaf->{_ntr};
1247 $sulfaf->{_Step} = $sulfaf->{_Step}.' ntr='.$sulfaf->{_ntr};
1248  
1249 } else {
1250 print("sulfaf, ntr, missing ntr,\n");
1251 }
1252 }
1253  
1254  
1255 =head2 sub r
1256  
1257  
1258 =cut
1259  
1260 sub r {
1261  
1262 my ( $self,$r ) = @_;
1263 if ( $r ne $empty_string ) {
1264  
1265 $sulfaf->{_r} = $r;
1266 $sulfaf->{_note} = $sulfaf->{_note}.' r='.$sulfaf->{_r};
1267 $sulfaf->{_Step} = $sulfaf->{_Step}.' r='.$sulfaf->{_r};
1268  
1269 } else {
1270 print("sulfaf, r, missing r,\n");
1271 }
1272 }
1273  
1274  
1275 =head2 sub rec_o
1276  
1277  
1278 =cut
1279  
1280 sub rec_o {
1281  
1282 my ( $self,$rec_o ) = @_;
1283 if ( $rec_o ne $empty_string ) {
1284  
1285 $sulfaf->{_rec_o} = $rec_o;
1286 $sulfaf->{_note} = $sulfaf->{_note}.' rec_o='.$sulfaf->{_rec_o};
1287 $sulfaf->{_Step} = $sulfaf->{_Step}.' rec_o='.$sulfaf->{_rec_o};
1288  
1289 } else {
1290 print("sulfaf, rec_o, missing rec_o,\n");
1291 }
1292 }
1293  
1294  
1295 =head2 sub rt
1296  
1297  
1298 =cut
1299  
1300 sub rt {
1301  
1302 my ( $self,$rt ) = @_;
1303 if ( $rt ne $empty_string ) {
1304  
1305 $sulfaf->{_rt} = $rt;
1306 $sulfaf->{_note} = $sulfaf->{_note}.' rt='.$sulfaf->{_rt};
1307 $sulfaf->{_Step} = $sulfaf->{_Step}.' rt='.$sulfaf->{_rt};
1308  
1309 } else {
1310 print("sulfaf, rt, missing rt,\n");
1311 }
1312 }
1313  
1314  
1315 =head2 sub snfft
1316  
1317  
1318 =cut
1319  
1320 sub snfft {
1321  
1322 my ( $self,$snfft ) = @_;
1323 if ( $snfft ne $empty_string ) {
1324  
1325 $sulfaf->{_snfft} = $snfft;
1326 $sulfaf->{_note} = $sulfaf->{_note}.' snfft='.$sulfaf->{_snfft};
1327 $sulfaf->{_Step} = $sulfaf->{_Step}.' snfft='.$sulfaf->{_snfft};
1328  
1329 } else {
1330 print("sulfaf, snfft, missing snfft,\n");
1331 }
1332 }
1333  
1334  
1335 =head2 sub tmpr
1336  
1337  
1338 =cut
1339  
1340 sub tmpr {
1341  
1342 my ( $self,$tmpr ) = @_;
1343 if ( $tmpr ne $empty_string ) {
1344  
1345 $sulfaf->{_tmpr} = $tmpr;
1346 $sulfaf->{_note} = $sulfaf->{_note}.' tmpr='.$sulfaf->{_tmpr};
1347 $sulfaf->{_Step} = $sulfaf->{_Step}.' tmpr='.$sulfaf->{_tmpr};
1348  
1349 } else {
1350 print("sulfaf, tmpr, missing tmpr,\n");
1351 }
1352 }
1353  
1354  
1355 =head2 sub tri
1356  
1357  
1358 =cut
1359  
1360 sub tri {
1361  
1362 my ( $self,$tri ) = @_;
1363 if ( $tri ne $empty_string ) {
1364  
1365 $sulfaf->{_tri} = $tri;
1366 $sulfaf->{_note} = $sulfaf->{_note}.' tri='.$sulfaf->{_tri};
1367 $sulfaf->{_Step} = $sulfaf->{_Step}.' tri='.$sulfaf->{_tri};
1368  
1369 } else {
1370 print("sulfaf, tri, missing tri,\n");
1371 }
1372 }
1373  
1374  
1375 =head2 sub vel
1376  
1377  
1378 =cut
1379  
1380 sub vel {
1381  
1382 my ( $self,$vel ) = @_;
1383 if ( $vel ne $empty_string ) {
1384  
1385 $sulfaf->{_vel} = $vel;
1386 $sulfaf->{_note} = $sulfaf->{_note}.' vel='.$sulfaf->{_vel};
1387 $sulfaf->{_Step} = $sulfaf->{_Step}.' vel='.$sulfaf->{_vel};
1388  
1389 } else {
1390 print("sulfaf, vel, missing vel,\n");
1391 }
1392 }
1393  
1394  
1395 =head2 sub verbose
1396  
1397  
1398 =cut
1399  
1400 sub verbose {
1401  
1402 my ( $self,$verbose ) = @_;
1403 if ( $verbose ne $empty_string ) {
1404  
1405 $sulfaf->{_verbose} = $verbose;
1406 $sulfaf->{_note} = $sulfaf->{_note}.' verbose='.$sulfaf->{_verbose};
1407 $sulfaf->{_Step} = $sulfaf->{_Step}.' verbose='.$sulfaf->{_verbose};
1408  
1409 } else {
1410 print("sulfaf, verbose, missing verbose,\n");
1411 }
1412 }
1413  
1414  
1415 =head2 sub wh
1416  
1417  
1418 =cut
1419  
1420 sub wh {
1421  
1422 my ( $self,$wh ) = @_;
1423 if ( $wh ne $empty_string ) {
1424  
1425 $sulfaf->{_wh} = $wh;
1426 $sulfaf->{_note} = $sulfaf->{_note}.' wh='.$sulfaf->{_wh};
1427 $sulfaf->{_Step} = $sulfaf->{_Step}.' wh='.$sulfaf->{_wh};
1428  
1429 } else {
1430 print("sulfaf, wh, missing wh,\n");
1431 }
1432 }
1433  
1434  
1435 =head2 sub get_max_index
1436  
1437 max index = number of input variables -1
1438
1439 =cut
1440
1441 sub get_max_index {
1442 my ($self) = @_;
1443 my $max_index = 39;
1444  
1445 return($max_index);
1446 }
1447
1448
1449 1;