{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# DRMS access using Python\n", "\n", "- [Github Repository](https://github.com/kbg/drms-workshop/)\n", "- [README (Github)](https://github.com/kbg/drms-workshop/blob/master/README.md), [README (local)](render_readme.ipynb)\n", "\n", "\n", "## Basic examples\n", "\n", "- [DRMS basics](drms_basics.ipynb)\n", "- [JSOC data export](jsoc_data_export.ipynb)\n", "\n", "\n", "## HMI Science Nugget examples\n", "\n", "The following examples are taken from the [HMI Science Nugget](http://hmi.stanford.edu/hminuggets/?p=1757) about the `drms` Python module.\n", "\n", "- [Accessing SHARP metadata](nugget_sharp_metadata.ipynb)\n", "- [Select and download SHARP data](nugget_sharp_imgdata.ipynb)\n", "\n", "\n", "## Access HMI data locally stored at KIS\n", "\n", "This examples shows how to access the HMI data (e.g. Dopplergrams, magnetograms and intensity maps) that are locally stored on the DRMS server at KIS. This example was taken from the recent Python Workshop.\n", "\n", "- [KIS DRMS access](kis_drms_access.ipynb)\n", "\n", "Note: In order to be able to access our local FITS files, you need to run this notebook on a computer that has access to the KIS NFS, e.g. on one of our compute or login servers. \n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Test installation\n", "\n", "The following code lines can be used to test if everything is installed properly." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import sys\n", "print(' python: %d.%d.%d' % sys.version_info[:3])\n", "\n", "import numpy\n", "print(' numpy:', numpy.__version__)\n", "\n", "import pandas\n", "print(' pandas:', pandas.__version__)\n", "\n", "import drms\n", "print(' drms:', drms.__version__)\n", "\n", "import astropy\n", "print(' astropy:', astropy.__version__)\n", "\n", "import matplotlib\n", "print('matplotlib:', matplotlib.__version__)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "client = drms.Client()\n", "print(client)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "sharp_info = client.info('hmi.sharp_720s')\n", "print('SHARP pkeys:', sharp_info.primekeys)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "myemail = 'name@example.com'\n", "\n", "print('Checking email...', end='')\n", "if client.check_email(myemail):\n", " print('\\r\"{}\" is correctly registered at JSOC.'.format(myemail))\n", "else:\n", " print('\\r\"{}\" is NOT registered at JSOC.'.format(myemail))" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.0" } }, "nbformat": 4, "nbformat_minor": 2 }