sample_cr_params

romanisim.cr.sample_cr_params(N_samples, N_i=4096, N_j=4096, min_dEdx=None, max_dEdx=None, min_cr_len=None, max_cr_len=None, grid_size=None, rng=None, seed=48)

Generates cosmic ray parameters randomly sampled from distribution.

Parameters:
N_samplesint

Number of CRs to generate.

N_iint

Number of pixels along i-axis of detector

N_jint

Number of pixels along j-axis of detector

min_dEdxfloat

Minimum value of CR energy loss (dE/dx), units of eV / micron.

max_dEdxfloat

Maximum value of CR energy loss (dE/dx), units of eV / micron.

min_cr_lenfloat

Minimum length of cosmic ray trail, units of micron.

max_cr_lenfloat

Maximum length of cosmic ray trail, units of micron.

grid_sizeint

Number of points on the cosmic ray length and energy loss grids. Increasing this parameter increases the level of sampling for the distributions.

rngnp.random.Generator

Random number generator to use

seedint

seed to use for random number generator

Returns:
cr_xfloat, between 0 and N_x-1

x pixel coordinate of cosmic ray, units of pixels.

cr_yfloat between 0 and N_y-1

y pixel coordinate of cosmic ray, units of pixels.

cr_phifloat between 0 and 2pi

Direction of cosmic ray, units of radians.

cr_lengthfloat

Cosmic ray length, units of micron.

cr_dEdxfloat

Cosmic ray energy loss, units of eV / micron.