Skip to content

Commit

Permalink
fixing doc build issues
Browse files Browse the repository at this point in the history
  • Loading branch information
karllark committed Jan 26, 2022
1 parent c5c0f2b commit 49ce307
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 23 deletions.
22 changes: 10 additions & 12 deletions docs/calc_extinction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -244,19 +244,17 @@ exists.
.. plot::

import pkg_resources

import numpy as np
import matplotlib.pyplot as plt

from measure_extinction.stardata import StarData
from measure_extinction.extdata import ExtData

# get the location of the data files
data_path = pkg_resources.resource_filename('measure_extinction',
'data/')
data_path = pkg_resources.resource_filename("measure_extinction", "data/")

# read in the observed data on the star
redstar = StarData('hd229238.dat', path=data_path)
compstar = StarData('hd204172.dat', path=data_path)
redstar = StarData("hd229238.dat", path=data_path)
compstar = StarData("hd204172.dat", path=data_path)

# calculate the extinction curve
extdata = ExtData()
Expand All @@ -272,12 +270,12 @@ exists.
extdata.plot(ax)

# finish configuring the plot
ax.set_title('HD229238/HD204172 extinction')
ax.set_xscale('log')
ax.set_xlabel('$\lambda$ [$\mu m$]')
ax.set_ylabel('$E(\lambda - V)/E(B-V)$')
ax.tick_params('both', length=10, width=2, which='major')
ax.tick_params('both', length=5, width=1, which='minor')
ax.set_title("HD229238/HD204172 extinction")
ax.set_xscale("log")
ax.set_xlabel(r"$\lambda$ [$\mu m$]")
ax.set_ylabel(r"$E(\lambda - V)/E(B-V)$")
ax.tick_params("both", length=10, width=2, which="major")
ax.tick_params("both", length=5, width=1, which="minor")

# use the whitespace better
fig.tight_layout()
Expand Down
15 changes: 4 additions & 11 deletions measure_extinction/extdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,9 +536,6 @@ def calc_AV_JHK(self):
- extrapolate from J, H, & K photometry
- assumes functional form from Rieke, Rieke, & Paul (1989)
Parameters
----------
Returns
-------
Updates self.columns["AV"]
Expand Down Expand Up @@ -575,9 +572,6 @@ def calc_RV(self):
"""
Calculate R(V) from the observed extinction curve
Parameters
----------
Returns
-------
Updates self.columns["RV"]
Expand Down Expand Up @@ -628,8 +622,10 @@ def trans_elv_elvebv(self, ebv=None):
fullebv = _get_column_plus_unc(ebv)

for curname in self.exts.keys():
self.uncs[curname] = (self.exts[curname] / fullebv[0]) * np.sqrt(
np.square(self.uncs[curname] / self.exts[curname])
# only compute where there is data and exts is not zero
gvals = (self.exts[curname] != 0) & (self.npts[curname] > 0)
self.uncs[curname][gvals] = (self.exts[curname][gvals] / fullebv[0]) * np.sqrt(
np.square(self.uncs[curname][gvals] / self.exts[curname][gvals])
+ np.square(fullebv[1] / fullebv[0])
)
self.exts[curname] /= fullebv[0]
Expand Down Expand Up @@ -1445,9 +1441,6 @@ def fit_band_ext(self):
"""
Fit the observed NIR extinction curve with a powerlaw model, based on the band data between 1 and 40 micron
Parameters
----------
Returns
-------
Updates self.model["waves", "exts", "residuals", "params"] and self.columns["AV"] with the fitting results:
Expand Down

0 comments on commit 49ce307

Please sign in to comment.