Skip to content

Commit

Permalink
Merge pull request #333 from bd-j/line_names
Browse files Browse the repository at this point in the history
Add a check for emission line names in fsps cloudy table
  • Loading branch information
bd-j authored May 16, 2024
2 parents 7c1e179 + dc5c681 commit b3e5ae6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions prospect/models/sedmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,13 +406,17 @@ def parse_elines(self):
# unless some are explicitly fixed
lnames_to_fit = self.params.get('elines_to_fit', all_lines)
lnames_to_fix = self.params.get('elines_to_fix', np.array([]))
assert np.all(np.isin(lnames_to_fit, all_lines)), f"Some lines to fit ({lnames_to_fit})are not in the cloudy grid; see $SPS_HOME/data/emlines_info.dat for accepted names"
assert np.all(np.isin(lnames_to_fix, all_lines)), f"Some fixed lines ({lnames_to_fix}) are not in the cloudy grid; see $SPS_HOME/data/emlines_info.dat for accepted names"
self._fit_eline = np.isin(all_lines, lnames_to_fit) & ~np.isin(all_lines, lnames_to_fix)
else:
self._fit_eline = np.zeros(len(all_lines), dtype=bool)

self._fix_eline = ~self._fit_eline

if self.params.get("elines_to_ignore", []):
assert np.all(np.isin(self.params["elines_to_ignore"], self.emline_info["name"])), f"Some ignored lines lines ({self.params['elines_to_ignore']}) are not in the cloudy grid; see $SPS_HOME/data/emlines_info.dat for accepted names"

self._use_eline = ~np.isin(self.emline_info["name"],
self.params["elines_to_ignore"])

Expand Down

0 comments on commit b3e5ae6

Please sign in to comment.