Changeset 3206
- Timestamp:
- 11/17/11 10:05:42 (6 months ago)
- Location:
- trunk
- Files:
-
- 6 modified
-
nlib/contrib/Monochromator_2foc.comp (modified) (3 diffs)
-
nlib/optics/Guide_anyshape.comp (modified) (1 diff)
-
nlib/optics/Monochromator_curved.comp (modified) (3 diffs)
-
nlib/optics/Monochromator_flat.comp (modified) (1 diff)
-
nlib/optics/Monochromator_pol.comp (modified) (1 diff)
-
src/mcplot.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/nlib/contrib/Monochromator_2foc.comp
r3177 r3206 133 133 if (reflect != NULL) 134 134 { 135 if (verbose) fprintf(stdout, "Monochromator_2foc : %s : Reflectivity data (k, R)\n", NAME_CURRENT_COMP);135 if (verbose) fprintf(stdout, "Monochromator_2foc: %s : Reflectivity data (k, R)\n", NAME_CURRENT_COMP); 136 136 Table_Read(&rTable, reflect, 1); /* read 1st block data from file into rTable */ 137 137 Table_Rebin(&rTable); /* rebin as evenly, increasing array */ … … 214 214 if (my_r0 >= 1) 215 215 { 216 if (verbose) fprintf(stdout, "Warning: Monochromator_2foc : lowered reflectivity from %f to 0.99 (k=%f)\n", my_r0, k); 216 if (verbose) fprintf(stdout, "Warning: Monochromator_2foc: %s: lowered reflectivity from %f to 0.99 (k=%f)\n", 217 NAME_CURRENT_COMP, my_r0, k); 217 218 my_r0=0.99; 218 219 } 219 220 if (my_r0 < 0) 220 221 { 221 if (verbose) fprintf(stdout, "Warning: Monochromator_2foc : raised reflectivity from %f to 0 (k=%f)\n", my_r0, k); 222 if (verbose) fprintf(stdout, "Warning: Monochromator_2foc: %s: raised reflectivity from %f to 0 (k=%f)\n", 223 NAME_CURRENT_COMP, my_r0, k); 222 224 my_r0=0; 223 225 } … … 226 228 z = z1; 227 229 t = t1; 228 229 p *= fabs(my_r0)*exp(-tmp3*tmp3*4*log(2)); /* Use mosaics */ 230 231 /* reflectivity */ 232 t1 = fabs(my_r0)*exp(-tmp3*tmp3*4*log(2)); 233 if (t1 <= 0) ABSORB; 234 if (t1 > 1) t1 = 1; 235 p *= t1; /* Use mosaics */ 236 230 237 tmp1 = 2*theta; 231 238 cs = cos(tmp1); -
trunk/nlib/optics/Guide_anyshape.comp
r3177 r3206 150 150 151 151 if (R <= 0) ABSORB; 152 if (R > 1) { 153 fprintf(stderr,"Guide_anyshape: %s: Warning: Reflectivity R=%g > 1 lowered to R=1.\n", NAME_CURRENT_COMP, R); 154 R=1; 155 } 152 156 153 157 /* now handle either probability when transmit or reflect */ -
trunk/nlib/optics/Monochromator_curved.comp
r3198 r3206 182 182 if (reflect != NULL && r0 && strlen(reflect) && strcmp(reflect,"NULL") && strcmp(reflect,"0")) 183 183 { 184 if (verbose) fprintf(stdout, "Monochromator_curved : %s: Reflectivity data (k, R) from %s\n", NAME_CURRENT_COMP, reflect);184 if (verbose) fprintf(stdout, "Monochromator_curved: %s: Reflectivity data (k, R) from %s\n", NAME_CURRENT_COMP, reflect); 185 185 Table_Read(&rTable, reflect, 1); /* read 1st block data from file into rTable */ 186 186 Table_Rebin(&rTable); /* rebin as evenly, increasing array */ … … 191 191 if (transmit != NULL && strlen(transmit) && strcmp(transmit,"NULL") && strcmp(transmit,"0")) 192 192 { 193 if (verbose) fprintf(stdout, "Monochromator_curved : %s: Transmission data (k, T) from %s\n", NAME_CURRENT_COMP, transmit);193 if (verbose) fprintf(stdout, "Monochromator_curved: %s: Transmission data (k, T) from %s\n", NAME_CURRENT_COMP, transmit); 194 194 Table_Read(&tTable, transmit, 1); /* read 1st block data from file into rTable */ 195 195 Table_Rebin(&tTable); /* rebin as evenly, increasing array */ … … 384 384 vy = K2V*(kiy+q_y); 385 385 vz = K2V*(kiz+q_z); 386 p *= p_reflect/(total*GAUSS(phi,0,mos_sample)); 386 p_reflect /= total*GAUSS(phi,0,mos_sample); 387 if (p_reflect <= 0) ABSORB; 388 if (p_reflect > 1) p_reflect = 1; 389 p *= p_reflect; 387 390 388 391 SCATTER; -
trunk/nlib/optics/Monochromator_flat.comp
r3177 r3206 243 243 vy = K2V*(kiy+q_y); 244 244 vz = K2V*(kiz+q_z); 245 p *= p_reflect/(total*GAUSS(phi,0,mos_sample)); 245 p_reflect /= total*GAUSS(phi,0,mos_sample); 246 if (p_reflect <= 0) ABSORB; 247 if (p_reflect > 1) p_reflect = 1; 248 p *= p_reflect; 246 249 SCATTER; 247 250 } /* End MC choice to reflect or transmit neutron */ -
trunk/nlib/optics/Monochromator_pol.comp
r3177 r3206 156 156 // calculate deltalambda squared and sigmaLambda squared 157 157 dlambda2 = (lambda-lambdaBragg)*(lambda-lambdaBragg); 158 // The sigmaLambda is propagated by differentiating th ge bragg158 // The sigmaLambda is propagated by differentiating the Bragg 159 159 // condition: lambda = 2*d*sinTheta 160 160 sigmaLambda2 = 2.0*2.0 * sinTheta*sinTheta * d_rms*d_rms+ -
trunk/src/mcplot.py
r2916 r3206 412 412 # No filename given, assume mcstas.sim in current dir 413 413 this_File = "mcstas.sim" 414 415 # FIX: make the path to this_File absolute to always get a non-empty dirname. 416 this_File = os.path.abspath(this_File) 414 417 415 418 if os.path.isdir(this_File)==1: 416 419 # dirname given, assume mcstas.sim in that dir. 417 420 this_File = os.path.join(this_File,'mcstas.sim') 418 421 419 422 if os.path.dirname(this_File) != '': 420 423 pwd = os.getcwd()
