adler.science.NoiseChisel

Classes

NoiseChisel

Class for performing NoiseChisel source detection/segmentation analysis on a given fits image using gnuastro astnoisechisel.

Module Contents

class NoiseChisel(fits_file, i_hdu, out_dir='.')[source]

Class for performing NoiseChisel source detection/segmentation analysis on a given fits image using gnuastro astnoisechisel.

fits_file[source]

Filename of fits file to be analysed. Assumed to be like .fit

Type:

str

i_hdu[source]

Fits file HDU index containing the image to be analysed.

Type:

int

out_dir[source]

Path to directory for saving files. Directory will be created if necessary.

Type:

str

fits_file[source]
i_hdu[source]
out_dir = '.'[source]
file_suffix_nc = '_detected.fits'[source]
file_suffix_check = '_detcheck.fits'[source]
file_root[source]
file_nc[source]
file_check[source]
file_seg[source]
file_cat[source]
astnoisechisel = 'astnoisechisel'[source]
noise_chisel(nc_flags='--checkdetection --continueaftercheck', pre_cmd=None)[source]

Function to invoke the gnuastro noisechisel command. The results are stored in the file that is created (file_nc). This file contains a pixel map of detections, i.e. is a pixel signal or background?

Parameters:

pre_cmd (str) – Use this variable to pass any additional code to be run before the gnuastro command (e.g. set up conda env)

Returns:

file_nc – Name of the noisechisel results file

Return type:

str

segment_image(pre_cmd=None)[source]

Function to invoke the gnuastro image segmentation routine command. This step is required to separate the noisechisel chisel detections into individual objects/clumps. The results are stored in the file that is created (file_seg).

Parameters:

pre_cmd (str) – Use this variable to pass any additional code to be run before the gnuastro command (e.g. set up conda env)

Returns:

file_seg – Name of the image segmentation results file

Return type:

str

make_catalogue(i_cat=1, pre_cmd=None)[source]

Function to invoke the gnuastro make catalogue command. The results are stored in the file that is created (file_cat)

Parameters:
  • i_cat (int) – Use either the object (i_cat=1) or the clump (i_cat=2) detections to make the catalogue

  • pre_cmd (str) – Use this variable to pass any additional code to be run before the gnuastro command (e.g. set up conda env)

Returns:

df_cat – Dataframe containing the measured properties of the clumps

Return type:

DataFrame

clean_up()[source]

Function to remove all .fits created as part of the noisechisel, segmentation and catalogue process.

run_noise_chisel(conda_start=None, conda_env=None, keep_files=False)[source]

Wrapper function that calls each step to go from an input image to measurements of detections made by noisechisel. If required, conda_start and conda_env are used to set up the conda environment for subprocess to run gnuastro. These parameters are passed to the various noisechisel gnuastro commands using the pre_cmd parameter.

Parameters:
  • conda_start (str) – Optional, command to launch conda in the subprocess virtual environment. This might be needed when running WedgePhot in a jupyter notebook (e.g. on the RSP conda_start = “. /opt/lsst/software/stack/conda/etc/profile.d/conda.sh”)

  • conda_env (str) – Optional, name of the conda environment to use in the subprocess virtual environment.

  • keep_files (float) – Optional, flag to either remove all noisechisel associated files (by default) or keep them.

Returns:

df_cat – Dataframe containing the measured properties of the clumps

Return type:

DataFrame