Esempio n. 1
0
        private void AddMetaData(
            ImageMetaData metaData,
            CaptureSequence sequence,
            DateTime start,
            RMS rms,
            string targetName)
        {
            metaData.Image.ExposureStart  = start;
            metaData.Image.Binning        = sequence.Binning.Name;
            metaData.Image.ExposureNumber = sequence.ProgressExposureCount;
            metaData.Image.ExposureTime   = sequence.ExposureTime;
            metaData.Image.ImageType      = sequence.ImageType;
            metaData.Image.RecordedRMS    = rms;
            metaData.Target.Name          = targetName;

            // Fill all available info from profile
            metaData.FromProfile(profileService.ActiveProfile);
            metaData.FromTelescopeInfo(telescopeInfo);
            metaData.FromFilterWheelInfo(filterWheelInfo);
            metaData.FromRotatorInfo(rotatorInfo);
            metaData.FromFocuserInfo(focuserInfo);
            metaData.FromWeatherDataInfo(weatherDataInfo);

            metaData.FilterWheel.Filter = sequence.FilterType?.Name ?? metaData.FilterWheel.Filter;
        }
Esempio n. 2
0
        public void FromTelescopeInfoNoCoordinateTransformTest()
        {
            var coordinates   = new Coordinates(Angle.ByHours(4), Angle.ByDegree(29), Epoch.J2000);
            var telescopeInfo = new TelescopeInfo()
            {
                Connected   = true,
                Coordinates = coordinates
            };
            var sut = new ImageMetaData();

            sut.FromTelescopeInfo(telescopeInfo);

            Assert.AreEqual(Epoch.J2000, sut.Telescope.Coordinates.Epoch);
            Assert.AreEqual(60, sut.Telescope.Coordinates.RADegrees);
            Assert.AreEqual(29, sut.Telescope.Coordinates.Dec);
        }
Esempio n. 3
0
        public void FromTelescopeInfoNotConnectedTest()
        {
            var coordinates   = new Coordinates(Angle.ByHours(4), Angle.ByDegree(29), Epoch.J2000);
            var telescopeInfo = new TelescopeInfo()
            {
                Connected     = false,
                Name          = "TestName",
                SiteElevation = 120.3,
                Coordinates   = coordinates
            };
            var sut = new ImageMetaData();

            sut.FromTelescopeInfo(telescopeInfo);

            Assert.AreEqual(string.Empty, sut.Telescope.Name);
            Assert.AreEqual(double.NaN, sut.Telescope.FocalLength);
            Assert.AreEqual(double.NaN, sut.Telescope.FocalRatio);
            Assert.AreEqual(null, sut.Telescope.Coordinates);
        }
Esempio n. 4
0
        public void FromTelescopeInfoConnectedTest()
        {
            var coordinates   = new Coordinates(Angle.ByHours(4), Angle.ByDegree(29), Epoch.JNOW, new DateTime(2020, 06, 16));
            var telescopeInfo = new TelescopeInfo()
            {
                Connected     = true,
                Name          = "TestName",
                SiteElevation = 120.3,
                Coordinates   = coordinates
            };
            var sut = new ImageMetaData();

            sut.FromTelescopeInfo(telescopeInfo);

            Assert.AreEqual("TestName", sut.Telescope.Name);
            Assert.AreEqual(120.3, sut.Observer.Elevation);
            Assert.AreEqual(double.NaN, sut.Telescope.FocalLength);
            Assert.AreEqual(double.NaN, sut.Telescope.FocalRatio);

            Assert.AreEqual(Epoch.J2000, sut.Telescope.Coordinates.Epoch);
            Assert.AreEqual(59.694545025696307d, sut.Telescope.Coordinates.RADegrees);
            Assert.AreEqual(28.945185789035015d, sut.Telescope.Coordinates.Dec);
        }