Circumstellar Habitable Zone Simulator:


Python compilers:
https://www.w3schools.com/python/trypython.asp?filename=demo_compiler
(Alternate) https://brython.info/tests/editor.html?lang=en
Python code:
https://www.w3schools.com/python/trypython.asp?filename=demo_compiler
(Alternate) https://brython.info/tests/editor.html?lang=en
Python code:
import datetime
import random
import numpy as np
# Current date and time
now = datetime.datetime.now()
print(now)
now_str = now.strftime("%Y%m%d%H%M%S")
# Generate random star spectral type and mass
star_data = np.array([["K5", 0.50, 0.196, 0.257], ["K0", 0.60, 0.265, 0.346], ["G8", 0.70, 0.366, 0.477], ["G6", 0.80, 0.500, 0.651], ["G3", 0.90, 0.665, 0.865], ["G0", 1.1, 1.08, 1.41], ["F8", 1.2, 1.33, 1.72], ["F5", 1.5, 2.21, 2.86], ["A7", 2.0, 4.06, 5.28]])
random_star = np.random.randint(9, size=1)
spectral_type = star_data[random_star[0],0]
star_mass = float(star_data[random_star[0],1])
inner_distance = float(star_data[random_star[0],2])
outer_distance = float(star_data[random_star[0],3])
# Generate random star name
catalogs = ["Kepler", "WASP", "TOI", "WISE", "HD", "GJ", "2MASS", "TESS"]
catalog = random.choice(catalogs)
number = int(float(now_str) / random.randint(1000000, 9999999))
star_name = f"{catalog}-{number}"
# Calculate randomized exoplanet orbital radius
orbital_distance = round(random.uniform(inner_distance, outer_distance),3)
# Output results
print(f"Here is your unique (potentially) habitable exoplanet!")
print(f"=====")
print(f"Star: {star_name}")
print(f"Star mass = {star_mass} solar masses")
print(f"{spectral_type} main-sequence star")
print(f"=====")
print(f"Exoplanet: {star_name} b")
print(f"Orbital distance = {orbital_distance:.3} AU")
import random
import numpy as np
# Current date and time
now = datetime.datetime.now()
print(now)
now_str = now.strftime("%Y%m%d%H%M%S")
# Generate random star spectral type and mass
star_data = np.array([["K5", 0.50, 0.196, 0.257], ["K0", 0.60, 0.265, 0.346], ["G8", 0.70, 0.366, 0.477], ["G6", 0.80, 0.500, 0.651], ["G3", 0.90, 0.665, 0.865], ["G0", 1.1, 1.08, 1.41], ["F8", 1.2, 1.33, 1.72], ["F5", 1.5, 2.21, 2.86], ["A7", 2.0, 4.06, 5.28]])
random_star = np.random.randint(9, size=1)
spectral_type = star_data[random_star[0],0]
star_mass = float(star_data[random_star[0],1])
inner_distance = float(star_data[random_star[0],2])
outer_distance = float(star_data[random_star[0],3])
# Generate random star name
catalogs = ["Kepler", "WASP", "TOI", "WISE", "HD", "GJ", "2MASS", "TESS"]
catalog = random.choice(catalogs)
number = int(float(now_str) / random.randint(1000000, 9999999))
star_name = f"{catalog}-{number}"
# Calculate randomized exoplanet orbital radius
orbital_distance = round(random.uniform(inner_distance, outer_distance),3)
# Output results
print(f"Here is your unique (potentially) habitable exoplanet!")
print(f"=====")
print(f"Star: {star_name}")
print(f"Star mass = {star_mass} solar masses")
print(f"{spectral_type} main-sequence star")
print(f"=====")
print(f"Exoplanet: {star_name} b")
print(f"Orbital distance = {orbital_distance:.3} AU")
Circumstellar Habitable Zone Simulator:







































































