%**************************************************************************
%This function calculates the ideal radiation wavelength from the ideal K
%value and undulator period.
%
%Input:
%gamma, electron beam Lorentz factor
%ideal_lambda_u, ideal undulator period (m)
%ideal_k_value, ideal undulator K value that the undulator should be shimmed to
%
%Output:
%ideal_lambda_r, ideal radiation wavelength (m)
%
%Zachary Wolf, 1/7/06

function [ideal_lambda_r] = k_calc_ideal_lambdar(gamma, ideal_lambda_u, ideal_k_value)

%Calculate the ideal radiation wavelength using the ideal K parameter and undulator period
ideal_lambda_r = (1 / 2) * (1 / gamma^2) * (1 + (1 / 2) * ideal_k_value^2) * ideal_lambda_u;

%Done