shapepipe.modules.spread_model_package.spread_model

shapepipe.modules.spread_model_package.spread_model

SPREAD MODEL.

Class to compute the spread model, criterion to select galaxies

Author

Axel Guinot

get_sm(obj_vign, psf_vign, model_vign, weight_vign)[source]

Get Spread Model.

This method compute the spread moel for an object.

Parameters
Returns

Spread model and corresponding error values

Return type

tuple

get_model(sigma, flux, img_shape, pixel_scale=0.186)[source]

Get Model.

This method computes
  • an exponential galaxy model with scale radius = 1/16 FWHM

  • a Gaussian model for the PSF

Parameters
  • sigma (float) – Sigma of the PSF (in pixel units)

  • flux (float) – Flux of the galaxy for the model

  • img_shape (list) – Size of the output vignet [xsize, ysize]

  • pixel_scale (float, optional) – Pixel scale to use for the model (in arcsec); default is 0.186

Returns

Vignet of the galaxy model and of the PSF model

Return type

tuple

class SpreadModel(sex_cat_path, psf_cat_path, weight_cat_path, output_path, pixel_scale, output_mode)[source]

Bases: object

The Spread Model Class.

Parameters
  • sex_cat_path (str) – Path to SExtractor catalogue

  • psf_cat_path (str) – Path to PSF catalogue

  • weight_cat_path (str) – Path to weight catalogue

  • output_path (str) – Output file path of pasted catalog

  • pixel_scale (float) – Pixel scale in arcsec

  • output_mode (str) – Options are new or add

Notes

For the output_mode:

  • new will create a new catalogue with [number, mag, sm, sm_err]

  • add will output a copy of the input SExtractor with the columns sm and sm_err

process()[source]

Process.

Process the spread model computation

save_results(sm, sm_err, mag, number)[source]

Save Results.

Save output catalogue with spread model and errors.

Parameters
  • sm (numpy.ndarray) – Value of the spread model for all objects

  • sm_err (numpy.ndarray) – Value of the spread model error for all objects

  • mag (numpy.ndarray) – Magnitude of all objects (only for a new catalogue)

  • number (numpy.ndarray) – ID of all objects (only for a new catalogue)

Raises

ValueError – For incorrect output mode