Celestia
Celestia copied to clipboard
Improve spectral type parsing
Celestia's spectral type parsing could be improved. Currently if a spectral type string has a character that "doesn't belong" (including spaces) Celestia ignores everything after it. For example, G2(V)
is parsed as G2
instead of G2V
. This has already been fixed in Luke's version of buildstardb.pl.
Well, my buildstardb.pl only works because it actually deletes the special characters like the parentheses, before parsing them. I suppose we could do a similar thing in the stellarclass.cpp that the spectral class parser is originally from, but please, check my code for errors and such.
Some changes in this area would also be necessary to support the full range of white dwarf spectral types. The "D*#" numbers don't just go to 9, they go to 14 (source), but currently a two-digit number beginning with 1 is parsed as 1. Case in point: Gliese 223.2.