Example #1
0
        private void InitStarClassification()
        {
            int temperature = (int)this.Surface_temperature;

            this.luminosityClass = Star.FindStarClass(temperature);

            int relmassClass = (int)(this.relativeMass * 100);

            if (this.starRadius != this.getSchwarzschildRadius())
            {
                this.massClass = Star.FindStarMassClass(relmassClass);

                this.overallClass = Star.mapClassificationsToOverallClassification(this.massClass, this.luminosityClass);

                this.starClassification_ByColor = Star.FindStarColor(temperature);
            }
            else
            {
                this.massClass = StarClassification_byMass.BlackHole;
                this.starClassification_ByColor = StarClassification_byColor.BlackHole;
                this.overallClass = OverallStarClassification.BlackHole;
            }
        }
Example #2
0
        public static OverallStarClassification mapClassificationsToOverallClassification(StarClassification_byMass massClass,
                                                                                          StarClassification_byLum luminosityClass)
        {
            OverallStarClassification overallClass = OverallStarClassification.None;

            switch (massClass)
            {
            case StarClassification_byMass.T:
            case StarClassification_byMass.L:
            case StarClassification_byMass.M:
                if (luminosityClass > StarClassification_byLum.M)
                {
                    overallClass = OverallStarClassification.WhiteDwarf;
                }
                else
                {
                    overallClass = OverallStarClassification.BrownDwarf;
                }
                break;

            case StarClassification_byMass.K:
                if (luminosityClass > StarClassification_byLum.K)
                {
                    overallClass = OverallStarClassification.MainSequenceDwarf;
                }
                else
                {
                    overallClass = OverallStarClassification.WhiteDwarf;
                }
                break;

            case StarClassification_byMass.G:
                if (luminosityClass > StarClassification_byLum.G)
                {
                    overallClass = OverallStarClassification.LesserGiant;
                }
                else
                {
                    overallClass = OverallStarClassification.MainSequenceDwarf;
                }
                break;

            case StarClassification_byMass.F:
                if (luminosityClass > StarClassification_byLum.F)
                {
                    overallClass = OverallStarClassification.Giant;
                }
                else
                {
                    overallClass = OverallStarClassification.LesserGiant;
                }
                break;

            case StarClassification_byMass.A:
                if (luminosityClass > StarClassification_byLum.A)
                {
                    overallClass = OverallStarClassification.BrightGiant;
                }
                else
                {
                    overallClass = OverallStarClassification.Giant;
                }
                break;

            case StarClassification_byMass.B:
                if (luminosityClass > StarClassification_byLum.B)
                {
                    overallClass = OverallStarClassification.SuperGiant;
                }
                else
                {
                    overallClass = OverallStarClassification.BrightGiant;
                }
                break;

            case StarClassification_byMass.O:
                if (luminosityClass > StarClassification_byLum.O)
                {
                    overallClass = OverallStarClassification.HyperGiant;
                }
                else
                {
                    overallClass = OverallStarClassification.SuperGiant;
                }
                break;

            case StarClassification_byMass.BlackHole:
                if (luminosityClass == StarClassification_byLum.BlackHole)
                {
                    overallClass = OverallStarClassification.BlackHole;
                }
                break;
            }

            return(overallClass);
        }