scopesim_templates.misc.misc.source_from_imagehdu_with_flux

scopesim_templates.misc.misc.source_from_imagehdu_with_flux#

scopesim_templates.misc.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_hdu (fits.ImageHDU) – ImageHDU instance or

  • filename (str) – A fits filename.

  • ext (int) – Extension where the data and header is located in the file.

  • pixel_scale (float, optional) – The pixel scale in arcsec if not in the headers or a different one is needed.

  • flux (float, u.Quantity, optional) – The total flux of the image if the user wants to specify a different one than in the image.

  • bunit (u.Quantity) – The units of flux if BUNIT is not in the headers or a different one is needed.

Returns:

src

Return type:

scopesim.Source

Note

Creates a source with a flat spectrum. It is responsibility of the user to use it correctly with the proper filter and instrument configuration.