Skip to content
Snippets Groups Projects

Clean up of detectors

Merged Gregory Ashton requested to merge clean-up-of-detectors into master

Merge request reports

Pipeline #22471 passed

Pipeline passed for 5767f31c on clean-up-of-detectors

Approval is optional

Merged by Gregory AshtonGregory Ashton 6 years ago (Jun 20, 2018 10:05pm UTC)

Merge details

  • Changes merged into master with 271fdb87.
  • Deleted the source branch.

Pipeline #22543 passed

Pipeline passed for 271fdb87 on master

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Gregory Ashton added 1 commit

    added 1 commit

    Compare with previous version

  • Gregory Ashton added 2 commits

    added 2 commits

    Compare with previous version

  • 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 Ashton
  • Gregory Ashton added 3 commits

    added 3 commits

    • c0281426 - Remove obsolete start_time reference
    • d6d2e8c9 - Make frequency_domain_strain a property
    • fd2a4571 - Move set_data logic to InterferometerStrainData methods

    Compare with previous version

  • So 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.

  • Gregory Ashton added 12 commits

    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

    Compare with previous version

  • @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)

  • Gregory Ashton added 1 commit

    added 1 commit

    • 922a757d - Add shape and frequency checking to set_data methods

    Compare with previous version

  • Gregory Ashton unmarked as a Work In Progress

    unmarked as a Work In Progress

  • Can you add the buffer_timeto the function in utils that processes the data?

  • I think automatically updating the PSD when using a frame is more fool proof, otherwise you'll end up analysing O1 strain with the design sensitivity PSD and things will be bad. I'm not completely familiar with the updates so maybe it's now non-trivial to do both together.

  • @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?

  • Gregory Ashton added 1 commit

    added 1 commit

    • 5bd95ff1 - Move buffer time to the utils function

    Compare with previous version

  • I'm a bit confused how people are accessing set_data when dealing with a frame file. Is this directly, or through the get_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 the frame_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 like set_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 and psd_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 Biscoveanu
  • Hmm, this is confusing. In the current version, set_data doesn't have a psd_offset or psd_duration so these are going into kwargs. This is then passed to process_strain_data where it fortunately does nothing and then also to PowerSpectralDensity 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.

  • Would it be useful to have an example showing how to read in frame data? I'm happy to contribute mine if you guys think that would be helpful for future users.

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading