Loads particles positions from the given file path, automatically detects the file format
(
input_file: P,
_format_params: &InputFormatParameters,
)
| 42 | |
| 43 | /// Loads particles positions from the given file path, automatically detects the file format |
| 44 | pub fn read_particle_positions<R: Real, P: AsRef<Path>>( |
| 45 | input_file: P, |
| 46 | _format_params: &InputFormatParameters, |
| 47 | ) -> Result<Vec<Vector3<R>>, anyhow::Error> { |
| 48 | let input_file = input_file.as_ref(); |
| 49 | info!( |
| 50 | "Reading particle dataset from \"{}\"...", |
| 51 | input_file.display() |
| 52 | ); |
| 53 | |
| 54 | let particle_positions = { |
| 55 | profile!("loading particle positions"); |
| 56 | io::particles_from_file(input_file)? |
| 57 | }; |
| 58 | |
| 59 | info!( |
| 60 | "Successfully read dataset with {} particle positions.", |
| 61 | particle_positions.len() |
| 62 | ); |
| 63 | |
| 64 | Ok(particle_positions) |
| 65 | } |
| 66 | |
| 67 | /// Tries to read particle positions as well as attributes with the given names from the specified file |
| 68 | pub fn read_particle_positions_with_attributes<R: Real, P: AsRef<Path>>( |
no test coverage detected