autolens.PointDataset#

class PointDataset[source]#

Bases: object

A collection of the data component that can be used for point-source model-fitting, for example fitting the observed positions of a a strongly lensed quasar or supernovae or in strong lens cluster modeling, where there may be many tens or hundreds of individual source galaxies each of which are modeled as a point source.

The name of the dataset is required for point-source model-fitting, as it pairs a point-source dataset with its corresponding point-source in the model-fit. For example, if a dataset has the name source_1, it will be paired with the Point model-component which has the name source_1. If a dataset component is not successfully paired with a model-component, an error is raised.

Parameters:
  • name (str) – The name of the point source dataset which is paired to a Point in the Model.

  • positions (Union[Grid2DIrregular, List[List], List[Tuple]]) – The image-plane (y,x) positions of the point-source.

  • positions_noise_map (Union[float, ArrayIrregular, List[float]]) – The noise-value of every (y,x) position, which is typically the pixel-scale of the data.

  • fluxes (Union[ArrayIrregular, List[float], None]) – The image-plane flux of each observed point-source of light.

  • fluxes_noise_map (Union[float, ArrayIrregular, List[float], None]) – The noise-value of every observed flux, which is typically measured from the pixel values of the pixel containing the point source after convolution with the PSF.

  • time_delays (Union[ArrayIrregular, List[float], None]) – The time delays of each observed point-source of light in days.

  • time_delays_noise_map (Union[float, ArrayIrregular, List[float], None]) – The noise-value of every observed time delay, which is typically measured from the time delay analysis.

  • redshift (Optional[float]) – The redshift of the source. Optional; when provided it is carried through CSV round-trips alongside the positions so cluster-scale workflows can encode per-source redshifts in a single spreadsheet.

Methods

extent_from

from_csv

Load a single PointDataset from a CSV written by to_csv or output_to_csv.

to_csv

Write this dataset to file_path as a CSV with one row per image.

Attributes

info

A dictionary representation of this instance.

property info: str#

A dictionary representation of this instance.

Arrays are represented as lists or lists of lists.

extent_from(buffer=0.1)[source]#
to_csv(file_path)[source]#

Write this dataset to file_path as a CSV with one row per image.

Optional flux / time-delay columns are included only when this dataset carries the corresponding values. For multi-dataset output use output_to_csv.

classmethod from_csv(file_path, name=None)[source]#

Load a single PointDataset from a CSV written by to_csv or output_to_csv.

Parameters:
  • file_path (str) – Path to a CSV file with at minimum the columns name, y, x, positions_noise.

  • name (Optional[str]) – The name group to load. Must be provided when the CSV contains more than one name; when the CSV contains exactly one group it is picked automatically.