Skip to content

Commit

Permalink
Thomson cross section: Continuation of PR #688 (#863)
Browse files Browse the repository at this point in the history
* Use sigma_T from astropy constants instead of hardcoding it, also fixing its unit.

* Use sigma_T constant in test_cmontecarlo instead of a hardcoded value.

* Change refdata branch

* Update .travis.yml
  • Loading branch information
unoebauer authored and wkerzendorf committed Aug 19, 2018
1 parent 22cdfbe commit 41d3c8f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ before_install:
- if [[ $TEST_MODE == 'spectrum' ]]; then git fetch origin; fi
- if [[ $TEST_MODE == 'spectrum' ]]; then git checkout origin/master; fi
# Use the following to get the ref-data from a specific pull request;
# - if [[ $TEST_MODE == 'spectrum' ]]; then git fetch origin pull/10/head:formalintegral-ref; fi
# - if [[ $TEST_MODE == 'spectrum' ]]; then git checkout formalintegral-ref; fi
# - if [[ $TEST_MODE == 'spectrum' ]]; then git fetch origin pull/11/head:thomson-ref; fi
# - if [[ $TEST_MODE == 'spectrum' ]]; then git checkout thomson-ref; fi
- if [[ $TEST_MODE == 'spectrum' ]]; then git lfs pull --include="atom_data/kurucz_cd23_chianti_H_He.h5" origin; fi
- if [[ $TEST_MODE == 'spectrum' ]]; then git lfs pull --include="atom_data/chianti_He.h5" origin; fi
- if [[ $TEST_MODE == 'spectrum' ]]; then git lfs pull --include="plasma_reference/" origin; fi
Expand Down
4 changes: 2 additions & 2 deletions tardis/montecarlo/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,10 +391,10 @@ def from_config(cls, config):
"""
if config.plasma.disable_electron_scattering:
logger.warn('Disabling electron scattering - this is not physical')
sigma_thomson = 1e-200 / (u.cm ** 2)
sigma_thomson = 1e-200 * (u.cm ** 2)
else:
logger.debug("Electron scattering switched on")
sigma_thomson = 6.652486e-25 / (u.cm ** 2)
sigma_thomson = const.sigma_T.cgs

spectrum_frequency = quantity_linspace(
config.spectrum.stop.to('Hz', u.spectral()),
Expand Down
1 change: 1 addition & 0 deletions tardis/montecarlo/tests/test_cmontecarlo.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import pytest
import numpy as np
import pandas as pd
from astropy import constants as const
from ctypes import (
CDLL,
byref,
Expand Down

0 comments on commit 41d3c8f

Please sign in to comment.