shapepipe.modules.make_cat_package.make_cat

shapepipe.modules.make_cat_package.make_cat

MAKE CATALOGUE.

This module contains a class to create a shear catalogue.

Author

Axel Guinot

prepare_final_cat_file(output_path, file_number_string)[source]

Prepare Final Catalogue File.

Create a FITSCatalogue object for the current file.

Parameters
  • output_path (str) – Output file path

  • file_number_string (str) – String with current file numbering

Returns

Output FITS file

Return type

file_io.FITSCatalogue

remove_field_name(arr, name)[source]

Remove Field Name.

Remove a column of a structured array from the given name.

Parameters
  • arr (numpy.ndarray) – A numpy strucured array

  • name (str) – Name of the field to remove

Returns

The structured array with the field removed

Return type

numpy.ndarray

save_sextractor_data(final_cat_file, sexcat_path, remove_vignet=True)[source]

Save SExtractor Data.

Save the SExtractor catalogue into the final one.

Parameters
  • final_cat_file (file_io.FITSCatalogue) – Final catalogue

  • sexcat_path (str) – Path to SExtractor catalogue to save

  • remove_vignet (bool) – If True will not save the VIGNET field into the final catalogue

save_sm_data(final_cat_file, sexcat_sm_path, do_classif=True, star_thresh=0.003, gal_thresh=0.01)[source]

Save Spread-Model Data.

Save the spread-model data into the final catalogue.

Parameters
  • final_cat_file (file_io.FITSCatalogue) – Final catalogue

  • sexcat_sm_path (str) – Path to spread-model catalogue to save.

  • do_classif (bool) – If True objects will be classified into stars, galaxies, and other, using the classifier \({\rm class} = {\rm sm} + 2 * {\rm sm}_{\rm err}\)

  • star_thresh (float) – Threshold for star selection; object is classified as star if \(|{\rm class}| <\) star_thresh

  • gal_thresh (float) – Threshold for galaxy selection; object is classified as galaxy if \({\rm class} >\) gal_thresh

class SaveCatalogue(final_cat_file)[source]

Bases: object

Save Catalogue.

Class to save catalogue.

Parameters

final_cat_file (str) – Final catalogue file name

process(mode='', cat_path=None, moments=False)[source]

Process Catalogue.

Parameters
  • mode (str) – Run mode, options are ngmix, galsim or psf

  • cat_path (str) – Path to input catalogue

  • moments (bool) – Option to run ngmix mode with moments

_update_dict(key_string, value)[source]

Update Dictionary.

Update dictionary with value for all keys matching key string.

Parameters
  • key_string (str) – Key string

  • value (numpy.ndarray) – Value to be assigned to the keys

_add2dict(key, value, index=None)[source]

Add to Dictionary.

Add key, value pair to output dictionary.

Parameters
  • key (str) – Dictionary key

  • value (any) – Dictionary value

  • index (int) – Dictionary element index

_save_ngmix_data(ngmix_cat_path, moments=False)[source]

Save NGMIX Data.

Save the NGMIX catalogue into the final one.

Parameters

ngmix_cat_path (str) – Path to NGMIX catalogue

_save_galsim_shapes(galsim_cat_path)[source]

Save GalSim Shapes.

Save the GalSim catalogue into the final one.

Parameters

galsim_cat_path (str) – Path to GalSim catalogue to save

_save_psf_data(galaxy_psf_path)[source]

Save PSF data.

Save the PSF catalogue into the final one.

Parameters

galaxy_psf_path (str) – Path to the PSF catalogue to save