Closed musoke closed 1 year ago
There are currently two ways to fix parameters in a configuration:
1) Fix those values directly in the yaml file.
This is a bit clunky, but you could duplicate that yaml file and fix those values directly in the yaml file and generate a second dataset with those fixed model parameters.
2) Use Dataset.update_param
The Dataset
object has a method update_param
which allows you to update parameters to new values. For example:
model.update_param({'PLANE_1-OBJECT_1-MASS_PROFILE_1-theta_E-g': 2}, 'CONFIGURATION_1')
Changes the Einstein radius of all my PLANE_1, OBJECT_1, MASS_PROFILE_1 objects to 2. Follow this up with:
model.regenerate()
which will take the updated parameter dictionaries to regenerate an updated dataset including images.
I think method 2 is very similar to what you suggested. Let me know if this solves your requirements!
@Jasonpoh, thank you for the reply.
I ended up doing what you describe in 1).
2) is indeed quite similar to what wanted, the main difference being that the data set is generated first. I may use that in future if it works for me too.
I have created a configuration file in which some of the parameters are random.
I want to generate some images in which the random parameters are set to known, fixed values. I am envisioning being able to write something along the lines of