radial_profile
- poppy.radial_profile(hdulist_or_filename=None, ext=0, ee=False, center=None, stddev=False, mad=False, binsize=None, maxradius=None, normalize='None', pa_range=None, slice=0, custom_function=None)[source]
Compute a radial profile of the image.
This computes a discrete radial profile evaluated on the provided binsize. For a version interpolated onto a continuous curve, see measure_radial().
Code taken pretty much directly from pydatatut.pdf
- Parameters:
- hdulist_or_filenamestring
FITS HDUList object or path to a FITS file. NaN values in the FITS data array are treated as masked and ignored in computing bin statistics.
- extint
Extension in FITS file
- eebool
Also return encircled energy (EE) curve in addition to radial profile?
- centertuple of floats
Coordinates (x,y) of PSF center, in pixel units. Default is image center.
- binsizefloat
size of step for profile. Default is pixel size.
- stddevbool
Compute standard deviation in each radial bin, not average?
- madbool
Compute median absolute deviation (MAD) in each radial bin. Cannot be used at same time as stddev; pick one or the other.
- normalizestring
set to ‘peak’ to normalize peak intensity =1, or to ‘total’ to normalize total flux=1. Default is no normalization (i.e. retain whatever normalization was used in computing the PSF itself)
- maxradiusfloat, optional
Maximum radius to compute radial profile to. If not set, will be computed for all radii within the image.
- pa_rangelist of floats, optional
Optional specification for [min, max] position angles to be included in the radial profile. I.e. calculate that profile only for some wedge, not the full image. Specify the PA in degrees counterclockwise from +Y axis=0. Note that you can specify ranges across zero using negative numbers, such as pa_range=[-10,10]. The allowed PA range runs from -180 to 180 degrees.
- slice: integer, optional
Slice into a datacube, for use on cubes computed by calc_datacube. Default 0 if a cube is provided with no slice specified.
- custom_functionfunction
To evaluate an arbitrary function in each radial bin, provide some callable function that takes a list of pixels and returns one float. For instance custome_function=np.min to compute the minimum in each radial bin.
- Returns:
- resultstuple
Tuple containing (radius, profile) or (radius, profile, EE) depending on what is requested. The radius gives the center radius of each bin, while the EE is given inside the whole bin so you should use (radius+binsize/2) for the radius of the EE curve if you want to be as precise as possible. The profile will be either the average within each bin, or the standard or median absolute deviation within each bin if one of those options is selected.