Exemplo n.º 1
0
        public static object[] MagnitudeBandsForCatalog(TangraConfig.StarCatalog catalog)
        {
            if (catalog == TangraConfig.StarCatalog.UCAC2)
            {
                return(UCAC2Catalogue.CatalogMagnitudeBands);
            }
            else if (catalog == TangraConfig.StarCatalog.NOMAD)
            {
                return(NOMADCatalogue.CatalogMagnitudeBands);
            }
            else if (catalog == TangraConfig.StarCatalog.UCAC3)
            {
                return(UCAC3Catalogue.CatalogMagnitudeBands);
            }
            else if (catalog == TangraConfig.StarCatalog.PPMXL)
            {
                return(PPMXLCatalogue.CatalogMagnitudeBands);
            }
            else if (catalog == TangraConfig.StarCatalog.UCAC4)
            {
                return(UCAC4Catalogue.CatalogMagnitudeBands);
            }

            return(new object[] { });
        }
Exemplo n.º 2
0
        public static bool IsValidCatalogLocation(TangraConfig.StarCatalog catalog, ref string folderPath)
        {
            if (catalog == TangraConfig.StarCatalog.UCAC2)
            {
                return(UCAC2Catalogue.IsValidCatalogLocation(ref folderPath));
            }
            else if (catalog == TangraConfig.StarCatalog.NOMAD)
            {
                return(NOMADCatalogue.IsValidCatalogLocation(ref folderPath));
            }
            else if (catalog == TangraConfig.StarCatalog.UCAC3)
            {
                return(UCAC3Catalogue.IsValidCatalogLocation(ref folderPath));
            }
            else if (catalog == TangraConfig.StarCatalog.PPMXL)
            {
                return(PPMXLCatalogue.IsValidCatalogLocation(ref folderPath));
            }
            else if (catalog == TangraConfig.StarCatalog.UCAC4)
            {
                return(UCAC4Catalogue.IsValidCatalogLocation(ref folderPath));
            }

            return(false);
        }
Exemplo n.º 3
0
        public static bool VerifyCurrentCatalogue(TangraConfig.StarCatalog catalog, ref string path)
        {
            if (catalog == TangraConfig.StarCatalog.UCAC2)
            {
                if (!UCAC2Catalogue.IsValidCatalogLocation(ref path))
                {
                    return(false);
                }

                if (!UCAC2Catalogue.CheckAndWarnIfNoBSS(path, null))
                {
                    return(false);
                }
            }
            else if (catalog == TangraConfig.StarCatalog.NOMAD)
            {
                if (!NOMADCatalogue.IsValidCatalogLocation(ref path))
                {
                    return(false);
                }

                // TODO: Check index files??
            }
            else if (catalog == TangraConfig.StarCatalog.UCAC3)
            {
                if (!UCAC3Catalogue.IsValidCatalogLocation(ref path))
                {
                    return(false);
                }
            }
            else if (catalog == TangraConfig.StarCatalog.PPMXL)
            {
                if (!PPMXLCatalogue.IsValidCatalogLocation(ref path))
                {
                    return(false);
                }
            }
            else if (catalog == TangraConfig.StarCatalog.UCAC4)
            {
                if (!UCAC4Catalogue.IsValidCatalogLocation(ref path))
                {
                    return(false);
                }
            }

            return(true);
        }
Exemplo n.º 4
0
        private void cbxCatalogue_SelectedIndexChanged(object sender, EventArgs e)
        {
            // For each supported catalog we provide custom options for magnitude band to use for photometry
            TangraConfig.StarCatalog catalog = (TangraConfig.StarCatalog)(cbxCatalogue.SelectedIndex + 1);
            switch (catalog)
            {
            case TangraConfig.StarCatalog.UCAC3:
                cbxCatalogPhotometryBand.Items.Clear();
                cbxCatalogPhotometryBand.Items.AddRange(m_CatalogValidator.MagnitudeBandsForCatalog(catalog));
                break;

            case TangraConfig.StarCatalog.UCAC2:
                cbxCatalogPhotometryBand.Items.Clear();
                cbxCatalogPhotometryBand.Items.AddRange(m_CatalogValidator.MagnitudeBandsForCatalog(catalog));
                break;

            case TangraConfig.StarCatalog.NOMAD:
                cbxCatalogPhotometryBand.Items.Clear();
                cbxCatalogPhotometryBand.Items.AddRange(m_CatalogValidator.MagnitudeBandsForCatalog(catalog));
                break;

            case TangraConfig.StarCatalog.PPMXL:
                cbxCatalogPhotometryBand.Items.Clear();
                cbxCatalogPhotometryBand.Items.AddRange(m_CatalogValidator.MagnitudeBandsForCatalog(catalog));
                break;

            case TangraConfig.StarCatalog.UCAC4:
                cbxCatalogPhotometryBand.Items.Clear();
                cbxCatalogPhotometryBand.Items.AddRange(m_CatalogValidator.MagnitudeBandsForCatalog(catalog));
                break;
            }

            if (cbxCatalogPhotometryBand.Items.Count > 0)
            {
                cbxCatalogPhotometryBand.SelectedIndex = 0;
            }
        }
Exemplo n.º 5
0
        public override bool ValidateSettings()
        {
            if (cbxCatalogue.SelectedIndex != -1)
            {
                TangraConfig.StarCatalog chosenCatalogue = (TangraConfig.StarCatalog)(cbxCatalogue.SelectedIndex + 1);

                if (!Directory.Exists(tbxCatalogueLocation.Text))
                {
                    tbxCatalogueLocation.Focus();
                    MessageBox.Show(
                        this,
                        "Please select a valid directory",
                        "Tangra",
                        MessageBoxButtons.OK,
                        MessageBoxIcon.Error);
                    return(false);
                }

                string path = tbxCatalogueLocation.Text;
                if (!m_CatalogValidator.IsValidCatalogLocation(chosenCatalogue, ref path))
                {
                    tbxCatalogueLocation.Focus();
                    MessageBox.Show(
                        this,
                        string.Format("Selected folder does not contain the {0} catalogue", chosenCatalogue),
                        "Tangra",
                        MessageBoxButtons.OK,
                        MessageBoxIcon.Error);
                    return(false);
                }

                tbxCatalogueLocation.Text = path;
            }

            return(true);
        }
Exemplo n.º 6
0
 object[] ICatalogValidator.MagnitudeBandsForCatalog(TangraConfig.StarCatalog catalog)
 {
     return(MagnitudeBandsForCatalog(catalog));
 }
Exemplo n.º 7
0
 bool ICatalogValidator.VerifyCurrentCatalogue(TangraConfig.StarCatalog catalog, ref string path)
 {
     return(VerifyCurrentCatalogue(catalog, ref path));
 }
Exemplo n.º 8
0
 bool ICatalogValidator.IsValidCatalogLocation(TangraConfig.StarCatalog catalog, ref string folderPath)
 {
     return(IsValidCatalogLocation(catalog, ref folderPath));
 }