btk.create_blend_generator module

The create_blend_generator module defines the BlendGenerator class, which is used for generating blend parameters. This class is only used internally, inside a DrawBlendsGenerator.

Contains class BlendGenerator to combine entries from a given catalog into blends.

class btk.create_blend_generator.BlendGenerator(catalog, sampling_function, batch_size=8, shifts=None, indexes=None, verbose=False)

Bases: object

Class that uses a catalog and a sampling function to return blend information in batches.

__init__(catalog, sampling_function, batch_size=8, shifts=None, indexes=None, verbose=False)

Initializes the BlendGenerator.

Parameters:
  • catalog (btk.catalog.Catalog) – BTK Catalog object

  • sampling_function (btk.sampling_functions.SamplingFunction) – An object that return samples from the catalog.

  • batch_size (int) – Size of batches returned.

  • shifts (list) – Contains arbitrary shifts to be applied instead of random shifts. Must be of length batch_size. Must be used with indexes. Used mostly for internal testing purposes.

  • indexes (list) – Contains the ids of the galaxies to use in the stamp. Must be of length batch_size. Must be used with shifts. Used mostly for internal testing purposes.

  • verbose (bool) – Whether to print additional information.