Clean up of detectors
Merge request reports
Activity
added 2 commits
A brief summary of the work done so far
- Add a InterferometerStrainData class - ss discussed in #104 (closed)
- Use set_data to set the strain_data attribute of interferometer
- Adds properties to interferometer which call down to the strain_data
- Rename data -> frequency_domain_strain (effects likelihood and utils)
- Removes whitened_data method that was not used
- Move data plotting to method of interferometer and remove duplicate code
- Rename epoch -> start_time
- Add get/set for strain_data
- Adds an InterferometerSet clas. Rather than passing around a list of interferometers, have a defined set. Motivation: in several places we had dangerous calls to interferometers[0].attribute which will get confusing if not all IFO's have the same duration etc. This enforces that they do.
Edited by Gregory AshtonSo this just about completes the initial working version. I think now would be a good time to get some input @colm.talbot, @moritz.huebner @paul-lasky. I've tried to keep the changes as minimal as possible and not do extra stuff [1]. This should not change the functionality at all, but just change how things are handled.
[1] I failed in one instance and added the new class InterferometerSet. If we don't like the other changes here, we could always cherry pick this (if people agree) as I think it solves an important potential bug.
@moritz.huebner, unfortunately this changes much of the logic of the test suite. Do you have time at all to look and see what needs changing? I'd be happy to do it, but I fear my lazy attitude towards tests will mean that the tests will be as complete as before.
@gregory.ashton I will have a look at all of that tomorrow. Marking went a bit faster then expected.
added 12 commits
-
fd2a4571...82e1b5a5 - 7 commits from branch
master
- ef251ed6 - Merge branch 'master' into clean-up-of-detectors
- 18367122 - Clean up set_from_frame_file
- 59ea9890 - Clean up and document of InterferometerSet
- 2319b495 - Clean up and document InterferometerStrainData
- 74ef9db3 - Fix up bugs in set_from_frame_file
Toggle commit list-
fd2a4571...82e1b5a5 - 7 commits from branch
@colm.talbot I want to highlight that I removed the 'overwrite_psd' option. It wasn't clear to me why this was there. Presumably if someone wants to set the psd from a frame file, they should just do that? If I have missed something let me know and I can try to add it back in.
Also, I've merged in @sylvia.biscoveanu's recent change to add 1s to the frame file read-in. I generalised it to be user-settable (the argument
buffer_time
)added 1 commit
- 922a757d - Add shape and frequency checking to set_data methods
@gregory.ashton @colm.talbot I was using the overwrite_psd option while running on frames to estimate the PSD from the frame data, but I had also started some runs where I turned it off since I wanted to run with a PSD from a file. Can I still do this somehow?
I'm a bit confused how people are accessing
set_data
when dealing with a frame file. Is this directly, or through theget_interferometer_with_fake_noise_and_injection
function?If you where using
get_interferometer_with_fake_noise_and_injection
then everything (as far as I can tell) is equivalent. If not please let me know.If you where using
set_data
drectly with theframe_file
option before, you'd now do.interferometer = get_empty_interferometer('H1') interferometer.strain_data.set_from_frame_file( frame_file, channel_name, sampling_frequency, duration, start_time) interferometer.power_spectral_density = PowerSpectralDensity( frame_file=frame_file, channel_name=channel_name, start_time=start_time)
We could write a method for
Interferometer
, something likeset_strain_and_power_spectral_density_from_frame_file
which wraps all that together?I am setting it using two methods:
IFOs = [tupak.gw.detector.get_empty_interferometer(name) for name in ['H1', 'L1']] IFOs[0].set_data(frame_file="/home/sylvia.biscoveanu/LALInference/tbs_injections/dist_marg/noise_only/zero_padding/H-H1_H1:noiseOnly-1164557000-4096.gwf",\ channel_name = 'H1:noiseOnly',overwrite_psd=True,sampling_frequency=sampling_frequency,duration=time_duration, psd_duration = psd_length,\ psd_offset=psd_offset, epoch=epoch) IFOs[1].set_data(frame_file="/home/sylvia.biscoveanu/LALInference/tbs_injections/dist_marg/noise_only/zero_padding/L-L1_L1:noiseOnly-1164557000-4096.gwf",\ channel_name = 'L1:noiseOnly', overwrite_psd=True,sampling_frequency=sampling_frequency,duration=time_duration,psd_duration=psd_length,\ psd_offset=psd_offset, epoch=epoch)
Can I still specify the
psd_offset
andpsd_duration
options? And when I want to run with the PSD from file, I set it like this:IFOs = [tupak.gw.detector.get_empty_interferometer(name) for name in ['H1', 'L1']] for ifo in IFOs: ifo.power_spectral_density = 'home/sylvia.biscoveanu/tupak/examples/mine/spliced_low_freq_asd.txt' IFOs[0].set_data(frame_file="/home/sylvia.biscoveanu/LALInference/tbs_injections/dist_marg/noise_only/zero_padding/H-H1_H1:noiseOnly-1164557000-4096.gwf",\ channel_name = 'H1:noiseOnly',overwrite_psd=False,sampling_frequency=sampling_frequency,duration=time_duration, epoch=epoch) IFOs[1].set_data(frame_file="/home/sylvia.biscoveanu/LALInference/tbs_injections/dist_marg/noise_only/zero_padding/L-L1_L1:noiseOnly-1164557000-4096.gwf",\ channel_name = 'L1:noiseOnly', overwrite_psd=False,sampling_frequency=sampling_frequency,duration=time_duration, epoch=epoch)
Can I still read the data from the frame but run with a PSD from file?
Edited by Sylvia BiscoveanuHmm, this is confusing. In the current version,
set_data
doesn't have apsd_offset
orpsd_duration
so these are going intokwargs
. This is then passed toprocess_strain_data
where it fortunately does nothing and then also toPowerSpectralDensity
where it is of course used.So the answer is yes, you can still use them and it will actually be clearer what is going on. Soemthing like
IFOs[0].strain_data.set_from_frame_file( frame_file=frame_file, channel_name = channel, sampling_frequency=sampling_frequency, duration=time_duration, start_time=start_time) IFOs[0].power_spectral_density = PowerSpectralDensity( frame_file=frame_file, channel_name=channel_name, start_time=start_time) psd_duration=psd_length, psd_offset=psd_offset)
Then when you want to run with the PSD from file, you just set the PSD from file instead.
Excellent, thanks @gregory.ashton!
@sylvia.biscoveanu. Absolutely.