Skip to content

Commit

Permalink
altered stars to accept list of quantities
Browse files Browse the repository at this point in the history
  • Loading branch information
astronomyk committed Mar 31, 2021
1 parent 4a34e5c commit 95883b2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scopesim_templates/basic/stars.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def stars(filter_name, amplitudes, spec_types, x, y):
filter_name : str
For scaling the stars. Use either common names or Spanish-VO identifiers
amplitudes : list of Quanitity, float
[mag, Jy] amplitudes for the list of stars. Acceptable astropy.units:
[mag, ABmag, Jy] amplitudes for the list of stars. Acceptable astropy.units:
[u.mag, u.ABmag, u.Janksy]. If no units are given, Vega magnitudes are
assumed
spec_types : list of strings
Expand Down Expand Up @@ -200,15 +200,17 @@ def stars(filter_name, amplitudes, spec_types, x, y):
"x": x,
"y": y,
"object": "stars"}
pass

params["function_call"] = function_call_str(star_grid, params)
params["object"] = "stars"

if not isinstance(spec_types, (list, tuple, np.ndarray)):
spec_types = [spec_types]

if not isinstance(amplitudes, u.Quantity):
amplitudes = u.Quantity(amplitudes, u.mag, copy=False)
amplitudes = u.Quantity(amplitudes, copy=False)
if amplitudes.unit == u.dimensionless_unscaled:
amplitudes *= u.mag

if not isinstance(x, u.Quantity):
x = u.Quantity(x, u.arcsec, copy=False)
Expand Down

0 comments on commit 95883b2

Please sign in to comment.