Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading