Skip to content

Commit

Permalink
Min planck temperature
Browse files Browse the repository at this point in the history
  • Loading branch information
nichollsh committed Oct 21, 2024
1 parent f3b25d8 commit 3d7be38
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/proteus/star/dummy.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

log = logging.getLogger("fwl."+__name__)

PLANCK_MIN_TEMPERATURE:float = 0.1

def generate_spectrum(tmp:float, R_star:float):
'''
Get stellar spectrum at 1 AU, assuming that the star emits like a blackbody.
Expand Down Expand Up @@ -43,7 +45,7 @@ def generate_spectrum(tmp:float, R_star:float):
# If Teff=0, keep fluxes at zero. This is equivalent to turning the star 'off'.

# Else, for non-zero effective temperatures...
if tmp > 0.1:
if tmp > PLANCK_MIN_TEMPERATURE:

# Evaluate planck function in each bin
for i,wav in enumerate(wl_arr):
Expand All @@ -70,7 +72,13 @@ def calc_star_luminosity(tmp:float, R_star:float):
Assumes that the star emits like a blackbody.
'''
return 4 * np.pi * R_star * R_star * const_sigma * (tmp**4)

# Evaluate stefan-boltzmann law at Teff
lum = 0.0
if tmp > PLANCK_MIN_TEMPERATURE:
lum = 4 * np.pi * R_star * R_star * const_sigma * (tmp**4)

return lum


def calc_instellation(tmp:float, R_star:float, sep:float):
Expand Down

0 comments on commit 3d7be38

Please sign in to comment.