Skip to content
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

Bug t radiative #2560

Merged
merged 15 commits into from
May 10, 2024
Merged
6 changes: 3 additions & 3 deletions docs/physics/setup/model.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -485,13 +485,13 @@
"\n",
"$$T=\\frac{b}{\\lambda_\\mathrm{peak}}.$$\n",
"\n",
"Since we know $T_\\mathrm{inner}$ (from the previous calculation), at the photosphere, we have $\\lambda_\\mathrm{peak,inner}=\\frac{b}{T_\\mathrm{inner}}$. Now, when the ejecta is moving at a velocity $v$, $\\lambda_\\mathrm{peak}$ is doppler shifted (in more technical language, we find the peak wavelength in the co-moving frame, see [reference frames](../montecarlo/propagation.rst#reference-frames)). The doppler factor is (approximately) $1-\\frac{\\Delta v}{c}$ where $\\Delta v$ is the difference between $v$ and the velocity at the photosphere (i.e. $\\Delta v = v-v_\\mathrm{boundary\\_inner}$). So,\n",
"Since we know $T_\\mathrm{inner}$ (from the previous calculation), at the photosphere, we have $\\lambda_\\mathrm{peak,inner}=\\frac{b}{T_\\mathrm{inner}}$. Now, when the ejecta is moving at a velocity $v$, $\\lambda_\\mathrm{peak}$ is doppler shifted (in more technical language, we find the peak wavelength in the co-moving frame, see [reference frames](../montecarlo/propagation.rst#reference-frames)). The doppler factor is (approximately) $1+\\frac{\\Delta v}{c}$ where $\\Delta v$ is the difference between $v$ and the velocity at the photosphere (i.e. $\\Delta v = v-v_\\mathrm{boundary\\_inner}$). So,\n",
"\n",
"$$\\lambda_\\mathrm{peak}(v)=\\left(1-\\frac{v-v_\\mathrm{boundary\\_inner}}{c}\\right)\\lambda_\\mathrm{peak,inner}=\\left(1-\\frac{v-v_\\mathrm{boundary\\_inner}}{c}\\right)\\frac{b}{T_\\mathrm{inner}}.$$\n",
"$$\\lambda_\\mathrm{peak}(v)=\\left(1+\\frac{v-v_\\mathrm{boundary\\_inner}}{c}\\right)\\lambda_\\mathrm{peak,inner}=\\left(1+\\frac{v-v_\\mathrm{boundary\\_inner}}{c}\\right)\\frac{b}{T_\\mathrm{inner}}.$$\n",
"\n",
"Thus, the temperature at a velocity $v$ is\n",
"\n",
"$$T_\\mathrm{rad}(v)=\\frac{b}{\\lambda_\\mathrm{peak}(v)}=\\frac{T_\\mathrm{inner}}{1-\\frac{v-v_\\mathrm{boundary\\_inner}}{c}}.$$\n",
"$$T_\\mathrm{rad}(v)=\\frac{b}{\\lambda_\\mathrm{peak}(v)}=\\frac{T_\\mathrm{inner}}{1+\\frac{v-v_\\mathrm{boundary\\_inner}}{c}}.$$\n",
"\n",
"As with density, the radiative temperature is modeled as constant throughout the shell, so we determine the temperature of the shell based on the ejecta's velocity at the center of the shell.\n",
"\n",
Expand Down
4 changes: 2 additions & 2 deletions tardis/model/geometry/radial1d.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ class HomologousRadial1DGeometry:

Parameters
----------
r_inner : astropy.units.quantity.Quantity
r_outer : astropy.units.quantity.Quantity
v_inner : astropy.units.quantity.Quantity
v_outer : astropy.units.quantity.Quantity
v_inner_boundary : astropy.units.quantity.Quantity
v_outer_boundary : astropy.units.quantity.Quantity

Attributes
----------
Expand Down
44 changes: 4 additions & 40 deletions tardis/model/parse_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,42 +33,6 @@ def parse_structure_config(config, time_explosion, enable_homology=True):
"""
Parse the structure configuration data.

Parameters
----------
config : object
The configuration data.
time_explosion : float
The time of the explosion.
enable_homology : bool, optional
Whether to enable homology (default is True).

Returns
-------
electron_densities : object
The parsed electron densities.
temperature : object
The parsed temperature.
geometry : object
The parsed geometry.
density : object
The parsed density.

Raises
------
NotImplementedError
If the structure configuration type is not supported.

Notes
-----
This function parses the structure configuration data and returns the parsed electron
densities, temperature, geometry, and density. The structure configuration can be of
type 'specific' or 'file'. If it is of type 'specific', the velocity and density are
parsed from the configuration. If it is of type 'file', the velocity and density are
read from a file. The parsed data is used to create a homologous radial 1D geometry object.
"""
"""
Parse the structure configuration data.

DeerWhale marked this conversation as resolved.
Show resolved Hide resolved
Parameters
----------
config : object
Expand Down Expand Up @@ -145,8 +109,8 @@ def parse_structure_config(config, time_explosion, enable_homology=True):
)
density = density[1:]
geometry = HomologousRadial1DGeometry(
velocity[:-1], # r_inner
velocity[1:], # r_outer
velocity[:-1], # v_inner
velocity[1:], # v_outer
v_inner_boundary=structure_config.get("v_inner_boundary", None),
v_outer_boundary=structure_config.get("v_outer_boundary", None),
time_explosion=time_explosion,
Expand Down Expand Up @@ -217,8 +181,8 @@ def parse_csvy_geometry(
velocity = velocity.to("cm/s")

geometry = HomologousRadial1DGeometry(
velocity[:-1], # r_inner
velocity[1:], # r_outer
velocity[:-1], # v_inner
velocity[1:], # v_outer
v_inner_boundary=v_boundary_inner,
v_outer_boundary=v_boundary_outer,
time_explosion=time_explosion,
Expand Down
Loading