-
-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Additional features #187
Open
haydenmonk
wants to merge
9
commits into
tardis-sn:main
Choose a base branch
from
haydenmonk:additional_features
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Additional features #187
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
7a0548c
Added MARCS_TEST_FPATH, removed redundancies
f110291
Use model fixture in all tests
33a9f02
Combined all marcs tests
haydenmonk 288855c
Add relevant links to README file
haydenmonk 201a080
Merge branch 'main' into readme
haydenmonk 5a066c2
Add correct hyperlinks and clearer language
haydenmonk a5343d9
Add whitespace before license
haydenmonk 3de3604
mesa model and parallel tutorials
haydenmonk 8257f31
Part of the mesa model notebook was missing
haydenmonk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Large diffs are not rendered by default.
Oops, something went wrong.
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,114 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# Running the Simulation in Parallel" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"You can change the number of threads that STARDIS uses with the n_threads keyword. \n", | ||
"A few things to remember when running STARDIS in parallel: \n", | ||
" \n", | ||
"If no n_threads argument is provided, it defaults to 1 and runs in series. \n", | ||
" \n", | ||
"Set n_threads to 0 to use all available threads. \n", | ||
" \n", | ||
"The n_threads argument must be between the config version and the atom data, like this: \n", | ||
"```\n", | ||
"stardis_config_version: 1.0 \n", | ||
"n_threads: 4 \n", | ||
"atom_data: kurucz_cd23_chianti_H_He.h5\n", | ||
"```\n", | ||
"\n", | ||
"In the [stardis_config_parallel](stardis_config_parallel.yml) file, an n_threads value of 4 is added to the example config. Try running this code yourself to see how n_threads affects STARDIS's efficiency." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"application/vnd.jupyter.widget-view+json": { | ||
"model_id": "25723fa78e8d43ef8129a7667a39ebf8", | ||
"version_major": 2, | ||
"version_minor": 0 | ||
}, | ||
"text/plain": [ | ||
"Iterations: 0/? [00:00<?, ?it/s]" | ||
] | ||
}, | ||
"metadata": {}, | ||
"output_type": "display_data" | ||
}, | ||
{ | ||
"data": { | ||
"application/vnd.jupyter.widget-view+json": { | ||
"model_id": "86699bb231414753bfb51786d4a12b7f", | ||
"version_major": 2, | ||
"version_minor": 0 | ||
}, | ||
"text/plain": [ | ||
"Packets: 0/? [00:00<?, ?it/s]" | ||
] | ||
}, | ||
"metadata": {}, | ||
"output_type": "display_data" | ||
}, | ||
{ | ||
"name": "stderr", | ||
"output_type": "stream", | ||
"text": [ | ||
"Atomic Data kurucz_cd23_chianti_H_He already exists in /home/monkhayd/Downloads/tardis-data/kurucz_cd23_chianti_H_He.h5. Will not download - override with force_download=True.\n", | ||
"WARNING: UnitsWarning: 'erg/cm2/s' contains multiple slashes, which is discouraged by the FITS standard [astropy.units.format.generic]\n", | ||
"WARNING:astropy:UnitsWarning: 'erg/cm2/s' contains multiple slashes, which is discouraged by the FITS standard\n", | ||
"/home/monkhayd/Software/tardis/tardis/plasma/properties/radiative_properties.py:93: RuntimeWarning: invalid value encountered in divide\n", | ||
" (g_lower * n_upper) / (g_upper * n_lower)\n", | ||
"/home/monkhayd/Software/tardis/tardis/plasma/properties/radiative_properties.py:93: RuntimeWarning: invalid value encountered in divide\n", | ||
" (g_lower * n_upper) / (g_upper * n_lower)\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"import numpy as np\n", | ||
"import matplotlib.pyplot as plt\n", | ||
"from tardis.io.atom_data.util import download_atom_data\n", | ||
"from stardis.base import run_stardis\n", | ||
"from astropy import units as u, constants as const\n", | ||
"\n", | ||
"download_atom_data('kurucz_cd23_chianti_H_He')\n", | ||
"tracing_lambdas = np.mgrid[6540:6590:.01]* u.Angstrom\n", | ||
"\n", | ||
"sim = run_stardis('Tutorial_data/stardis_config_parallel.yml', tracing_lambdas)" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"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.11.5" | ||
}, | ||
"orig_nbformat": 4 | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
74 changes: 74 additions & 0 deletions
74
docs/Tutorials/Tutorial_data/h_minus_cross_section_wbr.dat
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,74 @@ | ||
180.0,6.700000000000001e-20 | ||
196.0,8.800000000000002e-20 | ||
214.0,1.17e-19 | ||
236.0,1.5500000000000002e-19 | ||
264.0,2.06e-19 | ||
298.0,2.8300000000000005e-19 | ||
343.0,4.14e-19 | ||
404.0,7.03e-19 | ||
491.0,1.2400000000000001e-18 | ||
626.0,2.3300000000000003e-18 | ||
1210.0,5.43e-18 | ||
1390.0,5.910000000000001e-18 | ||
1640.0,7.29e-18 | ||
1750.0,7.917999999999999e-18 | ||
2000.0,9.453e-18 | ||
2250.0,1.1080000000000001e-17 | ||
2500.0,1.275e-17 | ||
2750.0,1.4460000000000002e-17 | ||
3000.0,1.619e-17 | ||
3250.0,1.7920000000000003e-17 | ||
3500.0,1.965e-17 | ||
3750.0,2.1350000000000004e-17 | ||
4000.0,2.3020000000000002e-17 | ||
4250.0,2.465e-17 | ||
4500.0,2.624e-17 | ||
4750.0,2.777e-17 | ||
5000.0,2.923e-17 | ||
5250.0,3.0620000000000005e-17 | ||
5500.0,3.194e-17 | ||
5750.0,3.3170000000000005e-17 | ||
6000.0,3.432e-17 | ||
6250.0,3.537e-17 | ||
6500.0,3.6320000000000004e-17 | ||
6750.0,3.717e-17 | ||
7000.0,3.7909999999999996e-17 | ||
7250.0,3.854e-17 | ||
7500.0,3.9070000000000005e-17 | ||
7750.0,3.948e-17 | ||
8000.0,3.9770000000000003e-17 | ||
8250.0,3.995000000000001e-17 | ||
8500.0,4.001e-17 | ||
8750.0,3.995000000000001e-17 | ||
9000.0,3.9770000000000003e-17 | ||
9250.0,3.948e-17 | ||
9500.0,3.9060000000000006e-17 | ||
9750.0,3.8530000000000007e-17 | ||
10000.0,3.7890000000000004e-17 | ||
10250.0,3.7130000000000005e-17 | ||
10500.0,3.6250000000000004e-17 | ||
10750.0,3.5280000000000003e-17 | ||
11000.0,3.419e-17 | ||
11250.0,3.301e-17 | ||
11500.0,3.172e-17 | ||
11750.0,3.0340000000000003e-17 | ||
12000.0,2.887e-17 | ||
12250.0,2.7330000000000002e-17 | ||
12500.0,2.5710000000000003e-17 | ||
12750.0,2.402e-17 | ||
13000.0,2.2260000000000003e-17 | ||
13250.0,2.0460000000000004e-17 | ||
13500.0,1.862e-17 | ||
13750.0,1.674e-17 | ||
14000.0,1.485e-17 | ||
14250.0,1.295e-17 | ||
14500.0,1.107e-17 | ||
14750.0,9.211000000000001e-18 | ||
15000.0,7.407e-18 | ||
15250.0,5.677000000000001e-18 | ||
15500.0,4.052e-18 | ||
15750.0,2.5750000000000006e-18 | ||
16000.0,1.3019999999999999e-18 | ||
16100.0,8.697e-19 | ||
16200.0,4.974e-19 | ||
16300.0,1.989e-19 |
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,24 @@ | ||
stardis_config_version: 1.0 | ||
n_threads: 1 | ||
atom_data: kurucz_cd23_chianti_H_He.h5 | ||
|
||
model: | ||
fname: Tutorial_data/end_core_h_burn.mod | ||
type: mesa | ||
truncate_to_shell: 40 | ||
final_atomic_number: 30 | ||
|
||
opacity: | ||
file: | ||
Hminus_bf: Tutorial_data/h_minus_cross_section_wbr.dat | ||
bf: | ||
H_I: {} | ||
ff: | ||
H_I: {} | ||
disable_electron_scattering: False | ||
line: | ||
disable: False | ||
broadening: [radiation, linear_stark, quadratic_stark, van_der_waals] | ||
min: 6500 AA | ||
max: 6600 AA | ||
no_of_thetas: 20 |
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,24 @@ | ||
stardis_config_version: 1.0 | ||
n_threads: 1 | ||
atom_data: kurucz_cd23_chianti_H_He.h5 | ||
|
||
model: | ||
fname: Tutorial_data/end_core_h_burn.mod | ||
type: mesa | ||
truncate_to_shell: 40 | ||
final_atomic_number: 30 | ||
|
||
opacity: | ||
file: | ||
Hminus_bf: ../../stardis/data/h2_plus_bf_S1994.dat | ||
bf: | ||
H_I: {} | ||
ff: | ||
H_I: {} | ||
disable_electron_scattering: False | ||
line: | ||
disable: False | ||
broadening: [radiation, linear_stark, quadratic_stark, van_der_waals] | ||
min: 6500 AA | ||
max: 6600 AA | ||
no_of_thetas: 20 |
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,22 @@ | ||
stardis_config_version: 1.0 | ||
n_threads: 4 | ||
atom_data: kurucz_cd23_chianti_H_He.h5 | ||
|
||
model: | ||
type: marcs | ||
fname: Tutorial_data/sun.mod | ||
final_atomic_number: 30 | ||
opacity: | ||
file: | ||
Hminus_bf: Tutorial_data/h_minus_cross_section_wbr.dat | ||
bf: | ||
H_I: {} | ||
ff: | ||
H_I: {} | ||
disable_electron_scattering: False | ||
line: | ||
disable: False | ||
broadening: [radiation, linear_stark, quadratic_stark, van_der_waals] | ||
min: 6500 AA | ||
max: 6600 AA | ||
no_of_thetas: 20 |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file shouldn't really be added. I don't dislike the idea of a tutorial_data directory, but we should not duplicate data. You can point the h_minus_cross_section file to the existing data directory in the main stardis directory, and the docs already has a sun.mod file that can be pointed to as well.
Also, I would not really call the config files "data." Rather, maybe it's better structure to have the mesa_model be its own directory with both the notebook and the .yml file needed, and similar for the parallel stardis notebook.