Skip to content

Commit

Permalink
Merge pull request #7 from jlibermann/Readme+Build
Browse files Browse the repository at this point in the history
Updates README + build files
  • Loading branch information
joshua-liberman authored Jul 14, 2023
2 parents a97f2e1 + 8873208 commit a7cd046
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 10 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# reflected-light-sim
Calculates reflected light from a planet given a stellar PHOENIX model and planet albedo (developed as part of the 2023 CodeAstro workshop).\
![Code Astro](https://img.shields.io/badge/Made%20at-Code/Astro-blueviolet.svg)
[![Documentation Status](https://readthedocs.org/projects/reflected-light-sim/badge/?version=latest)](http://reflected-light-sim.readthedocs.io/en/latest/?badge=latest)
[![PyPI version](https://badge.fury.io/py/reflected-light-sim.svg)](https://badge.fury.io/py/reflected-light-sim)
[![PyPI downloads](https://img.shields.io/pypi/dm/reflected-light-sim.svg)](https://pypistats.org/packages/reflected-light-sim)

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.8147781.svg)](https://doi.org/10.5281/zenodo.8147781)
[![License](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
## Simulation Flowchart
![Flowchart](https://github.com/jlibermann/reflected-light-sim/blob/add-the-docs/codeastroflowchart.png)
![Flowchart](codeastroflowchart.png)
2 changes: 1 addition & 1 deletion build/lib/reflected_light_sim/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.1"
__version__ = "0.1.1"
36 changes: 30 additions & 6 deletions build/lib/reflected_light_sim/reflectance.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,21 @@ def __init__(self, wvs, spectrum, R):


def load_phoenix_model(lambda_start, lambda_end,steff,path=None):
'''
Read in a phoenix spectrum
'''
"""Load a PHOENIX Stellar Model
Loads a stellar PHOENIX model given a starting + ending wavelength, an effective temperature, and a path to the model.
Args:
lambda_start (int): Starting wavelength value
lambda_end (int): Ending wavelength value
steff (int): Stellar effective temperature
path (str, optional): Path to the PHOENIX model directory. Defaults to None.
Returns:
lam (array) : The wavelength array from the PHOENIX model.
spec (array): The flux array from the PHOENIX model.
"""

# Prompt the user to specify a path if none is given
if path is None:
Expand All @@ -61,9 +73,21 @@ def load_phoenix_model(lambda_start, lambda_end,steff,path=None):
return lam[isub]/10.0,spec[isub] * 10 * 100**2 #nm, phot/m2/s/nm

def cal_refflux_pl(d_star_earth,host_spec,r_star,r_planet,a_planet, albedo,wvl):
'''
Calculation about reflected flux from planet
'''
"""Calculate the reflected flux from a planet.
Args:
d_star_earth (int): Star-Earth distance (parsecs)
host_spec (array): Flux array from host star model.
r_star (int): Stellar radius ($R_{\odot}$)
r_planet (int): Planet radius ($R_{Jup})
a_planet (int): Planet semi-major axis (AU)
albedo (float): Planet albedo.
wvl (array): Wavelength array from host star model.
Returns:
flux_planet_ph (array): An array of reflected planet fluxes.
"""
wvl *= u.nm
ph_energy = ((cons.h * cons.c / (wvl) ) /u.ph).to(u.J / u.ph)

Expand Down
Binary file removed dist/reflected_light_sim-0.1-py3-none-any.whl
Binary file not shown.
Binary file added dist/reflected_light_sim-0.1.1-py3-none-any.whl
Binary file not shown.
Binary file added dist/reflected_light_sim-0.1.1.tar.gz
Binary file not shown.
Binary file removed dist/reflected_light_sim-0.1.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion reflected_light_sim.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: reflected-light-sim
Version: 0.1
Version: 0.1.1
Summary: reflected-light-sim: a simulator for reflected light of planet
Home-page: https://github.com/jlibermann/reflected-light-sim/tree/main
Author: Josh+Huihao
Expand Down
2 changes: 1 addition & 1 deletion reflected_light_sim/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.1"
__version__ = "0.1.1"

0 comments on commit a7cd046

Please sign in to comment.