Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions examples/gw150914_audio.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,15 @@
}
],
"source": [
"#Set up the libraries we need and download the data\n",
"# Set up the libraries we need and download the data\n",
"import os\n",
"import shutil\n",
"from pycbc.io import get_file\n",
"\n",
"# Using GitHub instead of original LOSC location to improve reliability, especially in GitHub CI\n",
"# !wget https://losc.ligo.org/s/events/GW150914/H-H1_LOSC_4_V2-1126259446-32.gwf\n",
"!wget https://media.githubusercontent.com/media/gwastro/pycbc_data/master/H-H1_LOSC_4_V2-1126259446-32.gwf"
"url = \"https://gwosc.org/s/events/GW150914/H-H1_LOSC_4_V2-1126259446-32.gwf\"\n",
"fname = os.path.basename(url)\n",
"if not os.path.exists(fname):\n",
" shutil.copy(get_file(url, cache=True), fname)"
]
},
{
Expand Down
12 changes: 9 additions & 3 deletions examples/gw151226_snr.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -263,11 +263,17 @@
}
],
"source": [
"import os\n",
"import shutil\n",
"from pycbc.frame import read_frame\n",
"from pycbc.io import get_file\n",
"\n",
"# Now let's see what the SNR timeseries looks like in the other detector in Livingston.\n",
"# Get the data for L1. Using GitHub instead of original LOSC site for reliability\n",
"# !wget -O L-L1_LOSC_4_V2-1135136334-32.gwf https://losc.ligo.org/s/events/GW151226/L-L1_LOSC_4_V2-1135136334-32.gwf\n",
"!wget -O L-L1_LOSC_4_V2-1135136334-32.gwf https://media.githubusercontent.com/media/gwastro/pycbc_data/master/L-L1_LOSC_4_V2-1135136334-32.gwf\n",
"# Get the data for L1\n",
"url = \"https://gwosc.org/s/events/GW151226/L-L1_LOSC_4_V2-1135136334-32.gwf\"\n",
"fname = os.path.basename(url)\n",
"if not os.path.exists(fname):\n",
" shutil.copy(get_file(url, cache=True), fname)\n",
"\n",
"# Read the Lvingston data and remove low frequency content\n",
"l1 = read_frame('L-L1_LOSC_4_V2-1135136334-32.gwf', 'L1:LOSC-STRAIN')\n",
Expand Down
17 changes: 12 additions & 5 deletions examples/gw170104_look.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,18 @@
}
],
"source": [
"# Get the data for H1 and L1 redirect from LOSC to GitHub to improve reliability, especially in GitHub CI\n",
"# !wget https://losc.ligo.org/s/events/GW170104/H-H1_LOSC_4_V1-1167559920-32.gwf\n",
"# !wget https://losc.ligo.org/s/events/GW170104/L-L1_LOSC_4_V1-1167559920-32.gwf\n",
"!wget https://media.githubusercontent.com/media/gwastro/pycbc_data/master/H-H1_LOSC_4_V1-1167559920-32.gwf\n",
"!wget https://media.githubusercontent.com/media/gwastro/pycbc_data/master/L-L1_LOSC_4_V1-1167559920-32.gwf"
"import os\n",
"import shutil\n",
"from pycbc.io import get_file\n",
"\n",
"# Get the data for H1 and L1\n",
"for url in (\n",
" \"https://gwosc.org/s/events/GW170104/H-H1_LOSC_4_V1-1167559920-32.gwf\",\n",
" \"https://gwosc.org/s/events/GW170104/L-L1_LOSC_4_V1-1167559920-32.gwf\",\n",
"):\n",
" fname = os.path.basename(url)\n",
" if not os.path.exists(fname):\n",
" shutil.copy(get_file(url, cache=True), fname)"
]
},
{
Expand Down
17 changes: 11 additions & 6 deletions examples/gw170817_mass_estimate.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,18 @@
}
],
"source": [
"# Original links at \n",
"# https://dcc.ligo.org/public/0146/P1700349/001/H-H1_LOSC_CLN_4_V1-1187007040-2048.gwf\n",
"# https://dcc.ligo.org/public/0146/P1700349/001/L-L1_LOSC_CLN_4_V1-1187007040-2048.gwf\n",
"# Redirected to github for reliability\n",
"import os\n",
"import shutil\n",
"from pycbc.io import get_file\n",
"\n",
"!wget -nc https://media.githubusercontent.com/media/gwastro/pycbc_data/master/H-H1_LOSC_CLN_4_V1-1187007040-2048.gwf\n",
"!wget -nc https://media.githubusercontent.com/media/gwastro/pycbc_data/master/L-L1_LOSC_CLN_4_V1-1187007040-2048.gwf"
"# Download the GW170817 data\n",
"for url in (\n",
" \"https://dcc.ligo.org/public/0146/P1700349/001/H-H1_LOSC_CLN_4_V1-1187007040-2048.gwf\",\n",
" \"https://dcc.ligo.org/public/0146/P1700349/001/L-L1_LOSC_CLN_4_V1-1187007040-2048.gwf\",\n",
"):\n",
" fname = os.path.basename(url)\n",
" if not os.path.exists(fname):\n",
" shutil.copy(get_file(url, cache=True), fname)"
]
},
{
Expand Down
9 changes: 8 additions & 1 deletion tutorial/1_CatalogData.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,14 @@
],
"source": [
"# We'll first download some data for this demonstration\n",
"!curl -O -J -L https://media.githubusercontent.com/media/gwastro/pycbc_data/master/H-H1_LOSC_4_V2-1128678884-32.gwf"
"import os\n",
"import shutil\n",
"from pycbc.io import get_file\n",
"\n",
"url = \"https://gwosc.org/s/events/LVT151012/H-H1_LOSC_4_V2-1128678884-32.gwf\"\n",
"fname = os.path.basename(url)\n",
"if not os.path.exists(fname):\n",
" shutil.copy(get_file(url, cache=True), fname)"
]
},
{
Expand Down
24 changes: 13 additions & 11 deletions tutorial/inference_0_Overview.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -498,17 +498,20 @@
}
],
"source": [
"import os\n",
"import shutil\n",
"\n",
"from pycbc.catalog import Merger\n",
"from pycbc.psd import interpolate, inverse_spectrum_truncation\n",
"from pycbc.frame import read_frame\n",
"from pycbc.filter import highpass, resample_to_delta_t\n",
"from astropy.utils.data import download_file\n",
"from pycbc.io import get_file\n",
"\n",
"m = Merger(\"GW170817\")\n",
"\n",
"# List of observatories we'll analyze\n",
"ifos = ['H1', \n",
" 'V1', \n",
"ifos = ['H1',\n",
" 'V1',\n",
" 'L1',\n",
" ]\n",
"\n",
Expand All @@ -521,14 +524,13 @@
"\n",
"for ifo in ifos:\n",
" print(\"Processing {} data\".format(ifo))\n",
" \n",
"\n",
" # Download the gravitational wave data for GW170817\n",
" \n",
" # Redirected to aid reliability of downloading, especially on the GitHub CI\n",
" # url = \"https://dcc.ligo.org/public/0146/P1700349/001/{}-{}1_LOSC_CLN_4_V1-1187007040-2048.gwf\"\n",
" url = \"https://media.githubusercontent.com/media/gwastro/pycbc_data/master/{}-{}1_LOSC_CLN_4_V1-1187007040-2048.gwf\"\n",
" \n",
" fname = download_file(url.format(ifo[0], ifo[0]), cache=True)\n",
" url = \"https://dcc.ligo.org/public/0146/P1700349/001/{}-{}1_LOSC_CLN_4_V1-1187007040-2048.gwf\"\n",
" url = url.format(ifo[0], ifo[0])\n",
" fname = os.path.basename(url)\n",
" if not os.path.exists(fname):\n",
" shutil.copy(get_file(url, cache=True), fname)\n",
" data_filenames[ifo] = fname\n",
"\n",
" # Read the gravitational wave data and do some minimal\n",
Expand All @@ -543,7 +545,7 @@
"\n",
" # Estimate the power spectral density of the data\n",
" psd = interpolate(ts.psd(4), ts.delta_f)\n",
" psd = inverse_spectrum_truncation(psd, int(4 * psd.sample_rate), \n",
" psd = inverse_spectrum_truncation(psd, int(4 * psd.sample_rate),\n",
" trunc_method='hann',\n",
" low_frequency_cutoff=20.0)\n",
" psds[ifo] = psd\n"
Expand Down
22 changes: 13 additions & 9 deletions tutorial/inference_1_ModelsAndPEByHand.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -782,17 +782,20 @@
}
],
"source": [
"import os\n",
"import shutil\n",
"\n",
"from pycbc.catalog import Merger\n",
"from pycbc.psd import interpolate, inverse_spectrum_truncation\n",
"from pycbc.frame import read_frame\n",
"from pycbc.filter import highpass, resample_to_delta_t\n",
"from astropy.utils.data import download_file\n",
"from pycbc.io import get_file\n",
"\n",
"m = Merger(\"GW170817\")\n",
"\n",
"# List of observatories we'll analyze\n",
"ifos = ['H1', \n",
" 'V1', \n",
"ifos = ['H1',\n",
" 'V1',\n",
" 'L1',\n",
" ]\n",
"\n",
Expand All @@ -802,12 +805,13 @@
"\n",
"for ifo in ifos:\n",
" print(\"Processing {} data\".format(ifo))\n",
" \n",
" # Redirected to aid reliability of downloading, especially on the GitHub CI\n",
" # url = \"https://dcc.ligo.org/public/0146/P1700349/001/{}-{}1_LOSC_CLN_4_V1-1187007040-2048.gwf\"\n",
" url = \"https://media.githubusercontent.com/media/gwastro/pycbc_data/master/{}-{}1_LOSC_CLN_4_V1-1187007040-2048.gwf\"\n",
"\n",
" fname = download_file(url.format(ifo[0], ifo[0]), cache=True) \n",
" # Download the gravitational wave data for GW170817\n",
" url = \"https://dcc.ligo.org/public/0146/P1700349/001/{}-{}1_LOSC_CLN_4_V1-1187007040-2048.gwf\"\n",
" url = url.format(ifo[0], ifo[0])\n",
" fname = os.path.basename(url)\n",
" if not os.path.exists(fname):\n",
" shutil.copy(get_file(url, cache=True), fname)\n",
"\n",
" # Read the gravitational wave data and do some minimal\n",
" # conditioning of the data.\n",
Expand All @@ -821,7 +825,7 @@
"\n",
" # Estimate the power spectral density of the data\n",
" psd = interpolate(ts.psd(4), ts.delta_f)\n",
" psd = inverse_spectrum_truncation(psd, int(4 * psd.sample_rate), \n",
" psd = inverse_spectrum_truncation(psd, int(4 * psd.sample_rate),\n",
" trunc_method='hann',\n",
" low_frequency_cutoff=20.0)\n",
" psds[ifo] = psd\n"
Expand Down
19 changes: 10 additions & 9 deletions tutorial/inference_4_bbh_example/IntroToPyCBCInference.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -269,16 +269,17 @@
"metadata": {},
"outputs": [],
"source": [
"# Paths redirected from GWOSC to GitHub to improve reliability, especially in GitHub CI\n",
"#if not os.path.exists('H-H1_GWOSC_4KHZ_R1-1126257415-4096.gwf'):\n",
"# !wget https://www.gw-openscience.org/catalog/GWTC-1-confident/data/GW150914/H-H1_GWOSC_4KHZ_R1-1126257415-4096.gwf\n",
"#if not os.path.exists('L-L1_GWOSC_4KHZ_R1-1126257415-4096.gwf'):\n",
"# !wget https://www.gw-openscience.org/catalog/GWTC-1-confident/data/GW150914/L-L1_GWOSC_4KHZ_R1-1126257415-4096.gwf\n",
"# Download the GW150914 data\n",
"import shutil\n",
"from pycbc.io import get_file\n",
"\n",
"if not os.path.exists('H-H1_GWOSC_4KHZ_R1-1126257415-4096.gwf'):\n",
" !wget https://media.githubusercontent.com/media/gwastro/pycbc_data/master/H-H1_GWOSC_4KHZ_R1-1126257415-4096.gwf\n",
"if not os.path.exists('L-L1_GWOSC_4KHZ_R1-1126257415-4096.gwf'):\n",
" !wget https://media.githubusercontent.com/media/gwastro/pycbc_data/master/L-L1_GWOSC_4KHZ_R1-1126257415-4096.gwf"
"for url in (\n",
" \"https://gwosc.org/eventapi/html/GWTC-1-confident/GW150914/v3/H-H1_GWOSC_4KHZ_R1-1126257415-4096.gwf\",\n",
" \"https://gwosc.org/eventapi/html/GWTC-1-confident/GW150914/v3/L-L1_GWOSC_4KHZ_R1-1126257415-4096.gwf\",\n",
"):\n",
" fname = os.path.basename(url)\n",
" if not os.path.exists(fname):\n",
" shutil.copy(get_file(url, cache=True), fname)"
]
},
{
Expand Down
16 changes: 10 additions & 6 deletions tutorial/inference_8_BHRingdown.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -116,18 +116,22 @@
"metadata": {},
"outputs": [],
"source": [
"from astropy.utils.data import download_file\n",
"import os\n",
"import shutil\n",
"\n",
"from pycbc.io import get_file\n",
"\n",
"ifos = ['H1', 'L1', 'V1']\n",
"data_filenames = {}\n",
"for ifo in ifos:\n",
" print(\"Downloading {} data\".format(ifo))\n",
" \n",
"\n",
" # Download the gravitational wave data for GW190521\n",
" # URL changed from GWOSC to GitHub to improve reliability\n",
" #url = \"https://www.gw-openscience.org/eventapi/html/O3_Discovery_Papers/GW190521/v2/{}-{}1_GWOSC_4KHZ_R2-1242440920-4096.gwf\"\n",
" url = \"https://media.githubusercontent.com/media/gwastro/pycbc_data/master/{}-{}1_GWOSC_4KHZ_R2-1242440920-4096.gwf\"\n",
" fname = download_file(url.format(ifo[0], ifo[0]), cache=True)\n",
" url = \"https://gwosc.org/eventapi/html/O3_Discovery_Papers/GW190521/v2/{}-{}1_GWOSC_4KHZ_R2-1242440920-4096.gwf\"\n",
" url = url.format(ifo[0], ifo[0])\n",
" fname = os.path.basename(url)\n",
" if not os.path.exists(fname):\n",
" shutil.copy(get_file(url, cache=True), fname)\n",
" data_filenames[ifo] = fname"
]
},
Expand Down
Loading