Beispiel #1
0
        private Star Convert(HabHygRecord record)
        {
            Star star = new Star(record.DisplayName);

            star.Identifier = string.Format("HabHyg-{0:D5}", record.HabHyg);
            star.Name       = record.DisplayName;

            if (AddDataAsProperties)
            {
                IDictionary <string, string> prop = new Dictionary <string, string>();
                prop.Add("HabHyg", record.HabHyg.ToString());
                prop.Add("Hip", record.Hip);
                prop.Add("Hab", record.Hab);
                prop.Add("Display Name", record.DisplayName);
                prop.Add("Hyg", record.Hyg);
                prop.Add("BayerFlamsteed", record.BayerFlamsteed);
                prop.Add("Gliese", record.Gliese);
                prop.Add("BD", record.BD);
                prop.Add("HD", record.HD);
                prop.Add("HR", record.HR);
                prop.Add("Proper Name", record.ProperName);
                prop.Add("Spectral Class", record.SpectralClass);
                prop.Add("Distance", record.Distance.ToString());
                prop.Add("Xg", record.Xg);
                prop.Add("Yg", record.Yg);
                prop.Add("Zg", record.Zg);
                prop.Add("AbsMag", record.AbsMag.ToString());
                star.Properties.AddGroup("HabHyg", prop);
            }

            return(star);
        }
Beispiel #2
0
        public void Load(string catalogueFile)
        {
            Catalogue = new List <HabHygRecord>();

            CsvReader reader = new CsvReader(File.OpenText(catalogueFile), System.Globalization.CultureInfo.CurrentCulture);

            reader.Configuration.RegisterClassMap <HabHYGRecordMap>();
            reader.Read();
            reader.ReadHeader();
            while (reader.Read())
            {
                HabHygRecord record = reader.GetRecord <HabHygRecord>();
                Catalogue.Add(record);
            }
        }