scopesim.optics.image_plane module

class scopesim.optics.image_plane.ImagePlane(header, cmds=None, **kwargs)[source]

Bases: ImagePlaneBase

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

Parameters:
headerfits.Header

Must contain a valid WCS

.. todo: Write the code to deal with a canvas larger than max_segment_size

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)
add(hdus_or_tables, sub_pixel=None, spline_order=None, wcs_suffix='')[source]

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

Parameters:
hdus_or_tablesfits.ImageHDU or astropy.Table

The input to be projected onto the image plane. See above.

sub_pixelbool, 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_orderint, optional

Order of spline interpolations used in scipy.ndimage functions zoom and rotate.

wcs_suffixstr, optional

Default “”. For sky coords - “” or “S”, Detector coords - “D”

property data
property header
property image
view(sub_pixel)[source]