mirror of
https://github.com/dnlbauer/WHAM.git
synced 2026-09-10 22:25:31 +00:00
add pi to min/max
This commit is contained in:
@@ -31,14 +31,14 @@ args:
|
||||
takes_value: true
|
||||
required: true
|
||||
allow_hyphen_values: true
|
||||
help: Histogram minima (comma separated for multiple dimensions).
|
||||
help: Histogram minima (comma separated for multiple dimensions). Also accepts "pi".
|
||||
- max_hist:
|
||||
long: max
|
||||
value_name: HIST_MAX
|
||||
takes_value: true
|
||||
required: true
|
||||
allow_hyphen_values: true
|
||||
help: Histogram maxima (comma separated)
|
||||
help: Histogram maxima (comma separated). Also accepts "pi".
|
||||
- bins:
|
||||
short: b
|
||||
long: bins
|
||||
|
||||
20
src/main.rs
20
src/main.rs
@@ -23,9 +23,25 @@ fn cli() -> Result<Config> {
|
||||
let cyclic: bool = matches.is_present("cyclic");
|
||||
|
||||
let hist_min: Vec<f64> = matches.value_of("min_hist").unwrap()
|
||||
.split(',').map(|x| { x.parse().unwrap() }).collect();
|
||||
.split(',').map(|x| {
|
||||
if x.to_ascii_lowercase() == "pi" {
|
||||
std::f64::consts::PI
|
||||
} else if x.to_ascii_lowercase() == "-pi" {
|
||||
-std::f64::consts::PI
|
||||
} else {
|
||||
x.parse().unwrap()
|
||||
}
|
||||
}).collect();
|
||||
let hist_max: Vec<f64> = matches.value_of("max_hist").unwrap()
|
||||
.split(',').map(|x| { x.parse().unwrap() }).collect();
|
||||
.split(',').map(|x| {
|
||||
if x.to_ascii_lowercase() == "pi" {
|
||||
std::f64::consts::PI
|
||||
} else if x.to_ascii_lowercase() == "-pi" {
|
||||
-std::f64::consts::PI
|
||||
} else {
|
||||
x.parse().unwrap()
|
||||
}
|
||||
}).collect();
|
||||
let num_bins: Vec<usize> = matches.value_of("bins").unwrap()
|
||||
.split(',').map(|x| { x.parse().unwrap() }).collect();
|
||||
let bootstrap: usize = matches.value_of("bootstrap").unwrap_or("0").parse()
|
||||
|
||||
Reference in New Issue
Block a user