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
GalsimFiberlossCalculatorto model the PSF components and source profile and perform the convolutions.To efficiently calculate fiberloss fractions for multiple sources with GalSim, use
GalsimFiberlossCalculatordirectly instead of repeatedly calling this method. Seespecsim.quickfiberlossfor an example of this approach.- Parameters:
- focal_x
astropy.units.Quantity X coordinate of the fiber center in the focal plane with length units.
- focal_y
astropy.units.Quantity Y coordinate of the fiber center in the focal plane with length units.
- wavelength
astropy.units.Quantity Array of simulation wavelengths (with length units) where the fiber acceptance fraction should be tabulated.
- source
specsim.source.Source Source model to use for the calculation.
- atmosphere
specsim.atmosphere.Atmosphere Atmosphere model to use for the calculation.
- instrument
specsim.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
tablemethod. Each name should already be defined as a key in theinstruments.fiberloss.table.pathsconfiguration. Ignored for thegalsimmethod.- source_fractionarray or None
Array of shape (num_fibers, 2). See
GalsimFiberlossCalculator.create_source()for details. Ignored for thetablemethod.- source_half_light_radiusarray or None
Array of shape (num_fibers, 2). See
GalsimFiberlossCalculator.create_source()for details. Ignored for thetablemethod.- source_minor_major_axis_ratioarray or None
Array of shape (num_fibers, 2). See
GalsimFiberlossCalculator.create_source()for details. Ignored for thetablemethod.- source_position_anglearray or None
Array of shape (num_fibers, 2). See
GalsimFiberlossCalculator.create_source()for details. Ignored for thetablemethod.- oversamplingint
Oversampling factor to use for anti-aliasing the fiber aperture. Ignored for the
tablemethod.- saved_images_filestr or None
See
GalsimFiberlossCalculator.calculate(). Ignored for thetablemethod.- 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’.
- focal_x
- Returns:
- numpy array
Array of fiber acceptance fractions (dimensionless) at each of the input wavelengths.