# Help with Challenge 1

**URL:** https://ask.igwn.org/t/help-with-challenge-1/323
**Category:** Data Analysis
**Created:** [May 27, 2022, 4:19pm UTC](https://ask.igwn.org/t/help-with-challenge-1/323 "2022-05-27T16:19:38Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Hsenag\_yajiV](https://avatars.discourse-cdn.com/v4/letter/h/a587f6/32.png) [@Hsenag\_yajiV](https://ask.igwn.org/u/Hsenag_yajiV)
#### Post date: [May 27, 2022, 4:19pm UTC](https://ask.igwn.org/t/help-with-challenge-1/323/1 "2022-05-27T16:19:38Z")

</div>

Hi. This might be dumb. How do I find the sampling rate and duration of a signal that we download?. In this case challenge1.gwf.

---

<div class="post-metadata">

### Author: ![jonah](https://yyz1.discourse-cdn.com/flex031/user_avatar/ask.igwn.org/jonah/32/10_2.png) [@jonah](https://ask.igwn.org/u/jonah)
#### Post date: [May 27, 2022, 7:03pm UTC](https://ask.igwn.org/t/help-with-challenge-1/323/2 "2022-05-27T19:03:29Z")

</div>

The sample rate is stored as an attribute with each timeseries object. The duration you can find as the length of the vector times the sample time. For example, you could try something like this:

```auto
# -- for pycbc
from pycbc import frame
pycbc_strain = frame.read_frame('challenge1.gwf', 'H1:CHALLENGE1')
dt = pycbc_strain.delta_t
duration = len(pycbc_strain)*dt
print(duration)

```

---

<div class="post-metadata">

### Author: ![Ajay\_Sharma](https://avatars.discourse-cdn.com/v4/letter/a/6a8cbe/32.png) [@Ajay\_Sharma](https://ask.igwn.org/u/Ajay_Sharma)
#### Post date: [May 30, 2022, 8:11am UTC](https://ask.igwn.org/t/help-with-challenge-1/323/3 "2022-05-30T08:11:25Z")

</div>

This gives an error  
RuntimeError: Internal function call failed: Invalid argument  
How to find the solution?

---

<div class="post-metadata">

### Author: ![martinberoiz](https://yyz1.discourse-cdn.com/flex031/user_avatar/ask.igwn.org/martinberoiz/32/11_2.png) [@martinberoiz](https://ask.igwn.org/u/martinberoiz)
#### Post date: [May 30, 2022, 4:25pm UTC](https://ask.igwn.org/t/help-with-challenge-1/323/4 "2022-05-30T16:25:57Z")

</div>

Hi Ajay,

Can you post the line in question as you wrote it and the entire backtrace? That can help in debugging.

---

<div class="post-metadata">

### Author: ![Ajay\_Sharma](https://avatars.discourse-cdn.com/v4/letter/a/6a8cbe/32.png) [@Ajay\_Sharma](https://ask.igwn.org/u/Ajay_Sharma)
#### Post date: [May 31, 2022, 6:34pm UTC](https://ask.igwn.org/t/help-with-challenge-1/323/5 "2022-05-31T18:34:39Z")

</div>

Hi Martin  
I have use this  
from pycbc import frame  
pycbc\_strain = frame.read\_frame(‘challenge2.gwf’, ‘H1:CHALLENGE2’)  
dt = pycbc\_strain.delta\_t  
duration = len(pycbc\_strain)\*dt  
print(duration)

---

<div class="post-metadata">

### Author: ![martinberoiz](https://yyz1.discourse-cdn.com/flex031/user_avatar/ask.igwn.org/martinberoiz/32/11_2.png) [@martinberoiz](https://ask.igwn.org/u/martinberoiz)
#### Post date: [May 31, 2022, 7:51pm UTC](https://ask.igwn.org/t/help-with-challenge-1/323/6 "2022-05-31T19:51:46Z")

</div>

At first sight it could be that the file challenge2.gwf is not in a directory accessible from your notebook. Try writing the absolute path for the file. If it doesn’t work, remember to copy here the _ **entire** _ backtrace for the error you get.
