public static Watershed ReadTimeSeriesProfiles(string watershedName, DateTime start, DateTime end, string dssFileName) { Watershed rval = new Watershed(watershedName); float[,] profile = null; using (DssReader dss = new DssReader(dssFileName, DssReader.MethodID.MESS_METHOD_GENERAL_ID, DssReader.LevelID.MESS_LEVEL_NONE)) { Console.WriteLine("Reading" + dssFileName); DssPathCollection dssPaths = dss.GetCatalog(); // sorted // var dssPaths = rawDssPaths.OrderBy(a => a, new PathComparer()).ToArray(); // sorted int size = dssPaths.Count(); if (size == 0) { throw new Exception("Empty DSS catalog"); } // /RUSSIANNAPA/APCC1/FLOW/01SEP2019/1HOUR/|T:0212019/ for (int i = 0; i < size; i++) { if (i % 100 == 0) { Console.Write("."); } DssPath path = dssPaths[i]; DateTime issueDate = ParseIssueDate(path.Fpart); if (issueDate >= start && issueDate <= end && path.Apart == watershedName) { var ts = dss.GetTimeSeriesProfile(path); ArrayUtility.TransposeDoubleToFloat(ts.Values, ref profile); rval.AddForecast(path.Bpart, issueDate, profile, ts.Times); } } } return(rval); }