示例#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;
            }
        }
 public void TestStarSol()
 {
     StarScannedEvent scan             = new StarScannedEvent(DateTime.Now, "Sol", "G", 1, 1, 4.83M, 5400000000, 300, 0, 10, 10, 0, 0, 0, 0, null);
     decimal          solLuminosity    = StarClass.luminosity(scan.absolutemagnitude);
     StarClass        starClass        = StarClass.FromName(scan.stellarclass);
     decimal          massChance       = starClass.stellarMassCP(scan.solarmass);
     decimal          radiusChance     = starClass.stellarRadiusCP(scan.radius);
     decimal          luminosityChance = starClass.luminosityCP(solLuminosity);
 }