scopesim.optics.fov_manager module

class scopesim.optics.fov_manager.FOVManager(effects=[], **kwargs)[source]

Bases: object

A class to manage the (monochromatic) image windows covering the target

Parameters:
effectslist of Effect objects

Passed from optics_manager.fov_setup_effects

property fov_footprints
property fovs
generate_fovs_list()[source]

Generates a series of FieldOfViews objects based self.effects

Returns:
fovslist of FieldOfView objects
class scopesim.optics.fov_manager.FovVolumeList(initial_volume={})[source]

Bases: FOVSetupBase

List of FOV volumes for FOVManager

extract(axes, edges, aperture_id=None)[source]

Returns new volumes from within all existing volumes

This method DOES NOT alter the existing self.volumes list To include the returned volumes, add them to the self.volumes list

Parameters:
axesstr, list of str

“wave”, “x”, “y”

edgeslist, tuple of lists

Edge points for each axes listed

aperture_idint, optional

Default None. If None, extract from all volumes. If int, only extract from volumes with this aperture_id in the meta dict

Returns:
new_volslist of dicts

A list of all new volumes extracted from existing volumes

Examples

::
>>> fvl = FovVolumeList()
>>> fvl.split("x", 0)
>>> new_vols = fvl.extract(axes=["wave"], edges=([0.5, 0.6], ))
>>> new_vols = fvl.extract(axes=["x", "y"], edges=([-1, 1], [0, 5]))
>>> new_vols = fvl.extract(axes=["x", "y", "wave"],
>>>                        edges=([-1, 1], [0, 5], [0.5, 0.6]))
>>> new_vols = fvl.extract(axes=["x", "y"], edges=([-1, 1], [0, 5]),
>>>                        aperture_id=1)
>>>
>>> fvl += [new_vols]
shrink(axis, values, aperture_id=None)[source]
  • Loop through all volume dict

  • Replace any entries where min < values.min

  • Replace any entries where max > values.max

Parameters:
axisstr

“wave”, “x”, “y”

valueslist of 2 floats

[min, max], [min, None], [None, max]

aperture_idint, optional

Default None. If None, shrink all volumes. If int, only shrink volumes with this aperture_id in the meta dict

Examples

::
>>> fvl = FovVolumeList()
>>> fvl.shrink(axis="wave", values=[3.0, 3.1])
>>> fvl.shrink(axis="wave", values=[2.9, 3.1], aperture_id=1)
>>> fvl.shrink(axis=["x", "y"], values=([-1, 1], [0, 5]))
split(axis, value, aperture_id=None)[source]

Splits the all volumes that include axis=value into two.

  • Loop through all volume dict

  • Find any entries where min < value < max

  • Add two new entries with [min, value], [value, max]

Parameters:
axisstr, list of str

“wave”, “x”, “y”

valuefloat, list of floats
aperture_idint, optional

Default None. If None, split all volumes. If int, only split volumes with this aperture_id in the meta dict

Examples

::
>>> fvl = FovVolumeList()
>>> fvl.split(axis="wave", value=1.5)
>>> fvl.split(axis="wave", value=[3.0, 3.1])
>>> fvl.split(axis=["x", "y"], value=[0, 0])
>>> fvl.split(axis=["x", "y"], value=([-1, 1], 0))
>>> fvl.split(axis=["x", "y"], value=([-1, 1], [0, 5]))
>>> fvl.split(axis="wave", value=3.0, aperture_id=1)
>>> fvl.split(axis="wave", value=3.0, aperture_id=None)