Esempio n. 1
0
        public override ExecutionResult Run(IStepExecutionContext context)
        {
            Guard.Against.Null(_options.GeostationaryRender !.Longitude, nameof(GeostationaryRenderOptions.Longitude));
            Guard.Against.Null(Activity, nameof(Activity));
            Guard.Against.Null(TargetImage, nameof(TargetImage));

            var longitudeRange = Activity.GetVisibleLongitudeRange();

            // Determine visible range of all satellite imagery
            var longitudeDegrees = _options.GeostationaryRender !.Longitude !.Value;

            _logger.LogInformation("Reprojecting to geostationary with longitude {longitudeDegrees} degrees", longitudeDegrees);

            // Adjust longitude based on the underlay wrapping for visible satellites
            var adjustedLongitude = -Math.PI - longitudeRange.Start + Angle.FromDegrees(longitudeDegrees).Radians;

            // Render geostationary image
            using (var sourceImage = TargetImage.Clone())
            {
                TargetImage = sourceImage.ToGeostationaryProjection(adjustedLongitude, Constants.Satellite.DefaultHeight, _options);

                // Apply haze if required
                var hazeAmount = _options.GeostationaryRender.HazeAmount;
                if (hazeAmount > 0 && !_options.NoUnderlay)
                {
                    TargetImage.ApplyHaze(_options.Tint, hazeAmount);
                }
            }

            return(ExecutionResult.Next());
        }
Esempio n. 2
0
        public override ExecutionResult Run(IStepExecutionContext context)
        {
            Guard.Against.Null(Longitude, nameof(Longitude));
            Guard.Against.Null(Activity, nameof(Activity));
            Guard.Against.Null(TargetImage, nameof(TargetImage));

            // Determine visible range of all satellite imagery
            _logger.LogInformation("Reprojecting to geostationary with longitude {longitude} degrees", Angle.FromRadians(Longitude !.Value).Degrees);

            // Render geostationary image
            using (var sourceImage = TargetImage.Clone())
            {
                TargetImage = sourceImage.ToGeostationaryProjection(Longitude.Value, Constants.Satellite.DefaultHeight, _options);
            }

            return(ExecutionResult.Next());
        }
Esempio n. 3
0
        public override ExecutionResult Run(IStepExecutionContext context)
        {
            Guard.Against.Null(Longitude, nameof(Longitude));
            Guard.Against.Null(Activity, nameof(Activity));
            Guard.Against.Null(TargetImage, nameof(TargetImage));

            var longitudeRange = Activity.GetVisibleLongitudeRange();

            // Determine visible range of all satellite imagery
            _logger.LogInformation("Reprojecting to geostationary with longitude {longitude} degrees", Angle.FromRadians(Longitude !.Value).Degrees);

            // Adjust longitude based on the underlay wrapping for visible satellites
            var adjustedLongitude = -Math.PI - longitudeRange.Start + Longitude !.Value;

            // Render geostationary image
            using (var sourceImage = TargetImage.Clone())
            {
                TargetImage = sourceImage.ToGeostationaryProjection(adjustedLongitude, Constants.Satellite.DefaultHeight, _options);
            }

            return(ExecutionResult.Next());
        }