GalsimFiberlossCalculator

class specsim.fiberloss.GalsimFiberlossCalculator(fiber_diameter, wlen_grid, num_pixels=16, oversampling=32, moffat_beta=3.5, maximum_fft_size=32767)[source] [edit on github]

Bases: object

Initialize a fiberloss calculator that uses GalSim.

Parameters:
fiber_diameterfloat

Fiber diameter in microns.

wlen_gridarray

Array of wavelengths in Angstroms where fiberloss will be calculated.

num_pixelsint

Number of pixels to cover the fiber aperture along each axis.

oversamplingint

Oversampling factor for anti-aliasing the circular fiber aperture.

moffat_betafloat

Beta parameter value for the atmospheric PSF Moffat profile.

maximum_fft_sizeint

Maximum size of FFT allowed.

Methods Summary

calculate(seeing_fwhm, scale, offset, ...[, ...])

Calculate the acceptance fractions for a set of fibers.

create_source(fractions, half_light_radius, ...)

Create a model for the on-sky profile of a single source.

Methods Documentation

calculate(seeing_fwhm, scale, offset, blur_rms, source_fraction, source_half_light_radius, source_minor_major_axis_ratio, source_position_angle, saved_images_file=None)[source] [edit on github]

Calculate the acceptance fractions for a set of fibers.

Parameters:
seeing_fwhmarray

Array of length num_wlen giving the FWHM seeing in arcseconds at each wavelength.

scalearray

Array of shape (num_fibers, 2) giving the x and y image scales in microns / arcsec at each fiber location.

offsetarray

Array of shape (num_fibers, num_wlen, 2) giving the x and y offsets in microns at each fiber location and wavelength.

blur_rmsarray

Array of shape (num_fibers, num_wlen) giving the RMS instrumental Gaussian blur at each fiber location and wavelength.

source_fractionarray

Array of shape (num_fibers, 2). See create_source() for details.

source_half_light_radiusarray

Array of shape (num_fibers, 2). See create_source() for details.

source_minor_major_axis_ratioarray

Array of shape (num_fibers, 2). See create_source() for details.

source_position_anglearray

Array of shape (num_fibers, 2). See create_source() for details.

saved_images_filestr or None

Write a multi-extension FITS file with this name containing images of the atmospheric and instrument PSFs as a function of wavelength, as well as the source profile and the anti-aliased fiber aperture.

Returns:
array

Array of fiberloss fractions in the range 0-1 with shape (num_fibers, num_wlen).

create_source(fractions, half_light_radius, minor_major_axis_ratio, position_angle)[source] [edit on github]

Create a model for the on-sky profile of a single source.

Size and shape parameter values for any component that is not present (because its fraction is zero) are ignored.

Parameters:
fractionsarray

Array of length 2 giving the disk and bulge fractions, respectively, which must be in the range [0,1] (but this is not checked). If their sum is less than one, the remainder is modeled as a point-like component.

half_light_radiusarray

Array of length 2 giving the disk and bulge half-light radii in arcseconds, respectively.

minor_major_axis_ratioarray

Array of length 2 giving the dimensionless on-sky ellipse minor / major axis ratio for the disk and bulge components, respectively.

position_anglearray

Array of length 2 giving the position angle in degrees of the on-sky disk and bluge ellipses, respectively. Angles are measured counter clockwise relative to the +x axis.

Returns:
galsim.GSObject

A object representing the sum of all requested components with its total flux normalized to one.