Skip to content

xsherman/Synthetic-Diagnostics-Platform

 
 

Repository files navigation

Synthetic Diagnostics Platform

The Synthetic Diagnostics Platform (SDP) is a Python package that provides synthetic diagnostic modules on fusion plasma experiments.

It has interfaces to many plasma simulation codes, including XGC1, GTC, GTS, and M3D-C1. Simple analytic plasmas can also be used for tests and demonstrations.

Currently, SDP has synthetic [ECEI](ECEI2D tutorial.ipynb), reflectometry (PPPL cluster access required), and BES (XGC1 simulation only).

Prerequisites

  1. Python

    Before you start using the SDP, it is necessary for you to know the basics of Python Programming Language. The official tutorial should be more than enough. SDP is developed on Python 2.7. The Python 3 compatibility is not tested.

  2. Numpy & Scipy

    SDP uses Numpy and Scipy packages extensively. Basic knowledge of Numpy is strongly recommended. The official tutorial provides a good starting point.

  3. Jupyter Notebook

    This documentation and other tutorials are written in Jupyter Notebook format. Refer to the Jupyter documentation if you need help on using this document.

  4. Git and Git-LFS

    The most convenient way to obtain SDP is through its GitHub repository. You'll need to be familiar with Git. Here is an interactive tutorial on Git. Another key tool to successfully clone SDP is the Git-LFS. CLONE WITHOUT Git-LFS WILL RESULT IN MISSING KEY DATA FILES IN THE PACKAGE.

Recommended IDE

There are a lot of Python Integrated Development Environments (IDEs) available. If you are an experienced Python programmer, and have already gotten familiar with a specific IDE, then you are free to skip this section, and move directly to [installation of SDP](#4. Installation of SDP). The following recommendations are for users of SDP who are still looking for an IDE to start playing with Python.

Anaconda

Anaconda is an open source suite of useful Python environments, including an integrated editor Spyder, and environments provided by Jupyter.

It is straightforward to install Anaconda. Give it a try!

Installation of SDP

  1. Obtain SDP source code

    Right now, SDP is not fully open source. If you want to obtain the latest version of SDP, please contact the author: Lei Shi (FPSDP.main@gmail.com).

  2. Put SDP into Python path

    In order to import SDP from Python interpreter, you need to put SDP into a directory Python recognizes. The most straightforward way is to add the full path of "src/python2/" directory to the PYTHONPATH environment variable.  

    For example, in Windows, suppose your SDP source package is in "C:\SDP_source". Then, you only need to add "C:\SDP_source\src\python2" to the system's environment variable "PYTHONPATH". If no environment variable named "PYTHONPATH" exists, you should create one.

SDP should now be correctly recognized by Python and up to work.

SDP depends on some standard scientific libraries: scipy, numpy, matplotlib. You'll need to install them before using SDP. Guide on installation of these packages can be found in their official websites. If you are using Anaconda, you'll be able to obtain these packages easily through the "conda install" command.

Importing SDP and start using

After setting up the Python path, you should be able to do the following in the Python interpreter.

import sdp.plasma.analytic.testparameter as tp
from sdp.settings.unitsystem import cgs
print cgs['c']
29979000000.0

If you can run the above lines successfully, SDP should be working fine on your machine. Go on and try Create a simple model plasma.

About

Python platform for applying and developing synthetic diagnostics tool in fusion plasma scenarios.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 89.4%
  • C 10.5%
  • C++ 0.1%