Persistence

class romanisim.persistence.Persistence(x=None, t=None, index=None, A=None, x0=None, dx=None, alpha=None, gamma=None)

Bases: object

Track persistence information.

There are two important sets of things to keep track of with persistence:

  • how pixels respond to persistence

  • what pixels have experienced large fluxes in the past and may be affected by persistence.

This class tracks both of those quantities. The first category is expected to be largely constant with time and basically only a function of the specific device doing the imaging. The second category changes in each exposure as new bright stars are observed.

Construct a new Persistence instance.

Parameters:
xnp.ndarray[float]

Fluence level (electrons)

tnp.ndarray[float]

Time since exposure (s)

indexnp.ndarray[integer]

Indices of persistence-affected pixels (1D into raveled array)

Afloat

Amplitude parameter of persistence (electrons)

x0float

Pivot fluence (electrons)

dxfloat

dx parameter (electrons)

alphafloat

Power law index scaling with fluence

gammafloat

Power law index scaling with time

Methods Summary

add_to_read(image, tnow[, rng, seed])

Add persistence signature to image.

current(tnow)

Evaluate current in electron / s from past persistence artifacts at time tnow.

from_dict(d)

Convert a dictionary to a Persistence object.

read(filename)

Read a persistence dictionary from a simulated image.

to_dict()

Convert this persistence object to a dictionary.

update(image, tnow)

Update stored fluence values of events worth tracking for future persistence.

write(filename)

Write a persistence dictionary from a simulated image.

Methods Documentation

add_to_read(image, tnow, rng=None, seed=50)

Add persistence signature to image.

Parameters:
imagenp.ndarray[float], shape: (npix_x, npix_y)

Image to which to add persistence (electrons)

tnowfloat

Current time (MJD)

rngnp.random.Generator

Random number generator

seedint

Seed to use if instantiating new random number generator.

current(tnow)

Evaluate current in electron / s from past persistence artifacts at time tnow.

Parameters:
tnowfloat

Current time (MJD)

Returns:
Current in electron / s in pixels due to past persistence events.
static from_dict(d)

Convert a dictionary to a Persistence object.

Parameters:
ddict

The dictionary representing the persistence object.

Returns:
Persistence object represented by d.
static read(filename)

Read a persistence dictionary from a simulated image.

Parameters:
filenamestr

The file name to read

Returns:
Persistence object stored in filename.
to_dict()

Convert this persistence object to a dictionary.

Returns:
dictionary representing persistence object.
update(image, tnow)

Update stored fluence values of events worth tracking for future persistence.

New persistence-affected pixels are added and old ones removed according to whether the predicted persistence rate is larger than parameters.persistence[‘ignorerate’].

Parameters:
imagenp.ndarray[float]

Image of total electrons accumulated in exposure

tnowfloat

MJD of current observation

write(filename)

Write a persistence dictionary from a simulated image.

Parameters:
filenamestr

The file name to read