Skip to content

Galaxy.dict() not returning parameters correctly #188

Description

@samlange04

When calling the .dict() instance to extract the parameters of a galaxy, there are a few errors:

  1. The type instance is saved as a string rather than a callable to the function (same for individual mass/light profiles)
  2. If a parameter is drawn from a numpy array (e.g. when randomising and drawing), the dict returns the type rather than the value of the parameter.

See the example below:

lens = al.Galaxy(redshift=1.,
                 light = al.lp.EllSersic(intensity = np.array([0.1])[0]),
                 mass=al.mp.EllIsothermal())
lens.dict()

{'light': {'type': 'autogalaxy.profiles.light_profiles.light_profiles.EllSersic',
'centre': (0.0, 0.0),
'elliptical_comps': (0.0, 0.0),
'intensity': {'type': 'numpy.float64'},
'effective_radius': 0.6,
'sersic_index': 4.0},
'mass': {'type': 'autogalaxy.profiles.mass_profiles.total_mass_profiles.EllIsothermal',
'centre': (0.0, 0.0),
'elliptical_comps': (0.0, 0.0),
'einstein_radius': 1.0},
'type': 'autogalaxy.galaxy.galaxy.Galaxy',
'redshift': 1.0,
'pixelization': None,
'regularization': None,
'hyper_galaxy': None}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions