Getting Started
Installation
The cfspopcon package is available on the Python Package Index <https://pypi.org/>, thus installation is as simple as:
>>> pip install cfspopcon
>>> radas -d ./radas_dir
The second step is to generate a folder of OpenADAS atomic data files. We can’t ship these files with cfsPOPCON due to licensing issues, but they’re easy to make with radas. You only need to do this once.
Running cfspopcon from the command line
Once you’ve installed cfspopcon, you can run it from the command line using
>>> popcon example_cases/SPARC_PRD --show
This will run the run_popcon_cli function from cfspopcon/cli.py. The first argument to popcon should be a path to a folder containing an input.yaml file, which
sets the parameters for the POPCON analysis. Have a look at example_cases/SPARC_PRD/input.yaml to see how this file is structured.
The results of the POPCON analysis are stored in a output folder in the directory where input.yaml was read from. For the example case above, you can find the outputs in
example_cases/SPARC_PRD/outputs. These include a NetCDF dataset containing the results of the run, a JSON file representing points in plain-text, as well as any plots requested in the
input.yaml file.
Getting started with Jupyter
You can also run cfspopcon via a Jupyter notebook. If you’ve installed cfspopcon using pip, launch jupyter from the environment you installed cfspopcon
into. You can also run cfspopcon without installing anything at all, by using the binder interface. If you’ve installed using
poetry, you can either poetry run jupyter lab or open Jupyter (either directly or via an IDE like VSCode) and select .venv/bin/python as your kernel.
An example notebook in the docs folder. The contents and results of this can be compared to the static representation below:
More detailed documentation
We also provide interactive examples for POPCON functionality using Jupyter notebooks, since this lets us ensure that our documentation always produces runnable code. You can find extended examples listed below:
Other example notebooks
Jupyter notebooks provide a convenient way of demonstrating and documenting features of the code. You can find a collection of demonstration notebooks listed below. If you add features to
cfspopcon, or have a nice notebook which documents some pre-existing functionality, please add it below (this is a great way to start developing cfspopcon).