pyimcom.diagnostics.dynrange

Code to construct dynamic range estimates from block files.

Functions

gen_dynrange_data

Generates dynamic range data and writes to files.

Attributes

nscale

Functions

gen_dynrange_data(inpath, outstem[, rpix_try, nblockmax])

Takes files from inpath and writes histograms to outstem.

fn(ibx, iby)

Module Contents

nscale = 1[source]
gen_dynrange_data(inpath, outstem, rpix_try=50, nblockmax=100)[source]

Takes files from inpath and writes histograms to outstem. inpath should be a function that takes ix and iy and returns a file name

Optional input parameters: rpix_try : int = radius over which to compute profiles

(needs to be an integer less than the padding, will truncate)

nblockmaxmaximum block number to consider (default 100, only need to

reduce this if you want to make a report generate faster for testing)

The output files are:

Histograms:

outstem +’_sqrtS_hist.dat’: histogram of noise amplification factor sqrtS outstem +’_neff_hist.dat’: histogram of effective exposure number

Both of these have a header that indicates the fraction of data that is off scale high.

dynamic range file:

outstem +’_dynrange.dat’: table of percentiles of noisy star images

(Columns are radius and [1,5,25,50,75,95,99] percentiles)

Returns a dictionary of which files were successfully generated: output[key] = filename (if successful), None (if not successful) Current file keys: ‘SQRTS’, ‘NEFF’, ‘DYNRANGE’ Header information is in keys ‘SQRTS_HEADER’ and ‘NEFF_HEADER’ Number of blocks read is in ‘COUNTBLOCK’

fn(ibx, iby)[source]