test_L2P_v2¶
wield.control.fitting.SISO.test.v2.test_L2P_v2
This is a pytest module needing documentation
Functions
This is a pytest needing documentation |
|
This is a pytest needing documentation |
Details
- test_L2P_MULT_S()[source][github]¶
This is a pytest needing documentation
code
1@pytest.mark.skipif(module_import_skip, reason="cannot import IIRrational_test_data") 2def test_L2P_MULT_S(): 3 data_name = "L2P_MULT_WLF" 4 dataB = testing_data_dev( 5 data_name, 6 instance_num=1, 7 set_num=2, 8 ) 9 out = v2.data2filter( 10 F_Hz=dataB.F_Hz, 11 data=dataB.data, 12 SNR=dataB.SNR, 13 F_nyquist_Hz=None, 14 order_initial=15, 15 # order_initial = 80, 16 baseline_only=True, 17 delay_s=0, 18 hints=[sign_validate_and_plot_hint(tjoin('error'))], 19 ) 20 with plot_on_assert(tjoin('output'), out.fitter, plot_anyway=True): 21 pass 22 return
pytest information
This code is wrapped in a pytest function using conventions detailed in Pytest Conventions. The full name of this test, as known by the documentation, is:
wield.control.fitting.SISO.test.v2.test_L2P_v2.test_L2P_MULT_SThe full name is useful when building documentation, to link a reference to this page using
:func:`name`, or directly include it with an autofunction directive. The collapse nodes below show every instance of the test run. There may only be one, but if the test was run multiple times through pytest parametrizations, the list can be longer.test_L2P_MULT_S
output
{'F_Hz': array([0.03125, 0.0625 , 0.09375, 0.125 , 0.15625, 0.1875 , 0.21875, 0.25 , 0.28125, 0.3125 , 0.34375, 0.375 , 0.40625, 0.4375 , 0.46875, 0.5 , 0.53125, 0.5625 , 0.59375, 0.625 , 0.65625, 0.6875 , 0.71875, 0.75 , 0.78125, 0.8125 , 0.84375, 0.875 , 0.90625, 0.9375 , 0.96875, 1. , 1.03125, 1.0625 , 1.09375, 1.125 , 1.15625, 1.1875 , 1.21875, 1.25 , 1.28125, 1.3125 , 1.34375, 1.375 , 1.40625, 1.4375 , 1.46875, 1.5 , 1.53125, 1.5625 , 1.59375, 1.625 , 1.65625, 1.6875 , 1.71875, 1.75 , 1.78125, 1.8125 , 1.84375, 1.875 , 1.90625, 1.9375 , 1.96875, 2. , 2.03125, 2.0625 , 2.09375, 2.125 , 2.15625, 2.1875 , 2.21875, 2.25 , 2.28125, 2.3125 , 2.34375, 2.375 , 2.40625, 2.4375 , 2.46875, 2.5 , 2.53125, 2.5625 , 2.59375, 2.625 , 2.65625, 2.6875 , 2.71875, 2.75 , 2.78125, 2.8125 , 2.84375, 2.875 , 2.90625, 2.9375 , 2.96875, 3. , 3.03125, 3.0625 , 3.09375, 3.125 , 3.15625, 3.1875 , 3.21875, 3.25 , 3.28125, 3.3125 , 3.34375, 3.375 , 3.40625, 3.4375 , 3.46875, 3.5 , 3.53125, 3.5625 , 3.59375, 3.625 , 3.65625, 3.6875 , 3.71875, 3.75 , 3.78125, 3.8125 , 3.84375, 3.875 , 3.90625, 3.9375 , 3.96875]), 'data': array([ 2.53724696e-05+1.58205154e-04j, -3.34787352e-04+1.60789389e-04j, -4.42457095e-04+2.36151337e-04j, -1.11821898e-03+1.88644821e-04j, -2.22061649e-03+1.53633650e-04j, -3.31334408e-03-7.95173168e-05j, -5.51887889e-03+2.68851659e-04j, -8.55560903e-03+1.03609288e-03j, -1.12037255e-02+2.60900949e-04j, -1.68276522e-02+5.82449233e-04j, -3.00916447e-02+5.62643234e-03j, -4.73096074e-02+1.60150097e-02j, -5.54275135e-02+3.72222740e-02j, -5.68441980e-02+1.05241009e-01j, 8.94618357e-03+1.09325907e-01j, 2.91249058e-02+7.15546839e-02j, 3.66635109e-02+8.20490023e-02j, 8.79638415e-02+7.23388064e-02j, 9.16504774e-02+4.72164199e-02j, 6.39273271e-02+3.74134504e-02j, 6.79141799e-02+2.28429879e-02j, 6.49696611e-02+1.57620235e-02j, 5.95165089e-02+1.42780719e-02j, 5.63345142e-02+1.20582698e-02j, 5.80443567e-02+1.24933431e-02j, 5.80398485e-02+8.59141679e-03j, 6.00127362e-02+8.27960177e-03j, 6.49280606e-02+6.35878318e-03j, 7.10641688e-02+1.21112174e-03j, 8.22110443e-02-1.20646002e-02j, 8.22351229e-02-3.86964122e-02j, 5.68018646e-02-5.98581382e-02j, 3.31607864e-02-5.68429251e-02j, 1.77863717e-02-5.54759813e-02j, -2.58777236e-03-3.61713544e-02j, -1.79360609e-03-1.99068883e-02j, 3.31852254e-03-1.16004035e-02j, 6.94088609e-03-8.02343532e-03j, 8.94923253e-03-5.36977320e-03j, 1.06765281e-02-4.03141343e-03j, 1.19200071e-02-1.95228911e-03j, 1.34285456e-02-6.48798055e-04j, 1.38963760e-02-1.82468513e-04j, 1.37819452e-02+6.68632586e-04j, 1.50487557e-02+1.35409470e-03j, 1.57524367e-02+1.46701939e-03j, 1.51204899e-02+4.92074414e-03j, 2.01843759e-02+8.89880112e-04j, 2.01140475e-02+6.43393768e-03j, 1.55994295e-02+3.86438947e-03j, 1.83484884e-02+7.15000746e-03j, 1.96827483e-02+7.15202160e-03j, 1.89617361e-02+8.35867482e-03j, 1.99962310e-02+9.59002695e-03j, 2.11478514e-02+1.20227316e-02j, 2.11776966e-02+1.23104872e-02j, 2.30741746e-02+1.43695639e-02j, 2.43166213e-02+1.60072342e-02j, 2.58998156e-02+1.88692521e-02j, 2.82425438e-02+2.00219511e-02j, 3.18635676e-02+2.41209327e-02j, 4.03077924e-02+2.82661286e-02j, 4.49201170e-02+3.39587856e-02j, 6.28005796e-02+3.14594780e-02j, 8.21017401e-02+2.13887183e-02j, 9.21413415e-02+3.32353833e-05j, 8.25264389e-02-2.20050357e-02j, 6.81767383e-02-3.25362407e-02j, 5.79429848e-02-3.68258359e-02j, 4.85510759e-02-3.71602254e-02j, 3.97629501e-02-3.60603887e-02j, 3.35998341e-02-3.77732269e-02j, 3.09781717e-02-3.31935623e-02j, 2.34247277e-02-2.59937727e-02j, 1.90659840e-02-2.63972369e-02j, 2.38809513e-02-2.14545465e-02j, 2.27071570e-02-2.01434604e-02j, 2.89196158e-02-1.73277315e-02j, 2.52526574e-02-2.07984214e-02j, 3.00053610e-02-1.61284556e-02j, 2.80860882e-02-1.71765686e-02j, 3.11432996e-02-9.40921379e-03j, 2.42795355e-02-1.98223529e-02j, 2.63601287e-02-1.73557366e-02j, 2.51597055e-02-1.77472294e-02j, 1.81875042e-02-2.04300021e-02j, 2.22370078e-02-1.36405615e-02j, 2.52904435e-02-1.34385371e-02j, 2.13268048e-02-1.19211585e-02j, 2.04006841e-02-1.11198746e-02j, 2.83387841e-02-1.61791046e-02j, 2.06028992e-02-1.07224504e-02j, 2.29161871e-02-1.18392572e-02j, 1.44085082e-02-3.29071429e-03j, 2.09166529e-02-1.62267954e-02j, 2.55917865e-02-2.74679766e-02j, 2.12727813e-02-2.38287615e-02j, 2.83146382e-03+3.46745199e-03j, 1.10841814e-02+1.54212739e-02j, 6.21626386e-02+4.35281065e-03j, 1.11677416e-01+3.36774696e-02j, 6.09583896e-02-4.46065805e-02j, 1.43783126e-02+2.21178092e-02j, 6.12016318e-02-1.47764266e-02j, 1.43079786e-01+4.90445031e-02j, 9.92050120e-03+6.19501504e-02j, -1.60384456e-02-1.92596554e-01j, 2.49678739e-02-7.67336479e-03j, 4.69141159e-02+4.72808141e-02j, 2.49874274e-02-1.11393124e-01j, 3.73149991e-02-1.34155362e-01j, 2.71064327e-01+2.11264282e-02j, 1.40157066e-01+2.31984224e-01j, 6.68185097e-01-5.14733062e-02j, 3.69226880e-01+3.72570802e-02j, 3.60008592e-02+4.78501899e-01j, 3.79463295e-01-3.95099353e-01j, 1.13774486e+00+3.36811034e-01j, -1.42963944e+01+3.15078062e+00j, 1.03162516e-02-8.09303576e-02j, 5.85364213e-01-4.38982086e-01j, -2.50241041e-02-4.55133042e-02j, 6.84656113e-03+7.40726050e-02j, -4.05747342e-01-1.64348973e-01j, 1.33930310e+00+7.91832007e-03j, -2.70089461e-01-4.33507678e-01j, 1.33289342e-01+9.52242702e-03j]), 'SNR': array([5.91104137, 4.45295981, 3.75287819, 3.32214645, 3.02050249, 2.78402277, 2.61153747, 2.47939519, 2.36030036, 2.28142629, 2.18254211, 2.10482383, 1.96388855, 1.88687974, 1.91202692, 1.90415444, 1.78867498, 1.71389608, 1.65104755, 1.74439583, 1.71409112, 1.70254613, 1.6778598 , 1.653512 , 1.62944673, 1.60890321, 1.5881224 , 1.5684676 , 1.55008221, 1.53260313, 1.51582506, 1.49968601, 1.48446786, 1.468881 , 1.45503057, 1.43995145, 1.42890607, 1.4165267 , 1.40354242, 1.38988329, 1.37815194, 1.36665688, 1.352465 , 1.33330015, 1.32892987, 1.28308858, 1.26492924, 1.21659739, 1.26043417, 1.28243946, 1.26574505, 1.27562052, 1.26998686, 1.26103395, 1.25343793, 1.24782716, 1.23883977, 1.23553758, 1.22751692, 1.22625563, 1.22004968, 1.209135 , 1.20901969, 1.20306513, 1.19669086, 1.19341207, 1.18884135, 1.18459398, 1.17984514, 1.17408083, 1.16907584, 1.16380429, 1.16052618, 1.15621509, 1.15115927, 1.14678568, 1.14333272, 1.13933708, 1.13363527, 1.130305 , 1.12738412, 1.12203961, 1.12028091, 1.11502021, 1.10990294, 1.1071065 , 1.10165976, 1.09701997, 1.08528763, 1.08941964, 1.07681118, 1.08110006, 1.07019905, 1.07031307, 1.0567352 , 1.04371693, 1.05151934, 1.03540951, 1.0304021 , 1.00481235, 0.97301913, 1.00682631, 0.95219008, 0.86243236, 0.90441469, 0.93821662, 0.94093421, 0.93201444, 0.89235073, 0.83536423, 0.74022101, 0.69236759, 0.62189246, 0.57055467, 0.58153335, 0.56460512, 0.61667198, 0.55659243, 0.51866838, 0.64118565, 0.52427793, 0.53907513, 0.61820545, 0.51899644, 0.53506264, 0.55582858, 0.64339798]), 'F_nyquist_Hz': None, 'order_initial': 15, 'baseline_only': True, 'delay_s': 0, 'hints': [{'fitter_update_validate': <function sign_validate_and_plot_hint.<locals>.sign_validate_plot at 0x7fa898ede020>, 'fitter_check_validate': <function sign_validate_and_plot_hint.<locals>.sign_validate_plot at 0x7fa898ede020>, 'rational_fitter_validate': <function rational_fitter_validate at 0x7fa899c6b420>}]} TEE_LOGFILE None A [] B [] ------------:SNR Fix Test: ------------:rational fitting: 4P 0.02 chebychev rational fit RELDEG: 0 0 0 3P 0.10 Initial Order: (Z=15, P=15, Z-P=0) 3P 0.15 Fastdrop Order: (Z=11, P=11, Z-P=0) 4P 0.17 mag fitting and phase patching --------------:rational fitting:sample variance (from magnitude): 3A 1.02 Weight Scaling determined: 25.4884758137833 3A 1.02 Weight Scaling Used 5.048611275765178 ------------:Q-ranked order reduction: 4P 1.76 order reduced annealing 5P 2.86 zero flipping, maxzp 3, residuals=6.56e-01, 6.56e-01, reldeg=0 ------------:selective order reduction: 5P 3.48 order reduced to 3, residuals=7.09e-01, reldeg=1 2A 4.27 Baseline fit residuals: 7.08e-01, at order 3 BASELINE: 3 ------------:investigations: 2I 4.29 max(z, p) ChiSq. order avg. res. med. res. max. res. ----------- ----------- ----------- ----------- 3 0.656331 0.778856 10.1607 Captured stderr call 3W 0.01 The number of effective data points N=(ΣW^2)^2/(ΣW^4)=2.76e-01*len(W) [where W=SNR] is below the configured 'SNR_regularize_ratio'=0.5. Now Finding an SNR ceiling to adjust to that ratio. 3W 0.01 Using SNR<3.02050249174716 ceiling. 3W 0.14 Fitter_checkpoint improvement succeed, None 3W 1.71 Fitter_checkpoint improvement succeed, None 3W 1.76 Fitter_checkpoint improvement succeed, None 3W 1.99 Fitter_checkpoint improvement succeed, None 3W 2.86 Fitter_checkpoint improvement succeed, None 3W 3.48 Fitter_checkpoint improvement succeed, None 3W 4.27 Fitter_checkpoint improvement succeed, None
- test_L2P_MULT_S_WOLAY()[source][github]¶
This is a pytest needing documentation
code
1@pytest.mark.skipif(module_import_skip, reason="cannot import IIRrational_test_data") 2def test_L2P_MULT_S_WOLAY(): 3 data_name = "L2P_MULT_WLF" 4 dataB = testing_data_dev( 5 data_name, 6 instance_num=1, 7 set_num=2, 8 ) 9 out = v2.data2filter( 10 F_Hz=dataB.F_Hz, 11 data=dataB.data, 12 SNR=dataB.SNR, 13 F_nyquist_Hz=None, 14 order_initial=30, 15 delay_s=0, 16 ZPK_overlay=((0,), (), 1), 17 baseline_only=True, 18 hints=[sign_validate_and_plot_hint(tjoin('error'))], 19 ) 20 with plot_on_assert(tjoin('output'), out.fitter, plot_anyway=True): 21 print(out.fitter) 22 print(out.fitter.F_nyquist_Hz) 23 print(out.fitter.zeros) 24 print(out.fitter.zeros_overlay) 25 # print(out.fitter.ZPKrep) 26 # assert(False) 27 pass 28 print(out.as_foton_str_ZPKsf(annotate_pairs=False)) 29 return
pytest information
This code is wrapped in a pytest function using conventions detailed in Pytest Conventions. The full name of this test, as known by the documentation, is:
wield.control.fitting.SISO.test.v2.test_L2P_v2.test_L2P_MULT_S_WOLAYThe full name is useful when building documentation, to link a reference to this page using
:func:`name`, or directly include it with an autofunction directive. The collapse nodes below show every instance of the test run. There may only be one, but if the test was run multiple times through pytest parametrizations, the list can be longer.test_L2P_MULT_S_WOLAY
output
{'F_Hz': array([0.03125, 0.0625 , 0.09375, 0.125 , 0.15625, 0.1875 , 0.21875, 0.25 , 0.28125, 0.3125 , 0.34375, 0.375 , 0.40625, 0.4375 , 0.46875, 0.5 , 0.53125, 0.5625 , 0.59375, 0.625 , 0.65625, 0.6875 , 0.71875, 0.75 , 0.78125, 0.8125 , 0.84375, 0.875 , 0.90625, 0.9375 , 0.96875, 1. , 1.03125, 1.0625 , 1.09375, 1.125 , 1.15625, 1.1875 , 1.21875, 1.25 , 1.28125, 1.3125 , 1.34375, 1.375 , 1.40625, 1.4375 , 1.46875, 1.5 , 1.53125, 1.5625 , 1.59375, 1.625 , 1.65625, 1.6875 , 1.71875, 1.75 , 1.78125, 1.8125 , 1.84375, 1.875 , 1.90625, 1.9375 , 1.96875, 2. , 2.03125, 2.0625 , 2.09375, 2.125 , 2.15625, 2.1875 , 2.21875, 2.25 , 2.28125, 2.3125 , 2.34375, 2.375 , 2.40625, 2.4375 , 2.46875, 2.5 , 2.53125, 2.5625 , 2.59375, 2.625 , 2.65625, 2.6875 , 2.71875, 2.75 , 2.78125, 2.8125 , 2.84375, 2.875 , 2.90625, 2.9375 , 2.96875, 3. , 3.03125, 3.0625 , 3.09375, 3.125 , 3.15625, 3.1875 , 3.21875, 3.25 , 3.28125, 3.3125 , 3.34375, 3.375 , 3.40625, 3.4375 , 3.46875, 3.5 , 3.53125, 3.5625 , 3.59375, 3.625 , 3.65625, 3.6875 , 3.71875, 3.75 , 3.78125, 3.8125 , 3.84375, 3.875 , 3.90625, 3.9375 , 3.96875]), 'data': array([ 2.53724696e-05+1.58205154e-04j, -3.34787352e-04+1.60789389e-04j, -4.42457095e-04+2.36151337e-04j, -1.11821898e-03+1.88644821e-04j, -2.22061649e-03+1.53633650e-04j, -3.31334408e-03-7.95173168e-05j, -5.51887889e-03+2.68851659e-04j, -8.55560903e-03+1.03609288e-03j, -1.12037255e-02+2.60900949e-04j, -1.68276522e-02+5.82449233e-04j, -3.00916447e-02+5.62643234e-03j, -4.73096074e-02+1.60150097e-02j, -5.54275135e-02+3.72222740e-02j, -5.68441980e-02+1.05241009e-01j, 8.94618357e-03+1.09325907e-01j, 2.91249058e-02+7.15546839e-02j, 3.66635109e-02+8.20490023e-02j, 8.79638415e-02+7.23388064e-02j, 9.16504774e-02+4.72164199e-02j, 6.39273271e-02+3.74134504e-02j, 6.79141799e-02+2.28429879e-02j, 6.49696611e-02+1.57620235e-02j, 5.95165089e-02+1.42780719e-02j, 5.63345142e-02+1.20582698e-02j, 5.80443567e-02+1.24933431e-02j, 5.80398485e-02+8.59141679e-03j, 6.00127362e-02+8.27960177e-03j, 6.49280606e-02+6.35878318e-03j, 7.10641688e-02+1.21112174e-03j, 8.22110443e-02-1.20646002e-02j, 8.22351229e-02-3.86964122e-02j, 5.68018646e-02-5.98581382e-02j, 3.31607864e-02-5.68429251e-02j, 1.77863717e-02-5.54759813e-02j, -2.58777236e-03-3.61713544e-02j, -1.79360609e-03-1.99068883e-02j, 3.31852254e-03-1.16004035e-02j, 6.94088609e-03-8.02343532e-03j, 8.94923253e-03-5.36977320e-03j, 1.06765281e-02-4.03141343e-03j, 1.19200071e-02-1.95228911e-03j, 1.34285456e-02-6.48798055e-04j, 1.38963760e-02-1.82468513e-04j, 1.37819452e-02+6.68632586e-04j, 1.50487557e-02+1.35409470e-03j, 1.57524367e-02+1.46701939e-03j, 1.51204899e-02+4.92074414e-03j, 2.01843759e-02+8.89880112e-04j, 2.01140475e-02+6.43393768e-03j, 1.55994295e-02+3.86438947e-03j, 1.83484884e-02+7.15000746e-03j, 1.96827483e-02+7.15202160e-03j, 1.89617361e-02+8.35867482e-03j, 1.99962310e-02+9.59002695e-03j, 2.11478514e-02+1.20227316e-02j, 2.11776966e-02+1.23104872e-02j, 2.30741746e-02+1.43695639e-02j, 2.43166213e-02+1.60072342e-02j, 2.58998156e-02+1.88692521e-02j, 2.82425438e-02+2.00219511e-02j, 3.18635676e-02+2.41209327e-02j, 4.03077924e-02+2.82661286e-02j, 4.49201170e-02+3.39587856e-02j, 6.28005796e-02+3.14594780e-02j, 8.21017401e-02+2.13887183e-02j, 9.21413415e-02+3.32353833e-05j, 8.25264389e-02-2.20050357e-02j, 6.81767383e-02-3.25362407e-02j, 5.79429848e-02-3.68258359e-02j, 4.85510759e-02-3.71602254e-02j, 3.97629501e-02-3.60603887e-02j, 3.35998341e-02-3.77732269e-02j, 3.09781717e-02-3.31935623e-02j, 2.34247277e-02-2.59937727e-02j, 1.90659840e-02-2.63972369e-02j, 2.38809513e-02-2.14545465e-02j, 2.27071570e-02-2.01434604e-02j, 2.89196158e-02-1.73277315e-02j, 2.52526574e-02-2.07984214e-02j, 3.00053610e-02-1.61284556e-02j, 2.80860882e-02-1.71765686e-02j, 3.11432996e-02-9.40921379e-03j, 2.42795355e-02-1.98223529e-02j, 2.63601287e-02-1.73557366e-02j, 2.51597055e-02-1.77472294e-02j, 1.81875042e-02-2.04300021e-02j, 2.22370078e-02-1.36405615e-02j, 2.52904435e-02-1.34385371e-02j, 2.13268048e-02-1.19211585e-02j, 2.04006841e-02-1.11198746e-02j, 2.83387841e-02-1.61791046e-02j, 2.06028992e-02-1.07224504e-02j, 2.29161871e-02-1.18392572e-02j, 1.44085082e-02-3.29071429e-03j, 2.09166529e-02-1.62267954e-02j, 2.55917865e-02-2.74679766e-02j, 2.12727813e-02-2.38287615e-02j, 2.83146382e-03+3.46745199e-03j, 1.10841814e-02+1.54212739e-02j, 6.21626386e-02+4.35281065e-03j, 1.11677416e-01+3.36774696e-02j, 6.09583896e-02-4.46065805e-02j, 1.43783126e-02+2.21178092e-02j, 6.12016318e-02-1.47764266e-02j, 1.43079786e-01+4.90445031e-02j, 9.92050120e-03+6.19501504e-02j, -1.60384456e-02-1.92596554e-01j, 2.49678739e-02-7.67336479e-03j, 4.69141159e-02+4.72808141e-02j, 2.49874274e-02-1.11393124e-01j, 3.73149991e-02-1.34155362e-01j, 2.71064327e-01+2.11264282e-02j, 1.40157066e-01+2.31984224e-01j, 6.68185097e-01-5.14733062e-02j, 3.69226880e-01+3.72570802e-02j, 3.60008592e-02+4.78501899e-01j, 3.79463295e-01-3.95099353e-01j, 1.13774486e+00+3.36811034e-01j, -1.42963944e+01+3.15078062e+00j, 1.03162516e-02-8.09303576e-02j, 5.85364213e-01-4.38982086e-01j, -2.50241041e-02-4.55133042e-02j, 6.84656113e-03+7.40726050e-02j, -4.05747342e-01-1.64348973e-01j, 1.33930310e+00+7.91832007e-03j, -2.70089461e-01-4.33507678e-01j, 1.33289342e-01+9.52242702e-03j]), 'SNR': array([5.91104137, 4.45295981, 3.75287819, 3.32214645, 3.02050249, 2.78402277, 2.61153747, 2.47939519, 2.36030036, 2.28142629, 2.18254211, 2.10482383, 1.96388855, 1.88687974, 1.91202692, 1.90415444, 1.78867498, 1.71389608, 1.65104755, 1.74439583, 1.71409112, 1.70254613, 1.6778598 , 1.653512 , 1.62944673, 1.60890321, 1.5881224 , 1.5684676 , 1.55008221, 1.53260313, 1.51582506, 1.49968601, 1.48446786, 1.468881 , 1.45503057, 1.43995145, 1.42890607, 1.4165267 , 1.40354242, 1.38988329, 1.37815194, 1.36665688, 1.352465 , 1.33330015, 1.32892987, 1.28308858, 1.26492924, 1.21659739, 1.26043417, 1.28243946, 1.26574505, 1.27562052, 1.26998686, 1.26103395, 1.25343793, 1.24782716, 1.23883977, 1.23553758, 1.22751692, 1.22625563, 1.22004968, 1.209135 , 1.20901969, 1.20306513, 1.19669086, 1.19341207, 1.18884135, 1.18459398, 1.17984514, 1.17408083, 1.16907584, 1.16380429, 1.16052618, 1.15621509, 1.15115927, 1.14678568, 1.14333272, 1.13933708, 1.13363527, 1.130305 , 1.12738412, 1.12203961, 1.12028091, 1.11502021, 1.10990294, 1.1071065 , 1.10165976, 1.09701997, 1.08528763, 1.08941964, 1.07681118, 1.08110006, 1.07019905, 1.07031307, 1.0567352 , 1.04371693, 1.05151934, 1.03540951, 1.0304021 , 1.00481235, 0.97301913, 1.00682631, 0.95219008, 0.86243236, 0.90441469, 0.93821662, 0.94093421, 0.93201444, 0.89235073, 0.83536423, 0.74022101, 0.69236759, 0.62189246, 0.57055467, 0.58153335, 0.56460512, 0.61667198, 0.55659243, 0.51866838, 0.64118565, 0.52427793, 0.53907513, 0.61820545, 0.51899644, 0.53506264, 0.55582858, 0.64339798]), 'F_nyquist_Hz': None, 'order_initial': 30, 'delay_s': 0, 'ZPK_overlay': ((0,), (), 1), 'baseline_only': True, 'hints': [{'fitter_update_validate': <function sign_validate_and_plot_hint.<locals>.sign_validate_plot at 0x7fa88d80a520>, 'fitter_check_validate': <function sign_validate_and_plot_hint.<locals>.sign_validate_plot at 0x7fa88d80a520>, 'rational_fitter_validate': <function rational_fitter_validate at 0x7fa899c6b420>}]} TEE_LOGFILE None A [] B [] ------------:SNR Fix Test: ------------:rational fitting: 4P 0.01 chebychev rational fit RELDEG: 1 1 0 3P 0.29 Initial Order: (Z=29, P=29, Z-P=1) 3P 0.36 Fastdrop Order: (Z=17, P=17, Z-P=1) 4P 0.38 mag fitting and phase patching --------------:rational fitting:sample variance (from magnitude): 3A 2.63 Weight Scaling determined: 16.765953568803866 3A 2.63 Weight Scaling Used 4.094624960702001 ------------:Q-ranked order reduction: 4P 3.98 order reduced annealing 5P 4.47 zero flipping, maxzp 8, residuals=6.67e-01, 6.88e-01, reldeg=0 <wield.control.fitting.SISO.fitters_ZPK.MRF.MultiReprFilterS object at 0x7fa88d6fc170> None rB(-11.152334923473324, -11.149860804744854, -0.5831263954368017, 0.2631674893341721, 11.088272691377886, -12.389213612269156±10.311150960085957j) rB(0.0) <wield.control.fitting.SISO.representations.zpk_with_data.ZPKwData object at 0x7fa88d79cb90> Captured stderr call 3W 0.01 The number of effective data points N=(ΣW^2)^2/(ΣW^4)=2.76e-01*len(W) [where W=SNR] is below the configured 'SNR_regularize_ratio'=0.5. Now Finding an SNR ceiling to adjust to that ratio. 3W 0.01 Using SNR<3.02050249174716 ceiling. 3W 0.34 Fitter_checkpoint improvement succeed, None 3W 3.77 Fitter_checkpoint improvement succeed, None 3W 3.97 Fitter_checkpoint improvement succeed, None captured errors: @pytest.mark.skipif(module_import_skip, reason="cannot import IIRrational_test_data") def test_L2P_MULT_S_WOLAY(): data_name = "L2P_MULT_WLF" dataB = testing_data_dev( data_name, instance_num=1, set_num=2, ) > out = v2.data2filter( F_Hz=dataB.F_Hz, data=dataB.data, SNR=dataB.SNR, F_nyquist_Hz=None, order_initial=30, delay_s=0, ZPK_overlay=((0,), (), 1), baseline_only=True, hints=[sign_validate_and_plot_hint(tjoin('error'))], ) ../../src/wield/control/fitting/SISO/test/v2/test_L2P_v2.py:55: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../src/wield/control/fitting/SISO/v2/data2filter.py:423: in data2filter baseline_order = fit_full(aid, emphasis) ../../src/wield/control/fitting/SISO/v2/data2filter.py:489: in fit_full return _reduce(aid) ../../src/wield/control/fitting/SISO/v2/data2filter.py:1135: in _reduce order_reduce_flip.order_reduce_flip( ../../src/wield/control/fitting/SISO/v2/algorithms/order_reduce_flip.py:136: in order_reduce_flip ret = ranking_delay_flip( ../../src/wield/control/fitting/SISO/v2/algorithms/order_reduce_flip.py:94: in ranking_delay_flip did_reduce = aid.fitter_check( ../../src/wield/control/fitting/SISO/v2/fit_aid.py:371: in fitter_check val_func(self, fitter_new) ../../src/wield/control/fitting/SISO/testing/utilities.py:219: in sign_validate_plot sign_validate(aid, fitter) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ aid = <wield.control.fitting.SISO.v2.fit_aid.FitAid object at 0x7fa88e9b0680> fitter = <wield.control.fitting.SISO.fitters_ZPK.MRF.MultiReprFilterS object at 0x7fa88d6fc170> def sign_validate(aid, fitter): """ To be added as a hint to data2filter """ rep = fitter.ZPKrep xfer = rep.xfer_fit data = rep.data rat = data / xfer rat_ang = np.exp(1j * np.angle(rat)) ang_avg_rep = np.sum(rat_ang * rep.W ** 2) / np.sum(rep.W ** 2) xfer = fitter.xfer_fit data = fitter.data rat = data / xfer rat_ang = np.exp(1j * np.angle(rat)) ang_avg_fit = np.sum(rat_ang * fitter.W ** 2) / np.sum(fitter.W ** 2) # print("SGN: ", ang_avg_rep, ang_avg_fit) # axB = plots.plots.plot_fit( # fitter, # fname = 'test1.png', # ) # axB = plots.plots.plot_fitter_flag( # fitter, # fname = 'test3.png', # ) # axB = plots.plots.plot_fit( # fitter.ZPKrep, # fname = 'test2.png', # ) if isinstance(fitter, fitters_ZPK.MultiReprFilterBase): for coding in list(fitter.num_codings) + list(fitter.den_codings): rB = representations.RootBunch( u=coding.roots(), constraint=representations.root_constraints.no_constraint, ) h1 = coding.transfer() h, lnG = rB.val_lnG(fitter.Xex_grid) h = h * np.exp(lnG) assert_almost_equal(h / h1, 1, 4) > assert ang_avg_fit.real > 0 and ang_avg_rep.real > 0 E AssertionError ../../src/wield/control/fitting/SISO/testing/utilities.py:191: AssertionError