SourceXtractorPlusPlus 1.0.3
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
sourcextractor.config.measurement_images.ImageGroup Class Reference
Inheritance diagram for sourcextractor.config.measurement_images.ImageGroup:
Collaboration diagram for sourcextractor.config.measurement_images.ImageGroup:

Public Member Functions

 __init__ (self, **kwargs)
 __len__ (self)
 __iter__ (self)
 split (self, grouping_method)
 add_images (self, images)
 add_subgroup (self, name, group)
 is_leaf (self)
 __getitem__ (self, name)
 print (self, prefix='', show_images=False, file=sys.stderr)
 __str__ (self)

Private Attributes

list __images = []
list __subgroups = None
 __subgroup_names = set()

Detailed Description

Models the grouping of images. Measurement can *not* be made directly on instances of this type.
The configuration must be "frozen" before creating a MeasurementGroup

See Also
--------
MeasurementGroup

Definition at line 254 of file measurement_images.py.

Constructor & Destructor Documentation

◆ __init__()

sourcextractor.config.measurement_images.ImageGroup.__init__ ( self,
** kwargs )
Constructor. It is not recommended to be used directly. Use instead load_fits_image or load_fits_images.

Definition at line 264 of file measurement_images.py.

Member Function Documentation

◆ __getitem__()

sourcextractor.config.measurement_images.ImageGroup.__getitem__ ( self,
name )
Get a subgroup.

Parameters
----------
name : str
    The name of the subgroup.

Returns
-------
ImageGroup
    The matching group.

Raises
------
ValueError
    If the group has not been split.
KeyError
    If the group has not been found.

Definition at line 401 of file measurement_images.py.

References __subgroups.

◆ __iter__()

sourcextractor.config.measurement_images.ImageGroup.__iter__ ( self)
Allows to iterate on the contained subgroups or images

See Also
--------
is_leaf

Returns
-------
iterator

Definition at line 300 of file measurement_images.py.

References __images, __iter__(), and __subgroups.

Referenced by __iter__().

Here is the call graph for this function:

◆ __len__()

sourcextractor.config.measurement_images.ImageGroup.__len__ ( self)
See Also
--------
is_leaf

Returns
-------
int
    How may subgroups or images are there in this group

Definition at line 284 of file measurement_images.py.

References __images, and __subgroups.

◆ __str__()

sourcextractor.config.measurement_images.ImageGroup.__str__ ( self)
Returns
-------
str
    A human-readable representation of the group

Definition at line 455 of file measurement_images.py.

References print().

Here is the call graph for this function:

◆ add_images()

sourcextractor.config.measurement_images.ImageGroup.add_images ( self,
images )
Add new images to the group.

Parameters
----------
images : list of, or a single, MeasurementImage

Raises
------
ValueError
    If the group has been split, no new images can be added.

Definition at line 354 of file measurement_images.py.

References __images, and __subgroups.

◆ add_subgroup()

sourcextractor.config.measurement_images.ImageGroup.add_subgroup ( self,
name,
group )
Add a subgroup to a group.

Parameters
----------
name : str
    The new of the new group

group : ImageGroup

Definition at line 374 of file measurement_images.py.

References __subgroup_names, and __subgroups.

◆ is_leaf()

sourcextractor.config.measurement_images.ImageGroup.is_leaf ( self)
Returns
-------
bool
    True if the group is a leaf group

Definition at line 392 of file measurement_images.py.

References __subgroups.

◆ print()

sourcextractor.config.measurement_images.ImageGroup.print ( self,
prefix = '',
show_images = False,
file = sys.stderr )
Print a human-readable representation of the group.

Parameters
----------
prefix : str
    Print each line with this prefix. Used internally for indentation.
show_images : bool
    Show the images belonging to a leaf group.
file : file object
    Where to print the representation. Defaults to sys.stderr

Definition at line 429 of file measurement_images.py.

References __images, __subgroups, and print().

Referenced by __str__(), sourcextractor.config.measurement_images.MeasurementGroup.__str__(), and print().

Here is the call graph for this function:

◆ split()

sourcextractor.config.measurement_images.ImageGroup.split ( self,
grouping_method )
Splits the group in various subgroups, applying a filter on the contained images. If the group has
already been split, applies the split to each subgroup.

Parameters
----------
grouping_method : callable
    A callable that receives as a parameter the list of contained images, and returns
    a list of tuples, with the grouping key value, and the list of grouped images belonging to the given key.

See Also
--------
ByKeyword
ByPattern

Raises
-------
ValueError
    If some images have not been grouped by the callable.

Definition at line 317 of file measurement_images.py.

References __images, __subgroup_names, and __subgroups.

Member Data Documentation

◆ __images

◆ __subgroup_names

sourcextractor.config.measurement_images.ImageGroup.__subgroup_names = set()
private

Definition at line 270 of file measurement_images.py.

Referenced by add_subgroup(), and split().

◆ __subgroups


The documentation for this class was generated from the following file: