scopesim_templates.misc.source_from_imagehdu_with_flux

scopesim_templates.misc.source_from_imagehdu_with_flux(image_hdu=None, filename=None, ext=1, pixel_scale=None, flux=None, bunit=None) Source

Create a source from an image where pixel values have known flux and unit.

The units of the flux density expressed by ‘bunit’.

It is possible to change the flux and pixel scale to simulate e.g. more distant objects.

Parameters:
image_hdufits.ImageHDU

ImageHDU instance or

filenamestr

A fits filename.

extint

Extension where the data and header is located in the file.

pixel_scalefloat, optional

The pixel scale in arcsec if not in the headers or a different one is needed.

fluxfloat, u.Quantity, optional

The total flux of the image if the user wants to specify a different one than in the image.

bunitu.Quantity

The units of flux if BUNIT is not in the headers or a different one is needed.

Returns:
srcscopesim.Source