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.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| catmaker-0.2.2.tar.gz | 69.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| catmaker-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 124.8 kB
Release files / catmaker-0.2.2.tar.gz
| Download URL | catmaker-0.2.2.tar.gz |
|---|---|
| Size | 69.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6a70f0a139c6b18a6f74684f7dc44c3cfd4ddb3d07484b1933c18b07f485dd01
|
|
BLAKE2b-256 checksum How to use checksums |
5d0a32b4a9cf10db41f4d552dad9536657d49fd1757f9fc346c431878ecd64f4
|
| 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.2-py3-none-any.whl
| Download URL | catmaker-0.2.2-py3-none-any.whl |
|---|---|
| Size | 55.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
aca470cfe71119b260e73f2c7139116a7ae9b50a2a43438a40f66a0a4013eac7
|
|
BLAKE2b-256 checksum How to use checksums |
46866d0fc6b2ed424648db0212fe51e3ed1cc0ef6a414b6468f9818df952e927
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|