Skip to content

Commit

Permalink
Subarr LTM and LTV default values changed to accomodate reference fil…
Browse files Browse the repository at this point in the history
…es with missing info
  • Loading branch information
pllim committed Sep 12, 2016
1 parent 1761c7f commit 18127bb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions acstools/utils_subarr.py
Expand Up @@ -216,20 +216,21 @@ def get_lt(hdr):
-------
ltm, ltv : tuple of float
``(LTM1_1, LTM2_2)`` and ``(LTV1, LTV2)``.
Values are `None` if not found.
Values are ``(1, 1)`` and ``(0, 0)`` if not found,
to accomodate reference files with missing info.
Raises
------
ValueError
Invalid LTM* values.
"""
ltm = (hdr.get('LTM1_1'), hdr.get('LTM2_2'))
ltm = (hdr.get('LTM1_1', 1.0), hdr.get('LTM2_2', 1.0))

if ltm[0] <= 0 or ltm[1] <= 0:
raise ValueError('(LTM1_1, LTM2_2) = {0} is invalid'.format(ltm))

ltv = (hdr.get('LTV1'), hdr.get('LTV2'))
ltv = (hdr.get('LTV1', 0.0), hdr.get('LTV2', 0.0))
return ltm, ltv


Expand Down

0 comments on commit 18127bb

Please sign in to comment.