pycbc
pycbc copied to clipboard
Error happened when I generate a noise
When I enter these codes
Then, the code gives an output.
When I try to use different delta_t value, like 64, it works. But some values still are not invalid and give the same error message.
@siangyuhuang Thanks for posting this issue here. Please do post any problems you might encounter here. We love seeing that folks are using PyCBC, and will do our best to solve any problems you are seeing.
To help with this could you enter the full code that raises this issue? In particular, I cannot see what psd
is from your code snippet.
I did try (following the documentation):
import pycbc.noise
import pycbc.psd
import pylab
flow = 30.0
delta_f = 1.0 / 16
flen = int(2048 / delta_f) + 1
psd = pycbc.psd.aLIGOZeroDetHighPower(flen, delta_f, flow)
delta_t = 1.0 / 4096
tsamples = int(32 / delta_t)
ts = pycbc.noise.noise_from_psd(tsamples, delta_t, psd, seed=127)
delta_t = 1. / 96
ts = pycbc.noise.noise_from_psd(tsamples, delta_t, psd, seed=127)
and it ran without problem for me.
A few things to point out:
- It seems that you are using a very old version of PyCBC (v1.9.0) in an anaconda environment. I would suggest to use something much more recent as this may not be compatible with the version of lalsuite being used, and you'd be missing a lot of new features. @duncanmmacleod manages the igwn anaconda environments, and I would recommend these environments for many use cases. I also see KAGRA in the path, so I'm not sure if KAGRA is maintaining its own anaconda environments? If so, it would be good for the person maintaining that to talk to Duncan!
- This looks related to the problem reported in (https://github.com/gwastro/pycbc/issues/3654). There Alex demonstrated an alternative way of generating noise. If you want to generate a lot of noise, the method Alex describes there is probably better, the example here is perhaps simpler if you want a short stretch of noise.
@siangyuhuang Thanks for posting this issue here. Please do post any problems you might encounter here. We love seeing that folks are using PyCBC, and will do our best to solve any problems you are seeing.
To help with this could you enter the full code that raises this issue? In particular, I cannot see what
psd
is from your code snippet.I did try (following the documentation):
import pycbc.noise import pycbc.psd import pylab flow = 30.0 delta_f = 1.0 / 16 flen = int(2048 / delta_f) + 1 psd = pycbc.psd.aLIGOZeroDetHighPower(flen, delta_f, flow) delta_t = 1.0 / 4096 tsamples = int(32 / delta_t) ts = pycbc.noise.noise_from_psd(tsamples, delta_t, psd, seed=127) delta_t = 1. / 96 ts = pycbc.noise.noise_from_psd(tsamples, delta_t, psd, seed=127)
and it ran without problem for me.
A few things to point out:
- It seems that you are using a very old version of PyCBC (v1.9.0) in an anaconda environment. I would suggest to use something much more recent as this may not be compatible with the version of lalsuite being used, and you'd be missing a lot of new features. @duncanmmacleod manages the igwn anaconda environments, and I would recommend these environments for many use cases. I also see KAGRA in the path, so I'm not sure if KAGRA is maintaining its own anaconda environments? If so, it would be good for the person maintaining that to talk to Duncan!
- This looks related to the problem reported in (#3654). There Alex demonstrated an alternative way of generating noise. If you want to generate a lot of noise, the method Alex describes there is probably better, the example here is perhaps simpler if you want a short stretch of noise.
Thank you. I will rearrange again later.
@spxiwh, from the looks of things the PyCBC install is not from a conda package, but is just from a local python setup.py install
into a conda environment. We (IGWN) do not support Python 2 at all.
My PSD file like this

My PSD setup is

Then generate time domain noise,

The error output is
