autolens.twins.ReferenceModel#
- class ReferenceModel[source]#
Bases:
FrozenA fitted lens frozen as the parent of twins.
Attribute assignment raises.
provenanceis returned as a copy, so the stored record cannot be edited through it. The tracer and setup are shared objects and must be treated as read-only;Twin.baselinetakes its own copy of the tracer.- Parameters:
tracer – The maximum-likelihood
al.Tracerwith solved linear intensities.setup (
ObservationSetup) – How the lens was observed.provenance (
Dict) –lens_id,labels,roles(galaxy name -> role),fit_path,dataset_sha256,tracer_sha256,ingested_at(ISO-8601 UTC) andversions(library and Python versions); seeprovenance_from.
Methods
Reload a reference written by
output_to.Ingest a model-fit output directory (the folder holding
files/tracer.jsonandimage/dataset.fits).Ingest an in-memory result and the dataset it fitted.
Write
tracer.json,setup/(mask.fits,noise_map.fits,psf.fitsfor inspection andsetup.json, the complete setup thatfrom_directoryreads),provenance.jsonandlabels.yaml.Attributes
- classmethod from_fit_directory(path, lens_id, labels=(), roles=None)[source]#
Ingest a model-fit output directory (the folder holding
files/tracer.jsonandimage/dataset.fits). The tracer is loaded fromtracer.jsonand therefore carries the solved linear intensities; the hashes are of the two files’ bytes.
- classmethod from_result(result, dataset, lens_id, labels=(), roles=None, fit_path=None)[source]#
Ingest an in-memory result and the dataset it fitted. With no files to hash,
dataset_sha256hashes the native data, noise map, PSF kernel and mask arrays andtracer_sha256hashes the tracer’s canonical dictable JSON.