Skip to content

Commit

Permalink
Merge 9700cef into fe70c29
Browse files Browse the repository at this point in the history
  • Loading branch information
ssim committed Apr 13, 2014
2 parents fe70c29 + 9700cef commit ebcf0b0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Bugfixes
- logger statement added for coronal approximation
- warning added to documentation since plasma is out of date (temp
solution only) #108
- warning added for density file readin outside tabulated range

New Features
^^^^^^^^^^^^
Expand Down
8 changes: 7 additions & 1 deletion tardis/io/model_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
import pandas as pd
from astropy import units as u

import logging
# Adding logging support
logger = logging.getLogger(__name__)

from tardis.util import parse_quantity

Expand Down Expand Up @@ -37,7 +40,7 @@ def read_density_file(density_filename, density_filetype, time_explosion, v_inne

if v_inner_boundary > v_outer_boundary:
raise ConfigurationError('v_inner_boundary > v_outer_boundary ({0:s} > {1:s}). unphysical!'.format(v_inner_boundary, v_outer_boundary))

if not np.isclose(v_inner_boundary, 0.0) and v_inner_boundary > v_inner[0]:

if v_inner_boundary > v_outer[-1]:
Expand All @@ -48,13 +51,16 @@ def read_density_file(density_filename, density_filetype, time_explosion, v_inne
else:
inner_boundary_index = None
v_inner_boundary = v_inner[0]
logger.warning("v_inner_boundary requested too small for readin file. Boundary shifted to match file.")

if not np.isinf(v_outer_boundary) and v_outer_boundary < v_outer[-1]:
outer_boundary_index = v_outer.searchsorted(v_outer_boundary) + 1
else:
outer_boundary_index = None
v_outer_boundary = v_outer[-1]
logger.warning("v_outer_boundary requested too large for readin file. Boundary shifted to match file.")


v_inner = v_inner[inner_boundary_index:outer_boundary_index]
v_inner[0] = v_inner_boundary

Expand Down

0 comments on commit ebcf0b0

Please sign in to comment.