calculate_fiber_acceptance_fraction

specsim.fiberloss.calculate_fiber_acceptance_fraction(focal_x, focal_y, wavelength, source, atmosphere, instrument, source_types=None, source_fraction=None, source_half_light_radius=None, source_minor_major_axis_ratio=None, source_position_angle=None, oversampling=32, saved_images_file=None, saved_table_file=None)[source] [edit on github]

Calculate the acceptance fraction for a single fiber.

The behavior of this function is customized by the instrument.fiberloss configuration parameters. When instrument.fiberloss.method == ‘table’, pre-tabulated values are returned using source.type as the key and all other parameters to this function are ignored.

When instrument.fiberloss.method == ‘galsim’, fiberloss is calculated on the fly using the GalSim package via GalsimFiberlossCalculator to model the PSF components and source profile and perform the convolutions.

To efficiently calculate fiberloss fractions for multiple sources with GalSim, use GalsimFiberlossCalculator directly instead of repeatedly calling this method. See specsim.quickfiberloss for an example of this approach.

Parameters:
focal_xastropy.units.Quantity

X coordinate of the fiber center in the focal plane with length units.

focal_yastropy.units.Quantity

Y coordinate of the fiber center in the focal plane with length units.

wavelengthastropy.units.Quantity

Array of simulation wavelengths (with length units) where the fiber acceptance fraction should be tabulated.

sourcespecsim.source.Source

Source model to use for the calculation.

atmospherespecsim.atmosphere.Atmosphere

Atmosphere model to use for the calculation.

instrumentspecsim.instrument.Instrument

Instrument model to use for the calculation.

source_typesarray or None

Array of source type names that identify which tabulated fiberloss fraction should be used for each fiber with the table method. Each name should already be defined as a key in the instruments.fiberloss.table.paths configuration. Ignored for the galsim method.

source_fractionarray or None

Array of shape (num_fibers, 2). See GalsimFiberlossCalculator.create_source() for details. Ignored for the table method.

source_half_light_radiusarray or None

Array of shape (num_fibers, 2). See GalsimFiberlossCalculator.create_source() for details. Ignored for the table method.

source_minor_major_axis_ratioarray or None

Array of shape (num_fibers, 2). See GalsimFiberlossCalculator.create_source() for details. Ignored for the table method.

source_position_anglearray or None

Array of shape (num_fibers, 2). See GalsimFiberlossCalculator.create_source() for details. Ignored for the table method.

oversamplingint

Oversampling factor to use for anti-aliasing the fiber aperture. Ignored for the table method.

saved_images_filestr or None

See GalsimFiberlossCalculator.calculate(). Ignored for the table method.

saved_table_filestr or None

Write a table of calculated values to a file with this name. The extension determines the file format, and .ecsv is recommended. The saved file can then be used as a pre-tabulated input with instrument.fiberloss.method = ‘table’.

Returns:
numpy array

Array of fiber acceptance fractions (dimensionless) at each of the input wavelengths.