lvmsurveysim.ifu¶
- class lvmsurveysim.ifu.IFU(n_fibres=None, centres=None, padding=0, fibre_size=None, allow_rotation=False, name=None)[source]¶
Bases:
object
A generic class representing a LVM hexagonal IFU.
This class is intended to be subclassed into real examples of IFU designs that LVM will use. An
IFU
is defined by a series of sub-IFU centres (or a single one for a monolithic IFU) and a fibre size, so that the real size of the IFU on the sky can be calculated.- Parameters
n_fibres (int) – Number of fibres in each of the sub-IFUs.
centres (list) – A list of 2D tuples describing the centres of each of the sub-IFUs. It assumes the diameter of the sub-IFU hexagon is 1.
padding (int) – Number of fibres the IFU should overlap when tiling. This will be used to slightly modify the distance between sub-IFUs.
fibre_size (float) – The real size, in microns, of each fibre including buffer.
gaps (list) – If the IFU is composed of multiple sub-IFUs and gaps exist between them, a list with the same format of
centres
must be provided, with the list of the hexagonal gap centres.allow_rotation (bool) – Whether this IFU can be rotated.
- get_ifu_size(scale, tile_overlap, sparse)[source]¶
Returns the size of the IFU in degrees
Calculate and return the size of the IFU in degrees in two dimensions, the first from center to corner of the hexagon (outer radius), the second from center to edge (inner radius). Take into account the amount of overlap we want and the sparse tiling.
Parameters:¶
- scalefloat
The plate scale in degrees per mm.
- tile_overlapfloat
The fraction of tile separation to overlap between neighboring tiles (ignored for sparse targets)
- sparsefloat
Factor for sparse sampling. Stretches IFU length scale by the number.
Returns:¶
- dx, dytuple of float
The extent of the hexagonal IFU in degrees from center to corner and center to edge scaled by the desired overlap.
- get_patch(**kwargs)[source]¶
Returns a matplotlib patch for the IFU.
- Parameters
kwargs (dict) – Parameters to be passed to
SubIFU.get_patch
.
- get_tile_grid(region, scale, tile_overlap=None, sparse=None, geodesic=None)[source]¶
Returns a grid of positions that tile a region with this IFU.
- Parameters
region (SkyRegion) – The SkyRegion to tile. It is assumed that x coordinates are RA and y is Declination, both in degrees.
scale (float) – The scale in degrees per mm.
tile_overlap (float) – The fraction of tile separation to overlap between neighboring tiles (ignored for sparse targets)
sparse (float) – Factor for sparse sampling. Stretches IFU length scale by the number.
geodesic (use geodesic sphere tiling, sparse gives depth in this case.) –
- class lvmsurveysim.ifu.SubIFU(id_subifu, parent, centre, n_fibres, fibre_size=None)[source]¶
Bases:
object
Represents a sub-IFU (group of contiguous fibres) within a larger IFU.
A sub-IFU is an hexagonal group of contiguous fibres, separated from other groups of fibres. LVM IFUs are formed by a series of sub-IFUs (a monolithic IFU can be considered as an IFU with a single sub-IFU). It is assumed that all sub-IFUs in an IFU have the same size.
- Parameters
n_subifu (int) – An integer used to identify the sub-IFU.
centre (tuple) – A 2D tuple describing the centre of the sub-IFUs. It asumes the diameter of the sub-IFU hexagon is 1.
n_fibres (int) – Number of fibres in the sub-IFUs.
fibre_size (float) – The real size, in microns, of each fibre including buffer.
- get_patch(scale=None, centre=None, pa=None, **kwargs)[source]¶
Returns a matplotlib patch for the sub-IFU.
- Parameters
scale (Quantity or float) – The plate scale to be used to convert the IFU to on-sky distances. Either a
Quantity
or a value in degrees/mm.centre (list) – The coordinates of the centre of the IFU on the sky.
pa (float) – The position angle of the IFU on the sky in degrees. Ignored if None.
kwargs (dict) – Parameters to be passed to
Polygon
when creating the patch.
- Returns
patch (
Polygon
) – A Matplotlib patch with the sub-ifu. If scale and centre are passed, the coordinates of the patch are on-sky.
- lvmsurveysim.ifu.fibres_to_rows(fibres)[source]¶
Calculates the number of rows for a set of fibres.
Given a total number of
fibres
, returns the number rows. Given that the IFU is an hexagon, the central row has as many fibres as rows in the IFU. It returnsNone
if the number of fibres can not be arranged in a full IFU.