scopesim.optics.image_plane.ImagePlane

scopesim.optics.image_plane.ImagePlane#

class scopesim.optics.image_plane.ImagePlane(header, cmds=None, **kwargs)#

Bases: object

A class to act as a canvas onto which to project Source images or tables.

Parameters:
  • header (fits.Header) – Must contain a valid WCS

  • todo (..)

Examples

from astropy.table import Table
from scopesim.optics import image_plane as imp

my_point_source_table = Table(names=["x", "y", "flux"],
                              data=[(0,  1,  2)*u.mm,
                                    (0, -5, 10)*u.mm,
                                    (100,50,25)*u.ph/u.s])

hdr = imp.make_image_plane_header([my_point_source_table],
                                   pixel_size=0.015*u.mm)
img_plane = imp.ImagePlane(hdr)
img_plane.add(my_point_source_table)

print(img_plane.image)
__init__(header, cmds=None, **kwargs)#

Methods

__init__(header[, cmds])

add(hdus_or_tables[, sub_pixel, ...])

Add a projection of an image or table files to the canvas.

plot()

Plot data in image plane.

view(sub_pixel)

Attributes

data

header

image

add(hdus_or_tables, sub_pixel=None, spline_order=None, wcs_suffix='')#

Add a projection of an image or table files to the canvas.

Note

If a Table is provided, it must include the following columns: x_mm, y_mm, and flux.

Units for the columns should be provided in the <Table>.unit attribute or as an entry in the table’s meta dictionary using this syntax: <Table>.meta[“<colname>_unit”] = <unit>.

For example:

tbl["x"].unit = u.arcsec   # or
tbl.meta[x_unit"] = "deg"

If no units are given, default units will be assumed. These are:

  • x, y: arcsec

  • flux : ph / s / pix

Changed in version 0.10.0: Adding a table directly to the ImagePlane is deprecated. Use FOV to add tables and image HDUs together before adding them to here.

Parameters:
  • hdus_or_tables (fits.ImageHDU or astropy.Table) – The input to be projected onto the image plane. See above.

  • sub_pixel (bool, optional) – Default is False. Dictates if point files should be projected with sub-pixel shifts or not. Accounting for sub-pixel shifts is approx. 5x slower.

  • spline_order (int, optional) – Order of spline interpolations used in scipy.ndimage functions zoom and rotate.

  • wcs_suffix (str, optional) – Default “”. For sky coords - “” or “S”, Detector coords - “D”

plot()#

Plot data in image plane.

Added in version 0.11.0.