SUNPY: PYTHON FOR SOLAR PHYSICS. AN IMPLEMENTATION FOR LOCAL CORRELATION TRACKING



Similar documents
CASA Analysis and Visualization

Postprocessing with Python

Introduction to Python

Scientific Programming, Analysis, and Visualization with Python. Mteor 227 Fall 2015

e-callisto status report #36

Introduction Installation Comparison. Department of Computer Science, Yazd University. SageMath. A.Rahiminasab. October9, / 17

VisIVO, a VO-Enabled tool for Scientific Visualization and Data Analysis: Overview and Demo

Programming Languages & Tools

ANSA and μeta as a CAE Software Development Platform

Exercise 0. Although Python(x,y) comes already with a great variety of scientic Python packages, we might have to install additional dependencies:

MayaVi: A free tool for CFD data visualization

Efficiency Considerations of PERL and Python in Distributed Processing

Integrated Open-Source Geophysical Processing and Visualization

Analytic Modeling in Python

Computational Mathematics with Python

Unlocking the True Value of Hadoop with Open Data Science

Python for Scientific Computing.

Predicting outcome of soccer matches using machine learning

Observing the Sun from space: Highlights from Yohkoh, SOHO, TRACE, RHESSI. H.S. Hudson Space Sciences Lab University of California, Berkeley

Astronomical Instruments Software System Design

McGraw-Hill The McGraw-Hill Companies, Inc.,

Computational Mathematics with Python

Computational Mathematics with Python

Multiprocess System for Virtual Instruments in Python

MACHINE LEARNING IN HIGH ENERGY PHYSICS

MDSplus Automated Build and Distribution System

OpenWalnut An Open-Source Visualization System

Intro to scientific programming (with Python) Pietro Berkes, Brandeis University

IDL. Get the answers you need from your data. IDL

Software Architecture Document (SAD) for the Interferometric Modules of the Next ESA SAR Toolbox (NEST)

An interactive 3D visualization system for displaying fieldmonitoring

How To Write A Data Analysis Project

2 SYSTEM DESCRIPTION TECHNIQUES

HEP data analysis using jhepwork and Java

Computer Vision Technology. Dave Bolme and Steve O Hara

Modelling cellular processes with Python and Scipy

SPASE: THE CONNECTION AMONG SOLAR AND SPACE PHYSICS DATA CENTERS

The Ultra-scale Visualization Climate Data Analysis Tools (UV-CDAT): A Vision for Large-Scale Climate Data

Data Analytics at NERSC. Joaquin Correa NERSC Data and Analytics Services

A Python-Based Simulation Code Repository for Complex Systems Education. Hiroki Sayama

Visualizing and Analyzing Massive Astronomical Datasets with Partiview

Sourcery Overview & Virtual Machine Installation

COMESEP Project : Space Weather Impact Forecasting

Rotorcraft Health Management System (RHMS)

Python for Data Analysis and Visualiza4on. Fang (Cherry) Liu, Ph.D PACE Gatech July 2013

Analysis Programs DPDAK and DAWN

Today's Topics. COMP 388/441: Human-Computer Interaction. simple 2D plotting. 1D techniques. Ancient plotting techniques. Data Visualization:

Some programming experience in a high-level structured programming language is recommended.

VisIVO, an open source, interoperable visualization tool for the Virtual Observatory

The evolution of DAVE

Figure 2: System Flow Diagram for Workflow Management

CIS 192: Lecture 13 Scientific Computing and Unit Testing

A Color Placement Support System for Visualization Designs Based on Subjective Color Balance

Examples of Data Representation using Tables, Graphs and Charts

Performance Monitoring using Pecos Release 0.1

McIDAS-V: An open source data analysis and visualization tool for multiand hyperspectral satellite data ITSC-XVI, Angra do Reis, Brazil, 7 May 2008

Current Status of Development of New VLBI Data Analysis Software

Cloud tracking with optical flow for short-term solar forecasting

Massive Labeled Solar Image Data Benchmarks for Automated Feature Recognition

Introduction to Python

Graphical Processing Units to Accelerate Orthorectification, Atmospheric Correction and Transformations for Big Data

Car Insurance. Prvák, Tomi, Havri

SmartArrays and Java Frequently Asked Questions

Programming Languages

GStreamer for Engineering Video. Night Vision. Joshua M. Doe, Stephen D. Burks

Integration of C++ digital processing libraries and VTK through Tcl/Tk dynamic loadable extensions

Interactive Visualization of Magnetic Fields

Ulyxes automatic deformation monitoring system

Chapter 13: Program Development and Programming Languages

CME 193: Introduction to Scientific Python Lecture 8: Unit testing, more modules, wrap up

Whisler 1 A Graphical User Interface and Database Management System for Documenting Glacial Landmarks

CE 504 Computational Hydrology Computational Environments and Tools Fritz R. Fiedler

MongoDB and Python. Key Ingredients for a Perfect Big Data Recipe WHITEPAPER. Firoz Mohamed Kasim, PMP

Introduction to Visualization with VTK and ParaView

LSA SAF products: files and formats

Session 85 IF, Predictive Analytics for Actuaries: Free Tools for Life and Health Care Analytics--R and Python: A New Paradigm!

The PACS Software System. (A high level overview) Prepared by : E. Wieprecht, J.Schreiber, U.Klaas November, Issue 1.

Web Based Visualization Tool for Climate Data Using Python. Hannah Aizenman and Michael Grossberg. David Jones and Nick Barnes

Detailed Design Report

R YOU READY FOR PYTHON? Sunday 19th April, 2015

Data Products via TRMM Online Visualization and Analysis System

SCIENTIFIC COMPUTING AND PROGRAMMING IN THE CLOUD USING OPEN SOURCE PLATFORMS: AN ILLUSTRATION USING WEIGHTED VOTING SYSTEMS

Transcription:

ISSN 1845 8319 SUNPY: PYTHON FOR SOLAR PHYSICS. AN IMPLEMENTATION FOR LOCAL CORRELATION TRACKING J. I. CAMPOS ROZO 1 and S. VARGAS DOMINGUEZ 2 1 Universidad Nacional de Colombia, Bogotá, Colombia 2 Big Bear Solar Observatory, NJIT, 40386 North Shore Lane Big Bear City, CA 92314-9672, U.S.A. Abstract. Python programming language has experienced a great progress and growing use in the scientific community in the last years as well as a direct impact on solar physics. Python is a very mature language and almost any fundamental feature you might want to do is already implemented in a library or module. SunPy is a common effort of, using the advantages of Python, developing tools to be applied for processing and analysis of solar data. In this work we present a particular development, based on Python, for the analysis of proper motions in time series of images through the local correlation tracking algorithm. A graphic user interface allows to select different parameters for the computations, visualization and analysis of flow fields. Key words: Programming - Solar Physics - Data Analysis 1. What is Python? Python is an easy to learn, powerful programming language. It has efficient high-level data structures and a simple but effective approach to object-oriented programming. Python is an ideal language for scripting and rapid application development in many areas on most platforms. The Python interpreter and the extensive standard library are freely available in source or binary form for all major platforms from the Python Web site, http://www.python.org, and may be freely distributed. The Python interpreter is easily extended with new functions and data types implemented in C or C++ (or other languages callable from C). Python is also suitable as an extension language for customizable applications. Some of the attractive characteristics of Python have made the widespread use of this language in recent years. They can be summarized in the following. Learning: Python is easy to deal with (IDL too, but Python is a widely used general-purpose, Cent.Eur.Astrophys.Bull. 38 (2014) 1, 67 72 67

J. I. CAMPOS ROZO AND S. VARGAS DOMINGUEZ high-level, object-oriented, interpreted and functional programming language). Multi-purpose: packages for image processing (Scikit-image), neuronal network (Scikit-learn), 3D-display (Mayavi), symbolic math (Sympy), web-development (e.g. Django, Pylons) and a lot more. Some of the already developed scientific core packages are : Scipy: a collection of open source software for scientific computing in Python. Numpy: a powerful N-dimensional array object, useful linear algebra and other tools for integrating functions. Matplotlib: a Python 2D plotting library. Pandas: easy-to-use data structures and data analysis tools for the Python programming language. Astropy: the Astropy Project is a community effort to develop a single core package for Astronomy in Python. Figure 1: Structure of SunPy. 68 Cent.Eur.Astrophys.Bull. 38 (2014) 1, 67 72

SUNPY. AN IMPLEMENTATION FOR LOCAL CORRELATION TRACKING 2. SunPy SunPy is a free and open-source software library for solar physics based on Python. It is a community-developed free and open-source software package for solar physics research. SunPy is meant to be a free alternative to the SolarSoft data analysis environment which is based on the IDL scientific programming language. The aim of the SunPy project is to provide the software tools necessary so that anyone can analyze solar data. SunPy is written using the Python programming language and is built upon the scientific Python environment which includes the core packages listed above. The development of SunPy is associated with that of Astropy. SunPy was founded on March 28, 2011 by a small group of scientists and developers at the NASA Goddard Space Flight Center. Thanks to the generous support of the ESA Summer of Code and the Google Summer of Code as well as contributors from around the world, SunPy is now a global project and is not associated with any individual institution. One of the helpful characteristics of SunPy is the capability to make tests and version controls. The tests are done with Pytest (a library written in Python) and the version control is done with Git. These tools allow us to make fewer errors and avoid repeating the same code from different developers. There are several ways to install SunPy in all different operation systems (Windows, MacOs, Linux, Solaris, etc). Figure 1 shows the global building structure of SunPy. SunPy has three mean SuperClasses or packages (Net, Database, NDArray). With Net you can obtain data from Heliophysics Event Knowledgebase (HEK), Heliophysics Integrated Observatory (HELIO) and Virtual Solar Observatory (VSO) databases. With the Database package we can save and organize our data into a local or remote database and this function is connected with VSO network. The last package, NDArray, has three sub-packages: (1) Lightcurves (still under development) which already support SDO/EVE, GOES XRS and PROBA2/LYRA. (2) Spectra is the newest and the least developed but there are some functions to work with Callisto data. (3) Map, to make maps of SDO, LASCO, SOHO, STEREO, RHESSI, YOHKOH, IRIS, TRACE. At the moment, J. I. Campos Rozo is working on Hinode/SOT Map (together with Dr. David Perez-Suarez from SANSA, South African National Space Agency). Cent.Eur.Astrophys.Bull. 38 (2014) 1, 67 72 69

J. I. CAMPOS ROZO AND S. VARGAS DOMINGUEZ 3. Examples Let us develop an example for the use of the Map function as shown in Fig. 2. To start up using some of the SunPy functions we need to import the libraries, such as Numpy, Scipy, Matplotlib. One important thing is that when you import any library or class you can change its name if wanted. Next step is to build a Map. If the Map you want to create does not belong to the list of different satellites and instruments allowed, that function won t be built. The peek function plots the map with title and axis. We can also compose maps, for example, we can combine SDO/HMI with RHESSI images by using the compositemap function, that function use two objects obtained via Map function. We can create a data cube by using Map function and adding the keyword cube=true. The created cube can be saved in video format, e.g. mp4. Figure 2: Example of the use of the Map function in SunPy. 70 Cent.Eur.Astrophys.Bull. 38 (2014) 1, 67 72

SUNPY. AN IMPLEMENTATION FOR LOCAL CORRELATION TRACKING Figure 3: Python GUI to control the application of local correlation tracking algorithm to a time series of images. Different parameters can be selected to apply the algorithm and for the visualization of the velocity output. 4. Implementation for Local Correlation Tracking We are developing a solar physics hotbed research project at Universidad Nacional de Colombia. Besides from developing the routine SOTMap for SunPy (available in the repository https://github.com/hypnus1803), Python routines for computing proper motions of structures in a time series of images have been implemented. The Local Correlation Tracking (LCT, November and Simon, 1988) technique is a robust method used to study the dynamics of structures in a time series of images. By tracking pixel displacements, using a correlation window, LCT can determine proper motions and generate flow maps of horizontal velocities. This procedure is used to study the dynamics of plasma in the solar photosphere at different spatial scales, e.g the analysis of granular and supergranular convective cells, meridional flows, etc. As part of this project, a widget implemented in Python was Cent.Eur.Astrophys.Bull. 38 (2014) 1, 67 72 71

J. I. CAMPOS ROZO AND S. VARGAS DOMINGUEZ developed. It generates a user-friendly graphical user interface (GUI) to control various parameters for the process of calculating flow maps from a series of filtergrams (data cube). Figure 3 shows the GUI where the user can select a data cube to be processed and determine the size of the structures wanted to be tracked, among other options. At the moment additional features are being implemented for supplementary analysis of the data. In particular, the possibility to select different time windows and create multiple flow maps in time in order to study the evolution of flow patterns from one map to the other. Further analysis of the velocity outputs is also under development, i.e to obtain statistics for selected sub-regions in the field of view and the distribution of velocities, and the computation of the divergence field and vorticity. Acknowledgements This research has made use of SunPy, an open-source and free communitydeveloped solar data analysis package written in Python. The authors want to thank Dr. Dominik Utz and Dr. Arnold Hanslmeier for the invitation to the 4th International Workshop on Small-Scale Solar Magnetic Fields in Austria. References November, L. J. and Simon, G. W.: 1988, Astrophys. J. 333, 427. http://www.sunpy.org/ https://www.python.org/ http://www.numpy.org/ http://www.scipy.org/ http://matplotlib.org/ http://pyqt.sourceforge.net/docs/pyqt4/index.html http://sdac.virtualsolar.org/ http://www.lmsal.com/hek/ http://helioviewer.org/ 72 Cent.Eur.Astrophys.Bull. 38 (2014) 1, 67 72