Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into add_individual_inte…
Browse files Browse the repository at this point in the history
…nsities
  • Loading branch information
jvshields committed Dec 18, 2024
2 parents 5fbf7c3 + 1e7fbaa commit 8d8984c
Show file tree
Hide file tree
Showing 18 changed files with 478 additions and 284 deletions.
1 change: 0 additions & 1 deletion benchmarks/benchmark_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@ opacity:
line:
disable: False
broadening: [radiation, linear_stark, quadratic_stark, van_der_waals]
broadening_range: 3 AA
no_of_thetas: 20
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Custom Star Model"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -12,7 +19,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Using MARCS to get .mod files\n",
"## Using MARCS to get .mod files\n",
"\n",
"STARDIS uses files from the [MARCS site](https://marcs.oreme.org/), which \"contains about 52,000 stellar atmospheric models of spectral types F, G and K\". Here we will only be discussing the aspects of MARCS needed for STARDIS. To get started, [go to the 'Search Marcs' tab of the MARCS site](https://marcs.oreme.org/data/)"
]
Expand Down Expand Up @@ -89,7 +96,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"#### One last thing: gzipped files\n",
"## gzipped files\n",
"\n",
"when you download a mod file from MARCS, it will be gzipped (shown by the file ending with '.mod.gz'). By default STARDIS will assume you have extracted the file, however you can add a line to the yaml file 'gzipped: True' as shown below and STARDIS will take care of this for you.\n",
"\n",
Expand All @@ -104,6 +111,11 @@
"\n",
"```"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
}
],
"metadata": {
Expand Down
9 changes: 8 additions & 1 deletion docs/Custom_atomic_data/Custom_atomic_data.ipynb
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Custom Atomic Data"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -53,7 +60,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Using VALD linelists\n",
"## Using VALD linelists\n",
"\n",
"Possibly one of the most important reasons you would want to use a custom atomic data file would be to take advantage of a tailored VALD linelist. You can refer to [VALD's documentation](https://www.astro.uu.se/valdwiki) for information on these lists if you are unfamiliar. To create a detailed and accurate stellar spectrum, we highly recommend looking into using a VALD linelist bundled into your atomic data."
]
Expand Down
15 changes: 10 additions & 5 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,24 @@ This is the documentation for STARDIS.

.. toctree::
:maxdepth: 2
:caption: Contents:

Quickstart <quickstart/quickstart>
Downloading and Installation <installation>
Quickstart <quickstart/quickstart>
Physics of STARDIS <physics/physics_of_stardis>
Contributing <contributing>
Bibliography <bibliography>

.. toctree::
:maxdepth: 2
:caption: Example Notebooks

Custom Atomic Data <Custom_atomic_data/Custom_atomic_data>
Possible STARDIS Outputs <possible_stardis_outputs/possible_stardis_outputs>
Custom Star Model <Custom_Star_Model_with_Marcs/Custom_Star_Model_with_Marcs>
Using STARDIS in Parallel <using_stardis_in_parallel/stardis_in_parallel>
Changing Parameters <Changing_Parameters/Changing_Parameters>
Example Notebooks <example_notebooks/rotation_broadening>
Contributing <contributing>
Bibliography <bibliography>
Rotation Broadening <rotation_broadening/rotation_broadening>


Indices and tables
==================
Expand Down
18 changes: 10 additions & 8 deletions docs/possible_stardis_outputs/possible_stardis_outputs.ipynb
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Possible STARDIS Outputs"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -25,13 +32,15 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"#### STARDIS simulations contain a variety of information, and depending on your needs you can have different parts of a simulation returned."
"## Selecting Result Options"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"STARDIS simulations contain a variety of information, and depending on your needs you can have different parts of a simulation returned.\n",
"\n",
"There are three parts of the simulation you can choose to return:\n",
"- Stellar_Model\n",
"- Stellar_Plasma\n",
Expand All @@ -40,13 +49,6 @@
"Regardless of which are set to return, the simulation will always produce the stellar spectrum (such as the one displayed in the quickstart notebook)."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Selecting Result Options"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down
1 change: 0 additions & 1 deletion docs/quickstart/quickstart.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@
" line: # settings for line interaction opacity, at least one subfield is required\n",
" disable: <True or False>\n",
" broadening: <list of non-thermal broadening sources considered> # may include radiation, linear_stark, quadratic_stark, and/or van_der_waals, omit or use [] for none\n",
" broadening_range: <maximum distance in frquency space to the resonant frequency for line broadening to be considered> # necessary for computational efficiency and must have units, 1e13 Hz recommended\n",
"no_of_thetas: <number of angles to sample for raytracing>\n",
"```\n",
"\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# STARDIS"
"# Rotation Broadening"
]
},
{
Expand Down Expand Up @@ -92,7 +92,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### STARDIS contains a post-simulation function to broaden the spectrum appropriate for a v sin(i) given by the user. However, this is only physically valid when the spectrum broadened is given over a small range of frequencies or wavelengths, or is constant in velocity resolution across the spectrum. \n",
"STARDIS contains a post-simulation function to broaden the spectrum appropriate for a v sin(i) given by the user. However, this is only physically valid when the spectrum broadened is given over a small range of frequencies or wavelengths, or is constant in velocity resolution across the spectrum. \n",
"\n",
"First, let's run a small, simple STARDIS simulation with a spectral resolution $R \\sim 100000$"
]
Expand Down
2 changes: 1 addition & 1 deletion docs/using_stardis_in_parallel/stardis_in_parallel.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Setting number of threads used in running a STARDIS simulation"
"# Using STARDIS in Parallel"
]
},
{
Expand Down
11 changes: 5 additions & 6 deletions stardis/config_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,6 @@ properties:
type: boolean
default: false
description: Whether to disable microturbulence.
broadening_range:
type: [quantity, "null"]
default: null
description: How far away to look for lines at any given wavelength or frequency. Must be in frequency or wavelength units. Does not apply to hydrogen.
vald_linelist:
type: object
default: {}
Expand All @@ -129,6 +125,9 @@ properties:
shortlist:
type: boolean
default: false
use_vald_broadening:
type: boolean
default: true
description: Options for whether to use a vald linelist. Linelist must be included the atom_data and cannot be supplied separately.
include_molecules:
type: boolean
Expand All @@ -154,8 +153,8 @@ properties:
default: false
return_radiation_field:
type: boolean
default: false
description: Options for what to return from the simulation. Note that return_radiation_field can be very memory intensive because it returns the intensity at every depth point, wavelength, and theta in the model.
default: true
description: Options for what to return from the simulation.
required:
- stardis_config_version
- atom_data
Expand Down
1 change: 0 additions & 1 deletion stardis/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ def example_stellar_radiation_field_parallel(
stellar_model=example_stellar_model,
stellar_radiation_field=stellar_radiation_field,
opacity_config=example_config_parallel.opacity,
n_threads=example_config_parallel.n_threads,
)

raytrace(
Expand Down
18 changes: 7 additions & 11 deletions stardis/plasma/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,9 @@ def calculate(
linelist["level_energy_upper"] = ((linelist["e_up"].values * u.eV).cgs).value

# Radiation broadening parameter is approximated as the einstein A coefficient. Vald parameters are in log scale.
linelist["A_ul"] = 10 ** (linelist["rad"]) / (
4 * np.pi
) # see 1995A&AS..112..525P for appropriate units - may be off by a factor of 4pi
linelist["A_ul"] = 10 ** (
linelist["rad"]
) # see 1995A&AS..112..525P for appropriate units

# Need to remove autoionization lines - can't handle with current broadening treatment because can't calculate effective principal quantum number
valid_indices = linelist.level_energy_upper < linelist.ionization_energy
Expand Down Expand Up @@ -449,14 +449,10 @@ def calculate(
linelist["level_energy_upper"] = ((linelist["e_up"].values * u.eV).cgs).value

# Radiation broadening parameter is approximated as the einstein A coefficient. Vald parameters are in log scale.
linelist["A_ul"] = 10 ** (linelist["rad"]) / (
4 * np.pi
) # see 1995A&AS..112..525P for appropriate units - may be off by a factor of 4pi

# Need to remove autoionization lines - can't handle with current broadening treatment because can't calculate effective principal quantum number
valid_indices = linelist.level_energy_upper < linelist.ionization_energy

return alphas[valid_indices], linelist[valid_indices]
linelist["A_ul"] = 10 ** (
linelist["rad"]
) # see 1995A&AS..112..525P for appropriate units
return alphas, linelist


# Properties that haven't been used in creating stellar plasma yet,
Expand Down
12 changes: 6 additions & 6 deletions stardis/plasma/molecules.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,9 @@ def calculate(
linelist["level_energy_upper"] = ((linelist["e_up"].values * u.eV).cgs).value

# Radiation broadening parameter is approximated as the einstein A coefficient. Vald parameters are in log scale.
linelist["A_ul"] = 10 ** (linelist["rad"]) / (
4 * np.pi
) # see 1995A&AS..112..525P for appropriate units - may be off by a factor of 4pi
linelist["A_ul"] = 10 ** (
linelist["rad"]
) # see 1995A&AS..112..525P for appropriate units

return alphas, linelist

Expand Down Expand Up @@ -414,8 +414,8 @@ def calculate(
linelist["level_energy_upper"] = ((linelist["e_up"].values * u.eV).cgs).value

# Radiation broadening parameter is approximated as the einstein A coefficient. Vald parameters are in log scale.
linelist["A_ul"] = 10 ** (linelist["rad"]) / (
4 * np.pi
) # see 1995A&AS..112..525P for appropriate units - may be off by a factor of 4pi
linelist["A_ul"] = 10 ** (
linelist["rad"]
) # see 1995A&AS..112..525P for appropriate units

return alphas, linelist
1 change: 0 additions & 1 deletion stardis/radiation_field/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ def create_stellar_radiation_field(tracing_nus, stellar_model, stellar_plasma, c
stellar_model=stellar_model,
stellar_radiation_field=stellar_radiation_field,
opacity_config=config.opacity,
n_threads=config.n_threads,
)
logger.info("Raytracing")
raytrace(
Expand Down
Loading

0 comments on commit 8d8984c

Please sign in to comment.