Skip to content

Commit

Permalink
Pass kwargs from star_field() to stars() (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
teutoburg authored Nov 26, 2024
2 parents 2dfb7cd + 58ef400 commit c59a987
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scopesim_templates/stellar/stars.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def star_field(n, mmin, mmax, width, height=None, filter_name="V",
mmin, mmax = u.Quantity(mmin, u.mag), u.Quantity(mmax, u.mag)

if "x" in kwargs and "y" in kwargs:
x, y = kwargs["x"], kwargs["y"]
x, y = kwargs.pop("x"), kwargs.pop("y")
else:
rands = np.random.random(size=(2, n)) - 0.5
x, y = width * rands[0], height * rands[1]
Expand All @@ -88,7 +88,7 @@ def star_field(n, mmin, mmax, width, height=None, filter_name="V",
spec_types = ["A0V"] * n

src = stars(filter_name=filter_name, amplitudes=amplitudes,
spec_types=spec_types, x=x, y=y, ra=ra, dec=dec)
spec_types=spec_types, x=x, y=y, ra=ra, dec=dec, **kwargs)
src.meta["scaling_unit"] = mmin.unit
src.meta.update(params)

Expand Down Expand Up @@ -244,6 +244,8 @@ def stars(filter_name, amplitudes, spec_types, x, y, library="pyckles",
spectra = [Spextrum(library + "/" + spec.lower()).scale_to_magnitude(
amp, filter_curve=filter_name)
for spec, amp in zip(spec_types, amplitudes)]
# TODO: actually use weights here instead of spectra scaling to avoid
# O(n) scaling for number of spectra...
weight = np.ones(shape=amplitudes.shape)

# get the references to the unique stellar types
Expand Down

0 comments on commit c59a987

Please sign in to comment.