<jupyter_start><jupyter_text>Workspace for LOSC tutorialsThis notebook provides a workspace to try introductory LOSC tutorials.  * Find tutorials at: https://losc.ligo.org/tutorials/* Ctrl + Enter to run a cell * Alt + Enter to run a cell and make a new one  * Or, use the "Cell" and "Insert" menus at the top  Download LIGO DataSee how to find LIGO data here: https://losc.ligo.org/tutorial01/Here, we'll use a few lines of python to download a data file.<jupyter_code>#----------------------
# Import needed modules
#----------------------
import numpy as np
import matplotlib.pyplot as plt
import h5py
import readligo as rl
import urllib2
%matplotlib inline
%config InlineBackend.figure_format = 'retina'


url = 'https://losc.ligo.org/archive/data/S5/814743552/H-H1_LOSC_4_V1-815411200-4096.hdf5'
filename = 'H-H1_LOSC_4_V1-815411200-4096.hdf5'
r = urllib2.urlopen(url).read()
f = open(filename, 'w')   # write it to the right filename
f.write(r)
f.close()
print("File download complete")<jupyter_output>File download complete<jupyter_text>Load data<jupyter_code># -- Read in the strain data
strain, time, channel_dict = rl.loaddata(filename)

# -- Identify segment of useable data
ts = time[1] - time[0]      #-- Time between samples
fs = int(1.0 / ts)          #-- Sampling frequency
segList = rl.dq_channel_to_seglist(channel_dict['DATA'], fs)
length = 16  # seconds
strain_seg = strain[segList[0]][0:(length*fs)]  #-- Identify a 16 s segment of data
time_seg = time[segList[0]][0:(length*fs)]      #-- Identify the corresponding time segment<jupyter_output><empty_output><jupyter_text>Plot the strain time-series<jupyter_code>plt.plot(time_seg - time_seg[0], strain_seg)
plt.xlabel('Time since GPS ' + str(time_seg[0]))
plt.ylabel('Strain')
plt.xlim([0,2])<jupyter_output><empty_output><jupyter_text>More to try!You can use this space to try other tutorials: https://losc.ligo.org/tutorials/<jupyter_code># Try adding some code here!  
# https://losc.ligo.org/tutorials/
# Add code here
# Add code here<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13872549019607844, 'fraction_numerical': 0.031862745098039214, 'mean_word_length': 4.413793103448276, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, 'https://': 5, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '431758', 'license': 'Apache-2.0', 'n_tokens_mistral': 768, 'n_tokens_neox': 724, 'n_words': 194, 'path': 'quantum gravity/Getting Started/index.ipynb', 'repo_name': 'Vamshi-dhar/Artificial-Intelligence-Deep-Learning-Machine-Learning-Tutorials', 'size': '2040'}