示例#1
0
        public StarScannedEvent(DateTime timestamp, string name, string stellarclass, decimal solarmass, decimal radius, decimal absolutemagnitude, long age, decimal temperature, decimal distancefromarrival, decimal?orbitalperiod, decimal rotationperiod, decimal?semimajoraxis, decimal?eccentricity, decimal?orbitalinclination, decimal?periapsis, List <Ring> rings) : base(timestamp, NAME)
        {
            this.name              = name;
            this.stellarclass      = stellarclass;
            this.solarmass         = solarmass;
            this.radius            = radius;
            this.absolutemagnitude = absolutemagnitude;
            this.age                 = age;
            this.temperature         = temperature;
            this.distancefromarrival = distancefromarrival;
            this.orbitalperiod       = orbitalperiod;
            this.rotationperiod      = rotationperiod;
            this.semimajoraxis       = semimajoraxis;
            this.eccentricity        = eccentricity;
            this.orbitalinclination  = orbitalinclination;
            this.periapsis           = periapsis;
            this.rings               = rings;
            StarClass starClass = StarClass.FromName(this.stellarclass);

            if (starClass != null)
            {
                this.massprobability       = sanitiseCP(starClass.stellarMassCP(solarmass));
                this.solarradius           = StarClass.solarradius(radius);
                this.radiusprobability     = sanitiseCP(starClass.stellarRadiusCP(this.solarradius));
                this.luminosity            = StarClass.luminosity(absolutemagnitude);
                this.luminosityprobability = sanitiseCP(starClass.luminosityCP(this.luminosity));
                // TODO remove when temperature is in journal
                this.temperature  = StarClass.temperature(luminosity, this.radius);
                this.chromaticity = starClass.chromaticity;
            }
        }
示例#2
0
        public void TestStarEravarenth()
        {
            decimal temp = StarClass.temperature(StarClass.luminosity(6.885925M), 526252032M);

            Assert.AreEqual(4138, (int)temp);
        }