<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 urllib3
%matplotlib inline
%config InlineBackend.figure_format = 'retina'
help(rl)<jupyter_output>Help on module readligo:

NAME
    readligo - readligo.py

DESCRIPTION
    updated: January 15, 2018
    by: <NAME>
    what has been modified: minor corrections to make it usable with python 3 
    (tab replaced with spaces, argument of 'reshape' integer, forced the integer conversion also for slices)
    
    Version 0.3
    January 10, 2017
    <NAME>, <NAME>, and <NAME>
    
    Updates in this version:
     * Should now work with both Python 2 and Python 3
    
    This module provides tools for reading LIGO data
    files.  Data along with supporting documentation
    can be downloaded from the losc web site:
    https://losc.ligo.org
    
    Some possible use cases are shown below.
    
    Example #0:
    To load all data from a single file:
    strain, time, dq = rl.loaddata('ligo_data/H-H1_LOSC_4_V1-842653696-4096.hdf5', 'H1')
    
    Example #1: 
    segList = getsegs(842657792, 842658792, 'H1')
    for (start, stop) in segList:
      strain, met[...]<jupyter_text>A thing about https requests**Update (2017-07-28):** If you're using a modern version of these libraries, they may no longer be vendored. If that's the case, then you'll only need to do:```pythonimport urllib3urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)```If you're still using a version of Requests which vendors urllib3 inside of it (like the original question), then you can use the original answer below:Original answer:The reason doing `urllib3.disable_warnings()` didn't work for you is because it looks like you're using a separate instance of urllib3 vendored inside of requests.I gather this based on the path here: `/usr/lib/python2.6/site-packages/requests/packages/urllib3/connectionpool.py`To disable warnings in requests' vendored urllib3, you'll need to import that specific instance of the module:```pythonimport requestsfrom requests.packages.urllib3.exceptions import InsecureRequestWarningrequests.packages.urllib3.disable_warnings(InsecureRequestWarning)```<jupyter_code>! wget https://losc.ligo.org/archive/data/S5/814743552/H-H1_LOSC_4_V1-815411200-4096.hdf5
# urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
# 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 = urllib3.(url).read()
# http = urllib3.PoolManager()
# r = http.request('GET', url).read()
# f = open(filename, 'wb')   # write it to the right filename
# f.write(r)
# f.close()
# print("File download complete")
filename = 'H-H1_LOSC_4_V1-815411200-4096.hdf5'<jupyter_output><empty_output><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.figure(figsize=(16,12))
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.11382857142857143, 'fraction_numerical': 0.043885714285714285, 'mean_word_length': 4.297820823244552, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 24, 'https://': 7, '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': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '343655', 'license': 'Apache-2.0', 'n_tokens_mistral': 1587, 'n_tokens_neox': 1467, 'n_words': 434, 'path': 'quantum gravity/Getting Started/index.ipynb', 'repo_name': 'AadityaGupta/Artificial-Intelligence-Deep-Learning-Machine-Learning-Tutorials', 'size': '4402'}