dfisher_2022a.fits

Submodules

class dfisher_2022a.fits.base.CubeFitter(data, weight, x, model, fit_method)[source]

Bases: abc.ABC

abstract classmethod fit_cube()[source]

method to fit data cube

class dfisher_2022a.fits.cpufitter.CubeFitterLM(data, weight, x, model, nprocess=2, method='leastsq', **kwargs)[source]

Bases: dfisher_2022a.fits.base.CubeFitter

Parameters
  • data (numpy.ma.MaskedArray) – cube data; this array should be 3-d, and the ordering of its axes should be

  • (wavelength (mpdaf.obj.Cube.data)) –

  • image_y (mpdaf.obj.Cube.data)) –

  • (reference (image_x)) –

  • weight (numpy.ma.MaskedArray) – cube data weight; this array should be 3-d, and has the same ordering of axes as data.

  • x (numpy.array or list) – cube wavelength

  • model (lmfit.CompositeModel) –

  • nprocess (int, optional) – the number of worker processes used in parallel fitting, by default os.cpu_count()

  • method (str, optional) – specifies the fitting method available in lmfit, by default ‘leastsq’

  • kwargs (optional) – other keyword arguments passed from lmfit.Model.fit

Notes

If the light version of lmfit (https://github.com/ADACS-Australia/light-lmfit-py/tree/light) is used, method “fast_leastsq” is available.

fit_cube(nprocess=None)[source]

Fit cube parallelly.

Parameters

nprocess (int, optional) – number of worker processes used in parallel fitting, by default None. If None, nprocess set at class instance will be used

Returns

result

Return type

numpy.ndarray

fit_serial()[source]

“Fit cube serially.

class dfisher_2022a.fits.cpufitter.ResultLM(path='./')[source]

Bases: object

Result container. It can be used to collect key information (by reading attributes) from objects that generated during the fitting process.

Parameters

path (str, optional) – directory to hosts “out”, by default “./”

get_output(cls)[source]

Get relevant attributes from other class object.

save(save_fitdata=True)[source]