shapepipe.modules.vignetmaker_package.vignetmaker
shapepipe.modules.vignetmaker_package.vignetmaker¶
VIGNET MAKER.
This module contains a class to create postage stamps from images.
- Author
Axel Guinot
- class VignetMaker(galcat_path, pos_type, pos_params, output_dir, image_num)[source]¶
Bases:
object
Vignet Maker.
This class handles the creation of vignets.
- Parameters
galcat_path (str) – Path to catalogue containing the positions
pos_type (str) – Options are
PIX
orSPHE
-PIX
: position in pixel coordinates -SPHE
: position in world coordinatespos_params (list) – Parameters to use as positions, e.g.
['xpos', 'ypos']
output_dir (str) – Path to the output directory
image_num (str) – Image numbering
- get_pos(pos_params)[source]¶
Get Positions.
Get the positions of the given parameters from SExtractor catalogue.
- Parameters
pos_params (list) – List of string containing the SExtractor’s parameters to use as positions
- Returns
Array of the positions
- Return type
- convert_pos(image_path)[source]¶
Convert Position.
Convert positions from world coordinates to pixel coordinates.
- Parameters
image_path (str) – Path to the image from where the stamp are created
- Returns
New positions in pixel coordinates
- Return type
- _get_stamp(img_path, pos, rad)[source]¶
Get Stamp.
Extract stamps at given positions in the image.
- Parameters
img_path (str) – Path to the image
pos (numpy.ndarray) – Array of positions for the vignet’s centres
rad (int) – Radius of the stamp, must be odd
- Returns
Array containing the vignets
- Return type
- _get_stamp_me(image_dir, image_pattern)[source]¶
Get Stamp Multi-Epoch.
Get stamps for multi-epoch data.
- process_me(image_dir, image_pattern, f_wcs_path, rad)[source]¶
Process Multi-Epoch.
Main function to create the stamps in the multi-epoch case.
- Parameters
image_dir (list) – List of directories where the image are; ff
len(image_dir) == 1
-> all images are in the same directory, elselen(image_dir)
must matchlen(image_pattern)
image_pattern (list) – Common part of each kind of file names
f_wcs_path (str) – Path to the log file containing the WCS for each CCDs
rad (int) – Radius of the stamp, must be odd
- get_original_vignet(galcat_path)[source]¶
Get Original Vignet.
Get the vignets from the SExtractor catalogue.
- Parameters
galcat_path (str) – Path to the SExtractor catalogue
- Returns
Array containing the vignets
- Return type
- make_mask(galcat_path, mask_value)[source]¶
Make Mask.
Change the value of the SExtractor mask in the vignet.
- Parameters
- Returns
Array of the vignets with the new mask value
- Return type
- save_vignet(vignet, sexcat_path, output_dir, prefix, image_num)[source]¶
Save Vignet.
Save the vignet to a SExtractor format catalogue.
- Parameters
vignet (numpy.ndarray) – Array containing the vignets to be saved
sexcat_path (str) – Path to the original SExtractor catalogue
output_dir (str) – Path to the output directory
prefix (str) – Prefix to use for the output file name
image_num (str) – Image numbering