SourceXtractorPlusPlus 0.21
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
sourcextractor.config.measurement_config.MeasurementConfig Class Reference

Public Member Functions

 __init__ (self)
 
 apertures_for_image (self)
 
 measurement_images (self)
 
 model_fitting_parameter_columns (self)
 
 aperture_columns (self)
 
 model_fitting (self)
 
 add_measurement_image (self, image)
 
 load_fits_image (self, image, psf=None, weight=None, **kwargs)
 
 load_fits_images (self, images, psfs=None, weights=None, **kwargs)
 
 load_fits_data_cube (self, image, psf=None, weight=None, image_cube_hdu=-1, weight_cube_hdu=-1, **kwargs)
 
 print_measurement_images (self, file=sys.stderr)
 
 add_aperture_photometry (self, target, apertures)
 
 print_output_columns (self, file=sys.stderr)
 
 add_output_column (self, name, params)
 

Protected Attributes

 _measurement_images
 
 _apertures_for_image
 
 _used_names
 
 _model_fitting_parameter_columns
 
 _aperture_columns
 
 _column_map
 
 _model_fitting
 

Detailed Description

Definition at line 29 of file measurement_config.py.

Constructor & Destructor Documentation

◆ __init__()

sourcextractor.config.measurement_config.MeasurementConfig.__init__ ( self)

Definition at line 30 of file measurement_config.py.

Member Function Documentation

◆ add_aperture_photometry()

sourcextractor.config.measurement_config.MeasurementConfig.add_aperture_photometry ( self,
target,
apertures )
Flux measurement from the image above the background inside a circular aperture.

Parameters
----------
target : MeasurementImage object, or leaf MeasurementGroup object with a single image, or a list of either
    Target images on which to measure the aperture photometry. Leaf MeasurementGroup with a single image
    are accepted as a convenience.

apertures : float, or list of float
    Diameter of the aperture. As different MeasurementImage may not be aligned, nor have equivalent pixel size,
    the aperture is interpreted as diameter in pixels of a circle on the detection image.
    A transformation will be applied for each frame, so the covered area is equivalent.

Returns
-------
list of Aperture objects
    An Aperture object is an internal representation of a property on the measurement frame that contains the
    apertures. To actually get the measurements on the output catalog, you need to add explicitly them to the
    output.

See Also
--------
add_output_column

Notes
-----
This property will generate five columns with the prefix specified by `add_output_column`:
- ``_flux`` and ``_flux_err``, for the flux and its associated error
- ``_mag`` and ``_mag_err``, for the magnitude and its associated error
- ``_flags``, to mark, for instance, saturation, boundary conditions, etc.

For M apertures and N images, the cells on the output column will be an array of MxN fluxes.

Examples
--------
>>> context = MeasurementConfig()
>>> measurement_group = MeasurementGroup(load_fits_images(frames, psfs))
>>> all_apertures = []
>>> for img in measurement_group:
>>>     all_apertures.extend(context.add_aperture_photometry(img, [5, 10, 20]))
>>> context.add_output_column('aperture', all_apertures)

Definition at line 292 of file measurement_config.py.

References sourcextractor.config.measurement_config.MeasurementConfig._apertures_for_image.

◆ add_measurement_image()

sourcextractor.config.measurement_config.MeasurementConfig.add_measurement_image ( self,
image )

◆ add_output_column()

sourcextractor.config.measurement_config.MeasurementConfig.add_output_column ( self,
name,
params )
Add a new set of columns to the output catalog.

Parameters
----------
name : str
    Name/prefix of the new set of columns
params : list of columns
    List of properties to add to the output with the given name/prefix. They must be subtype
    of one of the known ones: ParameterBase for model fitting, or Aperture for aperture photometry.

Raises
------
ValueError
    If the name has already been used
TypeError
    If any of the parameters are not of a known type (see params)

See Also
--------
aperture.add_aperture_photometry
model_fitting.ParameterBase

Definition at line 381 of file measurement_config.py.

References sourcextractor.config.measurement_config.MeasurementConfig._column_map, sourcextractor.config.measurement_config.MeasurementConfig._used_names, and sourcextractor.config.measurement_config.MeasurementConfig.model_fitting().

Here is the call graph for this function:

◆ aperture_columns()

sourcextractor.config.measurement_config.MeasurementConfig.aperture_columns ( self)

◆ apertures_for_image()

sourcextractor.config.measurement_config.MeasurementConfig.apertures_for_image ( self)

◆ load_fits_data_cube()

sourcextractor.config.measurement_config.MeasurementConfig.load_fits_data_cube ( self,
image,
psf = None,
weight = None,
image_cube_hdu = -1,
weight_cube_hdu = -1,
** kwargs )
Creates an image group with the images of a data cube.

weight can be a matching datacube, multi-hdu or list of individual images
psf can be a multi-hdu or list of individual images to be matched

In any case, they are matched in order and HDUs not containing images are ignored.

:param image: The filename of the FITS file containing the image datacube
:param psf: psf file or list of psf files
:param weight: FITS file contianing a weight datacube, a MEF contianing the weights
     or a list of such files
:param image_cube_hdu: hdu containing the image datacube, default = first HDU containing image data
:param weight_cube_hdu: hdu containing the weight datacube, default = first HDU containing image data

:return: A ImageGroup representing the images

Definition at line 185 of file measurement_config.py.

References sourcextractor.config.measurement_config.MeasurementConfig._measurement_images.

◆ load_fits_image()

sourcextractor.config.measurement_config.MeasurementConfig.load_fits_image ( self,
image,
psf = None,
weight = None,
** kwargs )
Creates an image group with the images of a (possibly multi-HDU) single FITS file.

If image is multi-hdu, psf and weight can either be multi hdu or lists of individual files.

In any case, they are matched in order and HDUs not containing images (two dimensional arrays) are ignored.

:param image: The filename of the FITS file containing the image(s)
:param psf: psf file or list of psf files
:param weight: FITS file for the weight image or a list of such files

:return: A ImageGroup representing the images

Definition at line 73 of file measurement_config.py.

References sourcextractor.config.measurement_config.MeasurementConfig._measurement_images.

Referenced by sourcextractor.config.measurement_config.MeasurementConfig.load_fits_images().

◆ load_fits_images()

sourcextractor.config.measurement_config.MeasurementConfig.load_fits_images ( self,
images,
psfs = None,
weights = None,
** kwargs )
Creates an image group for the given images.

Parameters
----------
images : list of str
    A list of relative paths to the images FITS files. Can also be single string in which case,
     this function acts like load_fits_image
psfs : list of str
    A list of relative paths to the PSF FITS files (optional). It must match the length of image_list or be None.
weights : list of str
    A list of relative paths to the weight files (optional). It must match the length of image_list or be None.

Returns
-------
ImageGroup
    A ImageGroup representing the images

Raises
------
ValueError
    In case of mismatched list of files

Definition at line 135 of file measurement_config.py.

References sourcextractor.config.measurement_config.MeasurementConfig._measurement_images, and sourcextractor.config.measurement_config.MeasurementConfig.load_fits_image().

Here is the call graph for this function:

◆ measurement_images()

sourcextractor.config.measurement_config.MeasurementConfig.measurement_images ( self)

◆ model_fitting()

sourcextractor.config.measurement_config.MeasurementConfig.model_fitting ( self)

◆ model_fitting_parameter_columns()

sourcextractor.config.measurement_config.MeasurementConfig.model_fitting_parameter_columns ( self)

◆ print_measurement_images()

sourcextractor.config.measurement_config.MeasurementConfig.print_measurement_images ( self,
file = sys.stderr )
Print a human-readable representation of the configured measurement images.

Parameters
----------
file : file object
    Where to print the representation. Defaults to sys.stderr

Definition at line 275 of file measurement_config.py.

References sourcextractor.config.measurement_config.MeasurementConfig._measurement_images.

◆ print_output_columns()

sourcextractor.config.measurement_config.MeasurementConfig.print_output_columns ( self,
file = sys.stderr )
Print a human-readable representation of the configured output columns.

Parameters
----------
file : file object
    Where to print the representation. Defaults to sys.stderr

Definition at line 363 of file measurement_config.py.

References sourcextractor.config.measurement_config.MeasurementConfig._aperture_columns, and sourcextractor.config.measurement_config.MeasurementConfig._model_fitting_parameter_columns.

Member Data Documentation

◆ _aperture_columns

sourcextractor.config.measurement_config.MeasurementConfig._aperture_columns
protected

◆ _apertures_for_image

sourcextractor.config.measurement_config.MeasurementConfig._apertures_for_image
protected

◆ _column_map

sourcextractor.config.measurement_config.MeasurementConfig._column_map
protected

◆ _measurement_images

sourcextractor.config.measurement_config.MeasurementConfig._measurement_images
protected

◆ _model_fitting

sourcextractor.config.measurement_config.MeasurementConfig._model_fitting
protected

◆ _model_fitting_parameter_columns

sourcextractor.config.measurement_config.MeasurementConfig._model_fitting_parameter_columns
protected

◆ _used_names

sourcextractor.config.measurement_config.MeasurementConfig._used_names
protected

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