use crate::settings::EquipmentSettings;

pub fn calculate_psf_in_pixels(settings: &EquipmentSettings) -> f64
{
	settings.instrument_psf_fwhm_nm() / settings.camera_pixel_size_nm()
}

#[cfg(test)]
mod tests 
{
	use super::*;

	#[test]
	fn name() 
	{
		let mag_factor = 10.0;
		let instrument_fwhm_nm = 270.0 * mag_factor;
		let camera_pixel_size_nm = 160.0;
		let settings = EquipmentSettings::default().with_instrument_psf_fwhm_nm(instrument_fwhm_nm).with_camera_pixel_size_nm(camera_pixel_size_nm);
		assert_eq!(calculate_psf_in_pixels(&settings), 16.875)
	}
}