-
-
Notifications
You must be signed in to change notification settings - Fork 409
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Rename detailed_balance to equilibrium * Add ion number source and destination as index columns * Rates matrix solver * Normalized level population solver (not working) * Correct shape of assignment * Correctly updating the dataframe (still chained assignment) * Adds docstrings * Fixes level population indexing and add TODO for the rate matrix solver * Refactor of the rate matrix solver to adapt to different inputs Also include electron distribution class to hold relevant info. * Add consistent * Adds support for no approximation of collisional rates * Fix transformation of rate matrix * Make electron_distribution a dataclass * Better name for rate matrix variable * Adds simple tests for level pop solver * Correct index in col strength test * Resolve test indexing issue * Specify CGS for the electron distribution * Rename electron_distribution to electron_energy_distribution * Adds basic regression data test to the level population solver * Adds proper rate matrix and level population solver tests * Rename electron energy dist. input * Adds example notebooks and comment on tests * Remove outdated notebook * Address comment * Pre-run tardis solver workflow
- Loading branch information
1 parent
fd4369f
commit cc0b125
Showing
22 changed files
with
954 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import os\n", | ||
"\n", | ||
"os.environ['XUVTOP'] = \"~/chianti\"\n", | ||
"\n", | ||
"try:\n", | ||
" import ChiantiPy.core as ch\n", | ||
" from ChiantiPy.tools.io import versionRead\n", | ||
"\n", | ||
"except ImportError:\n", | ||
" # Shamefully copied from their GitHub source:\n", | ||
" import chianti.core as ch\n", | ||
" def versionRead():\n", | ||
" \"\"\"\n", | ||
" Read the version number of the CHIANTI database\n", | ||
" \"\"\"\n", | ||
" xuvtop = os.environ['XUVTOP']\n", | ||
" vFileName = os.path.join(xuvtop, 'VERSION')\n", | ||
" vFile = open(vFileName)\n", | ||
" versionStr = vFile.readline()\n", | ||
" vFile.close()\n", | ||
" return versionStr.strip()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"compare_shell = 0\n", | ||
"species = (14, 1)\n", | ||
"species_string = 'si_2'" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 9, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"t_electron = 9967.4884" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 10, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"electron_density = 1e6" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 11, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"chianti_species = ch.ion(species_string, temperature=t_electron, eDensity=electron_density)\n", | ||
"chianti_species.populate()\n", | ||
"chianti_population = chianti_species.Population['population']" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 12, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"array([[9.99999989e-01, 1.06967533e-08, 8.19021735e-17, 1.63935872e-16,\n", | ||
" 3.82270728e-16, 8.00932946e-18, 1.60440977e-17, 1.62648689e-17,\n", | ||
" 2.44571411e-17, 9.10400264e-17, 3.26639365e-18, 6.54275441e-18,\n", | ||
" 7.80689247e-18, 1.17291171e-17, 7.51999263e-18, 1.01449887e-17,\n", | ||
" 6.56279954e-17, 2.63927140e-18, 5.28562769e-18, 6.84869862e-18,\n", | ||
" 1.02728743e-17, 6.36689557e-18, 8.48045348e-18, 5.33290944e-18,\n", | ||
" 6.25920357e-18]])" | ||
] | ||
}, | ||
"execution_count": 12, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"chianti_population" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "carsus", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.12.5" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.