コード例 #1
0
        private int FilterMdexSources()
        {
            if (Verbose)
            {
                Console.WriteLine();
                Console.WriteLine("Setting mdex source cutoff to snr >= 20");
            }

            Filtered   = Filtered.Filter(IsInSnrRange);
            Unfiltered = Unfiltered.Filter(IsInSnrRange);

            if (Verbose)
            {
                Console.WriteLine(
                    "Filtered mdex reduced to {0} sources",
                    Filtered.Count);

                Console.WriteLine(
                    "Unfiltered mdex reduced to {0} sources",
                    Unfiltered.Count);
            }

            return(Status);

            bool IsInSnrRange(ISource source)
            {
                var snrSource = source as ISnrSource;

                return(snrSource.SignalToNoise >= 20);
            }
        }
コード例 #2
0
        private int FilterBounds()
        {
            if (Verbose)
            {
                Console.WriteLine();
                Console.WriteLine("Calculating intersection of regions");
            }

            var bounds1 = SourceMatchLists.GetBounds(Filtered);
            var bounds2 = SourceMatchLists.GetBounds(Spitzer);

            var minRa = Angle.FromRadians(
                Max(bounds1.minRa.Radians, bounds2.minRa.Radians));

            var maxRa = Angle.FromRadians(
                Min(bounds1.maxRa.Radians, bounds2.maxRa.Radians));

            var minDec = Angle.FromRadians(
                Max(bounds1.minDec.Radians, bounds2.minDec.Radians));

            var maxDec = Angle.FromRadians(
                Min(bounds1.maxDec.Radians, bounds2.maxDec.Radians));

            if (Verbose)
            {
                Console.WriteLine("Min RA={0}", minRa);
                Console.WriteLine("Max RA={0}", maxRa);
                Console.WriteLine("Min Dec={0}", minDec);
                Console.WriteLine("Max Dec={0}", maxDec);

                Console.WriteLine();
                Console.WriteLine(
                    "Filtering source lists to bounded region.");
            }

            Filtered   = Filtered.Filter(InBounds);
            Unfiltered = Unfiltered.Filter(InBounds);
            Spitzer    = Spitzer.Filter(InBounds);

            return(Status);

            bool InBounds(ISource source)
            {
                return
                    (source.RA >= minRa &&
                     source.RA <= maxRa &&
                     source.Dec >= minDec &&
                     source.Dec <= maxDec);
            }
        }