Skip to content

Commit

Permalink
Let galsim simplify SED-with-magnitude calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
JoanneBogart committed Mar 4, 2024
1 parent 11793bd commit d02844d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
5 changes: 1 addition & 4 deletions skycatalogs/objects/sso_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,7 @@ def get_observer_sed_component(self, component, mjd=None):
raise ValueError(txt)

sed, magnorm = self._get_sed(mjd=mjd)

flux_500 = np.exp(-0.9210340371976184 * magnorm)
sed = sed.withMagnitude(0, self._bp500)
sed = sed*flux_500
sed = sed.withMagnitude(magnorm, self._bp500)

# no extinction
return sed
Expand Down
6 changes: 1 addition & 5 deletions skycatalogs/objects/star_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,7 @@ def get_gsobject_components(self, gsparams=None, rng=None):
def get_observer_sed_component(self, component, mjd=None):
sed, magnorm = self._get_sed(mjd=mjd)

# The SED is in units of photons/nm/cm^2/s
# -0.9210340371976184 = -np.log(10)/2.5. Use to convert mag to flux
flux_500 = np.exp(-0.9210340371976184 * magnorm)
sed = sed.withMagnitude(0, self._bp500)
sed = sed*flux_500
sed = sed.withMagnitude(magnorm, self._bp500)

if sed is not None:
sed = self._apply_component_extinction(sed)
Expand Down

0 comments on commit d02844d

Please sign in to comment.