Skip to main content

catmaker

Catmaker is a set of modules that run SExtractor in cold mode and hot mode, merge and clean the catalogs and segmentation maps(select the faint sources from the hot run, cleans it, leaving only the sources that were not detected in the cold run(bright objects)) while correcting the magnitudes for galactic extinction and estimating the photometric error.

Prerequisites

Install SExtractor (for Linux/Ubuntu):

sudo apt install source-extractor

or: www.astromatic.net/software/sextractor/

Install ds9:

For visualization, download it and save the path for later: /usr/path/to/ds9

http://sites.google.com/cfa.harvard.edu/saoimageds9/download

Download the Dust maps:

Files from: github.com/kbarbary/sfddata
A directory "sfddata-master" will be created, save this path /usr/path-to/sfddata-master for later

Installation

Using a environment is recommended for proper installation of the package.

The library must be installed from PyPI:

pip install catmaker

If installing on the operating system, the following command should be used to allow the installation by bypassing system protection.

pip install catmaker --break-system-packages

Usage

Configuration files

To use the library, some configuration files are required, which can be divided into two types.

SExtractor files: The use of this software requires 5 files. These files require a prefix, indicated as "<file_prefix>", to be used by the Catmaker library:

  • <prefijo_archivo>_COLD.sex: SExtractor cold mode configuration.
CATALOG_NAME      output_test/<output_file_prefix>_COLD.cat
PARAMETERS_NAME   test_data/default.param 
FILTER_NAME       test_data/default.conv
WEIGHT_IMAGE      images/weight-input-image.fits
STARNNW_NAME      test_data/default.nnw
PSF_NAME          test_data/default.psf

It depends on the input image used:
SATUR_LEVEL      ****
MAG_ZEROPOINT    ****
PIXEL_SCALE      ****
SEEING_FWHM      ****

  • <prefijo_archivo>_HOT.sex: SExtractor hot mode configuration.
CATALOG           /output_test/<output_file_prefix>_HOT.cat
PARAMETERS_NAME   test_data/default.param 
FILTER_NAME       test_data/default.conv
WEIGHT_IMAGE      images/weight-input-image.fits
STARNNW_NAME      test_data/default.nnw
PSF_NAME          test_data/default.psf

It depends on the input image used:
SATUR_LEVEL      ****
MAG_ZEROPOINT    ****
PIXEL_SCALE      ****
SEEING_FWHM      ****
  • default.conv: Convolutional mask.
  • default.nnw: Neural Network Weights file.
  • default.param: Parameters configuration file.

Catmaker files: The class requires only one file, which does not need a specific name. This file configures aspects such as file paths for input and output, along with parameters for executing the steps. The config file must have the required configuration format.

    # Default configuration file for catmaker
    #
    #
    ############## General configuration ################
    
    IMAGES_PATH                 images/              # Path folder of the images
    DATA_PATH                   test_data/           # Path folder of SExtractor configuration files (e.g., .params, .sex)
    OUTPUT_PATH                 output_test/         # Path to folder of output files
    OUTPUT_FILES_PREFIX         spt0205_SE           # Prefix for output files
    
    ################## Make Catalog ######################
    
    DETECTION_IMAGE             spt0205_f814w_ivm_v2_drc_sci_wcs.fits               # Name of the detection image file
    MEASUREMENT_IMAGE           spt0205_f814w_ivm_v2_drc_sci_wcs.fits             # Name of the measurement image file
    DETECTION_WEIGHT_IMAGE      spt0205_f814w_ivm_v2_drc_wht_wcs.fits        # Name of the detection weight image file
    MEASUREMENT_WEIGHT_IMAGE    spt0205_f814w_ivm_v2_drc_wht_wcs.fits      # Name of the measurement weight image file
    CONFIGURATION_FILE_PREFIX   default_conf                       # SExtractor config file prefixes
    PARAMETER_FILE              default.param                      # Path to the SExtractor parameter file
    PSF_FWHM                    0.08310611041715447                # Value for PSF_FWHM
    WEIGHT_TYPE                 MAP_WEIGHT                         # weight type for SExtractor (e.g., BACKGROUND, MAP_RMS, MAP_VAR, MAP_WEIGHT)
    
    ############## Gain and Zero-Point ################
    
    TELESCOPE_PREFIX    none         # Telescope prefix for calculating the magnitude zero-point (e.g., HST). If none, provide the next parameters in the config file.
    EXPTIME             5623.51      # Value for Exposure time in seconds (only needed if TELESCOPE_PREFIX is none)
    MAG_ZEROPOINT       35.3213      # Value for Magnitude ZERO-POINT (only needed if TELESCOPE_PREFIX is none)
    INPUT_GAIN          1.2          # Value for GAIN (only needed if TELESCOPE_PREFIX is none)
    
    ################# Merge Catalogs ##################
    
    LAMBDA_EFF      0.797339         # Effective Wavelenghts must be expressed in microns
    FILTER_BAND     F814W            # Filter band
    DUSTMAPS_PATH   test_data        # Path to the dust maps folder
    PIXEL_SCALE     0.03             # Pixel_scale in arcsec
    
    ############### Make Simulated Catalog #############
    
    SIZE_X                  60       # maximum amplitude in X of the noise curve adjustment
    SIZE_Y                  60       # maximum amplitude in Y of the noise curve adjustment
    N_SIMULATED_CATALOGUE   10000    # number of generated coordinates for the clean
    
    ############### Photometric Error #################
    
    PHOT_APERTURES         30.0           # MAG_APER aperture diameter(s) in pixels
    DATA_REPORT_PATH       test_report/   # Path for the output files report folder

Using the library

In a py file, the library or class must be imported as follows:

from catmaker.catmaker import Catmaker

Then, there are two ways to initialize the Catmaker class

  • Without Parameters : The class initializes with an initial setup and creates a file with a template to configure the class call it "default_config" (It is recommended to use it only to obtain the configuration file).
# Initializes the class without configuration file
Catmaker = Catmaker() 
# Print the current configuration
Catmaker.get_configuration()
  • With Parameters : The class read and save the configuration from the file.
# Initializes the class with a configuration file
Catmaker = Catmaker(<path-to-Catmaker-config-file>) 
# Print the current configuration
Catmaker.get_configuration()

Once initialized, pipelines can be created by concatenating the methods that apply each step, respecting the order of use and adding the method end_pipeline at the end. The last method is added to ensure that the pipeline has finished before creating another one.

# This pipeline use the first 2 steps of a complete pipeline
catmaker.make_catalog(hot=True, cold=True, measurement_image=False).merge_catalogs().end_pipeline()

The steps in a pipeline can be used as a group or individually.

# This pipeline use the first 2 steps of a complete pipeline
Catmaker.make_catalog(hot=True, cold=True, measurement_image=False).merge_catalogs()
# The last step of the pipeline
Catmaker.make_simulated_catalog().end_pipeline()
# The intermediate steps of the process can be used in a new pipeline
Catmaker.merge_catalogs().end_pipeline()

Additionally, the full_pipeline method can be used to run the entire process; this method includes the pipeline completion method.

# This method run the complete pipeline
Catmaker.run_full_pipeline(hot=True, cold=True, measurement_image=False, incompletness='5sigma', report=False)

For more information see the documentation.

Metadata

Release files for catmaker 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for catmaker 0.2.1
File Size Uploaded
catmaker-0.2.1.tar.gz 68.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for catmaker 0.2.1
File Interpreter ABI Platform
catmaker-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 126.9 kB

Release files / catmaker-0.2.1.tar.gz

Download URL catmaker-0.2.1.tar.gz
Size 68.9 kB
Tags Source
SHA-256 checksum
How to use checksums
0c7af8a8a5a1f1d12722de480027b1012c45c0390cba310f4602b28ef438f903
BLAKE2b-256 checksum
How to use checksums
0f22a999373ac715642a65e46241000b63d37fa1ea8ba48a8f51496b5e610e6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / catmaker-0.2.1-py3-none-any.whl

Download URL catmaker-0.2.1-py3-none-any.whl
Size 58.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
82733ebf7ff2b282d513a05b8274855d2fee9ca44c6c4c9ca90655dcd43fe4b7
BLAKE2b-256 checksum
How to use checksums
5ba040322c55a0a2a6c0509b3728c9bfa502aeee31a2f527dfa747874c04416c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release history Release notifications | RSS feed

0.2.2

2 release files

This release

0.2.1 This release

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page