/// <summary> /// Returns a two-dimensional array of data in the log /// </summary> /// <returns><see cref="LasData"/></returns> /// Member of <see cref="ILas"/> public LasData Data() { var hds = Header(); var totalHeadersLength = hds.Length; var sB = Regex.Split(_blobString, @"~A(?:\w*\s*)*\n")[1] .Trim(); var sB2literals = Regex.Split(sB, @"\s+").ToArray(); if (sB2literals.Length < 0) { throw new LasError("No data/~A section in the file"); } LasData lasData = new LasData(); var conliteral = Chunk(sB2literals, totalHeadersLength); lasData.literals = conliteral; var sB2doubles = sB2literals.Select(s => ConvertToValue(s)).ToArray(); var condoubles = Chunk(sB2doubles, totalHeadersLength); lasData.numbers = condoubles; return(lasData); }
/// <summary> /// Returns a two-dimensional array of data in the log with all rows containing null values stripped off /// </summary> /// <returns><see cref="LasData"/></returns> /// Member of <see cref="ILas"/> public LasData DataStripped() { var hds = Header(); var nullValue = Well.GetValueOrDefault("NULL").Value; var totalHeadersLength = hds.Length; var sB = Regex.Split(_blobString, @"~A(?:\w*\s*)*\n")[1] .Trim(); var sB2literals = Regex.Split(sB, @"\s+").ToArray(); if (sB2literals.Length < 0) { throw new LasError("No data/~A section in the file"); } LasData lasData = new LasData(); lasData.literals = Chunk(sB2literals, totalHeadersLength).Where(x => !x.Contains(nullValue)).ToArray(); var sB2doubles = sB2literals.Select(s => ConvertToValue(s)).ToArray(); lasData.numbers = Chunk(sB2doubles, totalHeadersLength).Where(x => !x.Contains(ConvertToValue(nullValue))).ToArray(); return(lasData); }