Browse Source

gen_mod.py : updates through 3-6-17

master
kevin 7 years ago
parent
commit
0a0f8c78b8
1 changed files with 164 additions and 12 deletions
  1. 164
    12
      src/kc/data/gen_mod/gen_mod.py

+ 164
- 12
src/kc/data/gen_mod/gen_mod.py View File

585
         psL[1][var] = v1L[i]
585
         psL[1][var] = v1L[i]
586
 
586
 
587
 
587
 
588
+def mod_discrete_range( presetL, var, v0L, v1L ):
589
+
590
+    assert( len(v0L) == len(v1L) )
591
+    
592
+    N   = min(len(v0L),len(presetL))
593
+
594
+
595
+    for i in range(N):
596
+        preset = presetL[i]
597
+        label  = preset.keys()[0]
598
+        psL    = preset[label]
599
+
600
+        print "%i %s %f %f" % (i,label,v0L[i],v1L[i])
601
+
602
+        psL[0][var] = v0L[i]
603
+        psL[1][var] = v1L[i]
588
         
604
         
605
+    return N
606
+
589
 def print_preset( presetL ):
607
 def print_preset( presetL ):
590
 
608
 
591
     for x in presetL:
609
     for x in presetL:
626
 
644
 
627
     # assign a sequential range of thresholds to each preset
645
     # assign a sequential range of thresholds to each preset
628
     if 0: # 12/28/16
646
     if 0: # 12/28/16
647
+        
629
         mod_range( presetL, "thr", 50.0, 90.0, 55.0, 95.0 )
648
         mod_range( presetL, "thr", 50.0, 90.0, 55.0, 95.0 )
630
         mod_range( presetL, "cigain", 6.0, 12.0, 6.0, 12.0 )
649
         mod_range( presetL, "cigain", 6.0, 12.0, 6.0, 12.0 )
631
         mod_range( presetL, "upr",  2.5, -5.0, 2.3, -5.2)
650
         mod_range( presetL, "upr",  2.5, -5.0, 2.3, -5.2)
648
         #mod_range( presetL, "upr",  2.5, -5.0, 2.3, -5.2)
667
         #mod_range( presetL, "upr",  2.5, -5.0, 2.3, -5.2)
649
         #mod_range( presetL, "lwr",  0.5,  2.0, 0.5,  2.0)
668
         #mod_range( presetL, "lwr",  0.5,  2.0, 0.5,  2.0)
650
 
669
 
651
-    if 0: # 1/14/17
670
+    if 1: # 1/14/17
652
 
671
 
653
         seq1L =[
672
         seq1L =[
654
             (778, None)   # meas 50
673
             (778, None)   # meas 50
655
             ]
674
             ]
675
+
676
+        if 0:
677
+            presetL = dupl_preset( dfltPresetL, "f_3", dfltLabelsL)
678
+
679
+            # thr: (40 ok) - (71 0k) upr:-3.0 lwr:1.0 cigain:6.0 vetted trajectory for measure 50 
656
         
680
         
657
-        presetL = dupl_preset( dfltPresetL, "f_3", dfltLabelsL)
681
+            mod_range( presetL, "thr",   40.0, 71.0, 40.0, 71.0 )
682
+            #mod_range( presetL, "thr",   68.0, 68.0, 68.0, 68.0 )
683
+            #mod_range( presetL, "upr",  -4.0,  0.0,  -4.0,  0.0)
684
+            mod_range( presetL, "upr",  -3.0,  -3.0,  -3.0,  -3.0) 
685
+            mod_range( presetL, "lwr",    1.0,  1.0,  1.0,  1.0 )
686
+            mod_range( presetL, "cigain", 6.0,  6.0,  6.0,  6.0 )
687
+
688
+        else:  # 3/6/17
689
+
690
+            presetL = dupl_preset( dfltPresetL, "g_1_a", dfltLabelsL)
658
 
691
 
659
-        # thr: (40 ok) - (71 0k) upr:-3.0 lwr:1.0 cigain:6.0 vetted trajectory for measure 50 
692
+            mod_range( presetL, "thr",   20.0, 50.0, 20.0, 50.0 )  # offs:65 thr:20-50
693
+            mod_range( presetL, "off",   10.0, 80.0, 10.0, 80.0)
694
+            mod_range( presetL, "upr",  -0.7, -0.2, -0.7, -0.2 )
695
+            mod_range( presetL, "lwr",   2.0, 2.0,   8.0, 4.0 )
660
         
696
         
661
-        mod_range( presetL, "thr",   40.0, 74.0, 40.0, 74.0 )
662
-        #mod_range( presetL, "thr",   68.0, 68.0, 68.0, 68.0 )
663
-        #mod_range( presetL, "upr",  -4.0,  0.0,  -4.0,  0.0)
664
-        mod_range( presetL, "upr",  -3.0,  -3.0,  -3.0,  -3.0) 
665
-        mod_range( presetL, "lwr",    1.0,  1.0,  1.0,  1.0 )
666
-        mod_range( presetL, "cigain", 6.0,  6.0,  6.0,  6.0 )
697
+            mod_range( presetL, "cigain", 10.0,  14.0,  10.0,  14.0 )
667
 
698
 
668
 
699
 
669
     if 0: # 1/14/17 and 1/28/17
700
     if 0: # 1/14/17 and 1/28/17
670
-
701
+    
671
         seq1L =[
702
         seq1L =[
672
             (917, None)   # meas 53
703
             (917, None)   # meas 53
704
+            #(1, None)   # meas 1
673
             ]
705
             ]
706
+
707
+        # 2/4/17 vetted for both meas 53 and meas 1
674
         
708
         
675
         # make all presets identical to preset 'a'.
709
         # make all presets identical to preset 'a'.
676
         presetL = dupl_preset( dfltPresetL, "g_1_d", dfltLabelsL)
710
         presetL = dupl_preset( dfltPresetL, "g_1_d", dfltLabelsL)
679
         #mod_range( presetL, "off",   10.0, 80.0, 10.0, 80.0)
713
         #mod_range( presetL, "off",   10.0, 80.0, 10.0, 80.0)
680
         #mod_range( presetL, "off",   65.0, 65.0, 65.0, 65.0)      # thr 34, offset should be > 50
714
         #mod_range( presetL, "off",   65.0, 65.0, 65.0, 65.0)      # thr 34, offset should be > 50
681
         #mod_range( presetL, "off",   50.0, 80.0, 50.0, 80.0)
715
         #mod_range( presetL, "off",   50.0, 80.0, 50.0, 80.0)
682
-        mod_range( presetL, "off",   80.0, 50.0, 80.0, 50.0)
716
+        mod_range( presetL, "off",   10.0, 80.0, 10.0, 80.0)
683
         mod_range( presetL, "cigain", 14.0,  14.0,  14.0,  14.0 )
717
         mod_range( presetL, "cigain", 14.0,  14.0,  14.0,  14.0 )
684
 
718
 
685
-    if 1: #  1/28/17
719
+    if 0: #  1/28/17
686
 
720
 
687
         seq1L =[
721
         seq1L =[
688
             (917, None)   # meas 53
722
             (917, None)   # meas 53
695
         mod_range( presetL, "upr",   0.0, 0.0, 0.0, 0.0 )
729
         mod_range( presetL, "upr",   0.0, 0.0, 0.0, 0.0 )
696
         mod_range( presetL, "lwr",   4.0, 4.0, 4.0, 4.0)       # vocal artifacts come in with lwr < 4
730
         mod_range( presetL, "lwr",   4.0, 4.0, 4.0, 4.0)       # vocal artifacts come in with lwr < 4
697
         mod_range( presetL, "cigain", 3.0,  8.0,  3.0,  8.0 )
731
         mod_range( presetL, "cigain", 3.0,  8.0,  3.0,  8.0 )
732
+
733
+
734
+    if 0: # 2/4/17
735
+        
736
+        seq1L =[
737
+            (378, None),   # meas 36
738
+        ]
739
+
740
+        presetL = dupl_preset( dfltPresetL, "g_1_a", dfltLabelsL)
741
+
742
+        mod_range( presetL, "thr",   20.0, 50.0, 20.0, 50.0 )  # offs:65 thr:20-50
743
+        mod_range( presetL, "off",   10.0, 80.0, 10.0, 80.0)
744
+        mod_range( presetL, "upr",  -0.7, -0.2, -0.7, -0.2 )
745
+        mod_range( presetL, "lwr",   2.0, 2.0,   8.0, 4.0 )
746
+        
747
+        mod_range( presetL, "cigain", 10.0,  14.0,  10.0,  14.0 )
748
+
749
+
750
+        
751
+    if 0: # 2/4/17
752
+        
753
+        seq1L =[
754
+            (378, "g_1_a"),  # meas 36
755
+            (384, None),  
756
+        ]
757
+
758
+        presetL = dupl_preset( dfltPresetL, "f_4", dfltLabelsL)
759
+
760
+        mod_range( presetL, "thr",  70.0, 75.0, 70.0, 75.0 ) 
761
+        mod_range( presetL, "upr",  -8.0, -4.0, -8.0, -4.0 )
762
+        mod_range( presetL, "lwr",   8.0,  1.0, 8.0, 1.0)    
763
+        mod_range( presetL, "cigain", 10.0,  14.0,  10.0,  14.0 )
764
+
765
+
766
+    if 0:
767
+
768
+        seq1L =[
769
+            (1, None)   # meas 1
770
+        ]
771
+
772
+        # 2/4/17 vetted for both meas 53 and meas 1
773
+        
774
+        # make all presets identical to preset 'a'.
775
+        presetL = dupl_preset( dfltPresetL, "g_1_d", dfltLabelsL)
776
+
777
+        print "preset len:",len(presetL)
778
+        
779
+        w0L = [ 512,  512,  512,  512,  1024, 1024, 1024, 2048, 2048, 4096 ]
780
+        w1L = [ 512, 1024, 2048, 4096,  1024, 2048, 4096, 2048, 4096, 4096 ]
781
+
782
+
783
+        
784
+        N = mod_discrete_range( presetL, "win", w0L, w1L )
785
+
786
+        presetL = presetL[0:N]
787
+        
788
+        mod_range( presetL, "thr",   40.0, 40.0, 40.0, 40.0 )  # offs:65 thr:20-50
789
+        mod_range( presetL, "off",   55.0, 55.0, 55.0, 55.0)
790
+        mod_range( presetL, "cigain", 14.0,  14.0,  14.0,  14.0 )
791
+
792
+
793
+    if 0: # 3/6/17
794
+
795
+        seq1L =[
796
+            (1, None)   # meas 1
797
+        ]
798
+
799
+        presetL = dupl_preset( dfltPresetL, "g_1_d", dfltLabelsL)
800
+
801
+        mod_range( presetL, "thr",   20.0, 50.0, 20.0, 50.0 )  # offs:65 thr:20-50
802
+        mod_range( presetL, "off",   10.0, 80.0, 10.0, 80.0)
803
+        mod_range( presetL, "cigain", 14.0,  14.0,  14.0,  14.0 )
804
+
805
+
806
+    if 0: # 3/6/17
807
+
808
+        seq1L =[
809
+            (1, None)   # meas 1
810
+        ]
811
+
812
+
813
+        presetL = dupl_preset( dfltPresetL, "a", dfltLabelsL)
814
+        mod_range( presetL, "thr",   55.0, 65.0, 55.0, 65.0 )
815
+        mod_range( presetL, "upr", -1.0,  -5.0,  -1.0,  -5.0 )
816
+        mod_range( presetL, "lwr",  2.0,   1.0,   2.0,   1.0 )
817
+        mod_range( presetL, "cigain", 6.0,  8.0,  6.0,  8.0 )
818
+        
819
+
820
+    if 0: # 3/6/17
821
+
822
+        seq1L =[
823
+            #(1, None)   # meas 38
824
+            (38, None)
825
+        ]
826
+
827
+        presetL = dupl_preset( dfltPresetL, "f_4", dfltLabelsL)
828
+
829
+        """
830
+        w0L = [ 512,  512,  512,  512,  1024, 1024, 1024, 2048, 2048, 4096 ]
831
+        w1L = [ 512, 1024, 2048, 4096,  1024, 2048, 4096, 2048, 4096, 4096 ]
832
+        
833
+        N = mod_discrete_range( presetL, "win", w0L, w1L )
834
+
835
+        presetL = presetL[0:N]
836
+        """
837
+        if 1:
838
+            mod_range( presetL, "thr",   55.0, 65.0, 55.0, 65.0 )
839
+            mod_range( presetL, "upr", -1.0,  -5.0,  -1.0,  -5.0 )
840
+            mod_range( presetL, "lwr",  2.0,   1.0,   2.0,   1.0 )
841
+            mod_range( presetL, "cigain", 6.0,  8.0,  6.0,  8.0 )
842
+        else:
843
+            mod_range( presetL, "thr",  55.0, 75.0, 55.0, 75.0 ) 
844
+            mod_range( presetL, "upr",  -8.0, -4.0, -8.0, -4.0 )
845
+            mod_range( presetL, "lwr",   8.0,  1.0, 8.0, 1.0)    
846
+            mod_range( presetL, "cigain", 10.0,  14.0,  10.0,  14.0 )
847
+        
848
+
849
+            
698
         
850
         
699
     # thr    upr  lwr   offs
851
     # thr    upr  lwr   offs
700
     # 65   -0.05  1.5   0.0
852
     # 65   -0.05  1.5   0.0

Loading…
Cancel
Save