SourceXtractorPlusPlus  0.19
SourceXtractor++, the next generation SExtractor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
sourcextractor.config.measurement_config.MeasurementConfig Class Reference

Public Member Functions

def __init__
 
def apertures_for_image
 
def measurement_images
 
def model_fitting_parameter_columns
 
def aperture_columns
 
def model_fitting
 
def add_measurement_image
 
def load_fits_image
 
def load_fits_images
 
def load_fits_data_cube
 
def print_measurement_images
 
def add_aperture_photometry
 
def print_output_columns
 
def add_output_column
 

Private 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

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

Definition at line 30 of file measurement_config.py.

Member Function Documentation

def 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.

def sourcextractor.config.measurement_config.MeasurementConfig.add_measurement_image (   self,
  image 
)
def 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, and sourcextractor.config.measurement_config.MeasurementConfig._used_names.

def sourcextractor.config.measurement_config.MeasurementConfig.aperture_columns (   self)
def sourcextractor.config.measurement_config.MeasurementConfig.apertures_for_image (   self)
def 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 186 of file measurement_config.py.

References sourcextractor.config.measurement_config.MeasurementConfig._measurement_images.

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

def 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().

def 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, sourcextractor.config.measurement_config.MeasurementConfig.load_fits_data_cube(), and sourcextractor.config.measurement_config.MeasurementConfig.load_fits_image().

Here is the call graph for this function:

def sourcextractor.config.measurement_config.MeasurementConfig.measurement_images (   self)
def sourcextractor.config.measurement_config.MeasurementConfig.model_fitting (   self)
def sourcextractor.config.measurement_config.MeasurementConfig.model_fitting_parameter_columns (   self)
def 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.

def 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

sourcextractor.config.measurement_config.MeasurementConfig._aperture_columns
private
sourcextractor.config.measurement_config.MeasurementConfig._apertures_for_image
private
sourcextractor.config.measurement_config.MeasurementConfig._column_map
private
sourcextractor.config.measurement_config.MeasurementConfig._measurement_images
private
sourcextractor.config.measurement_config.MeasurementConfig._model_fitting
private
sourcextractor.config.measurement_config.MeasurementConfig._model_fitting_parameter_columns
private
sourcextractor.config.measurement_config.MeasurementConfig._used_names
private

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