Samplers

lfd.analysis.profiles.samplers.generic_sampler(sources, instrument=None, seeingProfile=<class 'lfd.analysis.profiles.seeing.GausKolmogorov'>, seeingFWHM=None, defocusProfile=<class 'lfd.analysis.profiles.defocusing.FluxPerAngle'>, returnType='profiles', testRun=False, ntest=10, **kwargs)[source]

Convolves given source profile(s) with defocusing and seeing effects and returns a list of observed profiles and, optionally, a structured array of profile parameters.

Parameters:
  • sources (list or cls) – List of classes or a single class that produces the object profile.
  • instrument (tuple or None) – A tuple of diameters of primary and secondary mirrors of the used instrument in milimeters. See also lfd.analysis.profiles.SDSS or lfd.analysis.profiles.LSST.
  • seeingProfile (cls, optional) – Class representing a seeing profile, by default lfd.analysis.profiles.GausKolmogorov.
  • seeingFWHM (list, optional) – A list of full width half max values to use for seeing. If an instrument is LSST or SDSS and seeingProfile is provided will default to expected seeing FWHM or measured median seeing FWHM value respectively. See lfd.analysis.profiles.LSSTSEEING and lfd.analysis.profiles.SDSSSEEING.
  • defocusProfile (cls) – Class representing a seeing profile, by default lfd.analysis.profiles.FluxPerAngle.
  • returnType (str) – Chose values returned: profiles, grid measurements, or both by using “profiles”, “grid” or “both” respectively. The default, profiles, returns a simple 1D list of profiles, grid also returns a 2D structured array containing input and resulting profile parameters.
  • testRun (bool) – If true will print a table of ingoing arguments to the convolution function using the same combinations scheme. Usefull to verify whether the given convolution parameters actually match expected.
  • ntests (int) – Number of sample points printed if testRun is True.
  • **kwargs (dict) – Any additional provided keyword argument is used to create a Cartesian product of sample points which are then fed into the source, seeing and defocusing classes and convolved.
Returns:

  • convProfiles (list) – List of python objects representing the result of profile convolutions.
  • convMeas (np.array, optional) – A structured numpy array containing any of the following: any keywords that are given are stored under the key in which they were given, source profile name source, seeing profile name seeing, defocus profile name defocus, seeing FWHM, sfwhm, defocused FWHM dfwhm, observed FWHM ofwhm, per-cent value of the depth of central dip of the observed profile depth.

Examples

>>> convProfiles, convMeas = generic_sampler(sources=profiles.PointSource,
                                             sfwhm=s, h=h, returnType='grid')