diff options
author | iximeow <me@iximeow.net> | 2019-03-24 16:38:18 -0700 |
---|---|---|
committer | iximeow <me@iximeow.net> | 2019-03-24 16:38:18 -0700 |
commit | f3c683e77271cce88c45201154b9c2807327a54e (patch) | |
tree | 8db7ed355e267c8b868c39163d1b07f5d48821da | |
parent | 39a4ce0dc9e55d488240d2e5a353f8e86dbb4a51 (diff) |
add a notion of test mode to qhy/asi capture
-rw-r--r-- | src/main.rs | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/src/main.rs b/src/main.rs index 368a7d4..4a96614 100644 --- a/src/main.rs +++ b/src/main.rs @@ -41,19 +41,26 @@ fn operate_qhy() { println!("4x4: {}", camera.has_param(Control::Bin4x4Mode)); // camera.set_param(Control::Speed, 1.0).unwrap(); println!("current temp: {}", camera.get_param(Control::CurTemp)); - camera.set_defaults().unwrap(); - camera.set_param(Control::CONTROL_WBR, 4027.0).unwrap(); - camera.set_param(Control::CONTROL_WBG, 4027.0).unwrap(); - camera.set_param(Control::CONTROL_WBB, 4027.0).unwrap(); -// camera.set_bin_mode(2).unwrap(); - let object = "jupiter"; - for i in 0..10 { - camera.take_image(&format!("{}_{}.png", object, i));//, i)); + println!("Gain: {:?}", camera.get_param_limits(Control::Gain)); + println!("Offset: {:?}", camera.get_param_limits(Control::Offset)); + println!("USBTraffic: {:?}", camera.get_param_limits(Control::USBTraffic)); + println!("Gama: {:?}", camera.get_param_limits(Control::Gamma)); + camera.set_param(Control::CONTROL_WBR, 2750.0).unwrap(); + camera.set_param(Control::CONTROL_WBG, 2500.0).unwrap(); + camera.set_param(Control::CONTROL_WBB, 3000.0).unwrap(); + //camera.set_bin_mode(2).unwrap(); + if !test { + let object = "m13"; + for i in 0..20 { + camera.take_image(&format!("{}_{}.png", object, i));//, i)); + } + } else { + camera.take_image("qhy_test_2.png").unwrap(); } camera.release().unwrap(); } -fn operate_asi() { +fn operate_asi(test: bool) { println!("Operating on asi camera ... or i'll die trying"); let mut camera = asicam::acquire(0).unwrap(); @@ -75,13 +82,14 @@ fn operate_asi() { } } */ - camera.set_exposure_ms(45000).unwrap(); + camera.set_exposure_ms(1).unwrap(); // camera.set_control_value(ControlType::Exposure, 70000000).unwrap(); - camera.set_control_value(ControlType::Gain, 350).unwrap(); + camera.set_control_value(ControlType::Gain, 475).unwrap(); camera.set_control_value(ControlType::Offset, 0).unwrap(); camera.set_control_value(ControlType::HardwareBin, 0).unwrap(); camera.set_roi_format(camera.width, camera.height, 1, ImageType::RGB24).unwrap(); - take_calibration_images(&camera, 40, "dark_gain_350_exposure_45000"); + camera.take_image("asi_test.png").unwrap(); +// take_calibration_images(&camera, 40, "dark_gain_350_exposure_45000"); /* for exposure in [1000 * 1000 * 10].iter() { camera.set_control_value(ControlType::Exposure, *exposure).unwrap(); |