IIRrational issueshttps://git.ligo.org/lee-mcculler/iirrational/-/issues2023-01-09T21:39:13Zhttps://git.ligo.org/lee-mcculler/iirrational/-/issues/15Not able to install IIRrationa;2023-01-09T21:39:13ZAlec EnglNot able to install IIRrationa;Was trying to '$pip install iirrational' but am getting the same 'no matching distribution' message on all my machines/python versions. Perhaps I missed something but could not find the supported python versions anywhere in the docs. A...Was trying to '$pip install iirrational' but am getting the same 'no matching distribution' message on all my machines/python versions. Perhaps I missed something but could not find the supported python versions anywhere in the docs. Additionally the github and PyPI pages are throwing 404 errors. Is this package still being supported/hosted from anywhere?https://git.ligo.org/lee-mcculler/iirrational/-/issues/13Bug in results_aid_adv.py in latest version.2022-03-11T00:33:15ZNathan HollandBug in results_aid_adv.py in latest version.I am getting an error at [line 56 in results_aid_adv.py](https://git.ligo.org/lee-mcculler/iirrational/-/blob/4c43d042b5191c000a248e5fed0f2c5e718a1257/IIRrational/v2/results_aid_adv.py#L56) on the latest commit **4c43d042**.
I am using...I am getting an error at [line 56 in results_aid_adv.py](https://git.ligo.org/lee-mcculler/iirrational/-/blob/4c43d042b5191c000a248e5fed0f2c5e718a1257/IIRrational/v2/results_aid_adv.py#L56) on the latest commit **4c43d042**.
I am using `mode = 'fit'` for a single pole transfer function. I receive the following stack trace:
```
File "/ligo/home/nathan.holland/Science_Measurement/Cavity_Suppression_TFs/Analogue/process_scans.py", line 304, in main
fit_lpf = IIRrational.v2.data2filter(F_Hz = lpf_data.f,
File "/home/controls/miniconda3/envs/systemID/lib/python3.9/site-packages/IIRrational/v2/data2filter.py", line 401, in data2filter
ptbl = resaid.investigate_order_console(print_function = None)
File "/home/controls/miniconda3/envs/systemID/lib/python3.9/site-packages/IIRrational/v2/results_aid_adv.py", line 75, in investigate_order_console
oB = self.investigate_order_arrays()
File "/home/controls/miniconda3/envs/systemID/lib/python3.9/site-packages/IIRrational/v2/results_aid_adv.py", line 56, in investigate_order_arrays
fbo = [fbo[idx] for idx in lbo]
File "/home/controls/miniconda3/envs/systemID/lib/python3.9/site-packages/IIRrational/v2/results_aid_adv.py", line 56, in <listcomp>
fbo = [fbo[idx] for idx in lbo]
IndexError: list index out of range
```
Inserting a `breakpoint()` before this line reveal the following:
```
> /home/controls/miniconda3/envs/systemID/lib/python3.9/site-packages/IIRrational/v2/results_aid_adv.py(57)investigate_order_arrays()
-> fbo = [fbo[idx] for idx in lbo]
(Pdb) type(fbo)
<class 'list'>
(Pdb) len(fbo)
1
(Pdb) lbo
[True]
(Pdb) n
IndexError: list index out of range
> /home/controls/miniconda3/envs/systemID/lib/python3.9/site-packages/IIRrational/v2/results_aid_adv.py(57)investigate_order_arrays()
-> fbo = [fbo[idx] for idx in lbo]
```
In this instance `lbo = [True]` means that `idx` is resolving as `1`, which is out of bounds for a list with one element. Perhpas this line should read:
`fbo = [fbo[idx] for idx, flag in enumerate(lbo) if flag]`https://git.ligo.org/lee-mcculler/iirrational/-/issues/12Bug in uncertainty propagation formulas, within MRF.py. Not using cross-terms...2021-05-12T02:04:13ZNathan HollandBug in uncertainty propagation formulas, within MRF.py. Not using cross-terms of co-variance matrix.The error propagation formula on lines [654](https://git.ligo.org/lee-mcculler/iirrational/-/blob/master/IIRrational/fitters_ZPK/MRF.py#L654), [655](https://git.ligo.org/lee-mcculler/iirrational/-/blob/master/IIRrational/fitters_ZPK/MRF....The error propagation formula on lines [654](https://git.ligo.org/lee-mcculler/iirrational/-/blob/master/IIRrational/fitters_ZPK/MRF.py#L654), [655](https://git.ligo.org/lee-mcculler/iirrational/-/blob/master/IIRrational/fitters_ZPK/MRF.py#L655), [658](https://git.ligo.org/lee-mcculler/iirrational/-/blob/master/IIRrational/fitters_ZPK/MRF.py#L658), [660](https://git.ligo.org/lee-mcculler/iirrational/-/blob/master/IIRrational/fitters_ZPK/MRF.py#L660), and [661](https://git.ligo.org/lee-mcculler/iirrational/-/blob/master/IIRrational/fitters_ZPK/MRF.py#L661) in [MRF.py](https://git.ligo.org/lee-mcculler/iirrational/-/blob/master/IIRrational/fitters_ZPK/MRF.py) is incorrect. Currently it doesn't correctly utilise the cross terms, generally over-estimating the error.
To correct change `einsum(str("ij,ii,ij->j"), *args)` for `np.einsum(str("ij,ik,kj->j"), *args)`.
The same error is repeated in the class method [residuals_error](https://git.ligo.org/lee-mcculler/iirrational/-/blob/master/IIRrational/fitters_ZPK/MRF.py#L672). See lines [677](https://git.ligo.org/lee-mcculler/iirrational/-/blob/master/IIRrational/fitters_ZPK/MRF.py#L677), [678](https://git.ligo.org/lee-mcculler/iirrational/-/blob/master/IIRrational/fitters_ZPK/MRF.py#L678), [681](https://git.ligo.org/lee-mcculler/iirrational/-/blob/master/IIRrational/fitters_ZPK/MRF.py#L681), [683](https://git.ligo.org/lee-mcculler/iirrational/-/blob/master/IIRrational/fitters_ZPK/MRF.py#L683), and [684](https://git.ligo.org/lee-mcculler/iirrational/-/blob/master/IIRrational/fitters_ZPK/MRF.py#L684).https://git.ligo.org/lee-mcculler/iirrational/-/issues/11AAA poles2021-04-02T22:18:57ZKevin KunsAAA polesI noticed that one transfer function that I fit with AAA did not have pairs of conjugate poles. I attached a simple example. Increasing the data that I fit (up to 1000) points did not fix this problem, though it might change the number o...I noticed that one transfer function that I fit with AAA did not have pairs of conjugate poles. I attached a simple example. Increasing the data that I fit (up to 1000) points did not fix this problem, though it might change the number of poles. (I've yet to encounter a scenario where the zeros don't come in conjugate pairs.) I tried messing around with s_tol and res_tol with no effect.
I can understand why the number of poles might change, but I'm not sure why they wouldn't come in conjugate pairs since I thought the analytic properties of transfer functions are enforced with this fit method.
[AAA_poles.py](/uploads/7931eeec7459feb46616a34ea09caf7c/AAA_poles.py)
[data.txt](/uploads/c693a4ef0b513912df0df5b73a4336b1/data.txt)https://git.ligo.org/lee-mcculler/iirrational/-/issues/10Anaconda2022-03-11T00:19:41ZRana AdhikariAnacondaI wonder how easy / annoying to add to conda-forge. Its pretty nice to be able to get nds-client in this way.
https://conda-forge.org/docs/maintainer/adding_pkgs.htmlI wonder how easy / annoying to add to conda-forge. Its pretty nice to be able to get nds-client in this way.
https://conda-forge.org/docs/maintainer/adding_pkgs.htmlhttps://git.ligo.org/lee-mcculler/iirrational/-/issues/9Can't run IIRrational 2.5.0 from command line - Scipy._lib.six missing.2020-12-03T15:32:58ZNathan HollandCan't run IIRrational 2.5.0 from command line - Scipy._lib.six missing.# Problem
I just upgraded, 2020-10-13, my IIRrational installation from 2.0.11 to 2.5.0. As it exists in its own environment I decided to upgrade this too. When using IIRrational from the command line I receive the following error:
```b...# Problem
I just upgraded, 2020-10-13, my IIRrational installation from 2.0.11 to 2.5.0. As it exists in its own environment I decided to upgrade this too. When using IIRrational from the command line I receive the following error:
```bash
(iirrational) nathan@nahdebian0:~$ IIRrationalV2fit wiener_filters-01-20201013.hdf out_G1L-01-20201013.hdf -D'bar1,L' -Xdb Xdb -Xd Xd -F F -S S --choose shell
Traceback (most recent call last):
File "/home/nathan/miniconda3/envs/iirrational/bin/IIRrationalV2fit", line 5, in <module>
from IIRrational.v2.__main__ import main
File "/home/nathan/miniconda3/envs/iirrational/lib/python3.8/site-packages/IIRrational/__init__.py", line 12, in <module>
from . import v1
File "/home/nathan/miniconda3/envs/iirrational/lib/python3.8/site-packages/IIRrational/v1/__init__.py", line 5, in <module>
from .data2filter import data2filter
File "/home/nathan/miniconda3/envs/iirrational/lib/python3.8/site-packages/IIRrational/v1/data2filter.py", line 9, in <module>
from .. import fitters_ZPK
File "/home/nathan/miniconda3/envs/iirrational/lib/python3.8/site-packages/IIRrational/fitters_ZPK/__init__.py", line 6, in <module>
from . import codings_s
File "/home/nathan/miniconda3/envs/iirrational/lib/python3.8/site-packages/IIRrational/fitters_ZPK/codings_s/__init__.py", line 11, in <module>
from ..MRF import MultiReprFilterS
File "/home/nathan/miniconda3/envs/iirrational/lib/python3.8/site-packages/IIRrational/fitters_ZPK/MRF.py", line 16, in <module>
from ..external import scipy_optimize
File "/home/nathan/miniconda3/envs/iirrational/lib/python3.8/site-packages/IIRrational/external/scipy_optimize/__init__.py", line 5, in <module>
from .trf import trf
File "/home/nathan/miniconda3/envs/iirrational/lib/python3.8/site-packages/IIRrational/external/scipy_optimize/trf.py", line 137, in <module>
from scipy._lib.six import string_types
ModuleNotFoundError: No module named 'scipy._lib.six'
```
It seems to be missing/requiring _scipy._lib.six_.
# More
Below I outline my environment (declarative and IIRrational were installed with PyPi **after** using conda to install the other dependencies):
```bash
(iirrational) nathan@nahdebian0:~$ conda list
packages in environment at /home/nathan/miniconda3/envs/iirrational:
Name Version Build Channel
_libgcc_mutex 0.1 main
attrs 20.2.0 py_0
backcall 0.2.0 py_0
blas 1.0 mkl
ca-certificates 2020.7.22 0
certifi 2020.6.20 py38_0
cycler 0.10.0 py38_0
dbus 1.13.16 hb2f20db_0
declarative 1.2.0 pypi_0 pypi
decorator 4.4.2 py_0
expat 2.2.10 he6710b0_2
fontconfig 2.13.0 h9420a91_0
freetype 2.10.3 h5ab3b9f_0
glib 2.65.0 h3eb4bd4_0
gst-plugins-base 1.14.0 hbbd80ab_1
gstreamer 1.14.0 hb31296c_0
h5py 2.10.0 py38hd6299e0_1
hdf5 1.10.6 hb1b8bf9_0
icu 58.2 he6710b0_3
iirrational 2.5.0 pypi_0 pypi
iniconfig 1.0.1 py_0
intel-openmp 2020.2 254
ipython 7.18.1 py38h5ca1d4c_0
ipython_genutils 0.2.0 py38_0
jedi 0.17.2 py38_0
jpeg 9b h024ee3a_2
kiwisolver 1.2.0 py38hfd86e86_0
lcms2 2.11 h396b838_0
ld_impl_linux-64 2.33.1 h53a641e_7
libedit 3.1.20191231 h14c3975_1
libffi 3.3 he6710b0_2
libgcc-ng 9.1.0 hdf63c60_0
libgfortran-ng 7.3.0 hdf63c60_0
libpng 1.6.37 hbc83047_0
libstdcxx-ng 9.1.0 hdf63c60_0
libtiff 4.1.0 h2733197_1
libuuid 1.0.3 h1bed415_2
libxcb 1.14 h7b6447c_0
libxml2 2.9.10 he19cac6_1
lz4-c 1.9.2 heb0550a_3
matplotlib 3.3.1 0
matplotlib-base 3.3.1 py38h817c723_0
mkl 2020.2 256
mkl-service 2.3.0 py38he904b0f_0
mkl_fft 1.2.0 py38h23d657b_0
mkl_random 1.1.1 py38h0573a6f_0
more-itertools 8.5.0 py_0
ncurses 6.2 he6710b0_1
numpy 1.19.1 py38hbc911f0_0
numpy-base 1.19.1 py38hfa32c7d_0
olefile 0.46 py_0
openssl 1.1.1h h7b6447c_0
packaging 20.4 py_0
parso 0.7.0 py_0
pcre 8.44 he6710b0_0
pexpect 4.8.0 py38_0
pickleshare 0.7.5 py38_1000
pillow 7.2.0 py38hb39fc2d_0
pip 20.2.3 py38_0
pluggy 0.13.1 py38_0
prompt-toolkit 3.0.7 py_0
ptyprocess 0.6.0 py38_0
py 1.9.0 py_0
pygments 2.7.1 py_0
pyparsing 2.4.7 py_0
pyqt 5.9.2 py38h05f1152_4
pytest 6.1.1 py38_0
python 3.8.5 h7579374_1
python-dateutil 2.8.1 py_0
pyyaml 5.3.1 py38h7b6447c_1
qt 5.9.7 h5867ecd_1
readline 8.0 h7b6447c_0
scipy 1.5.2 py38h0b6359f_0
setuptools 50.3.0 py38hb0f4dca_1
sip 4.19.13 py38he6710b0_0
six 1.15.0 py_0
sqlite 3.33.0 h62c20be_0
tk 8.6.10 hbc83047_0
toml 0.10.1 py_0
tornado 6.0.4 py38h7b6447c_1
traitlets 5.0.4 py38_0
wcwidth 0.2.5 py_0
wheel 0.35.1 py_0
xz 5.2.5 h7b6447c_0
yaml 0.2.5 h7b6447c_0
zlib 1.2.11 h7b6447c_3
zstd 1.4.5 h9ceee32_0
```
I have tried uninstalling IIRrational, declarative, and then scipy; followed by a re-installation in reverse order. This didn't resolve the issue.
I have also tried:
```python
>>> from scipy import _lib
>>> _lib.test()
============================= test session starts ==============================
platform linux -- Python 3.8.5, pytest-6.1.1, py-1.9.0, pluggy-0.13.1
rootdir: /home/nathan
collected 45 items / 2 deselected / 43 selected
miniconda3/envs/iirrational/lib/python3.8/site-packages/scipy/_lib/tests/test__gcutils.py . [ 2%]
..... [ 13%]
miniconda3/envs/iirrational/lib/python3.8/site-packages/scipy/_lib/tests/test__pep440.py . [ 16%]
........ [ 34%]
miniconda3/envs/iirrational/lib/python3.8/site-packages/scipy/_lib/tests/test__testutils.py . [ 37%]
. [ 39%]
miniconda3/envs/iirrational/lib/python3.8/site-packages/scipy/_lib/tests/test__threadsafety.py . [ 41%]
. [ 44%]
miniconda3/envs/iirrational/lib/python3.8/site-packages/scipy/_lib/tests/test__util.py . [ 46%]
.............. [ 79%]
miniconda3/envs/iirrational/lib/python3.8/site-packages/scipy/_lib/tests/test_ccallback.py s [ 81%]
s.. [ 88%]
miniconda3/envs/iirrational/lib/python3.8/site-packages/scipy/_lib/tests/test_deprecation.py . [ 90%]
[ 90%]
miniconda3/envs/iirrational/lib/python3.8/site-packages/scipy/_lib/tests/test_import_cycles.py . [ 93%]
[ 93%]
miniconda3/envs/iirrational/lib/python3.8/site-packages/scipy/_lib/tests/test_tmpdirs.py . [ 95%]
.. [100%]
================= 41 passed, 2 skipped, 2 deselected in 7.98s ==================
True
>>> dir(_lib)
['__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', '_ccallback', '_ccallback_c', '_fpumode', '_gcutils', '_pep440', '_test_ccallback', '_test_deprecation_call', '_test_deprecation_def', '_testutils', '_threadsafety', '_tmpdirs', '_uarray', '_util', 'decorator', 'deprecation', 'test', 'tests', 'uarray']
```
This suggests that indeed there is **no scipy._lib.six** to import.https://git.ligo.org/lee-mcculler/iirrational/-/issues/8Add coherence command line option2020-07-01T00:20:27ZLee McCullerAdd coherence command line optionShould accept an option to calculate SNR from coherence, possibly from multiple coherence estimates.
Could be combined with an SNR or coherence cutoff level too, to reduce datasets with a lot of points.Should accept an option to calculate SNR from coherence, possibly from multiple coherence estimates.
Could be combined with an SNR or coherence cutoff level too, to reduce datasets with a lot of points.https://git.ligo.org/lee-mcculler/iirrational/-/issues/7Issues in IIRrational/LIGO/foton.py2020-01-16T22:39:59ZVladimir BossilkovIssues in IIRrational/LIGO/foton.pyI have done some successful testing with this file, but it required some fixes to be able to push zpk arrays to foton correctly. I will reference the current master branch.
Firstly, `ZPKz_add` function:
* https://git.ligo.org/lee-mccul...I have done some successful testing with this file, but it required some fixes to be able to push zpk arrays to foton correctly. I will reference the current master branch.
Firstly, `ZPKz_add` function:
* https://git.ligo.org/lee-mcculler/iirrational/blob/master/IIRrational/LIGO/foton.py#L522
* should say `zero_list.append(matlab_complex_str(zero))`
* is a fairly clear copy paste bug
* https://git.ligo.org/lee-mcculler/iirrational/blob/master/IIRrational/LIGO/foton.py#L510
* should say `return ("{0}".format(np.real(num)))`
* this gets around pushing numbers with the complex part of the number still appended (eg 101 + j0)
Same bugs used to apply (in older versions) to the function `ZPK_add`, but I see you have moved functionality to the 'IIRrational/LIGO/conversion.py' , which I have not tested.
I can clearly see a similar bug here:
* https://git.ligo.org/lee-mcculler/iirrational/blob/master/IIRrational/LIGO/conversion.py#L108
* should say `return ("{0}".format(np.real(num)))`
* The first bug I noted above is present in the commented out code, but it is clear that it isn't present in the rest of the functionshttps://git.ligo.org/lee-mcculler/iirrational/-/issues/6Needs proper license2019-09-04T21:02:42ZLee McCullerNeeds proper licenseWith merge requests and commits from LHO, this should be put in a central repo and have a proper license (GPLv3 probably). It has some numpy/scipy code embedded, but that should be BSD or MIT licensed if I recall.With merge requests and commits from LHO, this should be put in a central repo and have a proper license (GPLv3 probably). It has some numpy/scipy code embedded, but that should be BSD or MIT licensed if I recall.https://git.ligo.org/lee-mcculler/iirrational/-/issues/5SNR phase zeros can make "flat fits"2019-09-04T20:19:09ZLee McCullerSNR phase zeros can make "flat fits"See a note in the original merge !1. Perhaps at least users should be warned to not use zero values. Probably some flag logic is triggering on the zeros, or possibly that the pseudoinverse is too degenerate when SNR phase has exact zeros.See a note in the original merge !1. Perhaps at least users should be warned to not use zero values. Probably some flag logic is triggering on the zeros, or possibly that the pseudoinverse is too degenerate when SNR phase has exact zeros.https://git.ligo.org/lee-mcculler/iirrational/-/issues/4Bug: make interface more direct for calibration team2022-03-11T01:02:51ZLee McCullerBug: make interface more direct for calibration teamhttps://git.ligo.org/lee-mcculler/iirrational/-/issues/3Feature: fit only some sections to magnitude, or separate weights by mag/phase2019-08-14T13:17:30ZLee McCullerFeature: fit only some sections to magnitude, or separate weights by mag/phaseJenne:
> Kara is trying a method with PRCL to replace the low frequency data with her own hand-generated measurement data. If it were possible to tell IIRrational that in some area it needs to only fit the magnitude, and we don't care...Jenne:
> Kara is trying a method with PRCL to replace the low frequency data with her own hand-generated measurement data. If it were possible to tell IIRrational that in some area it needs to only fit the magnitude, and we don't care about the phase, this would probably be an easy way to solve our problems, but I don't know if we can do that. Is there any way we can tell IIRrational to not use the phase as part of the fitting metrics?