bilby-dev / bilby

A unified framework for stochastic sampling packages and gravitational-wave inference in Python. Note that we are currently transitioning from git.ligo.org/lscsoft/bilby, please bear with us!
https://bilby-dev.github.io/bilby/
MIT License
58 stars 66 forks source link

Service Desk (from wushichao@mail.bnu.edu.cn): Hello, Bilby team, I'm a KAGRA member. I want to ask how to use set_strain_data_from_frame_file() to load a frame file made by myself? #459

Closed bilby-bot closed 2 weeks ago

bilby-bot commented 5 years ago

In GitLab by @git.ligo:support-bot on Aug 16, 2019, 06:52

Hello, Bilby team,

I want to ask how to use set_strain_data_from_frame_file() to load a frame file made by myself? The frame file which I use comes from GWTC-1 website https://www.gw-openscience.org/catalog/GWTC-1-confident/single/GW150914/

But the length is to long (32s), so I cut it to 4s around the GW event. I use the code below to set the strain dataL

When I run the code, I get this error about the channel:

Then I read the source code of set_from_frame_file(), I find that 'channel' is set to 'None' by default. Is my frame file in wrong format?

Best wishes, Shichao Wu

图片

图片

bilby-bot commented 5 years ago

In GitLab by @git.ligo:matthew-pitkin on Aug 19, 2019, 10:06

Is your new file still in the gravitational-wave frame file format (GWF)? If it is, you should make sure your new file has the extension .gwf rather than .txt. The code is seeing that the file has a .txt extension and therefore thinks it is an ascii text file, so if trying to read it with the numpy loadtxt file rather than a frame reading function.

If your file is an ascii text file then I think there must be a bug in the interface, either in bilby or GWPy, that still tries passing the the channel option to loadtxt via the **kwargs.

bilby-bot commented 5 years ago

In GitLab by @git.ligo:gregory.ashton on Aug 20, 2019, 11:39

Hi Shichao Wu,

A cleaner way to load data is to the use the gpwy module as in the GW150914 example.

The gwpy module provides a way to access gravitational wave data. See the documentation for various ways to set a TimeSeries object up. Here is an example with fetch_open_data

ifo = bilby.gw.detector.get_empty_interferometer("H1")
data = TimeSeries.fetch_open_data("h1", start_time, end_time)
ifo.strain_data.set_from_gwpy_timeseries(data)
bilby-bot commented 5 years ago

In GitLab by @git.ligo:gregory.ashton on Aug 23, 2019, 01:13

I'm going to close this issue as there isn't an immediate action item for the team.

Shichao, if you'd like to discuss things more, please join the Bilby slack group, there is a #help channel :)

bilby-bot commented 5 years ago

In GitLab by @git.ligo:gregory.ashton on Aug 23, 2019, 01:13

closed