Skip to content

Commit

Permalink
potential fix for McStasMcXtrace#1735
Browse files Browse the repository at this point in the history
  • Loading branch information
ebknudsen committed Nov 11, 2024
1 parent f1c14e0 commit c508e28
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions mcxtrace-comps/sources/Source_div_quasi.comp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c508e28

Please sign in to comment.