It is possible to impose constraints on the fit parameters or some pre-defined combinations of them that are particularly important in microlensing observations. Let
The modified RTModel it is also possible to consider asymmetric constraints with different tolerances on either side of
The practical implementation in RTModel occurs through the function set_constraints as in the following example
import RTModel
rtm = RTModel.RTModel('/event001')
myconstraints = [['tE', 23.0, -1.0, +1.0],
['log_rho', -3, -2, +0.1],
['g_1', 0.0, -0.01, 1.e100]]
rtm.set_constraints(myconstraints)
rtm.run()
Here we have built a list of constraints on several parameters or functions that will be included in the modified [function_name, f_0, sigma_l, sigma_r]. The numbers for f_0, sigma_l, sigma_r express the asymmetric constraint as explained above. Note that one-sided constraints can be easily obtained if one of the sigmas is set to extremely large values, as in the third constraint in the example above.
The following sections explain the syntax for the function_name in detail.
Each entry in the list of constraints is a list starting with the name of the parameter or the function that is going to be constrained. We have four possibilities available to the user.
A single fit parameter can be just indicated as constrained function. For the names of the parameters, refer to Model Categories. Note that if the constraint is defined on a parameter that is not relevant for a given model category, the constraint will just be ignored for that specific model category.
In the second constraint in the example above we see how to constrain the logarithm (base 10) of a given parameter. The name of the parameter should just be preceded by the prefix 'log_'.
The third constraint in the example above shows how to constrain the blending parameter for telescope number 1 (the telescope list starts from 0). We remind that in RTModel the blending parameter is defined as the ratio of the background flux to the source flux:
To constrain other functions of the parameters, you may choose from the following list, to be updated on demand by users:
- 'muangle': The angle
$\psi_\mu$ in radians of the relative lens-source proper motion from the North direction taken counterclockwise. This angle affects the parallax parameters according to
This direction can be obtained from high-resolution observations which have been able to resolve the lens and the source individually. The constraint on the magnitude of the proper motion becomes a constraint on
- 't*': The source radius crossing time
The constraints used in a given modeling run are stored in the file Constraints.ini in the subdirectory /ini in the event directory.
The function recover_options() illustrated in Archiving and updating models recovers previously used constraints for a given event. These can be modified by manipulating the rtm.constraints object and will be used in the next modeling run.
Note that RTModel lets the parameters free to vary only within some pre-defined parameters ranges. So, even if you specify a very loose constraint, parameters will not be allowed to wander indefinitely. Parameters ranges are discussed in the Fitting section.