Skip to main content

No project description provided

Project description

rail_dnf

Template codecov PyPI

DNF: Directional Neighbourhood Fitting

DNF is a nearest-neighbor approach for photometric redshift estimation developed at the CIEMAT (Centro de Investigaciones Energéticas, Medioambientales y Tecnológicas). DNF computes the photo-z hyperplane that best fits the directional neighbourhood of a photometric galaxy in the training sample. A detailed description of DNF is available here.

If you have any questions or suggestions, please don't hesitate to contact us at laura.toribio@ciemat.es and/or juan.vicente@ciemat.es.

The current version of the code for RAILconsists of a training stage, DNFInformer and a estimation stage DNFEstimator. DNFInformer is a class that preprocesses the protometric data, handles missing or non-detected values, and trains a firts basic k-Nearest Neighbors regressor for redshift prediction. The DNFEstimator calculates photometric redshifts based on an enhancement of Nearest Neighbor techniques. The class supports three main metrics for redshift estimation: ENF, ANF or DNF.

  • ENF: Euclidean neighbourhood. It's a common distance metric used in kNN (k-Nearest Neighbors) for photometric redshift prediction.
  • ANF: uses normalized inner product for more accurate photo-z predictions. It is particularly recommended when working with datasets containing more than four filters. Use normalized inner product for more accurate photo-z predictions when signal/noise is good enough.
  • DNF: combines Euclidean and angular metrics, improving accuracy, especially for larger neighborhoods, and maintaining proportionality in observable content.

DNFInformer

The DNFInformer class processes a training dataset and produces a model file containing the computed magnitudes, colors, and their associated errors for the dataset. This model is then utilized in the DNFEstimator stage for photometric redshift estimation. Missing photometric detections (non-detections) are handled by replacing them with a configurable placeholder value, or optionally ignoring them during model training.

The configurable parameters for DNFInformer include:

  • bands: List of band names expected in the input dataset.
  • err_bands: List of magnitude error column names corresponding to the bands.
  • redshift_col: String indicating the name of the redshift column in the input data.
  • mag_limits: Dictionary with band names as keys and floats representing the acceptable magnitude range for each band.
  • nondetect_val: Float or np.nan, the value indicating a non-detection, which will be replaced by the values in mag_limits.
  • replace_nondetect: Boolean; if True, non-detections are replaced with the specified nondetect_val. If False, non-detections are ignored during the neighbor-finding process.

DNFEstimator

The DNFEstimator class uses the model generated by DNFInformer to compute photometric redshifts for new datasets and the PDFs. It identifies the nearest neighbors from the training data using various distance metrics and estimates redshifts based on these neighbors.

The configurable parameters for DNFEstimator include:

  • bands, err_bands, redshift_col, nondetect_val, mag_limits: As described for DNFInformer.
  • selection_mode: Integer indicating the method for neighbor selection:
    • 0: Euclidean Neighbourhood Fitting (ENF).
    • 1: Angular Neighbourhood Fitting (ANF).
    • 2: Directional Neighbourhood Fitting (DNF).
  • zmin, zmax, nzbins: Float values defining the minimum and maximum redshift range and the number of bins for estimation of the PDFs.
  • pdf_estimation: Boolean; if True, computes a probability density function (PDF) for the redshift of each object.

DNF calculates its own point estimate, DNF_Z, which is stored in the qp Ensemble ancil data. Also, DNF calculates other photo-zs called DNF_ZN.

  • DNF_Z represents the photometric redshift for each galaxy computed as the weighted average or hyperplane fit (depending on the option selected) for a set of neighbors determined by a specific metric (ENF, ANF, DNF) where the outliers are removed

  • DNF_ZN represents the photometric redshift using only the closest neighbor. It is mainly used for computing the redshift distributions.

RAIL: Redshift Assessment Infrastructure Layers

This package is part of the larger ecosystem of Photometric Redshifts in RAIL.

Citing RAIL

This code, while public on GitHub, has not yet been released by DESC and is still under active development. Our release of v1.0 will be accompanied by a journal paper describing the development and validation of RAIL.

If you make use of the ideas or software in RAIL, please cite the repository https://github.com/LSSTDESC/RAIL. You are welcome to re-use the code, which is open source and available under terms consistent with the MIT license.

External contributors and DESC members wishing to use RAIL for non-DESC projects should consult with the Photometric Redshifts (PZ) Working Group conveners, ideally before the work has started, but definitely before any publication or posting of the work to the arXiv.

Citing this package

Users of rail_dnf can cite De Vicente, Sanchez, & Sevilla-Noarbe If you use this package, you should also cite the appropriate papers for each code used. A list of such codes is included in the Citing RAIL section of the main RAIL Read The Docs page.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pz_rail_dnf-1.1.2.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pz_rail_dnf-1.1.2-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file pz_rail_dnf-1.1.2.tar.gz.

File metadata

  • Download URL: pz_rail_dnf-1.1.2.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for pz_rail_dnf-1.1.2.tar.gz
Algorithm Hash digest
SHA256 54250e18f1b03b20ba87bb9e04d5400acf91b5ed73a1204d6f3db3115d1cd53d
MD5 9ed1bf1f90893322c0e99e6d51fdf851
BLAKE2b-256 6ff95890fb65893867b950720aeee113f0dc856da9a536e23236823c6c35a168

See more details on using hashes here.

Provenance

The following attestation bundles were made for pz_rail_dnf-1.1.2.tar.gz:

Publisher: publish-to-pypi.yml on LSSTDESC/rail_dnf

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pz_rail_dnf-1.1.2-py3-none-any.whl.

File metadata

  • Download URL: pz_rail_dnf-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 12.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for pz_rail_dnf-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0b85bfc5ad2d815c01abf41e68b1d38656376dc7e8f9605bd78ad550d7eb7791
MD5 568f7fb372d2da5d1ae88df4cf58c93d
BLAKE2b-256 ecaea6009b3bcfe502711b86d03b0f8d5faa6ee005c36ac57ecd0b6c5ce5ab9f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pz_rail_dnf-1.1.2-py3-none-any.whl:

Publisher: publish-to-pypi.yml on LSSTDESC/rail_dnf

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page