PyLenstool object functions¶
-
class
pylenstool.lenstool_param_file(param_file='/home/docs/checkouts/readthedocs.org/user_builds/pylenstool/envs/stable/local/lib/python2.7/site-packages/pylenstool-0.1-py2.7.egg/pylenstool/default_param_file.par')¶ Methods
check_number_of_lens()Updates nlentille and nlens_opt value to reflect the current number of lenses get_comments()Returns the list of comments get_core()Returns a list of list containings all section and parameters get_inputfilename()Returns the name of the initial parameter used get_section()Returns the name of all the sections as a list keep_only_some_potentials(pot_to_keep)Removes every potential which is not in the list given in argument If you want to keep the parameter file and make a copy, use pylenstool.keep_only_some_potentials(parameter_file,pot_to_keep) launch_model([name, screen, …])Launches the parameter file set_parameter(section, param[, add])Replaces (or creates, if it does not exist) the section and the parameter given in arguments. write_param_file([output_filename, …])Writes the parameter file which is currently loaded -
check_number_of_lens()¶ Updates nlentille and nlens_opt value to reflect the current number of lenses
-
get_comments()¶ Returns the list of comments
-
get_core()¶ Returns a list of list containings all section and parameters
-
get_inputfilename()¶ Returns the name of the initial parameter used
-
get_section()¶ Returns the name of all the sections as a list
-
keep_only_some_potentials(pot_to_keep)¶ Removes every potential which is not in the list given in argument If you want to keep the parameter file and make a copy, use pylenstool.keep_only_some_potentials(parameter_file,pot_to_keep)
Parameters: - pot_to_keep : list of string
list of potential names
-
launch_model(name='pylenstool_model.par', screen=False, OMP_NUM_THREADS='default', check_count_lens=True)¶ Launches the parameter file
Parameters: - name : string
Name of the outputfile by DEFAULT it is pylenstool_model.par
- screen : boolean
Puts True if you want to screen your lenstool
- OMP_NUM_THREADS : int
Gives the number of threads you want to use, it takes by default your environnment value
- check_count_lens : boolean
False if you do not want to change nlentille and nlens_opt By default the nlentille and nlens_opt will be updated
-
set_parameter(section, param, add=False)¶ Replaces (or creates, if it does not exist) the section and the parameter given in arguments. By default the previous entry will be replaced, unless it is specified by the keyword add that it should be added.
Parameters: - section : string
Name of the section of parameters, such as runmode, potentiel XX, cline …
- param : string
Full sequence of the parameter in one string eg. ‘mass 3 1000 0.308 mass_minim.fits’
- add : boolean
If True a new line will be added without replacing, False by default.
- eg. pf.set_parameter(‘runmode’,’mass 3 1000 0.308 mass_minim.fits’)
-
write_param_file(output_filename='pylenstool_model.par', check_count_lens=True)¶ Writes the parameter file which is currently loaded
Parameters: - output_filename : string
gives the name of the output file, by default it is pylenstool_model.par
- check_count_lens : boolean
False if you do not want to change nlentille and nlens_opt By default the nlentille and nlens_opt will be updated
-