diff --git a/coolest/template/classes/parameter.py b/coolest/template/classes/parameter.py index d4df00c..82aa1a2 100644 --- a/coolest/template/classes/parameter.py +++ b/coolest/template/classes/parameter.py @@ -138,6 +138,26 @@ def set_point_estimate(self, point_estimate): if max_val is not None and np.any(np.asarray(val) > np.asarray(max_val)): raise ValueError(f"Value cannot be larger than {self.definition_range.max_value}.") + def set_flag(self, flag): + """Set the parameter as a flag. + + Parameters + ---------- + flag : bool, string + Flag value + + Raises + ------ + ValueError + If the provided flag has not a supported type. + """ + if isinstance(flag, (bool, str)): + self.point_estimate = flag + else: + raise ValueError("Flag value must be either a boolean or a string (bool or str).") + + + def remove_point_estimate(self): """Remove the current point estimate of the parameter. """ @@ -272,4 +292,4 @@ class IrregularGridParameter(IrregularGrid): def __init__(self, documentation, **kwargs_grid) -> None: self.documentation = documentation super().__init__(**kwargs_grid) - \ No newline at end of file + diff --git a/coolest/template/classes/profiles/light.py b/coolest/template/classes/profiles/light.py index c970f44..f8a6c69 100644 --- a/coolest/template/classes/profiles/light.py +++ b/coolest/template/classes/profiles/light.py @@ -148,24 +148,30 @@ class LensedPS(AnalyticalProfile): def __init__(self): documentation = "Set of point source and lensed multiple images" parameters = { - 'ra_true': NonLinearParameter("X-axis position of the true, unlensed point source", - DefinitionRange(), - latex_str=r"$ra$"), - 'dec_lensed': NonLinearParameter("Y-axis position of the true, unlensed point source", - DefinitionRange(), - latex_str=r"$dec$"), - 'mag_lensed': LinearParameter("Magnitude of the true, unlensed point sources", - DefinitionRange(min_value=0.0), - latex_str=r"$A$"), - 'ra_lensed': NonLinearParameterSet("X-axis positions of the multiple images", - DefinitionRange(), - latex_str=r"$ra$"), - 'dec_lensed': NonLinearParameterSet("Y-axis positions of the multiple images", - DefinitionRange(), - latex_str=r"$dec$"), - 'mag_lensed': LinearParameterSet("Set of magnitude values of the multiple images", - DefinitionRange(min_value=0.0), - latex_str=r"$A$"), + 'x_true': NonLinearParameter("X-axis position of the true, unlensed point source", + DefinitionRange(), + latex_str=r"$ra$"), + 'y_true': NonLinearParameter("Y-axis position of the true, unlensed point source", + DefinitionRange(), + latex_str=r"$dec$"), + 'm_true': LinearParameter("Magnitude of the true, unlensed point sources", + DefinitionRange(min_value=0.0), + latex_str=r"$A$"), + 'x_lensed': NonLinearParameterSet("X-axis positions of the multiple images", + DefinitionRange(), + latex_str=r"$ra$"), + 'y_lensed': NonLinearParameterSet("Y-axis positions of the multiple images", + DefinitionRange(), + latex_str=r"$dec$"), + 'm_lensed': LinearParameterSet("Set of magnitude values of the multiple images", + DefinitionRange(min_value=0.0), + latex_str=r"$A$"), + 'flag_contains': LinearParameter("Flag contains", + DefinitionRange(), + latex_str=r"Contains"), + 'flag_coupled': LinearParameter("Flag coupled", + DefinitionRange(), + latex_str=r"Coupled") } super().__init__(parameters)