{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## Get some 40m data using NDS" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "# Library Imports and Python parameter settings\n", "%matplotlib inline\n", "from __future__ import division\n", "import nds2\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "import scipy.signal as sig\n", "import scipy.constants as const\n", "from astropy.time import Time\n", "\n", "# Update the matplotlib configuration parameters:\n", "plt.rcParams.update({'font.size': 20,\n", " 'font.family': 'serif',\n", " 'figure.figsize': (10, 8),\n", " 'axes.grid': True,\n", " 'grid.color': '#555555'})" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Some references\n", "* https://www.lsc-group.phys.uwm.edu/daswg/projects/nds-client/doc/manual/ch04.html\n", "* http://wiki.scipy.org/NumPy_for_Matlab_Users" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "# Setup connection to the NDS\n", "conn = nds2.connection('nds40.ligo.caltech.edu', 31200)\n", "\n", "# Setup start and stop times\n", "times = '2017-01-12 19:45:00'\n", "t = Time(times, format='iso', scale='utc')\n", "t_start = int(t.gps)\n", "dur = 400\n", "\n", "# channel names\n", "#channels = ['C1:LSC-TRY_OUT_DQ', 'C1:ALS-BEATY_FINE_PHASE_OUT_DQ']\n", "#channels = ['C1:IOO-MC_F_DQ']\n", "channels = ['C1:SUS-BS_OL_SUM_OUT16']\n", "#\n", "data = conn.fetch(t_start, t_start + dur, channels)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "fig = plt.figure(figsize=(16, 9))\n", "#plt.loglog(aligo[:,0], sqrt(aligo[:,1]), color='Indigo', ls='--', alpha=0.65, lw=4)\n", "fs = data[0].channel.sample_rate\n", "y = data[0].data\n", "tt = np.arange(0,1/fs*np.size(data[0].data),1/fs)\n", "plt.plot(tt, y, linestyle='-', lw=2, alpha=0.9, color='BlueViolet',\n", " label=channels[0])\n", "\n", "plt.xlabel(r'Time [s]', fontsize=18)\n", "plt.ylabel(r'Frequency', fontsize=18)\n", "\n", "#plt.title(\"IR Transmission during ALS Scan\");\n", "plt.grid(b=True, which=\"major\", color='gray', alpha=0.33, linestyle='-' , lw=4)\n", "plt.grid(b=True, which=\"minor\", color='gray', alpha=0.22, linestyle='--', lw=1)\n", "plt.axis('tight')\n", "#plt.xlim((2,12))\n", "#plt.ylim((1e-3, 1))\n", "\n", "leg = plt.legend(loc='best', fancybox=True, fontsize=14)\n", "leg.get_frame().set_alpha(0.75)\n", "\n", "#plt.savefig(\"TRY.pdf\", bbox_inches='tight')\n", "\n", "plt.show()" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "channels[0]" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 2", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.13" } }, "nbformat": 4, "nbformat_minor": 0 }