[ Identification | Description | Input parameters | Output parameters | Links ]

# The `SNS_source` Component

A source that produces a time and energy distribution from the SNS moderator files

## Identification

- Author: G. Granroth
- Origin: SNS Project Oak Ridge National Laboratory
- Date: July 2004
- Version: 1.4

## Description

    Produces a time-of-flight spectrum from SNS moderator files
    moderator files can be obtained from the SNS website .
    The output units of this component are N/pulse
    Notes:
    (1) the raw moderator files are per Sr.  The focusing parameters provide the solid
    angle accepted by the guide to remove the Sr dependence from the output. Therefore
    the best practice is to set xw and yh to the width and height of the next beam
    component, respectively. The dist parameter should then be set as the distance
    from the moderator to the first component.
    (2) This component works purely by interpolation. Therefore be sure that Emin and
    Emax are within the limits of the moderator file

WARNING: This is a contributed Component.

## Input parameters

Parameters in boldface are required; the others are optional.

Name | Unit | Description | Default
--- | --- | --- | ---
S_filename | str | Filename of source data |
width | m | width of moderator |
height | m | height of moderator |
dist | m | Distance from source to the focusing rectangle |
xw | m | Width of focusing rectangle |
yh | m | Height of focusing rectangle |
Emin | meV | minimum energy of neutron to generate |
Emax | meV | maximum energy of neutron to generate |

## Output parameters

Name | Unit | Description | Default
--- | --- | --- | ---
hdiv |  |  |
vdiv |  |  |
p_in |  |  |
inxvec |  |  |
inyvec |  |  |
Pvec |  |  |
xylength |  |  |
tcol |  |  |
Ecol |  |  |
txval |  |  |
tyval |  |  |
tPvec |  |  |
Ptmat |  |  |
EPmax |  |  |
EPmin |  |  |
INorm |  |  |
INorm |  |  |
ntvals |  |  |
idxstart |  |  |
idxstop |  |  |
tidxstart |  |  |
tidxstop |  |  |
nEvals |  |  |
xonly |  |  |
Pfunc |  |  |
txonly |  |  |
tPfunc |  |  |

## Links

- Source code for `SNS_source.comp`.
- Source files SNS_test example instrument

[ Identification | Description | Input parameters | Output parameters | Links ]