diff --git a/mcstas-comps/sources/Source_div_quasi.comp b/mcstas-comps/sources/Source_div_quasi.comp index 4b708cb44..630ae3100 100644 --- a/mcstas-comps/sources/Source_div_quasi.comp +++ b/mcstas-comps/sources/Source_div_quasi.comp @@ -35,8 +35,8 @@ * %P * xwidth: [m] Width of source * yheight: [m] Height of source -* focus_aw: [rad] Std. dev. (Gaussian) or maximal (uniform) horz. width divergence -* focus_ah: [rad] Std. dev. (Gaussian) or maximal (uniform) vert. height divergence +* focus_aw: [rad] Std. dev. (Gaussian) or maximal (uniform) horz. width divergence. focus_xw overrrides if it is more restrictive. +* focus_ah: [rad] Std. dev. (Gaussian) or maximal (uniform) vert. height divergence. focus_yh overrrides if it is more restrictive. * focus_xw: [m] Width of sampling window * focus_yh: [m] Height of sampling window * dist: [m] Downstream distance to place sampling target window @@ -178,20 +178,14 @@ INITIALIZE /*check if divergence limits are compatible with focus_xw, focus_yh*/ if(focus_xw!=0){ double maxdivh=atan((xwidth+focus_xw)/dist); - if (focus_aw>maxdivh){ + if (focus_aw>maxdivh || focus_aw==0 ){ focus_aw=maxdivh; - if (verbose){ - fprintf(stderr,"WARNING(%s): sampling width does not support full divergence. Adjusting to focus_aw=%g rad\n",NAME_CURRENT_COMP,focus_aw); - } } } if(focus_yh!=0){ double maxdivv=atan((yheight+focus_yh)/dist); - if (focus_ah>maxdivv){ + if (focus_ah>maxdivv || focus_ah==0 ){ focus_ah=maxdivv; - if (verbose){ - fprintf(stderr,"WARNING(%s): sampling height does not support full divergence. Adjusting to focus_ah=%g rad\n",NAME_CURRENT_COMP,focus_ah); - } } } diff --git a/mcxtrace-comps/sources/Source_div_quasi.comp b/mcxtrace-comps/sources/Source_div_quasi.comp index 7a49337ad..7fd7bc9b6 100644 --- a/mcxtrace-comps/sources/Source_div_quasi.comp +++ b/mcxtrace-comps/sources/Source_div_quasi.comp @@ -32,8 +32,8 @@ * %Parameters * xwidth: [m] Width of source * yheight: [m] Height of source -* focus_aw: [rad] Std. dev. (Gaussian) or maximal (uniform) horz. width divergence -* focus_ah: [rad] Std. dev. (Gaussian) or maximal (uniform) vert. height divergence +* focus_aw: [rad] Std. dev. (Gaussian) or maximal (uniform) horz. width divergence. focus_xw overrrides if it is more restrictive. +* focus_ah: [rad] Std. dev. (Gaussian) or maximal (uniform) vert. height divergence. focus_yh overrrides if it is more restrictive. * focus_xw: [m] Width of sampling window * focus_yh: [m] Height of sampling window * dist: [m] Downstream distance to place sampling target window @@ -174,24 +174,17 @@ INITIALIZE /*check if divergence limits are compatible with focus_xw, focus_yh*/ if(focus_xw!=0){ double maxdivh=atan((xwidth+focus_xw)/dist); - if (focus_aw>maxdivh){ + if (focus_aw>maxdivh || focus_aw==0 ){ focus_aw=maxdivh; - if (verbose){ - fprintf(stderr,"WARNING(%s): sampling width does not support full divergence. Adjusting to focus_aw=%g rad\n",NAME_CURRENT_COMP,focus_aw); - } } } if(focus_yh!=0){ double maxdivv=atan((yheight+focus_yh)/dist); - if (focus_ah>maxdivv){ + if (focus_ah>maxdivv || focus_ah==0 ){ focus_ah=maxdivv; - if (verbose){ - fprintf(stderr,"WARNING(%s): sampling height does not support full divergence. Adjusting to focus_ah=%g rad\n",NAME_CURRENT_COMP,focus_ah); - } } } - %} TRACE @@ -257,7 +250,7 @@ TRACE }else if (lambda0){ if (!dlambda){ l=lambda0; - }else if (gauss){ + }else if (gauss){mcxtrace-comps/sources/Source_div_quasi.comp l=lambda0+dlambda*randnorm(); }else{ l=randpm1()*dlambda + lambda0;