gwastro / pycbc

Core package to analyze gravitational-wave data, find signals, and study their parameters. This package was used in the first direct detection of gravitational waves (GW150914), and is used in the ongoing analysis of LIGO/Virgo data.
http://pycbc.org
GNU General Public License v3.0
313 stars 347 forks source link

tutorial/1_CatalogData.ipynb RuntimeError: RETURN: untrapped XLAL error #2409

Closed matxil closed 5 years ago

matxil commented 5 years ago

In the first tutorial on PyCbc ("1. Work with accessing the catalog of gravitational-wave mergers and LIGO/Virgo data") , I get an error in the 8th code-block, at the call: ts = read_frame(file_name, channel_name, start, end) (where file_name = "H-H1_LOSC_4_V2-1128678884-32.gwf")

The complete error message is:

RuntimeErrorTraceback (most recent call last)
<ipython-input-72-418af70f2d93> in <module>()
     11 end = start + 32
     12 
---> 13 ts = read_frame(file_name, channel_name, start, end)

/home/nbuser/anaconda2_501/lib/python2.7/site-packages/pycbc/frame/frame.pyc in read_frame(location, channels, start_time, end_time, duration, check_integrity, sieve)
    179         locations = [location]
    180 
--> 181     cum_cache = locations_to_cache(locations)
    182     if sieve:
    183         logging.info("Using frames that match regexp: %s", sieve)

/home/nbuser/anaconda2_501/lib/python2.7/site-packages/pycbc/frame/frame.pyc in locations_to_cache(locations, latest)
    125                 cache = lal.CacheImport(file_path)
    126             elif file_extension == ".gwf" or _is_gwf(file_path):
--> 127                 cache = lalframe.FrOpen(str(dir_name), str(file_name)).cache
    128             else:
    129                 raise TypeError("Invalid location name")

**RuntimeError: RETURN: untrapped XLAL error**

How do I fix this? Best regards,

Machiel

ahnitz commented 5 years ago

@matxil Thanks for reporting this! The links for these files now folllows a redirect, and the curl command we had in the tutorial did not follow this redirect, so it ended up downloading the web page saying go somewhere else, instead of the actual file!

On your machine, replacing the curl command to get the data with below should resolve this issue.

# We'll first download some data for this demonstration
!curl -O -J -L https://losc.ligo.org/s/events/LVT151012/H-H1_LOSC_4_V2-1128678884-32.gwf

(Note the added -L)

Let me know if that works for you.

matxil commented 5 years ago

@ahnitz Hi, Thanks for your fast reply. Yes, now it works fine without problems. Thank you