Restore lspr flag for programatic running
@@ -39,7 +39,7 @@ except:
def main(argv=sys.argv, log_output=True, return_output_fname=False,
- return_results_dict=False, field=None):
+ return_results_dict=False, field=None, lspr=None):
"""
Run a PyGBe problem, write outputs to STDOUT and to log file in
problem directory
@@ -57,7 +57,10 @@ def main(argv=sys.argv, log_output=True, return_output_fname=False,
use of PyGBe
field : Dictionary, defaults to None.
If passed, this dictionary will supercede any config file found, useful in
- programmatically stepping through slight changes in a problem
+ programmatically stepping through slight changes in a problem.
+ lspr : list, defaults to None
+ If passed, provides values for `electric_field` and `wavelength`, useful to
+ programmatically step through varying wavelengths
Returns
--------
@@ -150,6 +153,9 @@ def main(argv=sys.argv, log_output=True, return_output_fname=False,
surf_array = initialize_surface(field_array, configFile, param)
### Read electric field and its wavelength.
+ if lspr:
+ electric_field, wavelength = lspr
+ else:
electric_field, wavelength = read_electric_field(param, configFile)
