Skip to content

Commit

Permalink
adding spectypenum
Browse files Browse the repository at this point in the history
  • Loading branch information
dsavransky committed Jun 4, 2024
1 parent 8f54aeb commit 6788335
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions MeanStars/MeanStars.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ class MeanStars:
Dictionary of roman numerals and their numerical values.
specdict (dict):
Dictionary mapping spectral classes to numerical values, with O = 0, and
Y = 9
Y = 9. The keys of this dictionary are the elements of attribute
``spectral_classes``
specregex (re.Pattern):
Regular expression matching a string with a spectral class, subclass and
luminosity class.
Expand Down Expand Up @@ -184,13 +185,16 @@ def __init__(self, datapath: Optional[str] = None) -> None:
self.MK = np.array(MK)
self.MKn = np.array(MKn).astype(float)
self.SpecTypes = np.unique(self.MK)
self.spectypenum = np.array(
[self.specdict[c] * 10 + sc for c, sc in zip(self.MK, self.MKn)]
)

# find all the colors and everything else
keys = self.data.keys()
colorregex = re.compile(r"(\w{1,2})-(\w{1,2})")
colors = np.array([])
noncolors = []
dontwant = ["SpT", "#SpT", "Teff"]
dontwant = ["SpT", "#SpT"]
for k in keys:
m = colorregex.match(k)
if m:
Expand Down

0 comments on commit 6788335

Please sign in to comment.