generate_petrosian_sersic_correction

petrofit.petrosian.generate_petrosian_sersic_correction(output_file_name, psf=None, r_eff_list=None, n_list=None, oversample=('x_0', 'y_0', 10, 50), psf_oversample=None, out_format=None, overwrite=False, ipython_widget=False, n_cpu=None, plot=False)[source]

Generate corrections for Petrosian profiles by simulating a galaxy image (single component sersic) and measuring its properties. This is done to identify the correct epsilon value that, when multiplied with r_petrosian, gives r_total_flux. To achieve this, an image is created from a Sersic model and convolved with a PSF (if provided). The Petrosian radii and concentrations are computed using the default epsilon = 2. Since the real r_total_flux of the simulated galaxy is known, the correct epsilon can be determined by epsilon = r_petrosian / corrceted_r_total_flux. The resulting grid is used to map measured properties to the correct epsilon value. If output_file_name is provided, the grid is saved to using an astropy table file which is readable by petrofit.petrosian.PetrosianCorrection.

Parameters:
output_file_namestr

Name of output file, must have .yaml or .yml extension.

psfnumpy.array or None

2D PSF image to pass to petrofit.fitting.models.PSFConvolvedModel2D.

r_eff_listlist, (optional)

List of r_eff (half light radii) in pixels to evaluate.

n_listlist, (optional)

List of Sersic indices to evaluate.

oversampleint or tuple

oversampling to pass to petrofit.fitting.models.PSFConvolvedModel2D.

psf_oversampleNone or int

Oversampling factor of the PSF relative to data. The oversample factor should be an integer multiple of the PSF oversampling factor (i.e oversample > psf_oversample).

out_formatstr, optional

Format passed to the resulting astropy table when writing to file.

overwritebool, optional

Overwrite if file exists.

ipython_widgetbool, optional

If True, the progress bar will display as an IPython notebook widget.

n_cpubool, int, optional

If True, use the multiprocessing module to distribute each task to a different processor core. If a number greater than 1, then use that number of cores. This should be selected taking ram in consideration (since high n and large r_eff create large images).

plotbool

Shows plot of photometry and Petrosian. Not available if n_cpu > 1.

Returns:
petrosian_gridTable

Astropy Table that is readable by petrofit.petrosian.PetrosianCorrection