rail.core.utilPhotometry module

Module that implements operations on photometric data such as magnitudes and fluxes.

class rail.core.utilPhotometry.HyperbolicMagnitudes(args, comm=None)[source]

Bases: PhotormetryManipulator

Convert a set of classical magnitudes to hyperbolic magnitudes (Lupton et al. 1999). Requires input from the initial stage (HyperbolicSmoothing) to supply optimal values for the smoothing parameters (b).

Configuration Parameters: output_mode [str]: What to do with the outputs (default=default) value_columns [list]: list of columns that prove photometric measurements (fluxes or magnitudes) (default=[‘mag_u_lsst’, ‘mag_g_lsst’, ‘mag_r_lsst’, ‘mag_i_lsst’, ‘mag_z_lsst’, ‘mag_y_lsst’]) error_columns [list]: list of columns with errors corresponding to value_columns (assuming same ordering) (default=[‘mag_err_u_lsst’, ‘mag_err_g_lsst’, ‘mag_err_r_lsst’, ‘mag_err_i_lsst’, ‘mag_err_z_lsst’, ‘mag_err_y_lsst’]) zeropoints [list]: optional list of magnitude zeropoints for value_columns (assuming same ordering, defaults to 0.0) (default=[]) is_flux [bool]: whether the provided quantities are fluxes or magnitudes (default=False)

compute(data, parameters)[source]

Main method to call. Outputs hyperbolic magnitudes compuated from a set of smoothing parameters and input catalogue with classical magitudes and their respective errors.

Parameters:
  • data (PqHandle) – Input table with photometry (magnitudes or flux columns and their respective uncertainties) as defined by the configuration.

  • parameters (PqHandle) – Table with smoothing parameters per photometric band, determined by HyperbolicSmoothing.

Returns:

output – Output table containting hyperbolic magnitudes and their uncertainties. If the columns in the input table contain a prefix mag_, this output tabel will replace the prefix with hyp_mag_, otherwise the column names will be identical to the input table.

Return type:

PqHandle

config_options = {'error_columns': <ceci.config.StageParameter object>, 'is_flux': <ceci.config.StageParameter object>, 'output_mode': <ceci.config.StageParameter object>, 'value_columns': <ceci.config.StageParameter object>, 'zeropoints': <ceci.config.StageParameter object>}
inputs = [('input', <class 'rail.core.data.PqHandle'>), ('parameters', <class 'rail.core.data.PqHandle'>)]
name = 'HyperbolicMagnitudes'
outputs = [('output', <class 'rail.core.data.PqHandle'>)]
run()[source]

Compute hyperbolic magnitudes and their error based on the parameters determined by HyperbolicSmoothing.

class rail.core.utilPhotometry.HyperbolicSmoothing(args, comm=None)[source]

Bases: PhotormetryManipulator

Initial stage to compute hyperbolic magnitudes (Lupton et al. 1999). Estimates the smoothing parameter b that is used by the second stage (HyperbolicMagnitudes) to convert classical to hyperbolic magnitudes.

Configuration Parameters: output_mode [str]: What to do with the outputs (default=default) value_columns [list]: list of columns that prove photometric measurements (fluxes or magnitudes) (default=[‘mag_u_lsst’, ‘mag_g_lsst’, ‘mag_r_lsst’, ‘mag_i_lsst’, ‘mag_z_lsst’, ‘mag_y_lsst’]) error_columns [list]: list of columns with errors corresponding to value_columns (assuming same ordering) (default=[‘mag_err_u_lsst’, ‘mag_err_g_lsst’, ‘mag_err_r_lsst’, ‘mag_err_i_lsst’, ‘mag_err_z_lsst’, ‘mag_err_y_lsst’]) zeropoints [list]: optional list of magnitude zeropoints for value_columns (assuming same ordering, defaults to 0.0) (default=[]) is_flux [bool]: whether the provided quantities are fluxes or magnitudes (default=False)

compute(data)[source]

Main method to call. Computes the set of smoothing parameters (b) for an input catalogue with classical photometry and their respective errors. These parameters are required by the follow-up stage HyperbolicMagnitudes and are parsed as tabular data.

Parameters:

data (PqHandle) – Input table with magnitude and magnitude error columns as defined in the configuration.

Returns:

parameters – Table with smoothing parameters per photometric band and additional meta data.

Return type:

PqHandle

config_options = {'error_columns': <ceci.config.StageParameter object>, 'is_flux': <ceci.config.StageParameter object>, 'output_mode': <ceci.config.StageParameter object>, 'value_columns': <ceci.config.StageParameter object>, 'zeropoints': <ceci.config.StageParameter object>}
inputs = [('input', <class 'rail.core.data.PqHandle'>)]
name = 'HyperbolicSmoothing'
outputs = [('parameters', <class 'rail.core.data.PqHandle'>)]
run()[source]

Computes the smoothing parameter b (see Lupton et al. 1999) per photometric band.

class rail.core.utilPhotometry.PhotormetryManipulator(args, comm=None)[source]

Bases: RailStage, ABC

Base class to perform opertations on magnitudes. A table with input magnitudes and errors is processed and transformed into an output table with new magnitudes and errors.

Subclasses must implement the run() and compute() method.

abstract compute(data)[source]

Main method to call.

Parameters:

data (PqHandle) – Input tabular data with column names as defined in the configuration.

Returns:

output – Output tabular data.

Return type:

PqHandle

config_options = {'error_columns': <ceci.config.StageParameter object>, 'is_flux': <ceci.config.StageParameter object>, 'output_mode': <ceci.config.StageParameter object>, 'value_columns': <ceci.config.StageParameter object>, 'zeropoints': <ceci.config.StageParameter object>}
get_as_fluxes()[source]

Loads specified photometric data as fluxes, converting magnitudes on the fly.

inputs = [('input', <class 'rail.core.data.PqHandle'>)]
name = 'PhotormetryManipulator'
outputs = [('output', <class 'rail.core.data.PqHandle'>)]
abstract run()[source]

Implements the operation performed on the photometric data.