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); }
} // One of Basic, Detailed, NavBeacon, NavBeaconDetail public StarScannedEvent(DateTime timestamp, string scantype, string name, string stellarclass, decimal solarmass, decimal radius, decimal absolutemagnitude, string luminosityclass, 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.scantype = scantype; this.name = name; this.stellarclass = stellarclass; this.solarmass = solarmass; this.radius = radius; this.absolutemagnitude = absolutemagnitude; this.luminosityclass = luminosityclass; 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; solarradius = StarClass.solarradius(radius); luminosity = StarClass.luminosity(absolutemagnitude); StarClass starClass = StarClass.FromName(this.stellarclass); if (starClass != null) { massprobability = StarClass.sanitiseCP(starClass.stellarMassCP(solarmass)); radiusprobability = StarClass.sanitiseCP(starClass.stellarRadiusCP(this.solarradius)); tempprobability = StarClass.sanitiseCP(starClass.tempCP(this.temperature)); ageprobability = StarClass.sanitiseCP(starClass.ageCP(this.age)); chromaticity = starClass.chromaticity.localizedName; if (radius != 0 && temperature != 0) { // Minimum estimated single-star habitable zone (target black body temperature of 315°K / 42°C / 107°F or less) estimatedhabzoneinner = StarClass.DistanceFromStarForTemperature(maxHabitableTempKelvin, Convert.ToDouble(radius), Convert.ToDouble(temperature)); this.estimatedhabzoneinner = estimatedhabzoneinner; // Maximum estimated single-star habitable zone (target black body temperature of 223.15°K / -50°C / -58°F or more) estimatedhabzoneouter = StarClass.DistanceFromStarForTemperature(minHabitableTempKelvin, Convert.ToDouble(radius), Convert.ToDouble(temperature)); this.estimatedhabzoneouter = estimatedhabzoneouter; } } this.estimatedvalue = estimateValue(scantype == "Detailed" || scantype == "NavBeaconDetail"); }