- About
- Setup
- Example Data
- Running Simulations
- Start Analyzing
- Loading Simulations and Data Structures
- Field Particle Correlation
- Wavelet Transform
- Instability Isolation Method
- Example Notebooks
- Premade Scripts
- Premade Plot Functions
- Regression and Unit Testing
- Development
- Useful Links
- This is the documentation for Collin Brown's FPC Analysis Environment, Library and Analysis scripts. Here, we present the code needed to perform FPC analysis on dHybridR, Tristan, and Gkeyll data. While examples are provided that require only trivial alteration to perform the core of most FPC and IIM related analysis, this repo's primary goal is to be a python analysis environment/ library that has functions that one can build upon to perform their own analysis.
- Major contributions/ Special Thanks: Greg Howes, Jimmy Juno, Colby Haggerty, Andrew McCubbin, Alberto Felix, Rui Huang, Emily Lichko
Requirements: python 3.11; pip; conda
Here, we walk through how to make an environment that contains this library. Installing directly to your main environment is not recommended.
- Clone this repo
git clone https://github.com/collinrbr/FPCAnalysis.git
- Run setup script to install libraries with the correct version. It may be possible for newer versions of the python libraries to be used, but compatibility is not tested.
./install.py
This will create a folder 'FPCAnalysisenv' that contains the python environment for doing FPCAnalysis with these scripts.
Note, if one 87B8 wishes to use additional libraries, add them to the requirements.txt file, remove the FPCAnalysis environment folder, and rerun setup.py or install them using pip/conda while the environment is activated. This can also be used to update libraries although compatibility is not guaranteed.
- Use the environment
This can be done in one of several ways. The most general way is to activate the environment in your terminal.
** ONE MUST REACTIVATE THE ENVIRONMENT EVERY TIME A NEW TERMINAL IS OPENED TO USE THIS ENVIRONMENT **
Linux/Mac:
conda activate /full/path/to/FPCAnalysisenv
** ONE MUST REACTIVATE THE ENVIRONMENT EVERY TIME A NEW TERMINAL IS OPENED TO USE THIS ENVIRONMENT **
One can also add the following to the top of any script that is written for this environment, in which case, it is no longer necessary to activate the environment when running any script with the following added to it:
#!FPCAnalysis/bin/python
Now, you can select an example notebook/ script and start running!
To uninstall remove the FPCAnalysisenv folder created by the install script. You may need to reinstall if you move the environment folder or the library that it is linked to (e.g. the FPCAnalysis lib folder).
To add additional libraries to this environment, activate the environment and then either pip install' them or
conda install' them.
After setup, it is recommended to obtain the sample data for dHybridR and go through the example notebooks analyzing this data!
Data for Gkeyll can be generated using the example inputs of published simulations at https://github.com/ammarhakim/gkyl-paper-inp. One simulation of note is the perpendicular shock simulation at https://github.com/ammarhakim/gkyl-paper-inp/tree/master/2021_JPP_FPC_Perp_Shock.
TODO: Here we will link data from upcoming paper on nonadiabatic electron heating. We will provide example inputs too!
Sample dHybridR data can be found at https://doi.org/10.5281/zenodo.7901521. Otherwise, as dHybridR is not currently open source, please contact the authors for an executable or to collaborate on a simulation.
One can start using this analysis environment with the example data above or by running their own simulation (see Running Simulations).
Analysis begins by loading the data. In the first chapter found here, we discuss how data is loaded into a common data struture and how to use this common structure.
There are many key features of this analysis environment:
- Most notable is the ability to compute the Field Particle Correlation, which shows energy transfer between waves and particles.
- We can also compute the Wavelet Transform, allowing us to measure the complex coefficients associated with wavenumber and position in a simulation.
- Finally, we can compute the Instability Isolation Method, which relates the measurements of the complex coefficients at particular wavenumber and position for each field component to frequency using faradays law assuming plane-wave solutions. This allows for one to measure (k_x, k_y, k_z, omega) using a single frame of data at a local specified position.
We walkthrough how to use many of the functions provided in this library in the example notebooks folder. But, there are also many premade scripts that you can use. There are many Premade Plot Functions, but it is encouraged to implement your own plots too!
It may also be helpful to look at the regression and unit testing. And also, if you plan on developing this, please see Development.