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 sextractor

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: www.github.com/kbarbary/sfddata
A directory "sfddata-master" will be created, save this path /usr/path-to/sfddata-master for later

Installation

Install it from PyPI:

pip install catmaker

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      /path-to/<output_file_prefix>_COLD.cat
PARAMETERS_NAME   /path-to/<prefijo_archivo>.param 
FILTER_NAME       /path-to/<prefijo_archivo>.conv
WEIGHT_IMAGE      /path-to/weight-input-image.fits
STARNNW_NAME      /path-to/<prefijo_archivo>.nnw
PSF_NAME          /path-to/<prefijo_archivo>.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           /path-to/<output_file_prefix>_HOT.cat
PARAMETERS_NAME   /path-to/<prefijo_archivo>.param 
FILTER_NAME       /path-to/<prefijo_archivo>.conv
WEIGHT_IMAGE      /path-to/weight-input-image.fits
STARNNW_NAME      /path-to/<prefijo_archivo>.nnw
PSF_NAME          /path-to/<prefijo_archivo>.psf

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

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 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         output_file          # Prefix for output files

################## Make Catalog ######################

DETECTION_IMAGE             detection_image.fits               # Path to the detection image
MEASUREMENT_IMAGE           measurement_image.fits             # Path to the measurement image
DETECTION_WEIGHT_IMAGE      detection_weight_image.fits        # Path to the detection weight image
MEASUREMENT_WEIGHT_IMAGE    measurement_weight_image.fits      # Path to the measurement weight image
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 #################

APERTURE_RADIUS        15.0           # 
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.0

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.0
File Size Uploaded
catmaker-0.2.0.tar.gz 69.2 kB Details

Built distribution (wheel)

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

Total release size: 128.1 kB

Release files / catmaker-0.2.0.tar.gz

Download URL catmaker-0.2.0.tar.gz
Size 69.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d1fa0a1b34edd6b5b280e3e5ede5f8de0cc368e6ed83cbee6445869227424f4f
BLAKE2b-256 checksum
How to use checksums
f2fa913af3affa5e97651736c8cf3a437099128fc60470dd9525a57f26484c63
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.0-py3-none-any.whl

Download URL catmaker-0.2.0-py3-none-any.whl
Size 58.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
52251cca9c5cdfcf5772a1e270f516977a420326a5da281fc5e91cc981aa0939
BLAKE2b-256 checksum
How to use checksums
e49775d71243de94cb30edcc75de9b184abc75d0b1b2b0dbcc700ed54cbb9aa2
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

0.2.1

2 release files

This release

0.2.0 This release

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