solid_waffle.flat_simulator.simulate_flat

Flat simulator.

Notes

Long description:

Start with a realization of a perfect detector plus some BFE effect to
the charge in a given pixel
1.  The mean charge <Q_a(i,j)> = It_a + 0.5*Sigma_a*I^2*t_a^2 (Eqn 36)
2.  Realization of a 4096 x 4096 pixel^2 grid with 66 time samples
This final result data cube will then be [4k, 4k, 66] in dimensions
and will require some kind of identifying header, currently taken
from one of the DCL flats.  This is charge.
3.  Convert to ADU/DN via gain ~ number(e-)/counts;  set ~ FWD/2^16

Run tests with 128x128 or something small...
current I is per pixel (units: e/s)
time t (units: s)
time step for read from t_a to t_a+1 (will need to check # for convergence)

NOTE: to run some modes, one needs:
 ** a copy of a DCL flat file with the name set below

Classes

Simulation

Run a flat field simulation.

Functions

PairPoisson(myMean, myShape, QY_offset, QY_p2, RNG)

Build distribution of pairs of points.

run_config(filename)

Runs a configuration from a file name.

Module Contents

PairPoisson(myMean, myShape, QY_offset, QY_p2, RNG)[source]

Build distribution of pairs of points.

Parameters:
  • myMean (float) – mean number of photons per pixel (number of e is 2x larger).

  • myShape ((int, int)) – Shape of numpy array to generate.

  • QY_offset (int) – Maximum offset of the “other” electron to consider (usually 2 is enough).

  • QY_p2 (np.array) – The pairwise probability array.

  • RNG (numpy.random.Generator or numpy.random.RandomState) – The random number generator.

Returns:

Pair-Poisson random array, including both Poisson photon generation and then the electron pairs being collected into pixels; shape = myShape..

Return type:

np.array

class Simulation(cfg, verbose=True)[source]

Run a flat field simulation.

Parameters:
  • cfg (str) – The configuration as a multiline string.

  • verbose (bool, optional) – Whether to talk a lot.

pars[source]

Parameter dictionary for this simulation.

Type:

dict

__init__()[source]

Constructor.

run()[source]

Runs the simulation.

pars[source]
run(verbose=False)[source]

Runs the simulation.

Parameters:

verbose (bool, optional) – Whether to print lots of status updates.

Return type:

None

run_config(filename)[source]

Runs a configuration from a file name.

Parameters:

filename (str) – The name of the file.

Return type:

None