Exemple #1
0
        private void btOPTD_Click(object sender, EventArgs e)
        {
            ProductColorTable[] tables = ProductColorTableFactory.GetAllColorTables();
            ProductColorTable   table  = ProductColorTableFactory.GetColorTable("FOG", "TIMS");


            ExtractProductIdentify exPro = new ExtractProductIdentify();

            exPro.ThemeIdentify      = "CMA";
            exPro.ProductIdentify    = "FOG";
            exPro.SubProductIdentify = "OPTD";


            ThemeDef      theme = MonitoringThemeFactory.GetThemeDefByIdentify("CMA");
            ProductDef    pro   = theme.GetProductDefByIdentify("FOG");
            SubProductDef sub   = pro.GetSubProductDefByIdentify("OPTD");
            AlgorithmDef  alg   = sub.GetAlgorithmDefByIdentify("OPTDAlgorithm");

            IArgumentProvider arg = MonitoringThemeFactory.GetArgumentProvider(exPro, "OPTDAlgorithm", "FY3A", "MERSI");

            arg.SetArg("OPTDAlgorithm", alg);
            IRasterDataProvider prd = GetRasterDataProvider("FOG");

            arg.DataProvider = prd;
            arg.SetArg("CSRFile", @"E:\code\SMARTII\SRC\【控制】监测分析框架\testCN\bin\Release\TEMP\FOG_0CSR_FY3A_MERSI_10M_20120614001422_20120615001422.dat");
            arg.SetArg("DBLVFile", @"E:\code\SMARTII\SRC\【控制】监测分析框架\testCN\bin\Release\TEMP\FOG_DBLV_FY3A_MERSI_1000M_20120614005135_20120615005135.dat");
            IMonitoringSubProduct       bin    = new SubProductOPTDFOG(sub);
            IPixelFeatureMapper <Int16> result = bin.Make(null) as IPixelFeatureMapper <Int16>;

            result.Dispose();
        }
Exemple #2
0
        private void btSeaIceNDSI_Click(object sender, EventArgs e)
        {
            ExtractProductIdentify exPro = new ExtractProductIdentify();

            exPro.ThemeIdentify      = "CMA";
            exPro.ProductIdentify    = "ICE";
            exPro.SubProductIdentify = "DBLV";

            //IArgumentProviderFactory fac = MifEnvironment.ActiveArgumentProviderFactory;
            ThemeDef      theme = MonitoringThemeFactory.GetThemeDefByIdentify("CMA");
            ProductDef    pro   = theme.GetProductDefByIdentify("ICE");
            SubProductDef sub   = pro.GetSubProductDefByIdentify("DBLV");
            AlgorithmDef  alg   = sub.GetAlgorithmDefByIdentify("NDSIAlgorithm_NOAA");

            IArgumentProvider arg = MonitoringThemeFactory.GetArgumentProvider(exPro, "NDSIAlgorithm_NOAA", "FY3A", "VIRR");

            arg.SetArg("NDSIAlgorithm_NOAA", alg);
            IRasterDataProvider prd = GetRasterDataProvider("ICE");

            arg.DataProvider = prd;
            IMonitoringSubProduct bin    = new SubProductBinaryICE(sub);
            IPixelIndexMapper     result = bin.Make(null) as IPixelIndexMapper;
            string saveName = "e:\\seaice1.png";

            CreatBitmap(prd, result.Indexes.ToArray(), saveName);
        }
Exemple #3
0
        private void InitExIdentify()
        {
            _exPro = new ExtractProductIdentify();
            _exPro.ThemeIdentify      = "CMA";
            _exPro.ProductIdentify    = "DST";
            _exPro.SubProductIdentify = "DBLV";
            _exAlg            = new ExtractAlgorithmIdentify();
            _exAlg.Resolution = null;

            //MonitoringThemeFactory = MifEnvironment.ActiveArgumentProviderFactory;
            ThemeDef theme = MonitoringThemeFactory.GetThemeDefByIdentify("CMA");

            _pro = theme.GetProductDefByIdentify("DST");
            _sub = _pro.GetSubProductDefByIdentify("DBLV");
        }
Exemple #4
0
        private void button2_Click(object sender, EventArgs e)
        {
            ExtractProductIdentify prdIdentify = new ExtractProductIdentify();

            prdIdentify.ThemeIdentify      = "CMA";
            prdIdentify.ProductIdentify    = "BAG";
            prdIdentify.SubProductIdentify = "DBLV";
            ExtractAlgorithmIdentify algIdentify = new ExtractAlgorithmIdentify();

            algIdentify.Satellite  = "EOST";
            algIdentify.Sensor     = "MODIS";
            algIdentify.Resolution = null;//not use

            //IArgumentProviderFactory fac = MifEnvironment.ActiveArgumentProviderFactory;
            ThemeDef           themeDef = MonitoringThemeFactory.GetThemeDefByIdentify("CMA");
            IArgumentProvider  prd      = MonitoringThemeFactory.GetArgumentProvider(prdIdentify, algIdentify);
            ProductDef         bag      = themeDef.GetProductDefByIdentify("BAG");
            IMonitoringProduct prbag    = new MonitoringProductBag();

            SubProductDef productDef = bag.GetSubProductDefByIdentify("DBLV");
            AlgorithmDef  alg        = productDef.GetAlgorithmDefByIdentify("BAGExtract");

            IMonitoringSubProduct product = new SubProductBinaryBag(productDef);

            //prd.SetArg("BAGExtract", alg);
            prd.DataProvider = GetRasterDataProvider();
            prd.AOI          = GetAOI(prd.DataProvider);
            //IExtractResult result = (product as SubProductBinaryBag).Make(null,null);
            //结果存为图片
            //idxs = (result as MatrixPixelIndexMapper).Indexes.ToArray();
            //IBinaryBitmapBuilder builder = new BinaryBitmapBuilder();
            //Size bmSize = new Size(prd.DataProvider.Width, prd.DataProvider.Height);
            //Bitmap bitmap = builder.CreateBinaryBitmap(bmSize, Color.Red, Color.Transparent);
            //builder.Fill(idxs, new Size(prd.DataProvider.Width, prd.DataProvider.Height), ref bitmap);
            //bitmap.Save(@"D:\Code\源代码\【控制】监测分析框架\test\bin\Release\TEMP\bag.png", ImageFormat.Png);
            //MessageBox.Show("判识结束.");
            //RasterIdentify id = new RasterIdentify();
            //id.ThemeIdentify = "CMA";
            //id.ProductIdentify = "BAG";
            //id.SubProductIdentify = "DBLV";
            //id.Sensor = "MODIS";
            //id.OrbitDateTime = DateTime.Now.Subtract(new TimeSpan(1, 0, 0, 0, 0));
            //id.GenerateDateTime = DateTime.Now;
            //IInterestedRaster<UInt16> iir = new InterestedRaster<UInt16>(id, new Size(prd.DataProvider.Width, prd.DataProvider.Height), prd.DataProvider.CoordEnvelope.Clone());
            //iir.Put(idxs, 1);
            //iir.Dispose();
            //MessageBox.Show("判识结果已永久保存.");
        }
Exemple #5
0
        private void btCSR_Click(object sender, EventArgs e)
        {
            //IArgumentProviderFactory fac1 = MifEnvironment.ActiveArgumentProviderFactory;

            ThemeDef   theme1 = MonitoringThemeFactory.GetThemeDefByIdentify("CMA"); // fac1.GetThemeDefByIdentify("CMA");
            ProductDef pro1   = theme1.GetProductDefByIdentify("FOG");

            //ProductDef pro1 = theme1.GetProductDefByIdentify("ICE");

            MonitoringProduct mp = new MonitoringProductFOG();

            //MonitoringProduct mp = new MonitoringProductICE(pro1);
            mp = mp;

            ExtractProductIdentify exPro = new ExtractProductIdentify();

            exPro.ThemeIdentify      = "CMA";
            exPro.ProductIdentify    = "FOG";
            exPro.SubProductIdentify = "0CSR";

            ExtractAlgorithmIdentify exAlg = new ExtractAlgorithmIdentify();

            exAlg.CustomIdentify = null;
            exAlg.Satellite      = "FY3A";
            exAlg.Sensor         = "MERSI";
            exAlg.Resolution     = null;

            //IArgumentProviderFactory fac = MifEnvironment.ActiveArgumentProviderFactory;
            ThemeDef      theme = MonitoringThemeFactory.GetThemeDefByIdentify("CMA"); //fac.GetThemeDefByIdentify("CMA");
            ProductDef    pro   = theme.GetProductDefByIdentify("FOG");
            SubProductDef sub   = pro.GetSubProductDefByIdentify("0CSR");
            AlgorithmDef  alg   = sub.GetAlgorithmDefByIdentify("BaseOrbitAlgorithm");

            IArgumentProvider arg = MonitoringThemeFactory.GetArgumentProvider(exPro, "BaseOrbitAlgorithm", "FY3A", "MERSI");

            arg.SetArg("BaseOrbitAlgorithm", alg);
            IRasterDataProvider prd = GetRasterDataProvider("FOG");

            arg.DataProvider = prd;
            arg.SetArg("OrbitFile", new string[] { prd.fileName });
            IMonitoringSubProduct        bin    = new SubProductCSRFOG(sub);
            IPixelFeatureMapper <UInt16> result = bin.Make(null) as IPixelFeatureMapper <UInt16>;

            result.Dispose();
        }
Exemple #6
0
        private void btFogBB_Click(object sender, EventArgs e)
        {
            ExtractProductIdentify exPro = new ExtractProductIdentify();

            exPro.ThemeIdentify      = "CMA";
            exPro.ProductIdentify    = "FOG";
            exPro.SubProductIdentify = "DBLV";

            ExtractAlgorithmIdentify exAlg = new ExtractAlgorithmIdentify();

            exAlg.CustomIdentify = null;
            exAlg.Satellite      = "FY3A";
            exAlg.Sensor         = "MERSI";
            exAlg.Resolution     = null;

            //IArgumentProviderFactory fac = MifEnvironment.ActiveArgumentProviderFactory;
            ThemeDef      theme = MonitoringThemeFactory.GetThemeDefByIdentify("CMA");
            ProductDef    pro   = theme.GetProductDefByIdentify("FOG");
            SubProductDef sub   = pro.GetSubProductDefByIdentify("DBLV");
            AlgorithmDef  alg   = sub.GetAlgorithmDefByIdentify("EasyAlgorithm");

            IArgumentProvider arg = MonitoringThemeFactory.GetArgumentProvider(exPro, "EasyAlgorithm", "FY3A", "MERSI");

            arg.SetArg("EasyAlgorithm", alg);
            IRasterDataProvider prd = GetRasterDataProvider("FOG");

            arg.DataProvider = prd;
            IMonitoringSubProduct bin    = new SubProductBinaryFOG(sub);
            IPixelIndexMapper     result = bin.Make(null) as IPixelIndexMapper;
            RasterIdentify        id     = new RasterIdentify();

            id.ThemeIdentify      = "CMA";
            id.ProductIdentify    = "FOG";
            id.SubProductIdentify = "DBLV";
            id.Satellite          = "FY3A";
            id.Sensor             = "MERSI";
            id.Resolution         = "1000M";
            id.OrbitDateTime      = DateTime.Now.Subtract(new TimeSpan(1, 0, 0, 0, 0));
            id.GenerateDateTime   = DateTime.Now;
            IInterestedRaster <Int16> iir = new InterestedRaster <Int16>(id, new Size(prd.Width, prd.Height), prd.CoordEnvelope);

            iir.Put(result.Indexes.ToArray(), 1);
            iir.Dispose();
        }
Exemple #7
0
        private void btImage_Click(object sender, EventArgs e)
        {
            //IArgumentProviderFactory fac = MifEnvironment.ActiveArgumentProviderFactory;
            ThemeDef      theme = MonitoringThemeFactory.GetThemeDefByIdentify("CMA");
            ProductDef    pro   = theme.GetProductDefByIdentify("FOG");
            SubProductDef sub   = pro.GetSubProductDefByIdentify("0IMG");
            AlgorithmDef  alg   = sub.GetAlgorithmDefByIdentify("0IMGAlgorithm");

            ExtractProductIdentify exPro = new ExtractProductIdentify();

            exPro.ThemeIdentify      = "CMA";
            exPro.ProductIdentify    = "FOG";
            exPro.SubProductIdentify = "0IMG";

            IArgumentProvider     arg    = MonitoringThemeFactory.GetArgumentProvider(exPro, "0IMGAlgorithm", "FY3A", "MERSI");
            IMonitoringSubProduct subPro = new SubProductIMGFOG(sub);

            subPro.ResetArgumentProvider("FY3A", "MERSI");
            arg.SetArg("AOI", "");
            arg.SetArg("OutFileIdentify", "STBI");
            subPro.Make(null);
        }
Exemple #8
0
        private void button1_Click(object sender, EventArgs e)
        {
            ExtractProductIdentify prdIdentify = new ExtractProductIdentify();

            prdIdentify.ThemeIdentify      = "CMA";
            prdIdentify.ProductIdentify    = "BAG";
            prdIdentify.SubProductIdentify = "DBLV";
            ExtractAlgorithmIdentify algIdentify = new ExtractAlgorithmIdentify();

            algIdentify.Satellite  = "EOST";
            algIdentify.Sensor     = "MODIS";
            algIdentify.Resolution = null;//not use

            //IArgumentProviderFactory fac = MifEnvironment.ActiveArgumentProviderFactory;
            ThemeDef           themeDef = MonitoringThemeFactory.GetThemeDefByIdentify("CMA");
            IArgumentProvider  prd      = MonitoringThemeFactory.GetArgumentProvider(prdIdentify, algIdentify);
            ProductDef         bag      = themeDef.GetProductDefByIdentify("BAG");
            IMonitoringProduct prbag    = new MonitoringProductBag();

            SubProductDef productDef = bag.GetSubProductDefByIdentify("DBLV");
            AlgorithmDef  alg        = productDef.GetAlgorithmDefByIdentify("BAGExtract");

            IMonitoringSubProduct product = new SubProductBinaryBag(productDef);

            prd.SetArg("BAGExtract", alg);
            prd.DataProvider = GetRasterDataProvider();
            prd.AOI          = GetAOI(prd.DataProvider);
            //IExtractResult result = (product as SubProductBinaryBag).Make(prd,null);
            //结果存为图片
            //int[] idxs = (result as IPixelIndexMapper).Indexes.ToArray();
            //IBinaryBitmapBuilder builder = new BinaryBitmapBuilder();
            //Size bmSize = new Size(prd.DataProvider.Width, prd.DataProvider.Height);
            //Bitmap bitmap = builder.CreateBinaryBitmap(bmSize, Color.Red, Color.Transparent);
            //builder.Fill(idxs, new Size(prd.DataProvider.Width, prd.DataProvider.Height), ref bitmap);
            //bitmap.Save("E:\\bag.png", ImageFormat.Png);
            //MessageBox.Show("判识结束");
        }
Exemple #9
0
        private void button1_Click(object sender, EventArgs e)
        {
            //IArgumentProviderFactory fac = MifEnvironment.ActiveArgumentProviderFactory;
            ThemeDef               themeDef    = MonitoringThemeFactory.GetThemeDefByIdentify("CMA");
            IMonitoringTheme       them        = new MonitoringThemeCMA(themeDef);
            IMonitoringProduct     fir         = them.GetProductByIdentify("FIR");
            ExtractProductIdentify prdIdentify = new ExtractProductIdentify();

            prdIdentify.ThemeIdentify      = "CMA";
            prdIdentify.ProductIdentify    = "FIR";
            prdIdentify.SubProductIdentify = "DBLV";
            ExtractAlgorithmIdentify algIdentify = new ExtractAlgorithmIdentify();

            algIdentify.Satellite  = "FY3A";
            algIdentify.Sensor     = "VIRR";
            algIdentify.Resolution = null;//not use
            IArgumentProvider     arg = MonitoringThemeFactory.GetArgumentProvider(prdIdentify, algIdentify);
            IMonitoringSubProduct bin = fir.GetSubProductByIdentify("DBLV");

            //arg.SetArg(bin.AlgorithmDefs[0].Indetify, bin.AlgorithmDefs[0]);
            arg.DataProvider = GetRasterDataProvider();
            arg.AOI          = GetAOI();
            IExtractResult result = bin.Make(null);
        }
Exemple #10
0
        private void button4_Click(object sender, EventArgs e)
        {
            ExtractProductIdentify prdIdentify = new ExtractProductIdentify();

            prdIdentify.ThemeIdentify      = "CMA";
            prdIdentify.ProductIdentify    = "SNW";
            prdIdentify.SubProductIdentify = "0CLM";
            ExtractAlgorithmIdentify algIdentify = new ExtractAlgorithmIdentify();

            algIdentify.Satellite  = "FY3A";
            algIdentify.Sensor     = "VIRR";
            algIdentify.Resolution = null;//not use

            //IArgumentProviderFactory fac = MifEnvironment.ActiveArgumentProviderFactory;
            ThemeDef           themeDef = MonitoringThemeFactory.GetThemeDefByIdentify("CMA");
            IArgumentProvider  prd      = MonitoringThemeFactory.GetArgumentProvider(prdIdentify, algIdentify);
            ProductDef         snw      = themeDef.GetProductDefByIdentify("SNW");
            IMonitoringProduct prbag    = new MonitoringProductBag();

            SubProductDef productDef = snw.GetSubProductDefByIdentify("0CLM");
            AlgorithmDef  alg        = productDef.GetAlgorithmDefByIdentify("CloudExtract");

            IMonitoringSubProduct product = new SubProductBinaryClm(productDef);

            prd.SetArg("CloudExtract", alg);
            prd.DataProvider = GetRasterDataProvider1();
            //IExtractResult result = product.Make(null,null);
            //结果存为图片
            //int[] idxs = (result as MemPixelIndexMapper).Indexes.ToArray();
            //IBinaryBitmapBuilder builder = new BinaryBitmapBuilder();
            //Size bmSize = new Size(prd.DataProvider.Width, prd.DataProvider.Height);
            //Bitmap bitmap = builder.CreateBinaryBitmap(bmSize, Color.Red, Color.Transparent);
            //builder.Fill(idxs, new Size(prd.DataProvider.Width, prd.DataProvider.Height), ref bitmap);
            //bitmap.Save("E:\\data\\蓝藻\\snow_clound.png", ImageFormat.Png);
            //MessageBox.Show("判识结束");
        }
Exemple #11
0
        private void button6_Click(object sender, EventArgs e)
        {
            string fname = @"E:\数据文件\BAG_NDVITemp_NUL_NUL_NUL_20120619163044_20120620163044.dat";
            IRasterDataProvider dataProvider = GeoDataDriver.Open(fname) as IRasterDataProvider;
            //非蓝藻区域赋-9999
            NDVISetValue setValue1 = (dataProvider as MemoryRasterDataProvider).GetExtHeader <NDVISetValue>();
            double       min       = setValue1.MinNDVI;
            double       max       = setValue1.MaxNDVI;
            IPixelFeatureMapper <float> ndvifinal = new MemPixelFeatureMapper <float>("NDVI", 1000, new Size(dataProvider.Width, dataProvider.Height), dataProvider.CoordEnvelope, dataProvider.SpatialRef);
            RasterIdentify idNDVI = new RasterIdentify();

            idNDVI.ThemeIdentify      = "CMA";
            idNDVI.ProductIdentify    = "BAG";
            idNDVI.SubProductIdentify = "NDVI";
            idNDVI.OrbitDateTime      = DateTime.Now.Subtract(new TimeSpan(1, 0, 0, 0, 0));
            idNDVI.GenerateDateTime   = DateTime.Now;
            InterestedRaster <float> iirNDVI = new InterestedRaster <float>(idNDVI, new Size(dataProvider.Width, dataProvider.Height), dataProvider.CoordEnvelope.Clone(), dataProvider.SpatialRef, 8);

            iirNDVI.Put(-9999);
            //IEnumerable<int> ids = (indexProvider as IPixelIndexMapper).Indexes;
            ArgumentProvider            ap      = new ArgumentProvider(dataProvider, null);
            RasterPixelsVisitor <float> visitor = new RasterPixelsVisitor <float>(ap);

            #region
            ExtractProductIdentify prdIdentify = new ExtractProductIdentify();
            prdIdentify.ThemeIdentify      = "CMA";
            prdIdentify.ProductIdentify    = "BAG";
            prdIdentify.SubProductIdentify = "DBLV";
            ExtractAlgorithmIdentify algIdentify = new ExtractAlgorithmIdentify();
            algIdentify.Satellite  = "EOST";
            algIdentify.Sensor     = "MODIS";
            algIdentify.Resolution = null;//not use

            //IArgumentProviderFactory fac = MifEnvironment.ActiveArgumentProviderFactory;
            ThemeDef           themeDef = MonitoringThemeFactory.GetThemeDefByIdentify("CMA");
            IArgumentProvider  prd      = MonitoringThemeFactory.GetArgumentProvider(prdIdentify, algIdentify);
            ProductDef         bag      = themeDef.GetProductDefByIdentify("BAG");
            IMonitoringProduct prbag    = new MonitoringProductBag();

            SubProductDef productDef = bag.GetSubProductDefByIdentify("DBLV");
            AlgorithmDef  alg        = productDef.GetAlgorithmDefByIdentify("BAGExtract");

            IMonitoringSubProduct product = new SubProductBinaryBag(productDef);
            //prd.SetArg("BAGExtract", alg);
            prd.DataProvider = GetRasterDataProvider();
            prd.AOI          = GetAOI(prd.DataProvider);
            //IExtractResult result = (product as SubProductBinaryBag).Make(prd,null, null);
            //idxs = (result as IPixelIndexMapper).Indexes.ToArray();
            //#endregion
            //visitor.VisitPixel(new int[] { 1 }, (index, values) =>
            //    {
            //        foreach (int item in idxs)
            //        {
            //            if (item == index)
            //            {
            //                ndvifinal.Put(index, values[0]);
            //                break;
            //            }
            //        }
            //    });
            //iirNDVI.SetExtHeader(setValue1);
            //iirNDVI.Put(ndvifinal);
            //iirNDVI.Dispose();
            #endregion
        }