RawFile

class mpdaf.drs.RawFile(filename)[source]

Bases: object

RawFile class manages input/output for raw FITS file.

Parameters
filenamestr

The raw FITS file name.

Attributes
filenamestr

The raw FITS file name. None if any.

channelsdict

List of extension (extname,Channel)

primary_headerastropy.io.fits.Header

The primary header

nxint

Lengths of data in X

nyint

Lengths of data in Y

nextint

Number of extensions

Methods Summary

get_channel(self, extname)

Return a Channel object.

get_channels_extname_list(self)

Return the list of existing channels names.

get_keywords(self, key)

Return the keyword value.

info(self)

Print information.

plot(self[, title, channels, area, scale, …])

Plot the raw images.

plot_white_image(self[, mask, channels])

Reconstructs the white image of the FOV using a mask file and plots this image.

reconstruct_white_image(self[, mask, channels])

Reconstructs the white image of the FOV using a mask file.

Methods Documentation

get_channel(self, extname)[source]

Return a Channel object.

Parameters
extnamestr

The extension name.

Returns
outmpdaf.drs.Channel
get_channels_extname_list(self)[source]

Return the list of existing channels names.

get_keywords(self, key)[source]

Return the keyword value.

info(self)[source]

Print information.

plot(self, title=None, channels='all', area=None, scale='linear', vmin=None, vmax=None, zscale=False, colorbar=None, figsize=None, **kwargs)[source]

Plot the raw images.

Parameters
titlestr

Figure title (None by default).

channelslist or ‘all’

List of channel names. All by default.

arealist

list of pixels [pmin,pmax,qmin,qmax] to zoom.

scalestr

‘linear’ | ‘log’ | ‘sqrt’ | ‘arcsinh’ | ‘power’ The stretch function to use for the scaling (default is ‘linear’).

vminfloat

Minimum pixel value to use for the scaling. If None, vmin is set to min of data.

vmaxfloat

Maximum pixel value to use for the scaling. If None, vmax is set to max of data.

zscalebool

If true, vmin and vmax are computed using the IRAF zscale algorithm.

colorbarstr

If ‘h’/’v’, a horizontal/vertical colorbar is added.

figsize: tuple

width, height of the figure.

kwargsdict

Additional options passed to Image.plot.

plot_white_image(self, mask=None, channels='all')[source]

Reconstructs the white image of the FOV using a mask file and plots this image.

Parameters
maskstr

Mask used to extract the data for each slice. Must be a FITS file with one extension per channel, and extension names which match the ones from the raw file. Defaults to PAE_July2013.fits.gz which comes with Mpdaf.

channelslist or ‘all’

List of channel names. All by default.

reconstruct_white_image(self, mask=None, channels='all')[source]

Reconstructs the white image of the FOV using a mask file.

Parameters
maskstr

Mask used to extract the data for each slice. Must be a FITS file with one extension per channel, and extension names which match the ones from the raw file. Defaults to PAE_July2013.fits.gz which comes with Mpdaf.

channelslist or ‘all’

List of channel names. All by default.

Returns
Image