Пример #1
0
        public static double ConvertMagnitude(double measuredMag, double vrColorIndex, Guid catalogMagBand, TangraConfig.MagOutputBand magOutputBand)
        {
            if (catalogMagBand == NOMADEntry.BAND_ID_R && magOutputBand == TangraConfig.MagOutputBand.CousinsR)
            {
                return(measuredMag);
            }
            if (catalogMagBand == NOMADEntry.BAND_ID_R && magOutputBand == TangraConfig.MagOutputBand.JohnsonV)
            {
                return(ColourIndexTables.GetVFromRAndVR(measuredMag, vrColorIndex));
            }

            if (catalogMagBand == NOMADEntry.BAND_ID_V && magOutputBand == TangraConfig.MagOutputBand.CousinsR)
            {
                return(ColourIndexTables.GetRFromVAndVR(measuredMag, vrColorIndex));
            }
            if (catalogMagBand == NOMADEntry.BAND_ID_V && magOutputBand == TangraConfig.MagOutputBand.JohnsonV)
            {
                return(measuredMag);
            }

            if (catalogMagBand == NOMADEntry.BAND_ID_B && magOutputBand == TangraConfig.MagOutputBand.CousinsR)
            {
                return(ColourIndexTables.GetRFromBAndVR(measuredMag, vrColorIndex));
            }
            if (catalogMagBand == NOMADEntry.BAND_ID_B && magOutputBand == TangraConfig.MagOutputBand.JohnsonV)
            {
                return(ColourIndexTables.GetVFromBAndVR(measuredMag, vrColorIndex));
            }

            return(double.NaN);
        }
Пример #2
0
        public static double ConvertMagnitude(double measuredMag, double vrColorIndex, Guid catalogMagBand, TangraConfig.MagOutputBand magOutputBand)
        {
            if (catalogMagBand == UCAC3Entry.BAND_ID_R && magOutputBand == TangraConfig.MagOutputBand.CousinsR)
            {
                return(measuredMag);
            }
            if (catalogMagBand == UCAC3Entry.BAND_ID_R && magOutputBand == TangraConfig.MagOutputBand.JohnsonV)
            {
                return(ColourIndexTables.GetVFromRAndVR(measuredMag, vrColorIndex));
            }

            if (catalogMagBand == UCAC3Entry.BAND_ID_V && magOutputBand == TangraConfig.MagOutputBand.CousinsR)
            {
                return(ColourIndexTables.GetRFromVAndVR(measuredMag, vrColorIndex));
            }
            if (catalogMagBand == UCAC3Entry.BAND_ID_V && magOutputBand == TangraConfig.MagOutputBand.JohnsonV)
            {
                return(measuredMag);
            }

            if (catalogMagBand == UCAC3Entry.BAND_ID_UNFILTERED)
            {
                double jk = ColourIndexTables.GetJKFromVR(vrColorIndex);
                if (magOutputBand == TangraConfig.MagOutputBand.CousinsR)
                {
                    return(-0.295 * jk + 1.323 * measuredMag - 0.0377 * measuredMag * measuredMag + 0.001142 * measuredMag * measuredMag * measuredMag - 0.68);
                }
                if (magOutputBand == TangraConfig.MagOutputBand.JohnsonV)
                {
                    return(0.552 * jk + 1.578 * measuredMag - 0.0560 * measuredMag * measuredMag + 0.001562 * measuredMag * measuredMag * measuredMag - 1.76);
                }
            }

            return(double.NaN);
        }
Пример #3
0
        public static double ConvertMagnitude(double measuredMag, double vrColorIndex, Guid catalogMagBand, TangraConfig.MagOutputBand magOutputBand)
        {
            if (catalogMagBand == UCAC2Entry.BAND_ID_R && magOutputBand == TangraConfig.MagOutputBand.CousinsR)
            {
                return(measuredMag);
            }
            if (catalogMagBand == UCAC2Entry.BAND_ID_R && magOutputBand == TangraConfig.MagOutputBand.JohnsonV)
            {
                return(ColourIndexTables.GetVFromRAndVR(measuredMag, vrColorIndex));
            }

            if (catalogMagBand == UCAC2Entry.BAND_ID_V && magOutputBand == TangraConfig.MagOutputBand.CousinsR)
            {
                return(ColourIndexTables.GetRFromVAndVR(measuredMag, vrColorIndex));
            }
            if (catalogMagBand == UCAC2Entry.BAND_ID_V && magOutputBand == TangraConfig.MagOutputBand.JohnsonV)
            {
                return(measuredMag);
            }

            if (catalogMagBand == UCAC2Entry.BAND_ID_UNFILTERED)
            {
                double jk = ColourIndexTables.GetJKFromVR(vrColorIndex);
                if (magOutputBand == TangraConfig.MagOutputBand.CousinsR)
                {
                    return(jk * -0.262157262293991 + measuredMag * 0.972995989114809 + measuredMag * measuredMag * 0.0294054519219995 +
                           measuredMag * measuredMag * measuredMag * -0.00152172319138341 + -1.27151807006964);
                }
                if (magOutputBand == TangraConfig.MagOutputBand.JohnsonV)
                {
                    return(jk * 0.482510826567376 + measuredMag * 0.69853741307966 + measuredMag * measuredMag * 0.053709249992501 +
                           measuredMag * measuredMag * measuredMag * -0.00221766445441987 + -0.186573576388743);
                }
            }

            return(double.NaN);
        }
Пример #4
0
        public static double ConvertMagnitude(double measuredMag, double vrColorIndex, Guid catalogMagBand, TangraConfig.MagOutputBand magOutputBand)
        {
            if (catalogMagBand == UCAC4Entry.BAND_ID_R && magOutputBand == TangraConfig.MagOutputBand.CousinsR)
            {
                return(measuredMag);
            }
            if (catalogMagBand == UCAC4Entry.BAND_ID_R && magOutputBand == TangraConfig.MagOutputBand.JohnsonV)
            {
                return(ColourIndexTables.GetVFromRAndVR(measuredMag, vrColorIndex));
            }

            if (catalogMagBand == UCAC4Entry.BAND_ID_V && magOutputBand == TangraConfig.MagOutputBand.CousinsR)
            {
                return(ColourIndexTables.GetRFromVAndVR(measuredMag, vrColorIndex));
            }
            if (catalogMagBand == UCAC4Entry.BAND_ID_V && magOutputBand == TangraConfig.MagOutputBand.JohnsonV)
            {
                return(measuredMag);
            }

            // V = r + 0.44 * (g - r) - 0.02
            // B = V + 1.04 * (g - r) + 0.19
            // R = V - 0.508 * (B - V) - 0.040   (0.3 < B - V < 0.9)


            // V - R = 0.508 * (B - V) + 0.040
            // B = V + ((V - R) - 0.040) / 0.508 = V + 1.04 * (g - r) + 0.19 => 1.04 * (g - r) = ((V - R) - 0.040) / 0.508 - 0.19 => (g - r) = (((V - R) - 0.040) / 0.508 - 0.19) / 1.04
            double grColorIndex = (((vrColorIndex) - 0.040) / 0.508 - 0.19) / 1.04;


            // R = r + 0.44 * (g - r) - 0.02 - 0.508 * (1.04 * (g - r) + 0.19) - 0.040 = r + (0.44 - 0.508 * 1.04)*(g-r) + (-0.060 - 0.19 * 0.508)
            if (catalogMagBand == UCAC4Entry.BAND_ID_SLOAN_r && magOutputBand == TangraConfig.MagOutputBand.CousinsR)
            {
                return(measuredMag + (0.44 - 0.508 * 1.04) * grColorIndex + (-0.060 - 0.19 * 0.508));
            }
            // V = r + 0.44 * (g - r) - 0.02
            if (catalogMagBand == UCAC4Entry.BAND_ID_SLOAN_r && magOutputBand == TangraConfig.MagOutputBand.JohnsonV)
            {
                return(measuredMag + 0.44 * grColorIndex - 0.02);
            }


            if (catalogMagBand == UCAC4Entry.BAND_ID_SLOAN_g && magOutputBand == TangraConfig.MagOutputBand.CousinsR)
            {
                throw new NotImplementedException();
            }

            // V = r + 0.44 * (g - r) - 0.02 = 0.44 * g + 0.56 * r - 0.02
            // B = V + 1.04 * g - 1.04 * r + 0.19 | *0.56 / 1.04 => 0.56 * (B - V) / 1.04 = 0.56 * g - 0.56 * r + 0.56 * 0.19 / 1.04
            // (1.04 * V + 0.56 * B - 0.56 * V) / 1.04 = g + 0.56 * 0.16/1.04 - 0.02 => 0.48 * V + 0.56 * B = 1.04 * g + 0.0688 => V = 2.17 * g - 1.17 * B + 0.14
            if (catalogMagBand == UCAC4Entry.BAND_ID_SLOAN_g && magOutputBand == TangraConfig.MagOutputBand.JohnsonV)
            {
                throw new NotImplementedException();
            }

            if (catalogMagBand == UCAC4Entry.BAND_ID_UNFILTERED)
            {
                double jk = ColourIndexTables.GetJKFromVR(vrColorIndex);
                if (magOutputBand == TangraConfig.MagOutputBand.CousinsR)
                {
                    return(-0.295 * jk + 1.323 * measuredMag - 0.0377 * measuredMag * measuredMag + 0.001142 * measuredMag * measuredMag * measuredMag - 0.68);
                }
                if (magOutputBand == TangraConfig.MagOutputBand.JohnsonV)
                {
                    return(0.552 * jk + 1.578 * measuredMag - 0.0560 * measuredMag * measuredMag + 0.001562 * measuredMag * measuredMag * measuredMag - 1.76);
                }
            }

            return(double.NaN);
        }