Skip to content
Snippets Groups Projects
Commit 01f007ca authored by Udo Eisenbarth's avatar Udo Eisenbarth :speech_balloon:
Browse files

Disable lens_test example

The node RealLens is missing in the repo..
parent 7bc742cd
No related branches found
No related tags found
No related merge requests found
use opossum::{
nodes::{RealLens, Source, Detector},
optic_scenery::OpticScenery, error::OpossumError,
error::OpossumError,
//nodes::{RealLens, Source, Detector},
optic_scenery::OpticScenery,
};
use std::fs::File;
use std::io::Write;
fn main() -> Result<(), OpossumError> {
let mut scenery = OpticScenery::new();
scenery.set_description("Lens Ray-trace test".into());
let src = scenery.add_element("Source", Source::default());
let l1 = scenery.add_element("Lens 1", RealLens::default());
let l2 = scenery.add_element("Lens 2", RealLens::default());
let det=scenery.add_element("Detector", Detector::default());
// let mut scenery = OpticScenery::new();
// scenery.set_description("Lens Ray-trace test".into());
// let src = scenery.add_element("Source", Source::default());
// let l1 = scenery.add_element("Lens 1", RealLens::default());
// let l2 = scenery.add_element("Lens 2", RealLens::default());
// let det=scenery.add_element("Detector", Detector::default());
scenery.connect_nodes(src, "out1", l1, "in1")?;
scenery.connect_nodes(l1, "out1", l2, "in1")?;
scenery.connect_nodes(l2, "out1", det, "in1")?;
// scenery.connect_nodes(src, "out1", l1, "in1")?;
// scenery.connect_nodes(l1, "out1", l2, "in1")?;
// scenery.connect_nodes(l2, "out1", det, "in1")?;
let path = "lens_system.dot";
let mut output = File::create(path).unwrap();
write!(output, "{}", scenery.to_dot()).unwrap();
// let path = "lens_system.dot";
// let mut output = File::create(path).unwrap();
// write!(output, "{}", scenery.to_dot()).unwrap();
Ok(())
}
......@@ -59,7 +59,7 @@ impl Spectrum {
})
}
/// Create a new [`Spectrum`] from a CSV (comma-separated values) file.
///
///
/// Currently this function is relatively limited. The CSV file must have a specific format in
/// order to be successfully parsed. It must be a file with two columns and `;` as separator.
/// The first column corresponds to the wavelength in nm, the second columns represent values in
......@@ -476,7 +476,7 @@ pub fn create_nd_glass_spectrum(energy: f64) -> Spectrum {
}
/// Helper function for adding two spectra.
///
/// This function allows for adding two (maybe non-existing = None) spectra with different bandwidth.
/// This function allows for adding two (maybe non-existing = None) spectra with different bandwidth.
/// The resulting spectum is created such that both spectra are contained. The resolution corresponds
/// to the highest (average) resolution of both spectra. If one spectrum is `None` the other spectrum is
/// returned respectively. If both spectra a `None` then also `None`is returned.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment