init_bpm

ndmapper.lib.cosmetics.init_bpm(*args, **kwargs)[source] [edit on github]

Initialize a bad pixel mask array from a string listing the corresponding regions in NumPy or IRAF/FITS syntax.

Parameters:

reference : DataFile

DataFile whose NDLater instances the bad pixel mask should match (in number and array dimensions).

regions : list of list of str

A list containing one sub-list of bad regions per NDLater instance of the reference DataFile. Each bad region is specified as a string in NumPy/IRAF syntax, eg. ‘100:110,50:60’, ‘100,*’ or ‘:,99’. The indices can be specified in either NumPy or FITS ordering (see below).

convention : str

Indexing convention for the region strings: ‘NumPy’ (default) or ‘FITS’ (case insensitive). The former uses 0-based indexing by (..., plane, row, column), similar to C or matrix notation, exclusive of the ending row/column, while the latter uses 1-based indexing by (column, row, plane, ...), similar to ForTran or IRAF and inclusive of the ending row/column (with the same origin in either case).

value : int, optional

Mask value for bad regions (default 1).

filename : str or FileName, optional

Filename for output DataFile.