MoffatModel2

class mpdaf.MUSE.MoffatModel2(fwhm_pol, beta_pol, lbrange, pixstep, field=0)[source]

Bases: mpdaf.MUSE.FSFModel

Circular MOFFAT beta=poly(lbda) fwhm=poly(lbda).

Create a FSF object

Parameters
fwhm_pollist

list of polynome coefficients for FWHM(l):

FWHM(l) = fwhm_pol[0] * l**deg + ... + fwhm_pol[deg]
l = (lbda - lb1) / (lb2 - lb1) - 0.5
beta_pollist

list of polynome coefficients for beta(l)

lbrangetuple

lb1,lb2 wavelengths used for wavelength normalisation

pixstepfloat

spaxel value in arcsec

fieldint

field location in case of multiple FSF

Returns
fsfMoffatModel2

fsf model

Attributes Summary

model

name

Methods Summary

convolve(cfwhm[, samp, nlbda, size, full_output])

Convolve the FSF with a Gaussian kernel

from_FSFlist(imalist, lbda, fwhm0, beta0[, …])

Fit a FSF model on a point source

from_header(hdr, pixstep[, field])

Read FSF from file header

from_hstconv(cube, hstimages[, lbrange])

Compute FSF by convolution of HST images

from_psfrec(rawfilename, **kwargs)

Compute Reconstructed FSF from AO telemetry

from_starfit(cube, pos[, size, nslice, …])

Fit a FSF model on a point source

get_2darray(lbda, shape[, center])

Return FSF 2D array at the given wavelength.

get_3darray(lbda, shape[, center])

Return FSF cube at the given wavelengths.

get_beta(lbda)

Return beta values

get_cube(wave, wcs[, center])

Return FSF cube at the given wavelengths.

get_fwhm(lbda[, unit])

Return FWHM

get_image(lbda, wcs[, center])

Return FSF image at the given wavelength.

info()

Print fsf model information

read(cube[, field, pixstep])

Read the FSF model from a file, cube, or header.

to_header([hdr, field_idx])

Write FSF in file header

Attributes Documentation

model = 2
name = 'Circular MOFFAT beta=poly(lbda) fwhm=poly(lbda)'

Methods Documentation

convolve(cfwhm, samp=10, nlbda=20, size=21, full_output=False)[source]

Convolve the FSF with a Gaussian kernel

Parameters
cfwhmfloat

Gaussian FWHM in arcsec

sampint

Resampling factor

nlbdaint

Number of wavelengths

sizeint

Image FSF size in pixel

full_output: bool

If True, return an additional dictionary

Returns
fsfMoffatModel2

fsf model

resdict

res[‘lbda’]: wavelengths res[‘fwhm0’]: initial FWHM values res[‘fwhm1’]: FWHM values after convolution res[‘beta0’]: initial BETA values res[‘beta1’]: BETA values after convolution

classmethod from_FSFlist(imalist, lbda, fwhm0, beta0, fwhmdeg=3, betadeg=3, lbrange=(5000, 9000))[source]

Fit a FSF model on a point source

Parameters
imalistList of mpdaf.obj.Image

List of FSF images

lbdaarray

Wavelength vector corresponding to the list of FSFs

fwhm0float

Value used to initialize the FWHM in the Moffat fit

beta0float

Value used to initialize the beta parameter in the Moffat fit

fwhmdegint

degre for polynomial fit of FWHM(lbda)

betadegint

degre for polynomial fit of Beta(lbda)

lbdarange: tuple of float

(lbda1,lbda2) reference wavelengths for normalisation

Returns
fsfMoffatModel2

fsf model

classmethod from_header(hdr, pixstep, field=0)[source]

Read FSF from file header

Parameters
hdrastropy.io.fits.Header

FITS header

pixstepfloat

spaxel value in arcsec

Returns
fsfMoffatModel2

fsf model

classmethod from_hstconv(cube, hstimages, lbrange=(5000, 9000), **kwargs)

Compute FSF by convolution of HST images

classmethod from_psfrec(rawfilename, **kwargs)[source]
Compute Reconstructed FSF from AO telemetry

Need muse_psfrec external python module.

Parameters
rawfilenamestr

MUSE raw file name with AO telemetry information

Returns
fsfMoffatModel2

fsf model

classmethod from_starfit(cube, pos, size=5, nslice=20, fwhmdeg=3, betadeg=3, lbrange=(5000, 9000))[source]

Fit a FSF model on a point source

Parameters
cubempdaf.obj.Cube

input datacube

postuple of float

(dec,ra) location of the source in deg

sizefloat

size of region to extract around the source in arcsec

nsliceint

number of wavelength slices to used

fwhmdegint

degre for polynomial fit of FWHM(lbda)

betadegint

degre for polynomial fit of Beta(lbda)

lbdarange: tuple of float

(lbda1,lbda2) reference wavelengths for normalisation

Returns
fsfMoffatModel2

fsf model with intermediate fitting results as .fit attribute

fsf.fitdict

center : array of fitted star location wave : array of wavelengths fwhmfit : array of fitted FWHM fwhmerr : array of errors in FWHM returned by the fit fwhmpol : list of FWHM polynomial betafit : array of fitted beta betaerr : array of errors in beta returned by the fit betapol : list of beta polynomial center0 : first iteration of fitted star location fwhm0 : first iteration of fitted FWHM beta0 : first iteration of fitted beta ima : list of images used in the fit

get_2darray(lbda, shape, center=None)

Return FSF 2D array at the given wavelength.

get_3darray(lbda, shape, center=None)

Return FSF cube at the given wavelengths.

get_beta(lbda)[source]

Return beta values

Parameters
lbdafloat or array of float

wavelengths

Returns
betafloat or array
get_cube(wave, wcs, center=None)

Return FSF cube at the given wavelengths.

get_fwhm(lbda, unit='arcsec')[source]

Return FWHM

Parameters
lbdafloat or array of float

wavelengths

unitstr

arcsec or pix, unit of FWHM

Returns
FWHMfloat or array
get_image(lbda, wcs, center=None)

Return FSF image at the given wavelength.

info()[source]

Print fsf model information

classmethod read(cube, field=None, pixstep=None)

Read the FSF model from a file, cube, or header.

Parameters
cubestr, mpdaf.obj.Cube, or astropy.io.fits.Header

Must contain a header with a FSF model.

fieldint

Field number to read, otherwise all models are read.

to_header(hdr=None, field_idx=0)[source]

Write FSF in file header

Parameters
hdrastropy.io.fits.Header

FITS header

field_idxint

field index

Returns
hdrastropy.io.fits.Header

FITS header