private void InitArgSet() { string argFileName = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "SystemData\\ProductArgs\\DST\\FY3ExtractThreshold.txt"); if (!File.Exists(argFileName)) { return; } string[] valueLines = File.ReadAllLines(argFileName); if (valueLines != null && valueLines.Length != 12) { return; } BareLandArg = new DstFY3ExtractArg(); VegetationArg = new DstFY3ExtractArg(); WaterArg = new DstFY3ExtractArg(); for (int j = 0; j < valueLines.Length; j++) { string[] values = valueLines[j].Split(new char[] { '\t' }, StringSplitOptions.RemoveEmptyEntries); if (values.Length != 18) { return; } SetArgsWithSingleLine(j, values); } isSmooth = true; }
private void SetArg(int index, string[] valueStrs, DstFY3ExtractArg arg) { float value; if (float.TryParse(valueStrs[0], out value)) { arg.Ref470[index] = value; } if (float.TryParse(valueStrs[1], out value)) { arg.Ref650[index] = value; } if (float.TryParse(valueStrs[5], out value)) { arg.Ref1380[index] = value; } if (float.TryParse(valueStrs[6], out value)) { arg.TBB11[index] = value; } if (float.TryParse(valueStrs[7], out value)) { arg.TBB37[index] = value; } if (float.TryParse(valueStrs[8], out value)) { arg.BTD11_12[index] = value; } if (float.TryParse(valueStrs[9], out value)) { arg.BTD11_37[index] = value; } if (float.TryParse(valueStrs[10], out value)) { arg.R47_64[index] = value; } if (float.TryParse(valueStrs[11], out value)) { arg.NDVI[index] = value; } if (float.TryParse(valueStrs[12], out value)) { arg.NDSI[index] = value; } if (float.TryParse(valueStrs[14], out value)) { arg.NDDI[index] = value; } if (float.TryParse(valueStrs[17], out value)) { arg.IDSI[index] = value; } }