Skip to content

Commit

Permalink
Update misc.py
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeshingles committed Jan 7, 2025
1 parent 9c791f2 commit 83c98bc
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions artistools/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from typeguard import typechecked

from artistools.configuration import get_config
from artistools.inputmodel import get_modeldata

roman_numerals = (
"",
Expand Down Expand Up @@ -291,9 +292,8 @@ def get_wid_init_at_tmodel(
if ngridpoints is None or t_model_days is None or xmax is None:
# Luke: ngridpoint only equals the number of model cells if the model is 3D
assert modelpath is not None
from artistools.inputmodel import get_modeldata_pandas

_, modelmeta = get_modeldata_pandas(modelpath, getheadersonly=True)
_, modelmeta = get_modeldata(modelpath, getheadersonly=True)
assert modelmeta["dimensions"] == 3
ngridpoints = modelmeta["npts_model"]
xmax = modelmeta["vmax_cmps"] * modelmeta["t_model_init_days"] * 86400.0
Expand Down Expand Up @@ -549,9 +549,8 @@ def get_timestep_time(modelpath: Path | str, timestep: int) -> float:
def get_escaped_arrivalrange(modelpath: Path | str) -> tuple[int, float | None, float | None]:
"""Return the time range for which the entire model can send light signals the observer."""
modelpath = Path(modelpath)
from artistools.inputmodel import get_modeldata_pandas

_, modelmeta = get_modeldata_pandas(modelpath, printwarningsonly=True, getheadersonly=True)
_, modelmeta = get_modeldata(modelpath, printwarningsonly=True, getheadersonly=True)
vmax = modelmeta["vmax_cmps"]
cornervmax = math.sqrt(3 * vmax**2)

Expand Down

0 comments on commit 83c98bc

Please sign in to comment.