astrowisp.subpixphot module

Class Inheritance Diagram

Inheritance diagram of SubPixPhot, c_double, c_uint

Define the SubPixPhot, which performs aperture photometry.

class astrowisp.subpixphot.SubPixPhot(**configuration)[source]

Bases: object

Inheritance diagram of astrowisp.subpixphot.SubPixPhot

Use sub-pixel aware aperture photomotre to measure fluxes of sources.

_library_configuration

The library configuration object to use the next aperture photometry measurement.

Type:

_c_subpixphot_configuration

_result_tree

The IOTree instance containing PSF fitting and aperture photometry information from the last aperture photomtry measurement, or None if no photometry has been done yet.

Type:

_c_h5io_data_tree_p

_library_subpix_map

The library object representing the currently set sub-pixel map.

Type:

_c_core_sub_pixel_map_p

configuration

The congfiguration for how to perform the next aperture photometry. The following keys are used (others are ignored by this class).

subpixmap (2D numpy array):

The sub-pixel map to assume.

apertures ([float, …]):

A list of the apertures to use.

gain (float):

The gain to assume for the input image.

magnitude_1adu (float):

The magnitude that corresponds to a flux of 1ADU.

const_error (float):

A constant that gets added to all error estimates.

Type:

dict

image

The last image for which aperture photometry was extracted. Contains the following entries:

values:

The calibrated pixel values.

errors:

Error estimates for the entries in values.

mask:

Bitmask flags indicating any known problems with image pixels.

Type:

dict

__call__(image, fitpsf_io_tree, image_index=0)[source]

Measure the fluxes of all sources in an image using aperture photometry.

Parameters:
  • image (2-D numpy.array, 2-D numpy.array, 2-D numpy.array) –

    entries:

    1. The calibrated values of the pixels in the image.

    2. Error estimates of the pixel values

    3. Bitmask flagging any known issues with image pixels (e.g. saturation, hot pixels, etc.).

  • fitsf_io_tree (IOTree) – The result tree returned by fit_star_shape.fit(). On output, this variable also contains the newly derived aperture photometry measurements.

  • image_index (int) – The image index within the result tree corresponding to the input image. This is the index of the image within the list of images passed to fit_star_shape.

Returns:

None. However, the fitpsf_io_tree argument is updated to include the newly measured fluxes.

__del__()[source]

Destroy any library objects created by this object.

__init__(**configuration)[source]

Prepare an object for measuring fluxes using aperture photometry.

Parameters:

**configuration – See configuration.

Returns:

None

static _format_config(param_value)[source]

Format config param for passing to AstroWISP aperture photometry func.

Parameters:

param_value (pair of values) – One of the recognized keys from configuration and the value it should be set to.

Returns:

  • The name of the option corresponding to the configuration parameter being set.

  • an ascii string representing the value in the format expected by the configuration file parser of the subpixphot tool.

Return type:

(bytes, bytes)

configure(**configuration)[source]

Modify the currently defined configuration.

Parameters:

**configuration – See configuration.

Returns:

None