private void TryGetInfosFromRasterProvider(AbstractWarpDataset raster)
 {
     try
     {
         if (raster != null)
         {
             _projectName = GetProjectionIdentify(raster.SpatialRef.GetAttrValue("GEOGCS", 0));
             DataIdentify df = raster.DataIdentify;
             if (string.IsNullOrEmpty(Satellite) || Satellite.ToUpper() == "NUL")
             {
                 Satellite = df.Satellite;
             }
             if (string.IsNullOrEmpty(Sensor) || Sensor.ToUpper() == "NUL")
             {
                 Sensor = df.Sensor;
             }
             if (OrbitDateTime == DateTime.MinValue)
             {
                 OrbitDateTime = df.OrbitDateTime;
             }
             if (string.IsNullOrWhiteSpace(Resolution) || Resolution == "NULL")
             {
                 Resolution = TryGetResolution(raster.ResolutionX);
             }
         }
     }
     catch
     {
     }
 }
Esempio n. 2
0
        private void SetBandArgs(IMonitoringSubProduct subProduct)
        {
            if (!subProduct.Definition.IsNeedCurrentRaster)
            {
                return;
            }
            DataIdentify id = GetCurrentRasterIdentify();

            if (id == null)
            {
                return;
            }
            if (!subProduct.ArgumentProvider.BandArgsIsSetted)
            {
                MonitoringThemeFactory.SetBandArgs(subProduct, id.Satellite, id.Sensor);
            }
            else
            {
                AlgorithmDef alg = subProduct.ArgumentProvider.CurrentAlgorithmDef;
                if (!alg.Satellites.Contains(id.Satellite) || !alg.Sensors.Contains(id.Sensor))
                {
                    MonitoringThemeFactory.SetBandArgs(subProduct, id.Satellite, id.Sensor);
                }
            }
        }
Esempio n. 3
0
        void c_OnAlgorithmChanged(object sender, AlgorithmDef algDef)
        {
            IMonitoringSession    msession   = _session.MonitoringSession as IMonitoringSession;
            IMonitoringSubProduct subProduct = msession.ActiveMonitoringSubProduct;

            if (subProduct == null)
            {
                return;
            }
            if (subProduct.Definition.IsNeedCurrentRaster)
            {
                DataIdentify did = GetCurrentRasterIdentify();
                if (did != null)
                {
                    subProduct.ResetArgumentProvider(algDef.Identify, did.Satellite, did.Sensor);
                }
            }
            else
            {
                subProduct.ResetArgumentProvider(algDef.Identify);
            }
            subProduct.ArgumentProvider.SetArg("AlgorithmName", algDef.Identify);
            SetSystemArguments(subProduct);
            SetCurrentRasterArgument(subProduct);
            SetBandArgs(subProduct);
        }
Esempio n. 4
0
 private void TryGetInfosFromRasterProvider(IRasterDataProvider raster)
 {
     try
     {
         if (raster != null)
         {
             _projectName = GetProjectionIdentify(raster.SpatialRef.GeographicsCoordSystem.Name);
             DataIdentify df = raster.DataIdentify;
             if (string.IsNullOrEmpty(Satellite) || Satellite.ToUpper() == "NUL")
             {
                 Satellite = df.Satellite;
             }
             if (string.IsNullOrEmpty(Sensor) || Sensor.ToUpper() == "NUL")
             {
                 Sensor = df.Sensor;
             }
             if (OrbitDateTime == DateTime.MinValue)
             {
                 OrbitDateTime = df.OrbitDateTime;
             }
             if (string.IsNullOrWhiteSpace(Resolution) || Resolution == "NULL")
             {
                 Resolution = TryGetResolution(raster.ResolutionX);
             }
         }
     }
     catch
     {
     }
 }
Esempio n. 5
0
        //NOAA18_AVHRR_CHINA_GLL_L1_20000101_0001_1000M_Day.LDF
        private string GetSpliceFilename(IRasterDataProvider inputRaster, MosaicInputArg inArg, string envName)
        {
            float        resolution   = inputRaster.ResolutionX;
            DataIdentify dataIdentify = inputRaster.DataIdentify;

            return(GetSpliceFilename(resolution, dataIdentify, inArg, envName));
        }
Esempio n. 6
0
        private float GetDefaultResolution(DataIdentify identify)
        {
            float resolution = 0.01f;

            if (_dstSpatialRef == null || _dstSpatialRef.ProjectionCoordSystem == null)
            {
                if (identify.Sensor == "VISSR")
                {
                    resolution = 0.05f;
                }
                else
                {
                    resolution = 0.01f;
                }
            }
            else
            {
                if (identify.Sensor == "VISSR")
                {
                    resolution = 5000f;
                }
                else
                {
                    resolution = 1000f;
                }
            }
            return(resolution);
        }
Esempio n. 7
0
 private static string AddDays001FilesInfo(ref CYCAFileListInfo result, DataIdentify di, RegionArg args, SubProductDef subPro, string file, out RasterIdentify ri, out string fileInfo, string outSubProIdnetify)
 {
     fileInfo = null;
     ri       = null;
     if (args.CKSatellite)
     {
         fileInfo = string.Format("{0}_{1}_{2}_{3}_{4}_{5}_{6}{7}", di.Satellite, di.Sensor, di.OrbitDateTime.AddHours(8).Year, GetSeason(di.OrbitDateTime.AddHours(8).Month),
                                  di.OrbitDateTime.AddHours(8).Month, GetDays010(di.OrbitDateTime.AddHours(8).Day), di.OrbitDateTime.AddHours(8).Day, GetTimeRegion(args, di.OrbitDateTime.AddHours(8).ToString("HHdd")));
     }
     else
     {
         fileInfo = string.Format("{0}_{1}_{2}_{3}_{4}{5}", di.OrbitDateTime.AddHours(8).Year, GetSeason(di.OrbitDateTime.AddHours(8).Month),
                                  di.OrbitDateTime.AddHours(8).Month, GetDays010(di.OrbitDateTime.AddHours(8).Day), di.OrbitDateTime.AddHours(8).Day, GetTimeRegion(args, di.OrbitDateTime.AddHours(8).ToString("HHdd")));
     }
     if (result.Days001Files.ContainsKey(fileInfo))
     {
         result.Days001Files[fileInfo].Add(file);
     }
     else
     {
         List <string> files = new List <string>();
         files.Add(file);
         result.Days001Files.Add(fileInfo, files);
         string exInfo      = args.CycType == enumProcessType.AVG ? "AOAD" : args.CycType == enumProcessType.MAX ? "MAAD" : args.CycType == enumProcessType.MIN ? "MNAD" : "POAD";
         string outFilename = GetResultFilename(out ri, file, di, subPro, exInfo, outSubProIdnetify);
         result.OutFilename.Add(fileInfo, outFilename);
         return(outFilename);
     }
     return(string.Empty);
 }
Esempio n. 8
0
 public void GetDataIdentify(IRasterDataProvider raster)
 {
     DataIdentify = raster.DataIdentify;
     Level        = "L1";
     //ProjectionIdentify = "GLL";
     Station = ParseStation(raster.fileName);
     //DayOrNight = "D";
     //OrbitIdentify = "L1";
 }
Esempio n. 9
0
 public void Clear()
 {
     for (int i = 0; i < _fileItems.Count; i++)
     {
         _fileItems[i].Dispose();
         _fileItems[i] = null;
     }
     _fileItems.Clear();
     _dataIdentify = null;
 }
Esempio n. 10
0
        private void AngleMosaicToFile()
        {
            int          length = inArg.MosaicEnvelopes.Length;
            DataIdentify di     = DataIdentifyMatcher.Match(GetFirstname(inArg.InputFilename));

            for (int i = 0; i < length; i++)
            {
                string tFilename = GetSpliceFilename(inArg.MosaicResoultionX, di, inArg, inArg.MosaicEnvelopes[i].Name);
                AngleMosaic.Mosaic(new string[] { inArg.InputFilename, inArg.OutputDir + "\\" + tFilename, inArg.MosaicBands, GetGeoHeadInfo(inArg.MosaicEnvelopes[i]), inArg.MosaicIdentify });
            }
        }
Esempio n. 11
0
 private void UpdateOutputFileName()
 {
     if (_mosaicProjectionFileProvider.FileItems != null && _mosaicProjectionFileProvider.FileItems.Length != 0)
     {
         string filename = _mosaicProjectionFileProvider.FileItems[0].MainFile.fileName;
         string fileDir;
         if (string.IsNullOrEmpty(_projectConfigDir))
         {
             fileDir = Path.GetDirectoryName(filename) + @"\Prj\";
         }
         else
         {
             fileDir = _projectConfigDir;
         }
         //if (!Directory.Exists(fileDir))
         //    Directory.CreateDirectory(fileDir);
         if (rbBlocks.Checked || _mosaicType != MosaicType.Mosaic)
         {
             txtOutDir.Text = fileDir;
             return;
         }
         string blockName = "";
         if (rbAllFile.Checked)
         {
             blockName = "GBAL";
         }
         else if (rbCenter.Checked)
         {
             blockName = "AOI";
         }
         string       satellite;
         string       sensor;;
         DateTime     datetime;
         DataIdentify dataIdentify = _mosaicProjectionFileProvider.FileItems[0].MainFile.DataIdentify;
         if (string.IsNullOrWhiteSpace(dataIdentify.Satellite) || string.IsNullOrWhiteSpace(dataIdentify.Sensor) || dataIdentify.OrbitDateTime == DateTime.MinValue)
         {
             RasterIdentify identify = new RasterIdentify(_mosaicProjectionFileProvider.FileItems[0].MainFile);
             satellite = string.IsNullOrWhiteSpace(dataIdentify.Satellite) ? identify.Satellite : dataIdentify.Satellite;
             sensor    = string.IsNullOrWhiteSpace(dataIdentify.Sensor) ? identify.Sensor : dataIdentify.Sensor;
             datetime  = identify.OrbitDateTime.TimeOfDay == TimeSpan.Zero ? dataIdentify.OrbitDateTime : identify.OrbitDateTime;
         }
         else
         {
             satellite = dataIdentify.Satellite;
             sensor    = dataIdentify.Sensor;
             datetime  = dataIdentify.OrbitDateTime;
         }
         float  resolution            = ucPrjEnvelopes1.ResolutionX;
         string outFilenameWithoutDir = PrjFileName.GetL1PrjFilenameWithOutDir(filename, satellite, sensor, datetime, _dstSpatialRef, blockName, resolution);
         string outfilename           = Path.Combine(fileDir, outFilenameWithoutDir);
         txtOutDir.Text = outfilename;
     }
 }
Esempio n. 12
0
        private void TryGetInfosFromRasterProvider(string fname)
        {
            string extension = Path.GetExtension(fname).ToUpper();

            foreach (string ext in EXTENSIONS)
            {
                if (extension == ext)
                {
                    return;
                }
            }
            if (!File.Exists(fname))
            {
                return;
            }
            IRasterDataProvider prd = null;
            IGeoDataDriver      id  = null;

            try
            {
                prd = RasterDataDriver.Open(fname) as IRasterDataProvider;
                if (prd != null)
                {
                    _projectName = GetProjectionIdentify(prd.SpatialRef.GeographicsCoordSystem.Name);
                    DataIdentify df = prd.DataIdentify;
                    if (string.IsNullOrEmpty(Satellite) || Satellite.ToUpper() == "NUL")
                    {
                        Satellite = df.Satellite;
                    }
                    if (string.IsNullOrEmpty(Sensor) || Sensor.ToUpper() == "NUL")
                    {
                        Sensor = df.Sensor;
                    }
                    if (OrbitDateTime == DateTime.MinValue)
                    {
                        OrbitDateTime = df.OrbitDateTime;
                    }
                    if (string.IsNullOrWhiteSpace(Resolution) || Resolution == "NULL")
                    {
                        Resolution = TryGetResolution(prd.ResolutionX);
                    }
                }
            }
            catch
            { }
            finally
            {
                if (prd != null)
                {
                    prd.Dispose();
                }
            }
        }
Esempio n. 13
0
 public void RemoveAt(int index)
 {
     if (_fileItems != null)
     {
         _fileItems.RemoveAt(index);
         if (_fileItems.Count == 0)
         {
             _fileItems.Clear();
             _dataIdentify = null;
         }
     }
 }
Esempio n. 14
0
        public string GetFileName(string[] files, string productIdentify, string outputIdentify, string fomart, string extinfo)
        {
            IFileNameGenerator fng = GetFileNameGenerator();

            if (fng == null)
            {
                return(string.Empty);
            }
            DataIdentify di = GetDataIdentify();

            return(fng.NewFileName(CreatRasterIndetifyId(files, productIdentify, outputIdentify, di, fomart, extinfo)));
        }
Esempio n. 15
0
        /// <summary>
        /// 根据栅格文件名获取图像增强方案文件名
        /// </summary>
        /// <param name="rasterName"></param>
        /// <param name="productName"></param>
        /// <returns></returns>
        public static string GetEnhanceNameByRasterFileName(IRasterDataProvider raster, string productName)
        {
            DataIdentify did = raster.DataIdentify;

            if (did == null || !did.IsOrbit)
            {
                return(GetEnhanceNameByRasterFileName(raster, productName, false));
            }
            else
            {
                return(GetEnhanceNameByRasterFileName(raster, productName, true));
            }
        }
Esempio n. 16
0
        private void AddBandsWithProjected(IRasterDataProvider rasterDataProvider)
        {
            DataIdentify dataIdentify = rasterDataProvider.DataIdentify;
            int          bandCount    = rasterDataProvider.BandCount;

            tvBandList.Nodes.Clear();
            for (int i = 1; i <= bandCount; i++)
            {
                TreeNode node = new TreeNode("band" + i);
                node.Checked = true;
                node.Tag     = new PrjBand(dataIdentify.Sensor, rasterDataProvider.ResolutionX, "1", i, "band" + "", "", "");
                tvBandList.Nodes.Add(node);
            }
        }
Esempio n. 17
0
        private string CreatOutputFileName(string fname, bool isCustom)
        {
            IFileNameGenerator fng            = GetFileNameGenerator();
            DataIdentify       di             = GetDataIdentify();
            string             outputIdentify = _argumentProvider.GetArg("OutFileIdentify").ToString();

            if (string.IsNullOrEmpty(outputIdentify))
            {
                outputIdentify = GetOutputIdentifyByFilename(fname, isCustom);
            }
            RasterIdentify rid = CreatRasterIndetifyId(new string[] { fname }, "VGT", outputIdentify, di, ".xlsx", null);

            return((fng == null) ? string.Empty : fng.NewFileName(rid));
        }
Esempio n. 18
0
 public bool Remove(IRasterDataProvider file)
 {
     if (_fileItems != null)
     {
         int i = _fileItems.RemoveAll(new Predicate <MosaicProjectItem>(item => { return(item.MainFile == file); }));
         if (_fileItems.Count == 0)
         {
             _fileItems.Clear();
             _dataIdentify = null;
         }
         return(i != 0);
     }
     return(false);
 }
Esempio n. 19
0
        public IExtractResult CycleTimeStatAnalysisByPixel <T>(string productName, string productIdentify, string extInfos, Func <int, T, T, T> function)
        {
            IRasterOperator <T>   roper           = new RasterOperator <T>();
            IInterestedRaster <T> cycleIimeResult = null;

            string[] files = GetStringArray("SelectedPrimaryFiles");
            if (files == null || files.Length == 0)
            {
                return(null);
            }
            if (string.IsNullOrEmpty(extInfos))
            {
                extInfos = GetStringArugment("extinfo");
            }
            DataIdentify di = GetDataIdentify();
            string       outFileIdentify = GetStringArugment("OutFileIdentify");

            cycleIimeResult = roper.CycleTimes(files, CreatRasterIndetifyId(files, productIdentify, outFileIdentify, di, null, extInfos), function);
            if (cycleIimeResult == null)
            {
                return(null);
            }
            object obj = _argumentProvider.GetArg("ThemeGraphyGenerator");

            if (obj == null)
            {
                return(cycleIimeResult);
            }
            IThemeGraphGenerator tgg = obj as IThemeGraphGenerator;

            if (tgg == null)
            {
                return(cycleIimeResult);
            }
            cycleIimeResult.Dispose();
            string aoiTemplateName         = string.Empty;
            Dictionary <string, int[]> aoi = null;

            GetAOI(out aoiTemplateName, out aoi);
            string templatName    = GetStringArugment("ThemeGraphTemplateName");
            string colorTabelName = GetColorTableName("colortablename");
            string resultFilename = tgg.Generate(cycleIimeResult.FileName, templatName, MasicAOI(aoi, ref extInfos), extInfos, outFileIdentify, colorTabelName);

            if (string.IsNullOrEmpty(resultFilename))
            {
                return(cycleIimeResult);
            }
            return(new FileExtractResult(outFileIdentify, resultFilename));
        }
Esempio n. 20
0
        private static RasterIdentify GetRasterIdentifyID(ISmartSession session)
        {
            RasterIdentify        rst = null;
            IMonitoringSubProduct msp;
            IRasterDataProvider   prd;

            GetPrd(session, out msp, out prd);
            DataIdentify currentIdentify = null;

            if (msp != null)
            {
                string[] files = (msp as MonitoringSubProduct).GetStringArray("SelectedPrimaryFiles");
                if (files == null || files.Length == 0)
                {
                    files = (msp as MonitoringSubProduct).GetStringArray("CurrentRasterFile");
                }
                if (files == null || files.Length == 0)
                {
                    files = (msp as MonitoringSubProduct).GetStringArray("mainfiles");
                }
                if (files == null || files.Length == 0)
                {
                    if (prd == null)
                    {
                        rst = new RasterIdentify();
                        rst.ThemeIdentify = "CMA";
                    }
                    else
                    {
                        rst             = new RasterIdentify(prd.fileName);
                        currentIdentify = prd.DataIdentify;
                    }
                }
                else
                {
                    rst = new RasterIdentify(files);
                }
            }

            rst.ProductIdentify    = msp != null ? msp.Definition.ProductDef.Identify : "";
            rst.SubProductIdentify = msp != null ? msp.Identify : "";
            if (msp != null)
            {
                GetOutFileIdentify(ref rst, msp);
                GetExtInfo(ref rst, msp);
            }
            rst.IsOutput2WorkspaceDir = true;
            return(rst);
        }
Esempio n. 21
0
        void _mosaicProjectionFileProvider_DataIdentifyChanged(DataIdentify arg1, IRasterDataProvider prd)
        {
            prjArgsSelectBand1.SetArgs(prd);
            if (string.IsNullOrEmpty(_projectConfigDir))
            {
                txtOutDir.Text = Path.GetDirectoryName(prd.fileName);
            }
            else
            {
                txtOutDir.Text = _projectConfigDir;
            }
            float resolution = GetDefaultResolution(arg1);

            UpdatePrjenvelopeSet(resolution);
            UpdateOutputFileName();
        }
Esempio n. 22
0
        /// <summary>
        /// FY3A_MERSI_GBAL_L1_20120808_0000_1000M_MS.HDF->
        /// FY3A_MERSI_GBAL_GLL_L1_20120808_0000_1000M_MS_D.ldf
        /// </summary>
        /// <param name="inArg"></param>
        /// <param name="dataIdentify"></param>
        /// <returns></returns>
        private string CreateMosaicFilename(InputArg inArg, DataIdentify dataIdentify, string projectionIdentify, float resolution, string station, string dayOrNight)
        {
            PrjEnvelopeItem item = inArg.MosaicInputArg.Envelope;

            return(string.Format("{0}_{1}_{2}_{3}_{4}_{5}_{6}_{7}_{8}_{9}.ldf",
                                 dataIdentify.Satellite,
                                 dataIdentify.Sensor,
                                 item.Name,
                                 projectionIdentify,
                                 "L1",
                                 dataIdentify.OrbitDateTime.ToString("yyyyMMdd"),
                                 string.IsNullOrWhiteSpace(inArg.OrbitIdentify) ? "0000" : inArg.OrbitIdentify,
                                 projectionIdentify == "GLL" ? GLLResolutionIdentify(resolution) : ResolutionIdentify(resolution),
                                 station,
                                 dayOrNight
                                 ));
        }
Esempio n. 23
0
        public void SetArgs(RSS.Core.DF.IRasterDataProvider rasterDataProvider)
        {
            if (rasterDataProvider == null)
            {
                return;
            }
            DataIdentify dataIdentify = rasterDataProvider.DataIdentify;

            if (dataIdentify.IsOrbit)
            {
                AddBandsWithOrbit(rasterDataProvider);
            }
            else
            {
                AddBandsWithProjected(rasterDataProvider);
            }
        }
Esempio n. 24
0
        private void UpdateFileItemsAddToList(string[] files, bool checkTime, DateTime beginTime, DateTime endTime)
        {
            lstFileInfoList.Items.Clear();
            RasterIdentify rid = null;
            FileListItem   fli = null;

            if (checkTime)
            {
                foreach (string file in files)
                {
                    DataIdentify di = DataIdentifyMatcher.Match(Path.GetFileName(file));
                    rid               = new RasterIdentify();
                    rid.OriFileName   = new string[] { file };
                    rid.Satellite     = di.Satellite;
                    rid.Sensor        = di.Sensor;
                    rid.OrbitDateTime = di.OrbitDateTime;
                    FillRid(ref rid);
                    if (rid.OrbitDateTime == DateTime.MinValue || rid.OrbitDateTime > Convert.ToDateTime(endTime.ToString("MM-dd-yyyy") + " 23:59:59") ||
                        rid.OrbitDateTime < Convert.ToDateTime(beginTime.ToString("MM-dd-yyyy") + " 00:00:00"))
                    {
                        continue;
                    }
                    fli = new FileListItem(file, rid);
                    AddToFileListItem(fli);
                }
            }
            else
            {
                foreach (string file in files)
                {
                    DataIdentify di = DataIdentifyMatcher.Match(Path.GetFileName(file));
                    rid               = new RasterIdentify();
                    rid.OriFileName   = new string[] { file };
                    rid.Satellite     = di.Satellite;
                    rid.Sensor        = di.Sensor;
                    rid.OrbitDateTime = di.OrbitDateTime;
                    FillRid(ref rid);
                    fli = new FileListItem(file, rid);
                    AddToFileListItem(fli);
                }
            }
            if (lstFileInfoList.Items.Count != 0)
            {
                lstFileInfoList.Items[0].Selected = true;
            }
        }
Esempio n. 25
0
        /*
         *分卫星 传感器
         *日信息:卫星_传感器_年_季_月_旬_日_时间起_时间止
         *旬信息: 卫星_传感器_年_季_月_旬_时间起_时间止
         *月信息:卫星_传感器_年_季_月_时间起_时间止
         * 季信息:卫星_传感器_年_季_时间起_时间止
         * 年信息:卫星_传感器_年_时间起_时间止
         *
         * 周信息:卫星_传感器_年_周_时间起_时间止
         */
        public static CYCAFileListInfo GeneralFileList(string[] files, RegionArg args, SubProductDef subPro, string outSubProIdentify)
        {
            CYCAFileListInfo result = new CYCAFileListInfo();

            GetMaxCyctime(args, ref result);
            if (result.Days001Files == null)
            {
                return(null);
            }
            DataIdentify   di       = null;
            string         fileInfo = string.Empty;
            RasterIdentify ri       = null;

            foreach (string file in files)
            {
                di = DataIdentifyMatcher.Match(file);
                string days001file = AddDays001FilesInfo(ref result, di, args, subPro, file, out ri, out fileInfo, outSubProIdentify);
                if (result.Days007Files != null && !string.IsNullOrEmpty(days001file))
                {
                    AddDays007FilesInfo(ref result, ri, args, subPro, days001file, fileInfo);
                }
                string days010file = string.Empty;
                if (result.Days010Files != null && !string.IsNullOrEmpty(days001file))
                {
                    days010file = AddDays010FilesInfo(ref result, ri, args, subPro, days001file, ref fileInfo);
                }
                string days030file = string.Empty;
                if (result.Days030Files != null && !string.IsNullOrEmpty(days010file))
                {
                    days030file = AddDays030FilesInfo(ref result, ri, args, subPro, days010file, ref fileInfo);
                }
                string days090file = string.Empty;
                if (result.Days090Files != null && !string.IsNullOrEmpty(days030file))
                {
                    days090file = AddDays090FilesInfo(ref result, ri, args, subPro, days030file, ref fileInfo);
                }
                string days365file = string.Empty;
                if (result.Days365Files != null && !string.IsNullOrEmpty(days090file))
                {
                    days365file = AddDays365FilesInfo(ref result, ri, args, subPro, days090file, ref fileInfo);
                }
            }
            return(result);
        }
Esempio n. 26
0
        private string GetSpliceFilename(float resolution, DataIdentify dataIdentify, MosaicInputArg inArg, string envName)
        {
            //PrjEnvelopeItem item = inArg.MosaicEnvelopes[0];
            string projectionIdentify = "GLL";
            string dayOrNight         = inArg.DayOrNight;
            string orbitIdentify      = inArg.OrbitIdentify;

            return(string.Format("{0}_{1}_{2}_{3}_{4}_{5}_{6}_{7}_{8}_MOSA.ldf",
                                 dataIdentify.Satellite,
                                 dataIdentify.Sensor,
                                 envName,
                                 projectionIdentify,
                                 "L1",
                                 dataIdentify.OrbitDateTime.ToString("yyyyMMdd"),
                                 orbitIdentify.PadRight(4, '0'),
                                 projectionIdentify == "GLL" ? GLLResolutionIdentify(resolution) : ResolutionIdentify(resolution),
                                 dayOrNight
                                 ));
        }
Esempio n. 27
0
 private void SetDefaultArgumentProvider(IMonitoringSubProduct subProduct)
 {
     if (subProduct.Definition.IsNeedCurrentRaster)
     {
         //根据卫星、传感器选择算法
         DataIdentify did = GetCurrentRasterIdentify();
         if (did != null)
         {
             IArgumentProvider prd = subProduct.ArgumentProvider;
             subProduct.ResetArgumentProvider(did.Satellite, did.Sensor);
             object algorithm     = prd.GetArg("AlgorithmName");
             string algorithmName = (algorithm == null ? "" : algorithm.ToString());
             if (prd != null && !string.IsNullOrWhiteSpace(algorithmName))
             {
                 subProduct.ResetArgumentProvider(algorithmName);
             }
         }
     }
 }
Esempio n. 28
0
        public static void TryCorrectCenterWaveNum(RSS.Core.DF.IRasterDataProvider dataProvider, int midIfrBandNo, int farIfrBandNo, ref float midIfrCenterWaveNum, ref float farIfrCenterWaveNum, IContextMessage contextMessage)
        {
            DataIdentify id = dataProvider.DataIdentify;

            if (id != null && !string.IsNullOrEmpty(id.Satellite) && !string.IsNullOrEmpty(id.Sensor))
            {
                BandnameRefTable tb = BandRefTableHelper.GetBandRefTable(id.Satellite, id.Sensor);
                if (tb != null)
                {
                    float        wn   = 0;
                    BandnameItem item = tb.GetBandItem(midIfrBandNo);
                    if (item != null)
                    {
                        wn = item.CenterWaveNumber;
                        if (wn > float.Epsilon)
                        {
                            midIfrCenterWaveNum = wn;
                        }
                    }
                    item = tb.GetBandItem(farIfrBandNo);
                    if (item != null)
                    {
                        wn = item.CenterWaveNumber;
                        if (wn > float.Epsilon)
                        {
                            farIfrCenterWaveNum = wn;
                        }
                    }
                }
            }
            //
            if (farIfrCenterWaveNum < float.Epsilon)
            {
                farIfrCenterWaveNum = 912;
                PrintInfo(contextMessage, "     通过卫星、传感器获远红外中心波数失败,使用缺省值:912。");
            }
            if (midIfrCenterWaveNum < float.Epsilon)
            {
                midIfrCenterWaveNum = 2640;
                PrintInfo(contextMessage, "     通过卫星、传感器获中红外中心波数失败,使用缺省值:2640。");
            }
        }
        private string GetPLSFFilename(IArgumentProvider argProvider, out DateTime orbitDateTime)
        {
            RasterIdentify id = new RasterIdentify(argProvider.DataProvider.fileName);

            id.ThemeIdentify         = "CMA";
            id.ProductIdentify       = "FIR";
            id.SubProductIdentify    = "PLSF";
            id.IsOutput2WorkspaceDir = true;
            DataIdentify dataId = argProvider.DataProvider.DataIdentify;

            if (dataId == null)
            {
                dataId = new DataIdentify();
            }
            id.Satellite     = dataId.Satellite ?? "Unknow";
            id.Sensor        = dataId.Sensor ?? "Unknow";
            id.OrbitDateTime = dataId.OrbitDateTime;
            orbitDateTime    = id.OrbitDateTime;
            return(id.ToWksFullFileName(".txt"));
        }
Esempio n. 30
0
        private RasterIdentify GetRasterIdentify(IRasterDataProvider prd)
        {
            RasterIdentify rst = new RasterIdentify(prd.fileName);
            DataIdentify   id  = prd.DataIdentify;

            if (id != null)
            {
                rst.Satellite = id.Satellite;
                rst.Sensor    = id.Sensor;
                if (id.OrbitDateTime != DateTime.MinValue)
                {
                    rst.OrbitDateTime = id.OrbitDateTime;
                }
            }
            rst.ThemeIdentify         = "CMA";
            rst.ProductIdentify       = _currentProduct.Identify;
            rst.SubProductIdentify    = _currentSubProduct.Identify;
            rst.IsOutput2WorkspaceDir = true;
            return(rst);
        }