pub struct Las {
pub blob: String,
}Expand description
Represents a parsed well log file
Fields§
§blob: Stringblob holds the String data read from the file
§Note
There’s no need to access the blob field, only exposed for debugging
Implementations§
Source§impl Las
impl Las
Sourcepub fn version(&self) -> f64
pub fn version(&self) -> f64
Returns f64 representing the version of Las specification
§Example
use lasrs::Las;
let log = Las::new("./sample/example.las");
assert_eq!(log.version(), 2.0);Sourcepub fn wrap(&self) -> bool
pub fn wrap(&self) -> bool
Returns a bool denoting the wrap mode
§Example
use lasrs::Las;
let log = Las::new("./sample/example.las");
assert_eq!(log.wrap(), false);Sourcepub fn headers(&self) -> Vec<String>
pub fn headers(&self) -> Vec<String>
Returns Vec<String> representing the titles of the curves (~C),
Which can be mapped to a row in ~A (data) section
§Example
use lasrs::Las;
let log = Las::new("./sample/A10.las");
assert_eq!(
log.headers(),
vec!["DEPT", "Perm", "Gamma", "Porosity", "Fluvialfacies", "NetGross"],
);Sourcepub fn data(&self) -> Vec<Vec<f64>>
pub fn data(&self) -> Vec<Vec<f64>>
Returns Vec<Vec<f64>> where every Vec
§Example
use lasrs::Las;
let log = Las::new("./sample/A10.las");
let expected: Vec<Vec<f64>> = vec![
vec![1501.129, -999.25, -999.25, 0.270646, 0.0, 0.0],
vec![1501.629, 124.5799, 78.869453, 0.267428, 0.0, 0.0],
];
assert_eq!(expected, &log.data()[3..5]);Sourcepub fn column_count(&self) -> usize
pub fn column_count(&self) -> usize
Returns usize representing the total number of columns/curves
§Example
use lasrs::Las;
let log = Las::new("./sample/example.las");
assert_eq!(8, log.column_count());Sourcepub fn row_count(&self) -> usize
pub fn row_count(&self) -> usize
Returns usize representing the total number of entry in ~A (data) section
§Example
use lasrs::Las;
let log = Las::new("./sample/example.las");
assert_eq!(4, log.row_count());Sourcepub fn headers_and_desc(&self) -> Vec<(String, String)>
pub fn headers_and_desc(&self) -> Vec<(String, String)>
Returns Vec<(String, String)> where the first item in the tuple is the title of curve
and the second is the full description of the curve
§Example
use lasrs::Las;
let log = Las::new("./sample/example.las");
let mut expected = vec![
("DEPT".to_owned(), "DEPTH".to_owned()),
("DT".to_owned(), "SONIC TRANSIT TIME".to_owned()),
("ILD".to_owned(), "DEEP RESISTIVITY".to_owned()),
];
let mut result = log.headers_and_desc();
result.sort_by(|a, b| a.0.partial_cmp(&b.0).unwrap());
assert_eq!(expected, &result[..3]);Sourcepub fn curve_params(&self) -> HashMap<String, WellProp>
pub fn curve_params(&self) -> HashMap<String, WellProp>
Returns HashMap<String, WellProp> containing all the WellProp(s) in a ~C (curve) section
§Example
use lasrs::{Las, WellProp};
let log = Las::new("./sample/example.las");
let curve_section = log.curve_params();
assert_eq!(
&WellProp::new("OHMM", "SHALLOW RESISTIVITY", "07 220 04 00"),
curve_section.get("SFLU").unwrap()
);Sourcepub fn well_info(&self) -> HashMap<String, WellProp>
pub fn well_info(&self) -> HashMap<String, WellProp>
Returns HashMap<String, WellProp> containing all the WellProp(s) in a ~W (well) section
§Example
use lasrs::{Las, WellProp};
let log = Las::new("./sample/example.las");
let well_section = log.well_info();
assert_eq!(
&WellProp::new("M", "STOP DEPTH", "1669.7500"),
well_section.get("STOP").unwrap()
);Sourcepub fn log_params(&self) -> HashMap<String, WellProp>
pub fn log_params(&self) -> HashMap<String, WellProp>
Returns HashMap<String, WellProp> containing all the WellProp(s) in a ~P (parameter) section
§Example
use lasrs::{Las, WellProp};
let log = Las::new("./sample/example.las");
let params = log.log_params();
assert_eq!(
&WellProp::new("", "MUD TYPE", "GEL CHEM"),
params.get("MUD").unwrap()
);Sourcepub fn other(&self) -> String
pub fn other(&self) -> String
Returns a String representing extra information in ~O (other) section
§Example
use lasrs::Las;
let log = Las::new("./sample/example.las");
let expected = [
"Note: The logging tools became stuck at 625 metres causing the data",
"between 625 metres and 615 metres to be invalid.",
];
assert_eq!(log.other(), expected.join("\n").to_string());