FIR module tests emit warnings / do not test all outputs
The following warnings are output from the FIR module when running unit tests:
/builds/Calibration/pydarm/pydarm/FIR.py:87: UserWarning: Frequency resolution can not be set since you are using Hann window.
warnings.warn("Frequency resolution can not be set "
/builds/Calibration/pydarm/pydarm/FIR.py:452: UserWarning: frequency spacing of frequency-domain model is incorrect. Resampling - some information may be lost.
warnings.warn("frequency spacing of frequency-domain model is incorrect."
/opt/conda/envs/pydarm-test/lib/python3.10/site-packages/gwpy/plot/log.py:111: MatplotlibDeprecationWarning: The is_close_to_int function was deprecated in Matplotlib 3.6 and will be removed two minor releases later.
is_x_decade = mticker.is_close_to_int(fx)
./opt/conda/envs/pydarm-test/lib/python3.10/site-packages/scipy/signal/_filter_design.py:584: RuntimeWarning: divide by zero encountered in divide
h = k * polyvalfromroots(zm1, z) / polyvalfromroots(zm1, p)
/builds/Calibration/pydarm/pydarm/darm.py:69: RuntimeWarning: invalid value encountered in multiply
response *= tf
/builds/Calibration/pydarm/pydarm/darm.py:139: RuntimeWarning: divide by zero encountered in divide
return (1.0/C_response + D_response * A_response)
/builds/Calibration/pydarm/pydarm/darm.py:139: RuntimeWarning: invalid value encountered in divide
return (1.0/C_response + D_response * A_response)
/builds/Calibration/pydarm/pydarm/FIRtools.py:1345: ComplexWarning: Casting complex values to real discards the imaginary part
filt_prime[: N - delay_samples] = np.longdouble(filt[delay_samples:])
/builds/Calibration/pydarm/pydarm/FIRtools.py:1347: ComplexWarning: Casting complex values to real discards the imaginary part
filt_prime[-delay_samples:] = np.longdouble(filt[:delay_samples])
/builds/Calibration/pydarm/pydarm/FIR.py:641: RuntimeWarning: invalid value encountered in divide
ratio = filter_response / model_response
Either the unit tests are using the code incorrectly or there is something wrong in the pydarm.FIR
module.
Additionally, in test/test_FIR.py
the test Testcheck_td_vs_fd_response
does not fully test the returned values from test_check_td_vs_fd()
. All of the values should be checked. When I did a quick spot check, I did not see values that were close to 1 in magnitude or 0 phase, which makes me think something could be wrong with this method.