Demodoc Documentation Release

Demodoc Documentation Release

DemoDoc Documentation Release Sourav Apr 24, 2017 Contents 1 SunPy User Guide 3 1.1 Installation................................................3 1.2 A brief tour of SunPy.......................................... 10 1.3 Acquiring Data with SunPy....................................... 16 1.4 Data Types in SunPy........................................... 42 1.5 Plotting in SunPy............................................. 52 1.6 Time in SunPy.............................................. 54 1.7 Region of Interest............................................ 57 1.8 Customizing SunPy........................................... 57 1.9 Troubleshooting............................................. 58 2 API Reference 61 2.1 SunPy................................................... 61 2.2 SunPy cm................................................. 61 2.3 SunPy coordinates............................................ 61 2.4 SunPy database.............................................. 64 2.5 SunPy image............................................... 64 2.6 SunPy instr................................................ 64 2.7 SunPy io................................................. 65 2.8 SunPy lightcurve............................................. 65 2.9 SunPy map................................................ 65 2.10 SunPy net................................................. 67 2.11 SunPy physics.............................................. 67 2.12 SunPy roi................................................. 67 2.13 SunPy spectra.............................................. 67 2.14 SunPy sun................................................ 68 2.15 SunPy time................................................ 68 2.16 SunPy util................................................ 68 2.17 SunPy visualization........................................... 68 2.18 SunPy wcs................................................ 68 3 Developer’s Guide 69 3.1 Developer’s Guide Overview....................................... 69 3.2 Version Control.............................................. 69 3.3 Coding Standards............................................. 74 3.4 Global Settings.............................................. 75 3.5 Documentation.............................................. 75 i 3.6 Testing.................................................. 80 4 Reporting Bugs 85 5 SSWIDL/SunPy Cheat Sheet 87 Python Module Index 89 ii DemoDoc Documentation, Release Welcome to the SunPy documentation. SunPy is a community-developed, free and open-source solar data analysis environment for Python. You can find the official SunPy website at sunpy.org. Contents 1 DemoDoc Documentation, Release 2 Contents CHAPTER 1 SunPy User Guide Welcome to the SunPy User Guide. SunPy is a community-developed, free and open-source solar data analysis environment. It is meant to provide the core functionality and tools to analyze solar data with Python. This guide provides a walkthrough of the major features in SunPy. For more details checkout the API Reference. Installation SunPy is a Python package for solar physics. It relies on and enables the use of the wider ecosystem of scientific Python packages for solar physics. Therefore a working SunPy installation is more about installing the scientific Python ecosystem than SunPy itself. SunPy is Python 2.7.x, 3.4.x and 3.5.x compatible. If you are new to Python and scientific Python then continue to follow this guide to get setup with the whole envi- ronment. If you already have a working Python / Scientific Python environment then you can skip to the Advanced Installation Instructions section. Installing Scientific Python and SunPy If you do not currently have a working scientific Python distribution this guide will set you up with the Anaconda sci- entific Python distribution. Anaconda makes it easy to install and manage your scientific Python packages. Alternative scientific Python options exist and can be found later in the Advanced Installation Instructions section. Anaconda contains a free distribution of Python and a large number of common scientific packages. Anaconda is very powerful and easy to use. Installing Anaconda provides (almost) all the packages you need to use SunPy. To install the Anaconda Python distribution follow the instructions here. You will need to select the correct download for your platform and follow the install procedure. Note that although Anaconda makes it simple to switch between Python versions, we recommend that new users install the latest Python 3.x version of Anaconda. This is because Python 2.7 is scheduled to be deprecated in 2020. 3 DemoDoc Documentation, Release Installing SunPy on top of Anaconda To install SunPy launch a system command prompt or the ‘Anaconda Command Prompt’ (under Windows). First configure conda for sunpy downloads: conda config--add channels conda-forge to install SunPy: conda install sunpy You now have a working SunPy installation. You can check your SunPy install by following the instructions in Testing SunPy. Note: Currently Glymur / JPEG2000 support is not tested under Anaconda on any platforms. However, an external installation of openJPEG should work with the glymur installation in conda. Updating SunPy to a New Version When a new version of SunPy is released you can update to the latest version by running: conda update sunpy Advanced SunPy Installation If you do not wish to use Anaconda to install Scientific Python or you already have a scientific Python installation there are other options for installing SunPy. Advanced Installation Instructions This document provides details on things you need to know to install and manage your own scientific Python + SunPy installation. If you have never installed or used scientific Python we recommend that you follow the Anaconda installation instructions. Alternative Scientific Python Installation Instructions There are many alternatives to Anaconda as a way of installing a scientific Python environment, there are various other platform specific ways to install scientific Python: Linux Overview Warning: We highly recommend that users use the Anaconda python distribution. Instructions are available here anaconda_install. 4 Chapter 1. SunPy User Guide DemoDoc Documentation, Release Almost all versions of Linux ship with a recent enough version of Python, so it is unlikely that you will need to install Python yourself. If you do not have python you can find the source at the Python official site. Install using sudo apt-get install python2.7-dev or a similar command, depending on your linux distro. Anything like python-dev provides you the required Python development headers. Debian based (eg. Ubuntu) On Ubuntu, most of the pre-reqs are available in the Ubuntu software repos and can be installed using apt-get: sudo apt-get install python-dev sudo apt-get install python-qt4 sudo apt-get install git-core sudo apt-get install python-numpy sudo apt-get install python-scipy sudo apt-get install python-matplotlib sudo apt-get update Now we shall install pip. Pip Most Python distributions ship with a tool called easy_install which assists with installing Python packages. Although easy_install is capable of installing most of the dependencies needed for SunPy itself, a more powerful tool called pip provides a more flexible installation (including support for uninstalling, upgrading, and installing from remote sources such as GitHub) and should be used instead. Use easy_install to install pip: sudo easy_install pip You are now ready to install SunPy and its dependencies. Mac OS X Overview Warning: We highly recommend that users use the Anaconda python distribution. Instructions are available here anaconda_install. Because of the wide variety of methods for setting up a Python environment on Mac OS X, users have a number of options with how to install SunPy and its dependencies. We have a number of solutions listed below. Choose the solution which best suits you. For users who wish to have more control over the installation of Python, several alternative installation methods are provided below, including instructions for Macports and Homebrew. The following instructions are not recommended for beginners. OS X comes pre-loaded with Python but each versions of OS X (Mountain Lion, Snow Leopard, etc.) ships with a different version of Python. In the instructions below, we therefore recommend that you install your own version of Python. You will then have two versions of Python living on your system at the same time. It can be confusing to make sure that when you install packages they are installed for the correct Python so beware. 1.1. Installation 5 DemoDoc Documentation, Release Python 2.7.3+ Download and install the latest version of 32 bit Python 2.7.3 <http://www.python.org/download/releases/2.7.3/> using their DMG installer. Next, choose your package installer of choice (either Macports or Homebrew) and follow the instructions below. If you do not have either go to their respective websites and install one of the other as needed. XCode tools / Compiler If you are using MacOS X, you will need to the XCode command line tools. One way to get them is to install XCode. If you are using OS X 10.7 (Lion) or later, you must also explicitly install the command line tools. You can do this by opening the XCode application, going to Preferences, then Downloads, and then under Components, click on the Install button to the right of Command Line Tools. Alternatively, on 10.7 (Lion) or later, you do not need to install XCode, you can download just the command line tools

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    95 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us